mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Fix dragon breath & fire shield
This commit is contained in:
@@ -1267,8 +1267,12 @@ int64_t CGameHandler::applyBattleEffects(BattleAttack & bat, std::shared_ptr<bat
|
||||
bat.bsa.push_back(bsa); //add this stack to the list of victims after drain life has been calculated
|
||||
|
||||
//fire shield handling
|
||||
if(!bat.shot() && !def->isClone() &&
|
||||
def->hasBonusOfType(Bonus::FIRE_SHIELD) && !attackerState->hasBonusOfType(Bonus::FIRE_IMMUNITY))
|
||||
if(!bat.shot() &&
|
||||
!def->isClone() &&
|
||||
def->hasBonusOfType(Bonus::FIRE_SHIELD) &&
|
||||
!attackerState->hasBonusOfType(Bonus::FIRE_IMMUNITY) &&
|
||||
CStack::isMeleeAttackPossible(attackerState.get(), def) // attacked needs to be adjacent to defender for fire shield to trigger (e.g. Dragon Breath attack)
|
||||
)
|
||||
{
|
||||
//TODO: use damage with bonus but without penalties
|
||||
auto fireShieldDamage = (std::min<int64_t>(def->getAvailableHealth(), bsa.damageAmount) * def->valOfBonuses(Bonus::FIRE_SHIELD)) / 100;
|
||||
|
||||
Reference in New Issue
Block a user