From ea3c86d769c3328faaba1a484b7ab5283d5f8786 Mon Sep 17 00:00:00 2001 From: Cherry Date: Mon, 19 Aug 2024 13:20:14 -0400 Subject: [PATCH] clear dualmenu rpanel on start --- pets-lib/src/battle/mod.rs | 4 ++++ pets-lib/src/battle/skills/attack.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/pets-lib/src/battle/mod.rs b/pets-lib/src/battle/mod.rs index 5aa35af7..b6c51041 100644 --- a/pets-lib/src/battle/mod.rs +++ b/pets-lib/src/battle/mod.rs @@ -208,7 +208,10 @@ impl BattleEngine { // disable the choice list self.choices.bind_mut().disable(); // self.other_choices.as_mut().map(|v| v.bind_mut().disable()); + self.clear_right_panel(); + } + fn clear_right_panel(&mut self) { self.right_panel_destination .clone() .expect("no right panel node exported") @@ -366,6 +369,7 @@ impl INode2D for BattleEngine { self.choices.bind_mut().disable(); self.battlers.init(pcb().bind().new_battlers()); self.update_mana_bar(); + self.clear_right_panel(); { let mut timer = Timer::new_alloc(); diff --git a/pets-lib/src/battle/skills/attack.rs b/pets-lib/src/battle/skills/attack.rs index fd797482..3a3bbb65 100644 --- a/pets-lib/src/battle/skills/attack.rs +++ b/pets-lib/src/battle/skills/attack.rs @@ -128,6 +128,8 @@ impl Skill for AttackSkill { power ); target.take_damage(damage); + + godot_print!("Target HP after damage: {}", target.hp()); } if let Some(effect) = &self.status_effect {