mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-11-29 15:56:53 +00:00
Gaudi projectiles and red demon exp (Fixes #95)
This commit is contained in:
parent
f60440f877
commit
703413dcb6
|
|
@ -401,6 +401,7 @@ impl NPC {
|
|||
self.anim_num = 2;
|
||||
state.quake_counter = 10;
|
||||
state.sound_manager.play_sfx(72);
|
||||
self.create_xp_drop_custom(self.x, self.y, 19, state, npc_list);
|
||||
|
||||
npc_list.create_death_smoke(
|
||||
self.x,
|
||||
|
|
|
|||
|
|
@ -1145,50 +1145,54 @@ impl NPC {
|
|||
}
|
||||
|
||||
pub(crate) fn tick_n174_gaudi_armored_projectile(&mut self, state: &mut SharedGameState) -> GameResult {
|
||||
if self.action_num == 0 && self.direction == Direction::Right {
|
||||
self.action_num = 2;
|
||||
match self.action_num {
|
||||
0 | 1 => {
|
||||
if self.direction == Direction::Right {
|
||||
self.action_num = 2;
|
||||
}
|
||||
|
||||
let mut hit = false;
|
||||
|
||||
if self.flags.hit_left_wall() {
|
||||
hit = true;
|
||||
self.vel_x = 0x200;
|
||||
}
|
||||
if self.flags.hit_right_wall() {
|
||||
hit = true;
|
||||
self.vel_x = -0x200;
|
||||
}
|
||||
if self.flags.hit_top_wall() {
|
||||
hit = true;
|
||||
self.vel_y = 0x200;
|
||||
}
|
||||
if self.flags.hit_bottom_wall() {
|
||||
hit = true;
|
||||
self.vel_y = -0x200;
|
||||
}
|
||||
|
||||
if hit {
|
||||
self.action_num = 2;
|
||||
self.action_counter2 += 1;
|
||||
state.sound_manager.play_sfx(31);
|
||||
}
|
||||
}
|
||||
2 => {
|
||||
self.vel_y += 0x40;
|
||||
|
||||
if self.flags.hit_bottom_wall() {
|
||||
self.action_counter2 += 1;
|
||||
if self.action_counter2 > 1 {
|
||||
state.create_caret(self.x, self.y, CaretType::ProjectileDissipation, Direction::Left);
|
||||
self.cond.set_alive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
if self.action_num == 1 {
|
||||
self.x += self.vel_x;
|
||||
self.y += self.vel_y;
|
||||
|
||||
let mut hit = false;
|
||||
|
||||
if self.flags.hit_left_wall() {
|
||||
hit = true;
|
||||
self.vel_x = 0x200;
|
||||
}
|
||||
if self.flags.hit_right_wall() {
|
||||
hit = true;
|
||||
self.vel_x = -0x200;
|
||||
}
|
||||
if self.flags.hit_top_wall() {
|
||||
hit = true;
|
||||
self.vel_y = 0x200;
|
||||
}
|
||||
if self.flags.hit_bottom_wall() {
|
||||
hit = true;
|
||||
self.vel_y = -0x200;
|
||||
}
|
||||
|
||||
if hit {
|
||||
self.action_num = 2;
|
||||
self.action_counter3 += 1;
|
||||
state.sound_manager.play_sfx(31);
|
||||
}
|
||||
}
|
||||
|
||||
self.vel_y += 0x40;
|
||||
self.x += self.vel_x;
|
||||
self.y += self.vel_y;
|
||||
|
||||
self.action_counter3 += 1;
|
||||
if self.flags.hit_bottom_wall() && self.action_counter3 > 1 {
|
||||
state.create_caret(self.x, self.y, CaretType::ProjectileDissipation, Direction::Left);
|
||||
self.cond.set_alive(false);
|
||||
}
|
||||
|
||||
self.vel_y = self.vel_y.clamp(-0x5ff, 0x5ff);
|
||||
|
||||
self.anim_num += 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue