This commit is contained in:
2020-04-22 21:20:07 +02:00
parent d2cf26e950
commit 75baf19ebd
4 changed files with 32 additions and 30 deletions

View File

@@ -96,7 +96,7 @@ Battling::Battle* Battling::Creature::GetBattle() const { return _battle; }
Battling::BattleSide* Battling::Creature::GetBattleSide() const { return _side; }
bool Battling::Creature::IsFainted() const noexcept { return this->_currentHealth <= 0; }
bool Battling::Creature::IsFainted() const noexcept { return this->_currentHealth == 0; }
void Battling::Creature::OnFaint() {
// HOOK: On Faint
@@ -115,6 +115,8 @@ void Battling::Creature::Damage(uint32_t damage, Battling::DamageSource source)
if (damage > _currentHealth) {
damage = _currentHealth;
}
if (damage == 0)
return;
// HOOK: On Damage
auto newHealth = _currentHealth - damage;
auto battle = this->GetBattle();