Files
CodenameEngine/source/funkin/game/cutscenes/ScriptedCutscene.hx
T
6e23da8e86 Add more stuff from the OG game and more PART 1 (#228)
* senpai fucking dies

* final flash fadeout

* made cutscene not play on restart

* winter horrorland + fixes

* fix for pixel perfect shader

* trail + fixes

* better + shaking

last update about it, i swear

* never fucking mind + repacks + accuracy

* more fixes + chromatic aberration

* i hate how pixel shader fucks everything up

* aberration in the cutscene & its cool twitch

* camera beats when twitching

* tank stuff pt1

now the cutscenes look 99% like og (still gotta freeze the stage animated sprites n stuff)
PS: Deleting the lipSycn function in ugh and guns cutscenes cause its not needed + sometimes breaks the animations so lets just leave it in stress only like it was in og

* week 5 completed + retrocompatibility with altanim

now chrima parents work

* philly train

* gameplay shaders option

better adding it now

* tank stuff pt2

* blue balled text (death counter)

* winter horrorland better rework WIP

colored vignette usable by everyone (you can change its color, amount and strength)
wip cuz i wanna edit the amount/strength based on the zoom, i'll do later, now i dont have time gotta do christmas irl stuff yay

* winter horrorland better rework completed

* seen cutscene variable

finally

* even better cutscenes

* oops

* tank stuff pt3

* tank stuff pt4

WIP running tanks

Co-Authored-By: Ne_Eo <NeeEoo@users.noreply.github.com>

* tankstuff pt4.5

imma check tmr why do some tankmen spawn too much up

* tank stuff pt4.75

* dumb

* tank stuff pt 4.9

* type on xml sprite type fix and more

Co-Authored-By: Ne_Eo <NeeEoo@users.noreply.github.com>

---------

Co-authored-by: Ne_Eo <NeeEoo@users.noreply.github.com>
Co-authored-by: lunarcleint <88809950+lunarcleint@users.noreply.github.com>
2024-02-04 00:54:00 -07:00

87 lines
2.1 KiB
Haxe

package funkin.game.cutscenes;
import funkin.backend.scripting.DummyScript;
import flixel.addons.transition.FlxTransitionableState;
import funkin.backend.scripting.Script;
/**
* Substate made for scripted cutscenes.
* To add cutscenes to your songs, add a `cutscene.hx` file in your song's directory (ex: `songs/song/cutscene.hx`)
*/
class ScriptedCutscene extends Cutscene {
var script:Script;
var scriptPath:String;
public function new(scriptPath:String, callback:Void->Void) {
super(callback);
script = Script.create(this.scriptPath = scriptPath);
script.setPublicMap(PlayState.instance.scripts.publicVariables);
script.setParent(this);
script.load();
}
public override function create() {
super.create();
trace("fuck you");
script.call("create");
if (Std.isOfType(script, DummyScript)) {
Logs.trace('Could not find script for scripted cutscene at ${scriptPath}', ERROR, RED);
close();
}
}
public override function update(elapsed:Float) {
script.call("update", [elapsed]);
super.update(elapsed);
script.call("postUpdate", [elapsed]);
}
public override function beatHit(curBeat:Int) {
super.beatHit(curBeat);
script.call("beatHit", [curBeat]);
}
public override function stepHit(curStep:Int) {
super.stepHit(curStep);
script.call("stepHit", [curStep]);
}
public override function destroy() {
script.call("destroy");
super.destroy();
}
// VIDEOS
#if REGION
public function startVideo(path:String, ?callback:Void->Void) {
persistentDraw = false;
openSubState(new VideoCutscene(path, function() {
if (callback != null)
callback();
}));
}
public var isVideoPlaying(get, null):Bool;
private inline function get_isVideoPlaying()
return subState is VideoCutscene;
#end
// DIALOGUE
#if REGION
public function startDialogue(path:String, ?callback:Void->Void) {
persistentDraw = true;
openSubState(new DialogueCutscene(path, function() {
if (callback != null)
callback();
}));
}
public var isDialoguePlaying(get, null):Bool;
private inline function get_isDialoguePlaying()
return subState is DialogueCutscene;
#end
}