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:
parent
cb52935d9f
commit
6339a612b5
|
@ -1921,13 +1921,16 @@ impl NPC {
|
||||||
|
|
||||||
if self.action_num == 0 {
|
if self.action_num == 0 {
|
||||||
self.action_num = 1;
|
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.anim_rect = Rect::new(0, 64, 32, 96);
|
||||||
self.display_bounds = Rect::new(0x2000, 0x2000, 0x2000, 0x2000);
|
self.display_bounds = Rect::new(0x2000, 0x2000, 0x2000, 0x2000);
|
||||||
self.hit_bounds = Rect::new(0x1800, 0x1800, 0x1800, 0x1800);
|
self.hit_bounds = Rect::new(0x1800, 0x1800, 0x1800, 0x1800);
|
||||||
} else {
|
} else {
|
||||||
self.anim_rect =
|
// Small Blocks
|
||||||
Rect::new_size(16 * (self.rng.range(0..3) as u16), 16 * (self.rng.range(0..3) as u16 / 3), 16, 16);
|
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);
|
self.vel_x = self.direction.vector_x() * 2 * self.rng.range(256..512);
|
||||||
|
|
|
@ -223,11 +223,10 @@ impl BossNPC {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
250 | 251 => {
|
250 | 251 => {
|
||||||
|
let player = self.parts[0].get_closest_player_ref(&players);
|
||||||
if self.parts[0].action_num == 250 {
|
if self.parts[0].action_num == 250 {
|
||||||
self.parts[0].action_num = 251;
|
self.parts[0].action_num = 251;
|
||||||
if self.parts[0].direction == Direction::Right {
|
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].x = 0x1E000;
|
||||||
self.parts[0].y = player.y;
|
self.parts[0].y = player.y;
|
||||||
} else {
|
} else {
|
||||||
|
@ -246,7 +245,7 @@ impl BossNPC {
|
||||||
self.parts[0].target_x += 0x400;
|
self.parts[0].target_x += 0x400;
|
||||||
} else {
|
} else {
|
||||||
self.parts[0].target_x -= 0x200;
|
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;
|
self.parts[0].target_y -= 0x200;
|
||||||
} else {
|
} else {
|
||||||
self.parts[0].target_y += 0x200;
|
self.parts[0].target_y += 0x200;
|
||||||
|
|
Loading…
Reference in a new issue