diff --git a/assets/music/DISTORTO.ogg b/assets/music/DISTORTO.ogg new file mode 100644 index 00000000..3df92dcb Binary files /dev/null and b/assets/music/DISTORTO.ogg differ diff --git a/assets/songs/ugh/cutscene.hx b/assets/songs/ugh/cutscene.hx index 103d2b6e..b4e709f6 100644 --- a/assets/songs/ugh/cutscene.hx +++ b/assets/songs/ugh/cutscene.hx @@ -1,7 +1,10 @@ import funkin.system.FunkinSprite; var tankman:FunkinSprite; +var tankTalk1, tankTalk2, bfBeep, distorto:FlxSound; + function create() { + FlxG.camera.zoom = 1; game.camHUD.visible = false; tankman = new FunkinSprite(game.dad.x + game.dad.globalOffset.x + 520, game.dad.y + game.dad.globalOffset.y + 225); @@ -9,18 +12,68 @@ function create() { tankman.loadSprite(Paths.image('game/cutscenes/tank/ugh-tankman')); tankman.animateAtlas.anim.addBySymbol('1', 'TANK TALK 1 P1', 24, false); tankman.animateAtlas.anim.addBySymbol('2', 'TANK TALK 1 P2', 24, false); - game.insert(game.members.indexOf(game.dad), tankman); + game.insert(game.members.indexOf(game.dad), tankman); game.dad.visible = false; - tankman.playAnim('1'); - - game.camFollow.setPosition(tankman.x, tankman.y); - + focusOn(game.dad); game.persistentUpdate = true; + + tankTalk1 = FlxG.sound.load(Paths.sound('cutscenes/tank/ugh-1')); + tankTalk2 = FlxG.sound.load(Paths.sound('cutscenes/tank/ugh-2')); + bfBeep = FlxG.sound.load(Paths.sound('cutscenes/tank/ugh-beep')); + bfBeep.onComplete = function() { + game.boyfriend.dance(); + }; + distorto = FlxG.sound.load(Paths.music('DISTORTO')); + distorto.volume = 0; + distorto.play(); + distorto.fadeIn(5, 0, 0.5); + + tankman.playAnim('1'); + tankTalk1.play(); + + new FlxTimer().start(3, function(tmr:FlxTimer) { + focusOn(game.boyfriend); + + new FlxTimer().start(1.5, function(t) { + game.boyfriend.playAnim("singUP"); + bfBeep.play(); + + new FlxTimer().start(1.5, function(t) { + focusOn(game.dad); + tankTalk2.play(); + tankman.playAnim('2'); + + new FlxTimer().start(6.1, function(t) { + game.remove(tankman); + tankman.destroy(); + + game.camHUD.visible = true; + game.dad.visible = true; + distorto.fadeOut((Conductor.crochet / 1000) * 5, 0); + + close(); + }, 1); + }, 1); + }, 1); + }, 1); +} + +function focusOn(char) { + var camPos = char.getCameraPosition(); + game.camFollow.setPosition(camPos.x, camPos.y); + camPos.put(); } function update(elapsed:Float) { if (FlxG.keys.justPressed.F5) FlxG.resetState(); + + if (tankTalk1.playing) lipSync(tankTalk1); + if (tankTalk2.playing) lipSync(tankTalk2); +} + +function lipSync(sound:FlxSound) { + tankman.animateAtlas.anim.curFrame = Std.int(tankman.animateAtlas.anim.length / sound.length * sound.time); } \ No newline at end of file diff --git a/assets/sounds/tankSong2.mp3 b/assets/sounds/cutscenes/tank/guns.mp3 similarity index 100% rename from assets/sounds/tankSong2.mp3 rename to assets/sounds/cutscenes/tank/guns.mp3 diff --git a/assets/sounds/cutscenes/tank/guns.ogg b/assets/sounds/cutscenes/tank/guns.ogg new file mode 100644 index 00000000..54abec8b Binary files /dev/null and b/assets/sounds/cutscenes/tank/guns.ogg differ diff --git a/assets/sounds/song3censor.mp3 b/assets/sounds/cutscenes/tank/stress-censor.mp3 similarity index 100% rename from assets/sounds/song3censor.mp3 rename to assets/sounds/cutscenes/tank/stress-censor.mp3 diff --git a/assets/sounds/cutscenes/tank/stress-censor.ogg b/assets/sounds/cutscenes/tank/stress-censor.ogg new file mode 100644 index 00000000..023dcca1 Binary files /dev/null and b/assets/sounds/cutscenes/tank/stress-censor.ogg differ diff --git a/assets/sounds/stressCutscene.mp3 b/assets/sounds/cutscenes/tank/stress.mp3 similarity index 100% rename from assets/sounds/stressCutscene.mp3 rename to assets/sounds/cutscenes/tank/stress.mp3 diff --git a/assets/sounds/cutscenes/tank/stress.ogg b/assets/sounds/cutscenes/tank/stress.ogg new file mode 100644 index 00000000..316ca2b8 Binary files /dev/null and b/assets/sounds/cutscenes/tank/stress.ogg differ diff --git a/assets/sounds/wellWellWell.mp3 b/assets/sounds/cutscenes/tank/ugh-1.mp3 similarity index 100% rename from assets/sounds/wellWellWell.mp3 rename to assets/sounds/cutscenes/tank/ugh-1.mp3 diff --git a/assets/sounds/cutscenes/tank/ugh-1.ogg b/assets/sounds/cutscenes/tank/ugh-1.ogg new file mode 100644 index 00000000..72ca127b Binary files /dev/null and b/assets/sounds/cutscenes/tank/ugh-1.ogg differ diff --git a/assets/sounds/killYou.mp3 b/assets/sounds/cutscenes/tank/ugh-2.mp3 similarity index 100% rename from assets/sounds/killYou.mp3 rename to assets/sounds/cutscenes/tank/ugh-2.mp3 diff --git a/assets/sounds/cutscenes/tank/ugh-2.ogg b/assets/sounds/cutscenes/tank/ugh-2.ogg new file mode 100644 index 00000000..80a19d64 Binary files /dev/null and b/assets/sounds/cutscenes/tank/ugh-2.ogg differ diff --git a/assets/sounds/bfBeep.mp3 b/assets/sounds/cutscenes/tank/ugh-beep.mp3 similarity index 100% rename from assets/sounds/bfBeep.mp3 rename to assets/sounds/cutscenes/tank/ugh-beep.mp3 diff --git a/assets/sounds/cutscenes/tank/ugh-beep.ogg b/assets/sounds/cutscenes/tank/ugh-beep.ogg new file mode 100644 index 00000000..ade169a7 Binary files /dev/null and b/assets/sounds/cutscenes/tank/ugh-beep.ogg differ diff --git a/buildnumber.txt b/buildnumber.txt index 5f25166f..e542c666 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2213 \ No newline at end of file +2216 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 59f7ad89..49fcb3d7 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -692,11 +692,12 @@ class PlayState extends MusicBeatState DiscordUtil.changeSongPresence(detailsText, (paused ? "Paused - " : "") + SONG.song + " (" + difficulty + ")", inst, getIconRPC()); } - public function startCutscene() { + public function startCutscene(prefix:String = "") { if (playCutscenes) { - var videoCutscene = Paths.video('${PlayState.SONG.song.toLowerCase()}-cutscene'); - var videoCutsceneAlt = Paths.file('songs/${PlayState.SONG.song.toLowerCase()}/cutscene.mp4'); - var dialogue = Paths.file('songs/${PlayState.SONG.song.toLowerCase()}/dialogue.xml'); + inCutscene = true; + var videoCutscene = Paths.video('${PlayState.SONG.song.toLowerCase()}-${prefix}cutscene'); + var videoCutsceneAlt = Paths.file('songs/${PlayState.SONG.song.toLowerCase()}/${prefix}cutscene.mp4'); + var dialogue = Paths.file('songs/${PlayState.SONG.song.toLowerCase()}/${prefix}dialogue.xml'); persistentUpdate = true; if (cutscene != null) { openSubState(new ScriptedCutscene(cutscene, function() { @@ -728,42 +729,6 @@ class PlayState extends MusicBeatState startCountdown(); } - public function startEndCutscene() { - if (playCutscenes) { - var videoCutscene = Paths.video('${PlayState.SONG.song.toLowerCase()}-end-cutscene'); - var videoCutsceneAlt = Paths.file('songs/${PlayState.SONG.song.toLowerCase()}/end-cutscene.mp4'); - var dialogue = Paths.file('songs/${PlayState.SONG.song.toLowerCase()}/end-dialogue.xml'); - persistentUpdate = true; - if (endCutscene != null) { - openSubState(new ScriptedCutscene(endCutscene, function() { - nextSong(); - })); - } else if (Assets.exists(dialogue)) { - FlxTransitionableState.skipNextTransIn = true; - openSubState(new DialogueCutscene(dialogue, function() { - startCountdown(); - })); - } else if (Assets.exists(videoCutsceneAlt)) { - FlxTransitionableState.skipNextTransIn = true; - persistentUpdate = false; - openSubState(new VideoCutscene(videoCutsceneAlt, function() { - nextSong(); - })); - persistentDraw = false; - } else if (Assets.exists(videoCutscene)) { - FlxTransitionableState.skipNextTransIn = true; - persistentUpdate = false; - openSubState(new VideoCutscene(videoCutscene, function() { - nextSong(); - })); - persistentDraw = false; - } else { - nextSong(); - } - } else - nextSong(); - } - public function startCountdown():Void { if (!_startCountdownCalled) { @@ -1130,6 +1095,11 @@ class PlayState extends MusicBeatState super.update(elapsed); scripts.call("update", [elapsed]); + if (inCutscene) { + scripts.call("postUpdate", [elapsed]); + return; + } + scoreTxt.text = 'Score:$songScore'; missesTxt.text = '${comboBreaks ? "Combo Breaks" : "Misses"}:$misses'; var acc = accuracy; @@ -1351,7 +1321,7 @@ class PlayState extends MusicBeatState #end } - startEndCutscene(); + startCutscene("end-"); } public function nextSong() {