Skip to content

Commit df89df1

Browse files
committed
0.4.1;
- Hurt arrows from VSOmega and Tricky now make you lose 1000 points from score and will lose 30 health offline - Fixed the game crashing after playing a song - Boot to where the song was chosen from when exiting to the menu from the pause screen
1 parent c77d7b2 commit df89df1

12 files changed

+64
-43
lines changed

source/FinishSubState.hx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class FinishSubState extends MusicBeatSubstate
4747
PlayState.gf.playAnim('sad',true);
4848
}
4949
super();
50-
if (win) boyfriend.animation.finishCallback = this.finishNew; else dad.animation.finishCallback = this.finishNew;
50+
if (win) boyfriend.animation.finishCallback = this.finishNew; else finishNew();
5151
if (FlxG.save.data.camMovement && camFollow != null){
5252
PlayState.instance.followChar(if(win) 0 else 1);
5353
}
@@ -113,6 +113,21 @@ class FinishSubState extends MusicBeatSubstate
113113
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
114114
}
115115

116+
public static function retMenu(){
117+
if (PlayState.isStoryMode){FlxG.switchState(new StoryMenuState());return;}
118+
PlayState.actualSongName = ""; // Reset to prevent issues
119+
switch (PlayState.stateType)
120+
{
121+
case 2:FlxG.switchState(new onlinemod.OfflineMenuState());
122+
case 4:FlxG.switchState(new multi.MultiMenuState());
123+
case 5:FlxG.switchState(new osu.OsuMenuState());
124+
125+
126+
default:FlxG.switchState(new FreeplayState());
127+
}
128+
return;
129+
}
130+
116131
override function update(elapsed:Float)
117132
{
118133
super.update(elapsed);
@@ -127,18 +142,7 @@ class FinishSubState extends MusicBeatSubstate
127142

128143
if (accepted)
129144
{
130-
if (PlayState.isStoryMode){FlxG.switchState(new StoryMenuState());return;}
131-
PlayState.actualSongName = ""; // Reset to prevent issues
132-
switch (PlayState.stateType)
133-
{
134-
case 2:FlxG.switchState(new onlinemod.OfflineMenuState());
135-
case 4:FlxG.switchState(new multi.MultiMenuState());
136-
case 5:FlxG.switchState(new osu.OsuMenuState());
137-
138-
139-
default:FlxG.switchState(new FreeplayState());
140-
}
141-
return;
145+
retMenu();
142146
}
143147

144148
if (FlxG.keys.justPressed.R)

source/FreeplayState.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ class FreeplayState extends MusicBeatState
206206
PlayState.isStoryMode = false;
207207
PlayState.storyDifficulty = curDifficulty;
208208
PlayState.storyWeek = songs[curSelected].week;
209+
PlayState.stateType = 0;
209210
trace('CUR WEEK' + PlayState.storyWeek);
210211
LoadingState.loadAndSwitchState(new PlayState());
211212
}

source/MainMenuState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ using StringTools;
2828

