ModSubState

This commit is contained in:
Yoshman29
2022-12-04 17:08:08 +01:00
parent 37068a1b1c
commit 2d4016a776
12 changed files with 202 additions and 29 deletions
+10 -11
View File
@@ -265,8 +265,10 @@ class PlayState extends MusicBeatState
} else {
var gfVersion = SONG.gf;
if (gfVersion == null) gfVersion = "gf";
gf = new Character(400, 130, gfVersion);
gf.scrollFactor.set(0.95, 0.95);
if (gfVersion != "none") {
gf = new Character(400, 130, gfVersion);
gf.scrollFactor.set(0.95, 0.95);
}
}
var camPos:FlxPoint = new FlxPoint(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y);
@@ -454,13 +456,10 @@ class PlayState extends MusicBeatState
startTimer = new FlxTimer().start(Conductor.crochet / 1000, function(tmr:FlxTimer)
{
dad.dance();
gf.dance();
boyfriend.dance();
countdown(swagCounter);
swagCounter += 1;
for(char in [dad, gf, boyfriend])
if (char != null)
char.dance();
countdown(swagCounter++);
}, introLength);
}
@@ -1223,7 +1222,7 @@ class PlayState extends MusicBeatState
if (event.cancelled) return;
health += event.healthGain;
if (combo > 5 && gf.animOffsets.exists('sad'))
if (gf != null && combo > 5 && gf.animOffsets.exists('sad'))
{
gf.playAnim('sad');
}
@@ -1441,7 +1440,7 @@ class PlayState extends MusicBeatState
iconP1.updateHitbox();
iconP2.updateHitbox();
if (curBeat % gfSpeed == 0)
if (gf != null && curBeat % gfSpeed == 0)
{
gf.dance();
}
+2 -2
View File
@@ -102,12 +102,12 @@ class Stage extends FlxBasic implements IBeatReceiver {
state.add(spr);
spr;
case "boyfriend" | "bf":
if (PlayState.instance == null) continue;
if (PlayState.instance == null || PlayState.instance.boyfriend == null) continue;
doCharNodeShit(PlayState.instance.boyfriend, node);
PlayState.instance.add(PlayState.instance.boyfriend);
PlayState.instance.boyfriend;
case "girlfriend" | "gf":
if (PlayState.instance == null) continue;
if (PlayState.instance == null || PlayState.instance.gf == null) continue;
doCharNodeShit(PlayState.instance.gf, node);
PlayState.instance.add(PlayState.instance.gf);
PlayState.instance.gf;