Skip to content

Commit

Permalink
0.4.1;
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
superpowers04 committed Aug 18, 2021
1 parent c77d7b2 commit df89df1
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 43 deletions.
30 changes: 17 additions & 13 deletions source/FinishSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class FinishSubState extends MusicBeatSubstate
PlayState.gf.playAnim('sad',true);
}
super();
if (win) boyfriend.animation.finishCallback = this.finishNew; else dad.animation.finishCallback = this.finishNew;
if (win) boyfriend.animation.finishCallback = this.finishNew; else finishNew();
if (FlxG.save.data.camMovement && camFollow != null){
PlayState.instance.followChar(if(win) 0 else 1);
}
Expand Down Expand Up @@ -113,6 +113,21 @@ class FinishSubState extends MusicBeatSubstate
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
}

public static function retMenu(){
if (PlayState.isStoryMode){FlxG.switchState(new StoryMenuState());return;}
PlayState.actualSongName = ""; // Reset to prevent issues
switch (PlayState.stateType)
{
case 2:FlxG.switchState(new onlinemod.OfflineMenuState());
case 4:FlxG.switchState(new multi.MultiMenuState());
case 5:FlxG.switchState(new osu.OsuMenuState());


default:FlxG.switchState(new FreeplayState());
}
return;
}

override function update(elapsed:Float)
{
super.update(elapsed);
Expand All @@ -127,18 +142,7 @@ class FinishSubState extends MusicBeatSubstate

if (accepted)
{
if (PlayState.isStoryMode){FlxG.switchState(new StoryMenuState());return;}
PlayState.actualSongName = ""; // Reset to prevent issues
switch (PlayState.stateType)
{
case 2:FlxG.switchState(new onlinemod.OfflineMenuState());
case 4:FlxG.switchState(new multi.MultiMenuState());
case 5:FlxG.switchState(new osu.OsuMenuState());


default:FlxG.switchState(new FreeplayState());
}
return;
retMenu();
}

if (FlxG.keys.justPressed.R)
Expand Down
1 change: 1 addition & 0 deletions source/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ class FreeplayState extends MusicBeatState
PlayState.isStoryMode = false;
PlayState.storyDifficulty = curDifficulty;
PlayState.storyWeek = songs[curSelected].week;
PlayState.stateType = 0;
trace('CUR WEEK' + PlayState.storyWeek);
LoadingState.loadAndSwitchState(new PlayState());
}
Expand Down
2 changes: 1 addition & 1 deletion source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using StringTools;

