1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fixed elemental immunity handling: #1335, #1343,

This commit is contained in:
DjWarmonger 2013-07-18 17:24:17 +00:00
parent b0f82957ab
commit 18794af2cb
2 changed files with 9 additions and 6 deletions

View File

@ -110,7 +110,8 @@
},
"immuneToFire" :
{
"type" : "FIRE_IMMUNITY"
"type" : "FIRE_IMMUNITY",
"subtype" : 0
},
"frostRingVulnerablity" :
{
@ -446,6 +447,11 @@
{
"type" : "NON_LIVING"
},
"immuneToFire" :
{
"type" : "FIRE_IMMUNITY",
"subtype" : 0
},
"spellPower" :
{
"type" : "CREATURE_ENCHANT_POWER",

View File

@ -289,12 +289,9 @@ bool CSpell::isImmuneBy(const IBonusBearer* obj) const
auto battleTestElementalImmunity = [&,this](Bonus::BonusType element) -> bool
{
if (isPositive())
{
if (obj->hasBonusOfType(element, 0)) //must be immune to all spells
if (obj->hasBonusOfType(element, 0)) //always resist if immune to all spells altogether
return true;
}
else //negative or indifferent
else if (!isPositive()) //negative or indifferent
{
if ((isDamageSpell() && obj->hasBonusOfType(element, 2)) || obj->hasBonusOfType(element, 1))
return true;