Files
2025-06-22 12:00:12 -04:00

57 lines
1.1 KiB
Plaintext
Executable File

import funkin.play.song.Song;
import funkin.play.PlayState;
import funkin.Paths;
import funkin.play.cutscene.VideoCutscene;
import funkin.play.PlayStatePlaylist;
class GunsSong extends Song {
var hasPlayedCutscene:Bool;
public function new() {
super('guns');
hasPlayedCutscene = false;
}
public override function onCountdownStart(event:CountdownScriptEvent):Void {
super.onCountdownStart(event);
if (!PlayStatePlaylist.isStoryMode) hasPlayedCutscene = true;
if (!hasPlayedCutscene) {
trace('Pausing countdown to play a video cutscene (`guns`)');
hasPlayedCutscene = true;
event.cancel(); // CANCEL THE COUNTDOWN!
startVideo();
}
}
function startVideo() {
VideoCutscene.play(Paths.videos('gunsCutscene'));
}
/**
* Don't replay the cutscene between restarts.
*/
function onSongRetry(event:ScriptEvent)
{
super.onSongRetry(event);
hasPlayedCutscene = true;
}
/**
* Replay the cutscene after leaving the song.
*/
function onCreate(event:ScriptEvent):Void
{
super.onCreate(event);
hasPlayedCutscene = false;
}
}