diff --git a/assets/data/characters/tankman.xml b/assets/data/characters/tankman.xml index eaec0bf5..a2b9b336 100644 --- a/assets/data/characters/tankman.xml +++ b/assets/data/characters/tankman.xml @@ -3,10 +3,10 @@ - - - - + + + + diff --git a/buildnumber.txt b/buildnumber.txt index af27f188..1276e598 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1873 \ No newline at end of file +1874 \ No newline at end of file diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index 91385b1e..33a1c348 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -246,6 +246,9 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom dance(); case DANCE: dance(); + case LOCK: + if (animation.curAnim == null) + dance(); default: if (animation.curAnim == null || animation.curAnim.finished) dance(); diff --git a/source/funkin/scripting/Script.hx b/source/funkin/scripting/Script.hx index c4a1e5c1..4367665d 100644 --- a/source/funkin/scripting/Script.hx +++ b/source/funkin/scripting/Script.hx @@ -47,6 +47,8 @@ class Script extends FlxBasic implements IFlxDestroyable { "FlxTypeText" => flixel.addons.text.FlxTypeText, "FlxText" => flixel.text.FlxText, "FlxTimer" => flixel.util.FlxTimer, + "FlxPoint" => CoolUtil.getMacroAbstractClass("flixel.math.FlxPoint"), + "FlxAxes" => CoolUtil.getMacroAbstractClass("flixel.util.FlxAxes"), // Engine related stuff "engine" => { @@ -57,6 +59,8 @@ class Script extends FlxBasic implements IFlxDestroyable { "ModSubState" => funkin.scripting.ModSubState, "PlayState" => funkin.game.PlayState, "GameOverSubstate" => funkin.game.GameOverSubstate, + "HealthIcon" => funkin.game.HealthIcon, + "HudCamera" => funkin.game.HudCamera, "Note" => funkin.game.Note, "Strum" => funkin.game.Strum, "Character" => funkin.game.Character, diff --git a/source/funkin/scripting/events/PlayAnimEvent.hx b/source/funkin/scripting/events/PlayAnimEvent.hx index 08e75ab6..00c65054 100644 --- a/source/funkin/scripting/events/PlayAnimEvent.hx +++ b/source/funkin/scripting/events/PlayAnimEvent.hx @@ -42,22 +42,32 @@ class PlayAnimEvent extends CancellableEvent { @:enum abstract PlayAnimContext(String) { /** - No context was given for the animation + No context was given for the animation. + The character won't dance until the animation is finished **/ var NONE = null; /** Whenever a note is hit and a sing animation will be played. + The character will only dance after their holdTime is reached. **/ var SING = "SING"; /** Whenever a dance animation is played. + The character's dancing wont be blocked. **/ var DANCE = "DANCE"; /** Whenever a note is missed and a miss animation will be played. + Only for scripting, since it has the same effects as SING. **/ var MISS = "MISS"; + + /** + Locks the character's animation. + Prevents the character from dancing, even if the animation ended. + **/ + var LOCK = "LOCK"; } \ No newline at end of file diff --git a/source/funkin/system/CoolUtil.hx b/source/funkin/system/CoolUtil.hx index aab15e70..55e38549 100644 --- a/source/funkin/system/CoolUtil.hx +++ b/source/funkin/system/CoolUtil.hx @@ -351,4 +351,11 @@ class CoolUtil spr.antialiasing = FlxSprite.defaultAntialiasing; spr.rotOffset.set(); } + + /** + * Gets the macro class created by hscript-improved for an abstract / enum + */ + public static function getMacroAbstractClass(className:String) { + return Type.resolveClass('${className}_HSC'); + } } \ No newline at end of file