2929
class MainMenuState extends SickMenuState
3030
{
31-
public static var ver:String = "0.4.0";
31+
public static var ver:String = "0.4.1";
3232

3333
public static var firstStart:Bool = true;
3434

source/Note.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Note extends FlxSprite
4141

4242
public var rating:String = "shit";
4343

44-
public function new(strumTime:Float, _noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false, ?inCharter:Bool = false)
44+
public function new(strumTime:Float, _noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false, ?inCharter:Bool = false,?_shouldntBeHit:Bool = false)
4545
{
4646
super();
4747
if (FlxG.save.data.downscroll) offscreenY = 50;
@@ -50,7 +50,7 @@ class Note extends FlxSprite
5050
this.prevNote = prevNote;
5151
isSustainNote = sustainNote;
5252

53-
shouldntBeHit = (_noteData > 7 || (isSustainNote && prevNote.shouldntBeHit)) && onlinemod.OnlinePlayMenuState.socket == null;
53+
shouldntBeHit = (isSustainNote && prevNote.shouldntBeHit || _shouldntBeHit);
5454

5555
x += 50;
5656
// MAKE SURE ITS DEFINITELY OFF SCREEN?

source/PauseSubState.hx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ class PauseSubState extends MusicBeatSubstate
179179

180180
if (FlxG.save.data.fpsCap > 290) (cast (Lib.current.getChildAt(0), Main)).setFPSCap(290);
181181

182-
FlxG.switchState(new MainMenuState());
182+
FinishSubState.retMenu();
183+
return;
183184
}
184185
function countdown(){try{
185186
ready = false;

source/PlayState.hx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ class PlayState extends MusicBeatState
227227
public static var stepAnimEvents:Map<Int,Map<String,IfStatement>>;
228228
public static var canUseAlts:Bool = false;
229229
public static var hitSoundEff:Sound;
230+
public static var hurtSoundEff:Sound;
230231
public var inputMode:Int = 0;
231232
var inputEngineName:String = "Unspecified";
232233

@@ -989,6 +990,8 @@ class PlayState extends MusicBeatState
989990
// cameras = [FlxG.cameras.list[1]];
990991
if(hitSound && hitSoundEff == null) hitSoundEff = Sound.fromFile(( if (FileSystem.exists('mods/hitSound.ogg')) 'mods/hitSound.ogg' else Paths.sound('Normal_Hit')));
991992

993+
if(hurtSoundEff == null) hitSoundEff = Sound.fromFile(( if (FileSystem.exists('mods/hurtSound.ogg')) 'mods/hurtSound.ogg' else Paths.sound('ANGRY')));
994+
992995
startingSong = true;
993996

994997
if (isStoryMode)
@@ -1394,7 +1397,7 @@ class PlayState extends MusicBeatState
13941397
else
13951398
oldNote = null;
13961399

1397-
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote);
1400+
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote,null,null,songNotes[3] == 1);
13981401
swagNote.sustainLength = songNotes[2];
13991402
swagNote.scrollFactor.set(0, 0);
14001403

@@ -1407,7 +1410,7 @@ class PlayState extends MusicBeatState
14071410
{
14081411
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];
14091412

1410-
var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true);
1413+
var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true,null,songNotes[3] == 1);
14111414
sustainNote.scrollFactor.set();
14121415
unspawnNotes.push(sustainNote);
14131416

