From cf7242b4f1033cfdf9999a26c772ced3c603f62f Mon Sep 17 00:00:00 2001 From: ChromaSen <86837253+ChromaSen@users.noreply.github.com> Date: Tue, 28 May 2024 21:53:07 +0300 Subject: [PATCH] wippp --- source/gameObjects/Stage.hx | 49 ----------- .../gameObjects/userInterface/DialogueBox.hx | 6 +- source/meta/state/PlayState.hx | 83 +++++++++++++------ 3 files changed, 61 insertions(+), 77 deletions(-) diff --git a/source/gameObjects/Stage.hx b/source/gameObjects/Stage.hx index 9f66a6e..d76706d 100644 --- a/source/gameObjects/Stage.hx +++ b/source/gameObjects/Stage.hx @@ -332,55 +332,6 @@ class Stage extends FlxTypedGroup { case 'hell': carlos.animation.play('idle', true); //up down left down right left down right down side to side - - case 'highway': - // trace('highway update'); - grpLimoDancers.forEach(function(dancer:BackgroundDancer) - { - dancer.dance(); - }); - case 'mall': - upperBoppers.animation.play('bop', true); - bottomBoppers.animation.play('bop', true); - santa.animation.play('idle', true); - - case 'school': - bgGirls.dance(); - - case 'philly': - if (!trainMoving) - trainCooldown += 1; - - if (curBeat % 4 == 0) - { - var lastLight:FlxSprite = phillyCityLights.members[0]; - - phillyCityLights.forEach(function(light:FNFSprite) - { - // Take note of the previous light - if (light.visible == true) - lastLight = light; - - light.visible = false; - }); - - // To prevent duplicate lights, iterate until you get a matching light - while (lastLight == phillyCityLights.members[curLight]) - { - curLight = FlxG.random.int(0, phillyCityLights.length - 1); - } - - phillyCityLights.members[curLight].visible = true; - phillyCityLights.members[curLight].alpha = 1; - - FlxTween.tween(phillyCityLights.members[curLight], {alpha: 0}, Conductor.stepCrochet * .016); - } - - if (curBeat % 8 == 4 && FlxG.random.bool(30) && !trainMoving && trainCooldown > 8) - { - trainCooldown = FlxG.random.int(-4, 0); - trainStart(); - } } } diff --git a/source/gameObjects/userInterface/DialogueBox.hx b/source/gameObjects/userInterface/DialogueBox.hx index 933e8e4..60cdb9b 100644 --- a/source/gameObjects/userInterface/DialogueBox.hx +++ b/source/gameObjects/userInterface/DialogueBox.hx @@ -94,6 +94,8 @@ class DialogueBox extends FlxSpriteGroup public var textStarted:Bool = false; public var voiceline:FlxSound; + public static var skipText:FlxText; + public static function createDialogue(thisDialogue:String):DialogueBox { // @@ -157,13 +159,13 @@ class DialogueBox extends FlxSpriteGroup add(alphabetText); // skip text - var skipText = new FlxText(100, 670, 1000, "PRESS SHIFT TO SKIP", 20); + skipText = new FlxText(100, 670, 1000, "PRESS SHIFT TO SKIP", 20); skipText.alignment = FlxTextAlign.CENTER; skipText.borderStyle = FlxTextBorderStyle.OUTLINE; skipText.borderColor = FlxColor.BLACK; skipText.borderSize = 3; - skipText.alpha=!PlayState.midsongdia?1:0; + skipText.visible=true; skipText.screenCenter(X); diff --git a/source/meta/state/PlayState.hx b/source/meta/state/PlayState.hx index 7a1d610..f68acfd 100644 --- a/source/meta/state/PlayState.hx +++ b/source/meta/state/PlayState.hx @@ -172,7 +172,6 @@ class PlayState extends MusicBeatState public static var hasInstSwitching:Bool = false; //does the song have multiple instrumentals? public var overlay:FlxSprite; - public var newdad:Character; public var grandpaspeech:FlxText; @@ -306,7 +305,7 @@ class PlayState extends MusicBeatState cloaked=new FlxSprite(); cloaked.frames=Paths.getSparrowAtlas('backgrounds/hell/dialogue'); cloaked.animation.addByPrefix('idle','throw',24,false); - cloaked.setPosition(178.05,366.1); + cloaked.setPosition(158.05,366.1); cloaked.alpha=0; add(cloaked); } @@ -380,17 +379,20 @@ class PlayState extends MusicBeatState add(darknessBG); if(curStage=='hell'){ - //newdad=new Character(); - //newdad.setCharacter(dadOpponent.x,dadOpponent.y,"grandpadeath"); - //insert(members.indexOf(dadOpponent),newdad); - - //preloadCharacter("grandpadeath","grandpadeath"); overlay=new FlxSprite().loadGraphic(Paths.image("backgrounds/hell/overlay")); overlay.updateHitbox(); overlay.scale.set(10,10); add(overlay); } + if(SONG.song.toLowerCase()=='reaper-rhythm'){ + dadOpponent.visible=false; + cloaked.alpha=1; + trace( + 'bye' + ); + } + // strum setup strumLines = new FlxTypedGroup(); @@ -616,20 +618,16 @@ class PlayState extends MusicBeatState } private function getKeyFromEvent(key:FlxKey):Int - { - if (key != NONE) { - for (i in 0...keysArray.length) + if(key==NONE)return-1; + + for(i in 0...keysArray.length) { - for (j in 0...keysArray[i].length) - { - if (key == keysArray[i][j]) - return i; - } + if(keysArray[i].contains(key))return i; } + + return-1; } - return -1; - } override public function destroy() { @@ -870,6 +868,16 @@ class PlayState extends MusicBeatState unspawnNotes.splice(unspawnNotes.indexOf(dunceNote), 1); } + if(SONG.song.toLowerCase()=='reaper-rhythm'){ + if(dialogueBox!=null&&dialogueBox.alive){ + if(dialogueBox.curPage==6){ + trace('cloak'); + + cloakreveal(); + } + } + } + noteCalls(); if (Init.trueSettings.get('Controller Mode')) @@ -1774,15 +1782,6 @@ class PlayState extends MusicBeatState ///* if (songMusic.time >= Conductor.songPosition + 20 || songMusic.time <= Conductor.songPosition - 20) resyncVocals(); - //*/ - /* - if(curSong.toLowerCase()=='granddad battle'){ - switch(curStep){ - case 30: - dadOpponent=newdad; - } - } - */ if (curSong.toLowerCase()=='reaper-rhythm'){ switch(curStep){ case 1169: @@ -1803,6 +1802,7 @@ class PlayState extends MusicBeatState dialogueBox = DialogueBox.createDialogue(sys.io.File.getContent(midsongdialoguepath)); trace(dialogueBox); dialogueBox.cameras = [dialogueHUD]; + DialogueBox.skipText.visible=false; midsongdia=true; case 1548: add(dialogueBox); @@ -2156,6 +2156,37 @@ class PlayState extends MusicBeatState dadStrums.visible=boyfriendStrums.visible=true; } + public function cloakreveal(){ + dialogueBox.alphabetText.playSounds=false; + dialogueBox.kill(); + dialogueBox.voiceline?.stop(); + ForeverTools.killMusic([songDialogue]); + + if(cloaked!=null){ + FlxTween.tween(camHUD,{alpha:0},0.5); + for (h in strumHUD){ + FlxTween.tween(h,{alpha:0},0.5); + } + tweenCam(0.65,0.5); + cloaked.animation.play('idle',false); + cloaked.animation.finishCallback=function(dfsjksdfkj:String){ + dadOpponent.visible=true; + cloaked.visible=false; + cloaked.active=false; + tweenCam(0.5,1); + new FlxTimer().start(2,function(sdfjkmasdk:FlxTimer){ + FlxTween.tween(camHUD,{alpha:1},1); + for (h in strumHUD){ + FlxTween.tween(h,{alpha:1},1); + } + startCountdown(); + }); + } + + } + + } + public function songIntroCutscene() { if(songDialogue!=null)