diff --git a/src/npc/ai/misc.rs b/src/npc/ai/misc.rs index 0143953..5d56f38 100644 --- a/src/npc/ai/misc.rs +++ b/src/npc/ai/misc.rs @@ -1921,13 +1921,16 @@ impl NPC { if self.action_num == 0 { self.action_num = 1; - if self.rng.range(0..9) == 9 { + let block = self.rng.range(0..9) as u16; + if block == 9 { + // Big Block self.anim_rect = Rect::new(0, 64, 32, 96); self.display_bounds = Rect::new(0x2000, 0x2000, 0x2000, 0x2000); self.hit_bounds = Rect::new(0x1800, 0x1800, 0x1800, 0x1800); } else { - self.anim_rect = - Rect::new_size(16 * (self.rng.range(0..3) as u16), 16 * (self.rng.range(0..3) as u16 / 3), 16, 16); + // Small Blocks + let scale = state.tile_size.as_int() as u16; + self.anim_rect = Rect::new_size(((block % 3) + 7) * scale, (block / 3) * scale, scale, scale); } self.vel_x = self.direction.vector_x() * 2 * self.rng.range(256..512); diff --git a/src/npc/boss/ironhead.rs b/src/npc/boss/ironhead.rs index ec52da6..1ab809b 100644 --- a/src/npc/boss/ironhead.rs +++ b/src/npc/boss/ironhead.rs @@ -223,11 +223,10 @@ impl BossNPC { } } 250 | 251 => { + let player = self.parts[0].get_closest_player_ref(&players); if self.parts[0].action_num == 250 { self.parts[0].action_num = 251; if self.parts[0].direction == Direction::Right { - let player = self.parts[0].get_closest_player_ref(&players); - self.parts[0].x = 0x1E000; self.parts[0].y = player.y; } else { @@ -246,7 +245,7 @@ impl BossNPC { self.parts[0].target_x += 0x400; } else { self.parts[0].target_x -= 0x200; - if self.parts[0].target_y >= self.parts[0].y { + if self.parts[0].target_y >= player.y { self.parts[0].target_y -= 0x200; } else { self.parts[0].target_y += 0x200;