diff --git a/src/npc/ai/egg_corridor.rs b/src/npc/ai/egg_corridor.rs index 1a5b69d..e41136e 100644 --- a/src/npc/ai/egg_corridor.rs +++ b/src/npc/ai/egg_corridor.rs @@ -26,20 +26,12 @@ impl NPC { _ => 0, }; - self.anim_counter += 1; - if self.anim_counter > 8 { - self.anim_counter = 0; - self.anim_num = (self.anim_num + 1) % 3; - self.anim_rect = state.constants.npc.n002_behemoth - [self.anim_num as usize + if self.direction == Direction::Right { 7 } else { 0 }]; - } + self.animate(8, 0, 3); if self.shock > 0 { self.action_counter = 0; self.action_num = 1; self.anim_num = 4; - self.anim_rect = state.constants.npc.n002_behemoth - [self.anim_num as usize + if self.direction == Direction::Right { 7 } else { 0 }]; } } 1 => { @@ -53,8 +45,6 @@ impl NPC { self.anim_num = 6; self.anim_counter = 0; self.damage = 5; - self.anim_rect = state.constants.npc.n002_behemoth - [self.anim_num as usize + if self.direction == Direction::Right { 7 } else { 0 }]; } else { self.action_num = 0; self.anim_counter = 0; @@ -83,9 +73,6 @@ impl NPC { state.sound_manager.play_sfx(26); state.quake_counter = 8; } - - self.anim_rect = state.constants.npc.n002_behemoth - [self.anim_num as usize + if self.direction == Direction::Right { 7 } else { 0 }]; } } _ => (), @@ -99,6 +86,9 @@ impl NPC { self.x += self.vel_x; self.y += self.vel_y; + self.anim_rect = state.constants.npc.n002_behemoth + [self.anim_num as usize + if self.direction == Direction::Right { 7 } else { 0 }]; + Ok(()) } diff --git a/src/npc/boss/ballos.rs b/src/npc/boss/ballos.rs index de70307..622cc67 100644 --- a/src/npc/boss/ballos.rs +++ b/src/npc/boss/ballos.rs @@ -1951,7 +1951,7 @@ impl BossNPC { npc.cond.set_alive(true); npc.x = self.parts[0].x + self.parts[0].rng.range(-40..40) * 0x200; npc.y = self.parts[0].y + self.parts[0].rng.range(0..40) * 0x200; - npc.direction = Direction::Up; + npc.direction = Direction::Bottom; let _ = npc_list.spawn(0x100, npc); } } diff --git a/src/scripting/tsc/text_script.rs b/src/scripting/tsc/text_script.rs index 5ae5479..bdfe5bf 100644 --- a/src/scripting/tsc/text_script.rs +++ b/src/scripting/tsc/text_script.rs @@ -1597,7 +1597,7 @@ impl TextScriptVM { state.control_flags.set_control_enabled(false); state.control_flags.set_interactions_disabled(true); - exec_state = TextScriptExecutionState::Running(event, cursor.position() as u32); + exec_state = TextScriptExecutionState::Ended; } TSCOpCode::SVP => { exec_state = TextScriptExecutionState::SaveProfile(event, cursor.position() as u32);