1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Handle AcidBreathDamage immunity in standard way.

This commit is contained in:
AlexVinS
2016-09-06 10:52:54 +03:00
parent 0241c6e843
commit f3d9e718bf
4 changed files with 25 additions and 8 deletions

View File

@@ -266,7 +266,9 @@ void DefaultSpellMechanics::castNormal(const SpellCastEnvironment * env, const B
//checking if creatures resist
handleResistance(env, ctx.attackedCres, ctx.sc);
//it is actual spell and can be reflected to single target, no recurrence
//reflection is applied only to negative spells
//if it is actual spell and can be reflected to single target, no recurrence
const bool tryMagicMirror = owner->isNegative() && owner->level && owner->getLevelInfo(0).range == "0";
if(tryMagicMirror)
{
@@ -765,7 +767,7 @@ void DefaultSpellMechanics::handleImmunities(const CBattleInfoCallback * cb, con
void DefaultSpellMechanics::handleResistance(const SpellCastEnvironment * env, std::vector<const CStack* >& attackedCres, BattleSpellCast& sc) const
{
//checking if creatures resist
//resistance/reflection is applied only to negative spells
//resistance is applied only to negative spells
if(owner->isNegative())
{
std::vector <const CStack*> resisted;
@@ -802,7 +804,6 @@ bool DefaultSpellMechanics::requiresCreatureTarget() const
return true;
}
std::vector<const CStack *> SpecialSpellMechanics::calculateAffectedStacks(const CBattleInfoCallback * cb, const SpellTargetingContext & ctx) const
{
return std::vector<const CStack *>();