mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-01-10 04:57:02 +00:00
fix #19
This commit is contained in:
parent
0b6f9191c2
commit
f4c11ba326
|
@ -157,28 +157,18 @@ impl NPC {
|
|||
}
|
||||
}
|
||||
|
||||
self.anim_rect = state.constants.npc.n015_closed_chest[0];
|
||||
}
|
||||
|
||||
self.anim_num = 0;
|
||||
if self.rng.range(0..30) == 0 {
|
||||
if self.rng.range(0..30) == 10 {
|
||||
self.action_num = 2;
|
||||
}
|
||||
}
|
||||
2 => {
|
||||
if self.anim_counter == 0 {
|
||||
self.anim_rect = state.constants.npc.n015_closed_chest[self.anim_num as usize];
|
||||
}
|
||||
|
||||
self.anim_counter += 1;
|
||||
if self.anim_counter > 1 {
|
||||
self.anim_counter = 0;
|
||||
self.anim_num += 1;
|
||||
|
||||
if self.anim_num > 2 {
|
||||
self.anim_num = 0;
|
||||
self.action_num = 1;
|
||||
}
|
||||
self.animate(1, 0, 3);
|
||||
if self.anim_num > 2 {
|
||||
self.anim_num = 0;
|
||||
self.action_num = 1;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
@ -191,6 +181,8 @@ impl NPC {
|
|||
|
||||
self.y += self.vel_y;
|
||||
|
||||
self.anim_rect = state.constants.npc.n015_closed_chest[self.anim_num as usize];
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue