mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-21 12:06:49 +02:00
Do not apply Fire Shield effect that deals 0 damage
This commit is contained in:
parent
397ea90040
commit
a1eaf4d9c8
@ -1180,27 +1180,30 @@ void CGameHandler::makeAttack(const CStack * attacker, const CStack * defender,
|
|||||||
//FIXME: add custom effect on actor
|
//FIXME: add custom effect on actor
|
||||||
}
|
}
|
||||||
|
|
||||||
BattleStackAttacked bsa;
|
if (totalDamage > 0)
|
||||||
|
|
||||||
bsa.flags |= BattleStackAttacked::FIRE_SHIELD;
|
|
||||||
bsa.stackAttacked = attacker->ID; //invert
|
|
||||||
bsa.attackerID = defender->ID;
|
|
||||||
bsa.damageAmount = totalDamage;
|
|
||||||
attacker->prepareAttacked(bsa, getRandomGenerator());
|
|
||||||
|
|
||||||
StacksInjured pack;
|
|
||||||
pack.stacks.push_back(bsa);
|
|
||||||
sendAndApply(&pack);
|
|
||||||
|
|
||||||
// TODO: this is already implemented in Damage::describeEffect()
|
|
||||||
{
|
{
|
||||||
MetaString text;
|
BattleStackAttacked bsa;
|
||||||
text.addTxt(MetaString::GENERAL_TXT, 376);
|
|
||||||
text.addReplacement(MetaString::SPELL_NAME, SpellID::FIRE_SHIELD);
|
bsa.flags |= BattleStackAttacked::FIRE_SHIELD;
|
||||||
text.addReplacement(totalDamage);
|
bsa.stackAttacked = attacker->ID; //invert
|
||||||
blm.lines.push_back(std::move(text));
|
bsa.attackerID = defender->ID;
|
||||||
|
bsa.damageAmount = totalDamage;
|
||||||
|
attacker->prepareAttacked(bsa, getRandomGenerator());
|
||||||
|
|
||||||
|
StacksInjured pack;
|
||||||
|
pack.stacks.push_back(bsa);
|
||||||
|
sendAndApply(&pack);
|
||||||
|
|
||||||
|
// TODO: this is already implemented in Damage::describeEffect()
|
||||||
|
{
|
||||||
|
MetaString text;
|
||||||
|
text.addTxt(MetaString::GENERAL_TXT, 376);
|
||||||
|
text.addReplacement(MetaString::SPELL_NAME, SpellID::FIRE_SHIELD);
|
||||||
|
text.addReplacement(totalDamage);
|
||||||
|
blm.lines.push_back(std::move(text));
|
||||||
|
}
|
||||||
|
addGenericKilledLog(blm, attacker, bsa.killedAmount, false);
|
||||||
}
|
}
|
||||||
addGenericKilledLog(blm, attacker, bsa.killedAmount, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sendAndApply(&blm);
|
sendAndApply(&blm);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user