|
@@ -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);
|
|
|
}
|