class MainMenuState extends SickMenuState
{
public static var ver:String = "0.4.0";
public static var ver:String = "0.4.1";

public static var firstStart:Bool = true;

Expand Down
4 changes: 2 additions & 2 deletions source/Note.hx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Note extends FlxSprite

public var rating:String = "shit";

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

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

x += 50;
// MAKE SURE ITS DEFINITELY OFF SCREEN?
Expand Down
3 changes: 2 additions & 1 deletion source/PauseSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ class PauseSubState extends MusicBeatSubstate

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

FlxG.switchState(new MainMenuState());
FinishSubState.retMenu();
return;
}
function countdown(){try{
ready = false;
Expand Down
24 changes: 14 additions & 10 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ class PlayState extends MusicBeatState
public static var stepAnimEvents:Map<Int,Map<String,IfStatement>>;
public static var canUseAlts:Bool = false;
public static var hitSoundEff:Sound;
public static var hurtSoundEff:Sound;
public var inputMode:Int = 0;
var inputEngineName:String = "Unspecified";

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

if(hurtSoundEff == null) hitSoundEff = Sound.fromFile(( if (FileSystem.exists('mods/hurtSound.ogg')) 'mods/hurtSound.ogg' else Paths.sound('ANGRY')));

startingSong = true;

if (isStoryMode)
Expand Down Expand Up @@ -1394,7 +1397,7 @@ class PlayState extends MusicBeatState
else
oldNote = null;

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

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

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

Expand Down Expand Up @@ -2566,7 +2569,7 @@ class PlayState extends MusicBeatState
daNote.kill();
notes.remove(daNote, true);
}
else
else if (!daNote.shouldntBeHit)
{
health -= 0.075;
vocals.volume = 0;
Expand Down Expand Up @@ -3012,7 +3015,7 @@ class PlayState extends MusicBeatState
daNote.kill();
notes.remove(daNote, true);
}
else
else if (!daNote.shouldntBeHit)
{
health -= 0.075;
vocals.volume = 0;
Expand Down Expand Up @@ -3266,14 +3269,16 @@ class PlayState extends MusicBeatState
if(daNote != null && daNote.shouldntBeHit && !forced) return;

if(daNote != null && forced && daNote.shouldntBeHit){ // Only true on hurt arrows
daNote.kill();
notes.remove(daNote, true);
daNote.destroy();
daNote.kill();
notes.remove(daNote, true);
daNote.destroy();
FlxG.sound.play(hitSoundEff, 1);

}
if (!boyfriend.stunned)
{
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));}
health -= 0.04;
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));}
switch (direction)
{
case 0:
Expand All @@ -3297,8 +3302,7 @@ class PlayState extends MusicBeatState
totalNotesHit -= 1;

songScore -= 10;
if (daNote != null && daNote.shouldntBeHit) {songScore -= 290; health -= 0.16;} // Having it insta kill, not a good idea

if (daNote != null && daNote.shouldntBeHit) {songScore -= 990; health -= 0.26;} // Having it insta kill, not a good idea



Expand Down
2 changes: 1 addition & 1 deletion source/QuickOptionsSubState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class QuickOptionsSubState extends MusicBeatSubstate
{
var grpMenuShit:FlxTypedGroup<Alphabet>;

public static var settings:Map<String,Bool> = ["Inverted chart" => false,"Opponent Arrows" => true];
public static var settings:Map<String,Bool> = ["Inverted chart" => false,"Opponent Arrows" => true,"Hurt notes" => true];
var menuItems:Array<String> = [];
var curSelected:Int = 0;
public static function getSetting(str:String){
Expand Down
1 change: 0 additions & 1 deletion source/Ratings.hx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class Ratings

if (customSafeZone != null)
customTimeScale = customSafeZone / 166;


if (noteDiff > 166 * customTimeScale) // so god damn early its a miss
return "miss";
Expand Down
19 changes: 18 additions & 1 deletion source/Song.hx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@ class Song
}
return swagShit;
}
static function removeHurtArrows(swagShit:SwagSong):SwagSong{
for (sid => section in swagShit.notes) {
for (nid => note in section.sectionNotes){
swagShit.notes[sid].sectionNotes[nid][3] = 0;
}
}
return swagShit;
}
static function convHurtArrows(swagShit:SwagSong):SwagSong{ // Support for Andromeda and tricky notes
for (sid => section in swagShit.notes) {
for (nid => note in section.sectionNotes){
if(note[4] == 1 || note[1] > 7) {swagShit.notes[sid].sectionNotes[nid][3] = 1;}
}
}
return swagShit;
}

public static function parseJSONshit(rawJson:String):SwagSong
{
Expand All @@ -88,10 +104,11 @@ class Song
swagShit.defplayer1 = swagShit.player1;
swagShit.defplayer2 = swagShit.player2;
if (PlayState.invertedChart || QuickOptionsSubState.getSetting("Inverted chart")) swagShit = invertChart(swagShit);
if (QuickOptionsSubState.getSetting("Hurt notes") || onlinemod.OnlinePlayMenuState.socket != null)swagShit = convHurtArrows(swagShit);
if (onlinemod.OnlinePlayMenuState.socket == null){
if (!QuickOptionsSubState.getSetting("Opponent Arrows")) swagShit = removeOpponentArrows(swagShit);
if (!QuickOptionsSubState.getSetting("Hurt notes")) swagShit = removeHurtArrows(swagShit);
}

swagShit.defgf = swagShit.gfVersion;
return swagShit;
}
Expand Down
4 changes: 2 additions & 2 deletions source/onlinemod/OfflinePlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class OfflinePlayState extends PlayState
else
oldNote = null;

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions source/onlinemod/OnlinePlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class OnlinePlayState extends PlayState
oldNote = null;


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

Expand All @@ -237,7 +237,7 @@ class OnlinePlayState extends PlayState
{
oldNote = unspawnNotes[Std.int(unspawnNotes.length - 1)];

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

Expand Down
13 changes: 4 additions & 9 deletions version.downloadMe
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
0.4.0;
- An overhaul to how characters are loaded
- Characters can now use custom voices
- Hitsounds were optimised and use Osu!Mania sounds(A custom hitsound.ogg can be placed in your mods folder)
- Hurt arrows(Only works with Tricky arrows at the moment)
- Player 3 can be used on animation offsets for GF
- Improvements to the animation debug
- Voices nolonger play during finished state
- Some quality of life improvements
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

0 comments on commit df89df1

Please sign in to comment.