1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-11-26 15:23:38 +00:00

ironhead bugfixes

This commit is contained in:
dawnDus 2022-01-09 13:19:58 -05:00 committed by alula
parent cb52935d9f
commit 6339a612b5
2 changed files with 8 additions and 6 deletions

View file

@ -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);

View file

@ -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;