|
|
@@ -22,7 +22,7 @@ void AcidBreathDamageMechanics::applyBattleEffects(const SpellCastEnvironment *
|
|
|
//calculating dmg to display
|
|
|
ctx.setDamageToDisplay(parameters.effectPower);
|
|
|
|
|
|
- for(auto & attackedCre : ctx.attackedCres) //no immunities
|
|
|
+ for(auto & attackedCre : ctx.attackedCres)
|
|
|
{
|
|
|
BattleStackAttacked bsa;
|
|
|
bsa.flags |= BattleStackAttacked::SPELL_EFFECT;
|
|
|
@@ -35,9 +35,23 @@ void AcidBreathDamageMechanics::applyBattleEffects(const SpellCastEnvironment *
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void AcidBreathDamageMechanics::handleImmunities(const CBattleInfoCallback * cb, const SpellTargetingContext & ctx, std::vector<const CStack*> & stacks) const
|
|
|
+ESpellCastProblem::ESpellCastProblem AcidBreathDamageMechanics::isImmuneByStack(const ISpellCaster * caster, const CStack * obj) const
|
|
|
{
|
|
|
- //no immunities
|
|
|
+ //just in case
|
|
|
+ if(!obj->alive())
|
|
|
+ return ESpellCastProblem::WRONG_SPELL_TARGET;
|
|
|
+
|
|
|
+ //there should be no immunities by design
|
|
|
+ //but make it a bit configurable
|
|
|
+ //ignore all immunities, except specific absolute immunity
|
|
|
+ {
|
|
|
+ //SPELL_IMMUNITY absolute case
|
|
|
+ std::stringstream cachingStr;
|
|
|
+ cachingStr << "type_" << Bonus::SPELL_IMMUNITY << "subtype_" << owner->id.toEnum() << "addInfo_1";
|
|
|
+ if(obj->hasBonus(Selector::typeSubtypeInfo(Bonus::SPELL_IMMUNITY, owner->id.toEnum(), 1), cachingStr.str()))
|
|
|
+ return ESpellCastProblem::STACK_IMMUNE_TO_SPELL;
|
|
|
+ }
|
|
|
+ return ESpellCastProblem::OK;
|
|
|
}
|
|
|
|
|
|
///DeathStareMechanics
|