Merge pull request #46 from dawndus/fixes

Minor fixes
This commit is contained in:
alula 2022-01-16 02:36:22 +01:00 committed by GitHub
commit 87792972d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 7 deletions

View File

@ -555,10 +555,11 @@ impl NPC {
self.action_num = 10
};
if self.action_counter > 20 && (self.direction == Direction::Left && self.x <= player.x + 0x4000)
|| (self.direction == Direction::Up && self.y <= player.y + 0x4000)
|| (self.direction == Direction::Right && self.x <= player.x - 0x4000)
|| (self.direction == Direction::Bottom && self.y <= player.y - 0x4000)
if self.action_counter > 20
&& ((self.direction == Direction::Left && self.x <= player.x + 0x4000)
|| (self.direction == Direction::Up && self.y <= player.y + 0x4000)
|| (self.direction == Direction::Right && self.x <= player.x - 0x4000)
|| (self.direction == Direction::Bottom && self.y <= player.y - 0x4000))
{
self.action_num = 10
}

View File

@ -568,6 +568,7 @@ impl NPC {
flash.set_blink();
state.sound_manager.play_sfx(29);
}
self.anim_num = self.anim_num.max(8);
self.animate(1, 8, 9);
}
_ => (),

View File

@ -88,7 +88,7 @@ impl BossNPC {
if self.parts[0].action_num == 20 {
self.parts[0].action_num = 21;
self.parts[0].damage = 0;
self.parts[0].x = 0x14000;
self.parts[0].x = if !state.constants.is_switch { 0x14000 } else { 0x1A000 };
self.parts[0].y = 0x33A00;
self.parts[0].npc_flags.set_solid_hard(false);
self.parts[1].cond.set_alive(false);
@ -110,7 +110,7 @@ impl BossNPC {
if self.parts[0].action_num == 30 {
self.parts[0].action_num = 31;
self.parts[0].anim_num = 2;
self.parts[0].x = 0x14000;
self.parts[0].x = if !state.constants.is_switch { 0x14000 } else { 0x1A000 };
self.parts[0].y = 0x8000;
}
self.parts[0].y += 0x800;

View File

@ -1351,7 +1351,9 @@ impl GameScene {
self.hud_player2.tick(state, (&self.player2, &mut self.inventory_player2))?;
self.boss_life_bar.tick(state, (&self.npc_list, &self.boss))?;
if self.player1.controller.trigger_inventory() {
if self.player1.controller.trigger_inventory()
&& state.textscript_vm.state == TextScriptExecutionState::Ended
{
state.textscript_vm.set_mode(ScriptMode::Inventory);
self.player1.cond.set_interacted(false);
}