mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
CGameHandler::applyBattleEffects: improve Fire Shield support
Now damage is limited to total health of defending stack and clone have no file shield damage. In same time damage calculation is likely remain incorrect.
This commit is contained in:
@ -900,15 +900,19 @@ void CGameHandler::applyBattleEffects(BattleAttack &bat, const CStack *att, cons
|
||||
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->hasBonusOfType(Bonus::FIRE_SHIELD) && !att->hasBonusOfType (Bonus::FIRE_IMMUNITY))
|
||||
if(!bat.shot() && !vstd::contains(def->state, EBattleStackState::CLONED) &&
|
||||
def->hasBonusOfType(Bonus::FIRE_SHIELD) && !att->hasBonusOfType(Bonus::FIRE_IMMUNITY))
|
||||
{
|
||||
// TODO: Fire sheild damage should be calculated separately after BattleAttack applied.
|
||||
// Currently it's looks like attacking stack damage itself with defenders fire shield.
|
||||
// So no separate message on spell damge in log and expirience calculation is likely wrong too.
|
||||
BattleStackAttacked bsa2;
|
||||
bsa2.stackAttacked = att->ID; //invert
|
||||
bsa2.attackerID = def->ID;
|
||||
bsa2.flags |= BattleStackAttacked::EFFECT; //FIXME: play animation upon efreet and not attacker
|
||||
bsa2.effect = 11;
|
||||
|
||||
bsa2.damageAmount = (bsa.damageAmount * def->valOfBonuses(Bonus::FIRE_SHIELD)) / 100; //TODO: scale with attack/defense
|
||||
bsa2.damageAmount = (std::min(def->totalHelth(), bsa.damageAmount) * def->valOfBonuses(Bonus::FIRE_SHIELD)) / 100; //TODO: scale with attack/defense
|
||||
att->prepareAttacked(bsa2, gameState()->getRandomGenerator());
|
||||
bat.bsa.push_back(bsa2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user