diff --git a/base/ControllableChar.ts b/base/ControllableChar.ts index 3bae0b102..95c71d4ba 100644 --- a/base/ControllableChar.ts +++ b/base/ControllableChar.ts @@ -913,6 +913,8 @@ export abstract class ControllableChar { bounce?: boolean; /** Whether the char shadow will remain hidden after jump. */ keep_shadow_hidden?: boolean; + /** If true, char jump animation won't be played. */ + dont_play_jump_animation?: boolean; }) { const duration = options?.duration ?? 65; const jump_height = options?.jump_height ?? 12; @@ -952,7 +954,7 @@ export abstract class ControllableChar { } this.toggle_collision(false); this.jumping = true; - if (this.sprite_info.hasAction(base_actions.JUMP)) { + if (this.sprite_info.hasAction(base_actions.JUMP) && !options.dont_play_jump_animation) { let jump_init_resolve; const jump_init_promise = new Promise(resolve => (jump_init_resolve = resolve)); this.play(base_actions.JUMP, reverse_directions[jump_direction]); diff --git a/base/game_events/GameEventManager.ts b/base/game_events/GameEventManager.ts index 42689a754..1fa0d9cb2 100644 --- a/base/game_events/GameEventManager.ts +++ b/base/game_events/GameEventManager.ts @@ -553,7 +553,8 @@ export class GameEventManager { info.dest, info.jump_direction, info.sfx_key, - info.wait_after + info.wait_after, + info.dont_play_jump_animation ); case event_types.FACE_DIRECTION: return new FaceDirectionEvent( diff --git a/base/game_events/JumpEvent.ts b/base/game_events/JumpEvent.ts index c89f4053f..5b4c1c9c1 100644 --- a/base/game_events/JumpEvent.ts +++ b/base/game_events/JumpEvent.ts @@ -17,6 +17,7 @@ export class JumpEvent extends GameEvent { distance?: number; }; private jump_direction: directions; + private dont_play_jump_animation: boolean; private sfx_key: string; private finish_events: GameEvent[]; @@ -36,7 +37,8 @@ export class JumpEvent extends GameEvent { dest, jump_direction, sfx_key, - wait_after + wait_after, + dont_play_jump_animation ) { super(game, data, event_types.JUMP, active, key_name, keep_reveal, keep_custom_psynergy); this.is_npc = is_npc; @@ -48,6 +50,7 @@ export class JumpEvent extends GameEvent { this.dest = dest; this.jump_direction = jump_direction !== undefined ? directions[jump_direction as string] : undefined; this.sfx_key = sfx_key; + this.dont_play_jump_animation = dont_play_jump_animation; this.finish_events = []; if (finish_events !== undefined) { finish_events.forEach(event_info => { @@ -81,6 +84,7 @@ export class JumpEvent extends GameEvent { dest: this.dest, time_on_finish: this.wait_after, sfx_key: this.sfx_key, + dont_play_jump_animation: this.dont_play_jump_animation, }); char.force_char_stop_in_event = previous_force_char_stop_in_event;