1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-09-29 21:49:33 +00:00

Added missing core action

This commit is contained in:
dawnDus 2022-01-19 18:50:33 -05:00
parent f676b73c0e
commit dd8f2dcf67
No known key found for this signature in database
GPG key ID: 972AABDE81848F21

View file

@ -66,8 +66,7 @@ impl NPC {
Ok(()) Ok(())
} }
pub(crate) fn tick_n218_core_giant_ball(&mut self, state: &mut SharedGameState) -> GameResult pub(crate) fn tick_n218_core_giant_ball(&mut self, state: &mut SharedGameState) -> GameResult {
{
self.x += self.vel_x; self.x += self.vel_x;
self.y += self.vel_y; self.y += self.vel_y;
@ -331,7 +330,7 @@ impl BossNPC {
} }
500 | 501 => { 500 | 501 => {
if self.parts[0].action_num == 500 { if self.parts[0].action_num == 500 {
self.parts[0].action_num = 501; self.parts[0].action_num = 501;
self.parts[0].action_counter = 0; self.parts[0].action_counter = 0;
self.parts[0].vel_x = 0; self.parts[0].vel_x = 0;
self.parts[0].vel_y = 0; self.parts[0].vel_y = 0;
@ -375,6 +374,24 @@ impl BossNPC {
let _ = npc_list.spawn(0x100, npc); let _ = npc_list.spawn(0x100, npc);
} }
self.parts[0].x += if self.parts[0].action_counter & 0x02 == 0 { 0x200 } else { -0x200 };
self.parts[0].x += if self.parts[0].x < 0x7E000 { 0x80 } else { -0x80 };
self.parts[0].y += if self.parts[0].y < 0x16000 { 0x80 } else { -0x80 };
}
600 | 601 => {
if self.parts[0].action_num == 600 {
self.parts[0].action_num = 601;
self.parts[4].action_num = 50;
self.parts[5].action_num = 50;
self.parts[8].npc_flags.set_invulnerable(false);
self.parts[9].npc_flags.set_invulnerable(false);
self.parts[10].npc_flags.set_invulnerable(false);
self.parts[11].npc_flags.set_invulnerable(false);
}
self.parts[0].action_counter += 1;
self.parts[0].x += if self.parts[0].action_counter & 0x02 == 0 { 0x800 } else { -0x800 };
} }
_ => {} _ => {}
} }
@ -485,11 +502,11 @@ impl BossNPC {
_ => {} _ => {}
} }
part.anim_rect = state.constants.npc.b04_core[part.anim_num as usize];
if part.action_num == 51 { if part.action_num == 51 {
part.anim_rect.bottom = part.action_counter + part.anim_rect.top; part.anim_rect.bottom = part.action_counter + part.anim_rect.top;
} }
part.anim_rect = state.constants.npc.b04_core[part.anim_num as usize];
} }
fn tick_b04_core_tail(&mut self, i: usize, state: &mut SharedGameState) { fn tick_b04_core_tail(&mut self, i: usize, state: &mut SharedGameState) {
@ -529,11 +546,11 @@ impl BossNPC {
_ => {} _ => {}
} }
part.anim_rect = state.constants.npc.b04_core[4 + part.anim_num as usize];
if part.action_num == 51 { if part.action_num == 51 {
part.anim_rect.bottom = part.action_counter + part.anim_rect.top; part.anim_rect.bottom = part.action_counter + part.anim_rect.top;
} }
part.anim_rect = state.constants.npc.b04_core[4 + part.anim_num as usize];
} }
fn tick_b04_core_small_head( fn tick_b04_core_small_head(