diff --git a/preload/scripts/characters/bf.hxc b/preload/scripts/characters/bf.hxc index a0396bb7b..596b57809 100644 --- a/preload/scripts/characters/bf.hxc +++ b/preload/scripts/characters/bf.hxc @@ -3,11 +3,33 @@ import flixel.FlxG; import funkin.audio.FunkinSound; import funkin.play.character.MultiSparrowCharacter; import funkin.play.GameOverSubState; +import funkin.play.character.CharacterType; +import funkin.play.PlayState; class BoyfriendCharacter extends MultiSparrowCharacter { function new() { super('bf'); } + + function onNoteHit(event:HitNoteScriptEvent) + { + if (event.eventCanceled) { + // onNoteHit event was cancelled by the gameplay module. + return; + } + + if (event.note.noteData.getMustHitNote() && characterType == CharacterType.BF) { + // Override the hit note animation. + switch(event.note.kind) { + case "cheer": + holdTimer = 0; + this.playAnimation('cheer', true, true); + return; + default: + super.onNoteHit(event); + } + } + } override function playAnimation(name:String, restart:Bool, ignoreOther:Bool) { if (name == "fakeoutDeath" && !this.debug) { diff --git a/preload/scripts/characters/spooky-dark.hxc b/preload/scripts/characters/spooky-dark.hxc index deab7ce6b..85b4947e4 100644 --- a/preload/scripts/characters/spooky-dark.hxc +++ b/preload/scripts/characters/spooky-dark.hxc @@ -43,5 +43,20 @@ class SpookyDarkCharacter extends SparrowCharacter { PlayState.instance.currentStage.add(normalChar); PlayState.instance.currentStage.refresh(); // Apply z-index. } + + function onNoteHit(event:HitNoteScriptEvent) + { + super.onNoteHit(event); + + if (!event.note.noteData.getMustHitNote() && characterType == CharacterType.DAD) { + // Override the hit note animation. + switch(event.note.kind) { + case "cheer": + holdTimer = 0; + this.playAnimation('cheer', true, true); + return; + } + } + } } diff --git a/preload/scripts/characters/spooky.hxc b/preload/scripts/characters/spooky.hxc new file mode 100644 index 000000000..8e1d24388 --- /dev/null +++ b/preload/scripts/characters/spooky.hxc @@ -0,0 +1,24 @@ +import funkin.play.character.SparrowCharacter; +import funkin.play.character.CharacterType; +import funkin.play.PlayState; + +class SpookyCharacter extends SparrowCharacter { + function new() { + super('spooky'); + } + + function onNoteHit(event:HitNoteScriptEvent) + { + super.onNoteHit(event); + + if (!event.note.noteData.getMustHitNote() && characterType == CharacterType.DAD) { + // Override the hit note animation. + switch(event.note.kind) { + case "cheer": + holdTimer = 0; + this.playAnimation('cheer', true, true); + return; + } + } + } +}