1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

vcmi: rename HeroBonus.h to Bonus.h

This commit is contained in:
Konstantin
2023-05-01 20:29:53 +03:00
committed by Konstantin P
parent 3df5a8e415
commit a6de9097be
66 changed files with 95 additions and 97 deletions

View File

@@ -1158,7 +1158,7 @@ int64_t CGameHandler::applyBattleEffects(BattleAttack & bat, std::shared_ptr<bat
{
if(attackerState->hasBonusOfType(Bonus::SOUL_STEAL, subtype))
{
int64_t toHeal = bsa.killedAmount * attackerState->valOfBonuses(Bonus::SOUL_STEAL, subtype) * attackerState->MaxHealth();
int64_t toHeal = bsa.killedAmount * attackerState->valOfBonuses(Bonus::SOUL_STEAL, subtype) * attackerState->getMaxHealth();
attackerState->heal(toHeal, EHealLevel::OVERHEAL, ((subtype == 0) ? EHealPower::ONE_BATTLE : EHealPower::PERMANENT));
drainedLife += toHeal;
break;
@@ -6003,7 +6003,7 @@ void CGameHandler::handleAfterAttackCasting(bool ranged, const CStack * attacker
resurrectInfo.type = attacker->creatureId();
if(attacker->hasBonusOfType((Bonus::TRANSMUTATION), 0))
resurrectInfo.count = std::max((defender->getCount() * defender->MaxHealth()) / resurrectInfo.type.toCreature()->MaxHealth(), 1u);
resurrectInfo.count = std::max((defender->getCount() * defender->getMaxHealth()) / resurrectInfo.type.toCreature()->getMaxHealth(), 1u);
else if (attacker->hasBonusOfType((Bonus::TRANSMUTATION), 1))
resurrectInfo.count = defender->getCount();
else
@@ -6044,7 +6044,7 @@ void CGameHandler::handleAfterAttackCasting(bool ranged, const CStack * attacker
BattleStackAttacked bsa;
bsa.attackerID = -1;
bsa.stackAttacked = defender->unitId();
bsa.damageAmount = amountToDie * defender->MaxHealth();
bsa.damageAmount = amountToDie * defender->getMaxHealth();
bsa.flags = BattleStackAttacked::SPELL_EFFECT;
bsa.spellID = SpellID::SLAYER;
defender->prepareAttacked(bsa, getRandomGenerator());
@@ -6488,7 +6488,7 @@ void CGameHandler::runBattle()
bte.stackID = stack->unitId();
bte.effect = Bonus::HP_REGENERATION;
const int32_t lostHealth = stack->MaxHealth() - stack->getFirstHPleft();
const int32_t lostHealth = stack->getMaxHealth() - stack->getFirstHPleft();
if(stack->hasBonusOfType(Bonus::HP_REGENERATION))
bte.val = std::min(lostHealth, stack->valOfBonuses(Bonus::HP_REGENERATION));