From 73d9a899e8a5b7de303a2eee73d4a2d558a2627e Mon Sep 17 00:00:00 2001
From: trayfellouch <48515908+trayfellow@users.noreply.github.com>
Date: Tue, 13 Jul 2021 13:03:27 +0700
Subject: [PATCH 1/9] Update PauseSubState.hx
---
source/PauseSubState.hx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/source/PauseSubState.hx b/source/PauseSubState.hx
index 0d78ca9..b3bffa6 100644
--- a/source/PauseSubState.hx
+++ b/source/PauseSubState.hx
@@ -264,6 +264,8 @@ class PauseSubState extends MusicBeatSubstate
function changeSelection(change:Int = 0):Void
{
curSelected += change;
+
+ FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
if (curSelected < 0)
curSelected = menuItems.length - 1;
@@ -287,4 +289,4 @@ class PauseSubState extends MusicBeatSubstate
}
}
}
-}
\ No newline at end of file
+}
From 9edadeca273e409617a5e4a0093707401849eedb Mon Sep 17 00:00:00 2001
From: Spel0 <75626813+Spel0@users.noreply.github.com>
Date: Tue, 13 Jul 2021 10:55:03 +0300
Subject: [PATCH 2/9] Update Project.xml
---
Project.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Project.xml b/Project.xml
index eeffad6..9516b71 100644
--- a/Project.xml
+++ b/Project.xml
@@ -123,7 +123,7 @@
-
+
From 00687fb1b6fc307008d3218d1b32f1807523ffba Mon Sep 17 00:00:00 2001
From: Spel0 <75626813+Spel0@users.noreply.github.com>
Date: Tue, 13 Jul 2021 13:37:30 +0300
Subject: [PATCH 3/9] lots of stuff
---
Project.xml | 2 +-
source/Character.hx | 41 ++++----------------------------
source/GameplayCustomizeState.hx | 7 +++---
source/Paths.hx | 6 ++---
source/PlayState.hx | 11 +++++----
source/TitleState.hx | 1 +
6 files changed, 20 insertions(+), 48 deletions(-)
diff --git a/Project.xml b/Project.xml
index 9516b71..eeffad6 100644
--- a/Project.xml
+++ b/Project.xml
@@ -123,7 +123,7 @@
-
+
diff --git a/source/Character.hx b/source/Character.hx
index e4c64ae..b9bc7f8 100644
--- a/source/Character.hx
+++ b/source/Character.hx
@@ -407,7 +407,7 @@ class Character extends FlxSprite
public function loadOffsetFile(character:String)
{
- var offset:Array = CoolUtil.coolTextFile(Paths.txt('images/characters/' + character + "Offsets"));
+ var offset:Array = CoolUtil.coolTextFile(Paths.txt('images/characters/' + character + "Offsets", 'shared'));
for (i in 0...offset.length)
{
@@ -452,13 +452,13 @@ class Character extends FlxSprite
/**
* FOR GF DANCING SHIT
*/
- public function dance()
+ public function dance(forced:Bool = false)
{
if (!debugMode)
{
switch (curCharacter)
{
- case 'gf':
+ case 'gf' | 'gf-christmas' | 'gf-car' | 'gf-pixel':
if (!animation.curAnim.name.startsWith('hair'))
{
danced = !danced;
@@ -468,39 +468,6 @@ class Character extends FlxSprite
else
playAnim('danceLeft');
}
-
- case 'gf-christmas':
- if (!animation.curAnim.name.startsWith('hair'))
- {
- danced = !danced;
-
- if (danced)
- playAnim('danceRight');
- else
- playAnim('danceLeft');
- }
-
- case 'gf-car':
- if (!animation.curAnim.name.startsWith('hair'))
- {
- danced = !danced;
-
- if (danced)
- playAnim('danceRight');
- else
- playAnim('danceLeft');
- }
- case 'gf-pixel':
- if (!animation.curAnim.name.startsWith('hair'))
- {
- danced = !danced;
-
- if (danced)
- playAnim('danceRight');
- else
- playAnim('danceLeft');
- }
-
case 'spooky':
danced = !danced;
@@ -509,7 +476,7 @@ class Character extends FlxSprite
else
playAnim('danceLeft');
default:
- playAnim('idle');
+ playAnim('idle', forced);
}
}
}
diff --git a/source/GameplayCustomizeState.hx b/source/GameplayCustomizeState.hx
index 2748e85..56e00f4 100644
--- a/source/GameplayCustomizeState.hx
+++ b/source/GameplayCustomizeState.hx
@@ -52,7 +52,7 @@ class GameplayCustomizeState extends MusicBeatState
curt = new FlxSprite(-500, -300).loadGraphic(Paths.image('stagecurtains','shared'));
front = new FlxSprite(-650, 600).loadGraphic(Paths.image('stagefront','shared'));
- Conductor.changeBPM(102);
+ //Conductor.changeBPM(102);
persistentUpdate = true;
super.create();
@@ -193,8 +193,9 @@ class GameplayCustomizeState extends MusicBeatState
{
super.beatHit();
- bf.playAnim('idle');
- dad.dance();
+ bf.playAnim('idle', true);
+ dad.dance(true);
+ gf.dance();
FlxG.camera.zoom += 0.015;
camHUD.zoom += 0.010;
diff --git a/source/Paths.hx b/source/Paths.hx
index 5d7b07a..69adc31 100644
--- a/source/Paths.hx
+++ b/source/Paths.hx
@@ -53,7 +53,7 @@ class Paths
return 'assets/$file';
}
- inline static public function file(file:String, type:AssetType = TEXT, ?library:String)
+ inline static public function file(file:String, ?library:String, type:AssetType = TEXT)
{
return getPath(file, type, library);
}
@@ -142,7 +142,7 @@ class Paths
return null;
#end
else
- return FlxAtlasFrames.fromSparrow(image('characters/$key'), file('images/characters/$key.xml'));
+ return FlxAtlasFrames.fromSparrow(image('characters/$key', library), file('images/characters/$key.xml', library));
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));
}
@@ -169,7 +169,7 @@ class Paths
return null;
#end
else
- return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt'));
+ return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt', library));
return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library));
}
}
diff --git a/source/PlayState.hx b/source/PlayState.hx
index 969568b..544da27 100644
--- a/source/PlayState.hx
+++ b/source/PlayState.hx
@@ -171,6 +171,8 @@ class PlayState extends MusicBeatState
var notesHitArray:Array = [];
var currentFrames:Int = 0;
+ var idleToBeat:Bool = true; // change if bf and dad would idle to the beat of the song
+ var idleBeat:Int = 1; // how frequently bf and dad would play their idle animation(1 - every beat, 2 - every 2 beats and so on)
public var dialogue:Array = ['dad:blah blah blah', 'bf:coolswag'];
@@ -4173,8 +4175,9 @@ class PlayState extends MusicBeatState
// Conductor.changeBPM(SONG.bpm);
// Dad doesnt interupt his own notes
- if (SONG.notes[Math.floor(curStep / 16)].mustHitSection && dad.curCharacter != 'gf')
- dad.dance();
+ if ((SONG.notes[Math.floor(curStep / 16)].mustHitSection || !dad.animation.curAnim.name.startsWith("sing")) && dad.curCharacter != 'gf')
+ if (curBeat % idleBeat == 0)
+ dad.dance(idleToBeat);
}
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
wiggleShit.update(Conductor.crochet);
@@ -4206,9 +4209,9 @@ class PlayState extends MusicBeatState
gf.dance();
}
- if (!boyfriend.animation.curAnim.name.startsWith("sing"))
+ if (!boyfriend.animation.curAnim.name.startsWith("sing") && curBeat % idleBeat == 0)
{
- boyfriend.playAnim('idle');
+ boyfriend.playAnim('idle', idleToBeat);
}
/*if (!dad.animation.curAnim.name.startsWith("sing"))
diff --git a/source/TitleState.hx b/source/TitleState.hx
index 13c4660..4df0552 100644
--- a/source/TitleState.hx
+++ b/source/TitleState.hx
@@ -275,6 +275,7 @@ class TitleState extends MusicBeatState
// FlxG.sound.music.stop();
MainMenuState.firstStart = true;
+ MainMenuState.finishedFunnyMove = false;
new FlxTimer().start(2, function(tmr:FlxTimer)
{
From 3d01f74c108a2c326aa1c511fb2e533c9081ce4a Mon Sep 17 00:00:00 2001
From: Spel0 <75626813+Spel0@users.noreply.github.com>
Date: Tue, 13 Jul 2021 13:50:51 +0300
Subject: [PATCH 4/9] Revert "lots of stuff"
This reverts commit 00687fb1b6fc307008d3218d1b32f1807523ffba.
---
Project.xml | 2 +-
source/Character.hx | 41 ++++++++++++++++++++++++++++----
source/GameplayCustomizeState.hx | 7 +++---
source/Paths.hx | 6 ++---
source/PlayState.hx | 11 ++++-----
source/TitleState.hx | 1 -
6 files changed, 48 insertions(+), 20 deletions(-)
diff --git a/Project.xml b/Project.xml
index eeffad6..9516b71 100644
--- a/Project.xml
+++ b/Project.xml
@@ -123,7 +123,7 @@
-
+
diff --git a/source/Character.hx b/source/Character.hx
index b9bc7f8..e4c64ae 100644
--- a/source/Character.hx
+++ b/source/Character.hx
@@ -407,7 +407,7 @@ class Character extends FlxSprite
public function loadOffsetFile(character:String)
{
- var offset:Array = CoolUtil.coolTextFile(Paths.txt('images/characters/' + character + "Offsets", 'shared'));
+ var offset:Array = CoolUtil.coolTextFile(Paths.txt('images/characters/' + character + "Offsets"));
for (i in 0...offset.length)
{
@@ -452,13 +452,13 @@ class Character extends FlxSprite
/**
* FOR GF DANCING SHIT
*/
- public function dance(forced:Bool = false)
+ public function dance()
{
if (!debugMode)
{
switch (curCharacter)
{
- case 'gf' | 'gf-christmas' | 'gf-car' | 'gf-pixel':
+ case 'gf':
if (!animation.curAnim.name.startsWith('hair'))
{
danced = !danced;
@@ -468,6 +468,39 @@ class Character extends FlxSprite
else
playAnim('danceLeft');
}
+
+ case 'gf-christmas':
+ if (!animation.curAnim.name.startsWith('hair'))
+ {
+ danced = !danced;
+
+ if (danced)
+ playAnim('danceRight');
+ else
+ playAnim('danceLeft');
+ }
+
+ case 'gf-car':
+ if (!animation.curAnim.name.startsWith('hair'))
+ {
+ danced = !danced;
+
+ if (danced)
+ playAnim('danceRight');
+ else
+ playAnim('danceLeft');
+ }
+ case 'gf-pixel':
+ if (!animation.curAnim.name.startsWith('hair'))
+ {
+ danced = !danced;
+
+ if (danced)
+ playAnim('danceRight');
+ else
+ playAnim('danceLeft');
+ }
+
case 'spooky':
danced = !danced;
@@ -476,7 +509,7 @@ class Character extends FlxSprite
else
playAnim('danceLeft');
default:
- playAnim('idle', forced);
+ playAnim('idle');
}
}
}
diff --git a/source/GameplayCustomizeState.hx b/source/GameplayCustomizeState.hx
index 56e00f4..2748e85 100644
--- a/source/GameplayCustomizeState.hx
+++ b/source/GameplayCustomizeState.hx
@@ -52,7 +52,7 @@ class GameplayCustomizeState extends MusicBeatState
curt = new FlxSprite(-500, -300).loadGraphic(Paths.image('stagecurtains','shared'));
front = new FlxSprite(-650, 600).loadGraphic(Paths.image('stagefront','shared'));
- //Conductor.changeBPM(102);
+ Conductor.changeBPM(102);
persistentUpdate = true;
super.create();
@@ -193,9 +193,8 @@ class GameplayCustomizeState extends MusicBeatState
{
super.beatHit();
- bf.playAnim('idle', true);
- dad.dance(true);
- gf.dance();
+ bf.playAnim('idle');
+ dad.dance();
FlxG.camera.zoom += 0.015;
camHUD.zoom += 0.010;
diff --git a/source/Paths.hx b/source/Paths.hx
index 69adc31..5d7b07a 100644
--- a/source/Paths.hx
+++ b/source/Paths.hx
@@ -53,7 +53,7 @@ class Paths
return 'assets/$file';
}
- inline static public function file(file:String, ?library:String, type:AssetType = TEXT)
+ inline static public function file(file:String, type:AssetType = TEXT, ?library:String)
{
return getPath(file, type, library);
}
@@ -142,7 +142,7 @@ class Paths
return null;
#end
else
- return FlxAtlasFrames.fromSparrow(image('characters/$key', library), file('images/characters/$key.xml', library));
+ return FlxAtlasFrames.fromSparrow(image('characters/$key'), file('images/characters/$key.xml'));
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));
}
@@ -169,7 +169,7 @@ class Paths
return null;
#end
else
- return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt', library));
+ return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt'));
return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library));
}
}
diff --git a/source/PlayState.hx b/source/PlayState.hx
index 544da27..969568b 100644
--- a/source/PlayState.hx
+++ b/source/PlayState.hx
@@ -171,8 +171,6 @@ class PlayState extends MusicBeatState
var notesHitArray:Array = [];
var currentFrames:Int = 0;
- var idleToBeat:Bool = true; // change if bf and dad would idle to the beat of the song
- var idleBeat:Int = 1; // how frequently bf and dad would play their idle animation(1 - every beat, 2 - every 2 beats and so on)
public var dialogue:Array = ['dad:blah blah blah', 'bf:coolswag'];
@@ -4175,9 +4173,8 @@ class PlayState extends MusicBeatState
// Conductor.changeBPM(SONG.bpm);
// Dad doesnt interupt his own notes
- if ((SONG.notes[Math.floor(curStep / 16)].mustHitSection || !dad.animation.curAnim.name.startsWith("sing")) && dad.curCharacter != 'gf')
- if (curBeat % idleBeat == 0)
- dad.dance(idleToBeat);
+ if (SONG.notes[Math.floor(curStep / 16)].mustHitSection && dad.curCharacter != 'gf')
+ dad.dance();
}
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
wiggleShit.update(Conductor.crochet);
@@ -4209,9 +4206,9 @@ class PlayState extends MusicBeatState
gf.dance();
}
- if (!boyfriend.animation.curAnim.name.startsWith("sing") && curBeat % idleBeat == 0)
+ if (!boyfriend.animation.curAnim.name.startsWith("sing"))
{
- boyfriend.playAnim('idle', idleToBeat);
+ boyfriend.playAnim('idle');
}
/*if (!dad.animation.curAnim.name.startsWith("sing"))
diff --git a/source/TitleState.hx b/source/TitleState.hx
index 4df0552..13c4660 100644
--- a/source/TitleState.hx
+++ b/source/TitleState.hx
@@ -275,7 +275,6 @@ class TitleState extends MusicBeatState
// FlxG.sound.music.stop();
MainMenuState.firstStart = true;
- MainMenuState.finishedFunnyMove = false;
new FlxTimer().start(2, function(tmr:FlxTimer)
{
From 69dd73a89878074840a288fa5723e0f00cc95258 Mon Sep 17 00:00:00 2001
From: Spel0 <75626813+Spel0@users.noreply.github.com>
Date: Wed, 14 Jul 2021 05:40:35 +0300
Subject: [PATCH 5/9] Update TitleState.hx
---
source/TitleState.hx | 1 +
1 file changed, 1 insertion(+)
diff --git a/source/TitleState.hx b/source/TitleState.hx
index 13c4660..4df0552 100644
--- a/source/TitleState.hx
+++ b/source/TitleState.hx
@@ -275,6 +275,7 @@ class TitleState extends MusicBeatState
// FlxG.sound.music.stop();
MainMenuState.firstStart = true;
+ MainMenuState.finishedFunnyMove = false;
new FlxTimer().start(2, function(tmr:FlxTimer)
{
From 3184e0bacb9ee95fcf77e149bd304a9e7960e39f Mon Sep 17 00:00:00 2001
From: Spel0 <75626813+Spel0@users.noreply.github.com>
Date: Wed, 14 Jul 2021 05:45:28 +0300
Subject: [PATCH 6/9] Revert "Revert "lots of stuff""
This reverts commit 3d01f74c108a2c326aa1c511fb2e533c9081ce4a.
---
Project.xml | 2 +-
source/Character.hx | 41 ++++----------------------------
source/GameplayCustomizeState.hx | 7 +++---
source/Paths.hx | 6 ++---
source/PlayState.hx | 11 +++++----
5 files changed, 19 insertions(+), 48 deletions(-)
diff --git a/Project.xml b/Project.xml
index 9516b71..eeffad6 100644
--- a/Project.xml
+++ b/Project.xml
@@ -123,7 +123,7 @@
-
+
diff --git a/source/Character.hx b/source/Character.hx
index e4c64ae..b9bc7f8 100644
--- a/source/Character.hx
+++ b/source/Character.hx
@@ -407,7 +407,7 @@ class Character extends FlxSprite
public function loadOffsetFile(character:String)
{
- var offset:Array = CoolUtil.coolTextFile(Paths.txt('images/characters/' + character + "Offsets"));
+ var offset:Array = CoolUtil.coolTextFile(Paths.txt('images/characters/' + character + "Offsets", 'shared'));
for (i in 0...offset.length)
{
@@ -452,13 +452,13 @@ class Character extends FlxSprite
/**
* FOR GF DANCING SHIT
*/
- public function dance()
+ public function dance(forced:Bool = false)
{
if (!debugMode)
{
switch (curCharacter)
{
- case 'gf':
+ case 'gf' | 'gf-christmas' | 'gf-car' | 'gf-pixel':
if (!animation.curAnim.name.startsWith('hair'))
{
danced = !danced;
@@ -468,39 +468,6 @@ class Character extends FlxSprite
else
playAnim('danceLeft');
}
-
- case 'gf-christmas':
- if (!animation.curAnim.name.startsWith('hair'))
- {
- danced = !danced;
-
- if (danced)
- playAnim('danceRight');
- else
- playAnim('danceLeft');
- }
-
- case 'gf-car':
- if (!animation.curAnim.name.startsWith('hair'))
- {
- danced = !danced;
-
- if (danced)
- playAnim('danceRight');
- else
- playAnim('danceLeft');
- }
- case 'gf-pixel':
- if (!animation.curAnim.name.startsWith('hair'))
- {
- danced = !danced;
-
- if (danced)
- playAnim('danceRight');
- else
- playAnim('danceLeft');
- }
-
case 'spooky':
danced = !danced;
@@ -509,7 +476,7 @@ class Character extends FlxSprite
else
playAnim('danceLeft');
default:
- playAnim('idle');
+ playAnim('idle', forced);
}
}
}
diff --git a/source/GameplayCustomizeState.hx b/source/GameplayCustomizeState.hx
index 2748e85..56e00f4 100644
--- a/source/GameplayCustomizeState.hx
+++ b/source/GameplayCustomizeState.hx
@@ -52,7 +52,7 @@ class GameplayCustomizeState extends MusicBeatState
curt = new FlxSprite(-500, -300).loadGraphic(Paths.image('stagecurtains','shared'));
front = new FlxSprite(-650, 600).loadGraphic(Paths.image('stagefront','shared'));
- Conductor.changeBPM(102);
+ //Conductor.changeBPM(102);
persistentUpdate = true;
super.create();
@@ -193,8 +193,9 @@ class GameplayCustomizeState extends MusicBeatState
{
super.beatHit();
- bf.playAnim('idle');
- dad.dance();
+ bf.playAnim('idle', true);
+ dad.dance(true);
+ gf.dance();
FlxG.camera.zoom += 0.015;
camHUD.zoom += 0.010;
diff --git a/source/Paths.hx b/source/Paths.hx
index 5d7b07a..69adc31 100644
--- a/source/Paths.hx
+++ b/source/Paths.hx
@@ -53,7 +53,7 @@ class Paths
return 'assets/$file';
}
- inline static public function file(file:String, type:AssetType = TEXT, ?library:String)
+ inline static public function file(file:String, ?library:String, type:AssetType = TEXT)
{
return getPath(file, type, library);
}
@@ -142,7 +142,7 @@ class Paths
return null;
#end
else
- return FlxAtlasFrames.fromSparrow(image('characters/$key'), file('images/characters/$key.xml'));
+ return FlxAtlasFrames.fromSparrow(image('characters/$key', library), file('images/characters/$key.xml', library));
return FlxAtlasFrames.fromSparrow(image(key, library), file('images/$key.xml', library));
}
@@ -169,7 +169,7 @@ class Paths
return null;
#end
else
- return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt'));
+ return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt', library));
return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library));
}
}
diff --git a/source/PlayState.hx b/source/PlayState.hx
index 969568b..544da27 100644
--- a/source/PlayState.hx
+++ b/source/PlayState.hx
@@ -171,6 +171,8 @@ class PlayState extends MusicBeatState
var notesHitArray:Array = [];
var currentFrames:Int = 0;
+ var idleToBeat:Bool = true; // change if bf and dad would idle to the beat of the song
+ var idleBeat:Int = 1; // how frequently bf and dad would play their idle animation(1 - every beat, 2 - every 2 beats and so on)
public var dialogue:Array = ['dad:blah blah blah', 'bf:coolswag'];
@@ -4173,8 +4175,9 @@ class PlayState extends MusicBeatState
// Conductor.changeBPM(SONG.bpm);
// Dad doesnt interupt his own notes
- if (SONG.notes[Math.floor(curStep / 16)].mustHitSection && dad.curCharacter != 'gf')
- dad.dance();
+ if ((SONG.notes[Math.floor(curStep / 16)].mustHitSection || !dad.animation.curAnim.name.startsWith("sing")) && dad.curCharacter != 'gf')
+ if (curBeat % idleBeat == 0)
+ dad.dance(idleToBeat);
}
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
wiggleShit.update(Conductor.crochet);
@@ -4206,9 +4209,9 @@ class PlayState extends MusicBeatState
gf.dance();
}
- if (!boyfriend.animation.curAnim.name.startsWith("sing"))
+ if (!boyfriend.animation.curAnim.name.startsWith("sing") && curBeat % idleBeat == 0)
{
- boyfriend.playAnim('idle');
+ boyfriend.playAnim('idle', idleToBeat);
}
/*if (!dad.animation.curAnim.name.startsWith("sing"))
From 1aade522aee986eef772c477d4d2ba9ad41bd40e Mon Sep 17 00:00:00 2001
From: Spel0 <75626813+Spel0@users.noreply.github.com>
Date: Wed, 14 Jul 2021 07:54:58 +0300
Subject: [PATCH 7/9] fixes + debug feature
---
source/PlayState.hx | 108 +++++++++++++++++++++++++++++++---------
source/ResultsScreen.hx | 19 ++++---
2 files changed, 96 insertions(+), 31 deletions(-)
diff --git a/source/PlayState.hx b/source/PlayState.hx
index 544da27..7078d9d 100644
--- a/source/PlayState.hx
+++ b/source/PlayState.hx
@@ -94,6 +94,7 @@ class PlayState extends MusicBeatState
public static var rep:Replay;
public static var loadRep:Bool = false;
+ public static var inResults:Bool = false;
public static var noteBools:Array = [false, false, false, false];
@@ -214,6 +215,7 @@ class PlayState extends MusicBeatState
var funneEffect:FlxSprite;
var inCutscene:Bool = false;
+ var usedTimeTravel:Bool = false;
public static var repPresses:Int = 0;
public static var repReleases:Int = 0;
@@ -279,6 +281,7 @@ class PlayState extends MusicBeatState
highestCombo = 0;
repPresses = 0;
repReleases = 0;
+ inResults = false;
PlayStateChangeables.useDownscroll = FlxG.save.data.downscroll;
PlayStateChangeables.safeFrames = FlxG.save.data.frames;
@@ -2308,6 +2311,45 @@ class PlayState extends MusicBeatState
}
#end
}
+
+ if(FlxG.keys.justPressed.TWO) { //Go 10 seconds into the future, credit: Shadow Mario#9396
+ if (!usedTimeTravel && Conductor.songPosition + 10000 < FlxG.sound.music.length)
+ {
+ usedTimeTravel = true;
+ FlxG.sound.music.pause();
+ vocals.pause();
+ Conductor.songPosition += 10000;
+ notes.forEachAlive(function(daNote:Note)
+ {
+ if(daNote.strumTime - 500 < Conductor.songPosition) {
+ daNote.active = false;
+ daNote.visible = false;
+
+
+ daNote.kill();
+ notes.remove(daNote, true);
+ daNote.destroy();
+ }
+ });
+ for (i in 0...unspawnNotes.length) {
+ var daNote:Note = unspawnNotes[0];
+ if(daNote.strumTime - 500 >= Conductor.songPosition) {
+ break;
+ }
+ unspawnNotes.splice(unspawnNotes.indexOf(daNote), 1);
+ }
+
+ FlxG.sound.music.time = Conductor.songPosition;
+ FlxG.sound.music.play();
+
+ vocals.time = Conductor.songPosition;
+ vocals.play();
+ new FlxTimer().start(0.5, function(tmr:FlxTimer)
+ {
+ usedTimeTravel = false;
+ });
+ }
+ }
#end
if (startingSong)
@@ -2565,34 +2607,39 @@ class PlayState extends MusicBeatState
if (health <= 0)
{
- boyfriend.stunned = true;
+ if (!usedTimeTravel)
+ {
+ boyfriend.stunned = true;
- persistentUpdate = false;
- persistentDraw = false;
- paused = true;
+ persistentUpdate = false;
+ persistentDraw = false;
+ paused = true;
- vocals.stop();
- FlxG.sound.music.stop();
+ vocals.stop();
+ FlxG.sound.music.stop();
- openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
+ openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
- #if windows
- // Game Over doesn't get his own variable because it's only used here
- DiscordClient.changePresence("GAME OVER -- "
- + SONG.song
- + " ("
- + storyDifficultyText
- + ") "
- + Ratings.GenerateLetterRank(accuracy),
- "\nAcc: "
- + HelperFunctions.truncateFloat(accuracy, 2)
- + "% | Score: "
- + songScore
- + " | Misses: "
- + misses, iconRPC);
- #end
+ #if windows
+ // Game Over doesn't get his own variable because it's only used here
+ DiscordClient.changePresence("GAME OVER -- "
+ + SONG.song
+ + " ("
+ + storyDifficultyText
+ + ") "
+ + Ratings.GenerateLetterRank(accuracy),
+ "\nAcc: "
+ + HelperFunctions.truncateFloat(accuracy, 2)
+ + "% | Score: "
+ + songScore
+ + " | Misses: "
+ + misses, iconRPC);
+ #end
- // FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
+ // FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
+ }
+ else
+ health = 0.01;
}
if (FlxG.save.data.resetButton)
{
@@ -3044,10 +3091,17 @@ class PlayState extends MusicBeatState
FlxG.sound.music.stop();
vocals.stop();
if (FlxG.save.data.scoreScreen)
+ {
openSubState(new ResultsScreen());
+ new FlxTimer().start(1, function(tmr:FlxTimer)
+ {
+ inResults = true;
+ });
+ }
else
{
FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ Conductor.changeBPM(102);
FlxG.switchState(new StoryMenuState());
}
@@ -3114,8 +3168,14 @@ class PlayState extends MusicBeatState
FlxG.sound.music.stop();
vocals.stop();
- if (FlxG.save.data.scoreScreen)
+ if (FlxG.save.data.scoreScreen)
+ {
openSubState(new ResultsScreen());
+ new FlxTimer().start(1, function(tmr:FlxTimer)
+ {
+ inResults = true;
+ });
+ }
else
FlxG.switchState(new FreeplayState());
}
diff --git a/source/ResultsScreen.hx b/source/ResultsScreen.hx
index 77d62f2..fe4fb92 100644
--- a/source/ResultsScreen.hx
+++ b/source/ResultsScreen.hx
@@ -54,10 +54,13 @@ class ResultsScreen extends FlxSubState
background.scrollFactor.set();
add(background);
- music = new FlxSound().loadEmbedded(Paths.music('breakfast'), true, true);
- music.volume = 0;
- music.play(false, FlxG.random.int(0, Std.int(music.length / 2)));
- FlxG.sound.list.add(music);
+ if (!PlayState.inResults)
+ {
+ music = new FlxSound().loadEmbedded(Paths.music('breakfast'), true, true);
+ music.volume = 0;
+ music.play(false, FlxG.random.int(0, Std.int(music.length / 2)));
+ FlxG.sound.list.add(music);
+ }
background.alpha = 0;
@@ -168,8 +171,8 @@ class ResultsScreen extends FlxSubState
override function update(elapsed:Float)
{
- if (music.volume < 0.5)
- music.volume += 0.01 * elapsed;
+ if (music != null && music.volume < 0.5)
+ music.volume += 0.01 * elapsed;
// keybinds
@@ -194,6 +197,7 @@ class ResultsScreen extends FlxSubState
if (PlayState.isStoryMode)
{
FlxG.sound.playMusic(Paths.music('freakyMenu'));
+ Conductor.changeBPM(102);
FlxG.switchState(new MainMenuState());
}
else
@@ -265,7 +269,8 @@ class ResultsScreen extends FlxSubState
var poop:String = Highscore.formatSong(songFormat, PlayState.storyDifficulty);
- music.fadeOut(0.3);
+ if (music != null)
+ music.fadeOut(0.3);
PlayState.SONG = Song.loadFromJson(poop, PlayState.SONG.song);
PlayState.isStoryMode = false;
From d1e55dd7eb512929e590b0c6d084888339b1abf7 Mon Sep 17 00:00:00 2001
From: Spel0 <75626813+Spel0@users.noreply.github.com>
Date: Wed, 14 Jul 2021 08:04:13 +0300
Subject: [PATCH 8/9] Making time travel useful without botplay
---
source/PlayState.hx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/PlayState.hx b/source/PlayState.hx
index 7078d9d..9052a01 100644
--- a/source/PlayState.hx
+++ b/source/PlayState.hx
@@ -2639,7 +2639,7 @@ class PlayState extends MusicBeatState
// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
}
else
- health = 0.01;
+ health = 1;
}
if (FlxG.save.data.resetButton)
{
From f3ac332cee7a8bd216293ef1ad0a7d1ddd1341f6 Mon Sep 17 00:00:00 2001
From: Spel0 <75626813+Spel0@users.noreply.github.com>
Date: Wed, 14 Jul 2021 09:40:02 +0300
Subject: [PATCH 9/9] song replay bug fix
---
source/ResultsScreen.hx | 2 --
1 file changed, 2 deletions(-)
diff --git a/source/ResultsScreen.hx b/source/ResultsScreen.hx
index fe4fb92..79ee271 100644
--- a/source/ResultsScreen.hx
+++ b/source/ResultsScreen.hx
@@ -238,7 +238,6 @@ class ResultsScreen extends FlxSubState
PlayState.SONG = Song.loadFromJson(poop, PlayState.rep.replay.songName);
PlayState.isStoryMode = false;
PlayState.storyDifficulty = PlayState.rep.replay.songDiff;
- PlayState.storyWeek = 0;
LoadingState.loadAndSwitchState(new PlayState());
}
@@ -275,7 +274,6 @@ class ResultsScreen extends FlxSubState
PlayState.SONG = Song.loadFromJson(poop, PlayState.SONG.song);
PlayState.isStoryMode = false;
PlayState.storyDifficulty = PlayState.storyDifficulty;
- PlayState.storyWeek = 0;
LoadingState.loadAndSwitchState(new PlayState());
}