@@ -2566,7 +2569,7 @@ class PlayState extends MusicBeatState
25662569
daNote.kill();
25672570
notes.remove(daNote, true);
25682571
}
2569-
else
2572+
else if (!daNote.shouldntBeHit)
25702573
{
25712574
health -= 0.075;
25722575
vocals.volume = 0;
@@ -3012,7 +3015,7 @@ class PlayState extends MusicBeatState
30123015
daNote.kill();
30133016
notes.remove(daNote, true);
30143017
}
3015-
else
3018+
else if (!daNote.shouldntBeHit)
30163019
{
30173020
health -= 0.075;
30183021
vocals.volume = 0;
@@ -3266,14 +3269,16 @@ class PlayState extends MusicBeatState
32663269
if(daNote != null && daNote.shouldntBeHit && !forced) return;
32673270

32683271
if(daNote != null && forced && daNote.shouldntBeHit){ // Only true on hurt arrows
3269-
daNote.kill();
3270-
notes.remove(daNote, true);
3271-
daNote.destroy();
3272+
daNote.kill();
3273+
notes.remove(daNote, true);
3274+
daNote.destroy();
3275+
FlxG.sound.play(hitSoundEff, 1);
3276+
32723277
}
32733278
if (!boyfriend.stunned)
32743279
{
3280+
if (boyfriend.useMisses){FlxG.sound.play(boyfriend.missSounds[direction], 1);}else{FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));}
32753281
health -= 0.04;
3276-
if (boyfriend.useMisses){FlxG.sound.play(boyfriend.missSounds[direction], 0.7);}else{FlxG.sound.play(Paths.soundRandom('missnote', 1, 3), FlxG.random.float(0.1, 0.2));}
32773282
switch (direction)
32783283
{
32793284
case 0:
@@ -3297,8 +3302,7 @@ class PlayState extends MusicBeatState
32973302
totalNotesHit -= 1;
32983303

32993304
songScore -= 10;
3300-
if (daNote != null && daNote.shouldntBeHit) {songScore -= 290; health -= 0.16;} // Having it insta kill, not a good idea
3301-
3305+
if (daNote != null && daNote.shouldntBeHit) {songScore -= 990; health -= 0.26;} // Having it insta kill, not a good idea
33023306

33033307

33043308

source/QuickOptionsSubState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class QuickOptionsSubState extends MusicBeatSubstate
2121
{
2222
var grpMenuShit:FlxTypedGroup<Alphabet>;
2323

24-
public static var settings:Map<String,Bool> = ["Inverted chart" => false,"Opponent Arrows" => true];
24+
public static var settings:Map<String,Bool> = ["Inverted chart" => false,"Opponent Arrows" => true,"Hurt notes" => true];
2525
var menuItems:Array<String> = [];
2626
var curSelected:Int = 0;
2727
public static function getSetting(str:String){

source/Ratings.hx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class Ratings
9999

100100
if (customSafeZone != null)
101101
customTimeScale = customSafeZone / 166;
102-
103102

104103
if (noteDiff > 166 * customTimeScale) // so god damn early its a miss
105104
return "miss";

source/Song.hx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,22 @@ class Song
8080
}
8181
return swagShit;
8282
}
83+
static function removeHurtArrows(swagShit:SwagSong):SwagSong{
84+
for (sid => section in swagShit.notes) {
85+
for (nid => note in section.sectionNotes){
86+
swagShit.notes[sid].sectionNotes[nid][3] = 0;
87+
}
88+
}
89+
return swagShit;
90+
}
91+
static function convHurtArrows(swagShit:SwagSong):SwagSong{ // Support for Andromeda and tricky notes
92+
for (sid => section in swagShit.notes) {
93+
for (nid => note in section.sectionNotes){
94+
if(note[4] == 1 || note[1] > 7) {swagShit.notes[sid].sectionNotes[nid][3] = 1;}
95+
}
96+
}
97+
return swagShit;
98+
}
8399

84100
public static function parseJSONshit(rawJson:String):SwagSong
85101
{
@@ -88,10 +104,11 @@ class Song
88104
swagShit.defplayer1 = swagShit.player1;
89105
swagShit.defplayer2 = swagShit.player2;
90106
if (PlayState.invertedChart || QuickOptionsSubState.getSetting("Inverted chart")) swagShit = invertChart(swagShit);
107+
if (QuickOptionsSubState.getSetting("Hurt notes") || onlinemod.OnlinePlayMenuState.socket != null)swagShit = convHurtArrows(swagShit);
91108
if (onlinemod.OnlinePlayMenuState.socket == null){
92109
if (!QuickOptionsSubState.getSetting("Opponent Arrows")) swagShit = removeOpponentArrows(swagShit);
110+
if (!QuickOptionsSubState.getSetting("Hurt notes")) swagShit = removeHurtArrows(swagShit);
93111
}
94-
95112
swagShit.defgf = swagShit.gfVersion;
96113
return swagShit;
97114
}

source/onlinemod/OfflinePlayState.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class OfflinePlayState extends PlayState
139139
else
140140
oldNote = null;
141141

142-
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote);
142+
var swagNote:Note = new Note(daStrumTime, daNoteData, oldNote,null,null,songNotes[3] == 1);
143143
swagNote.sustainLength = songNotes[2];
144144
swagNote.scrollFactor.set(0, 0);
145145

@@ -152,7 +152,7 @@ class OfflinePlayState extends PlayState
152152
{
153153
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];
154154

155-
var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true);
155+
var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, daNoteData, oldNote, true,null,songNotes[3] == 1);
156156
sustainNote.scrollFactor.set();
157157
unspawnNotes.push(sustainNote);
158158

0 commit comments

Comments
 (0)