1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-11-29 07:47:40 +00:00

Assorted bug fixes

This commit is contained in:
dawnDus 2022-03-04 20:38:13 -05:00
parent 15010e54c2
commit bba0313824
No known key found for this signature in database
GPG key ID: 972AABDE81848F21
3 changed files with 6 additions and 16 deletions

View file

@ -26,20 +26,12 @@ impl NPC {
_ => 0, _ => 0,
}; };
self.anim_counter += 1; self.animate(8, 0, 3);
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 }];
}
if self.shock > 0 { if self.shock > 0 {
self.action_counter = 0; self.action_counter = 0;
self.action_num = 1; self.action_num = 1;
self.anim_num = 4; 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 => { 1 => {
@ -53,8 +45,6 @@ impl NPC {
self.anim_num = 6; self.anim_num = 6;
self.anim_counter = 0; self.anim_counter = 0;
self.damage = 5; 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 { } else {
self.action_num = 0; self.action_num = 0;
self.anim_counter = 0; self.anim_counter = 0;
@ -83,9 +73,6 @@ impl NPC {
state.sound_manager.play_sfx(26); state.sound_manager.play_sfx(26);
state.quake_counter = 8; 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.x += self.vel_x;
self.y += self.vel_y; 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(()) Ok(())
} }

View file

@ -1951,7 +1951,7 @@ impl BossNPC {
npc.cond.set_alive(true); npc.cond.set_alive(true);
npc.x = self.parts[0].x + self.parts[0].rng.range(-40..40) * 0x200; 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.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); let _ = npc_list.spawn(0x100, npc);
} }
} }

View file

@ -1597,7 +1597,7 @@ impl TextScriptVM {
state.control_flags.set_control_enabled(false); state.control_flags.set_control_enabled(false);
state.control_flags.set_interactions_disabled(true); state.control_flags.set_interactions_disabled(true);
exec_state = TextScriptExecutionState::Running(event, cursor.position() as u32); exec_state = TextScriptExecutionState::Ended;
} }
TSCOpCode::SVP => { TSCOpCode::SVP => {
exec_state = TextScriptExecutionState::SaveProfile(event, cursor.position() as u32); exec_state = TextScriptExecutionState::SaveProfile(event, cursor.position() as u32);