1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Display of immunities and similar effects.

This commit is contained in:
DjWarmonger 2011-05-21 16:10:14 +00:00
parent b97988477e
commit 0adc4235f2
2 changed files with 60 additions and 11 deletions

View File

@ -1,5 +1,5 @@
Bonus Name (30 characters?) Description (30)
NO_SHOTING_PENALTY ? ???
NO_SHOTING_PENALTY No Shooting penalty? ???
ADDITIONAL_RETALIATION Additional retaliations May Retaliate %d extra times
ATTACKS_ALL_ADJACENT Attack all around Attacks all adjacent enemies
RETURN_AFTER_STRIKE Attack and Return Returns after melee attack
@ -42,3 +42,9 @@ THREE_HEADED_ATTACK Three-headed attack Attacks three adjacent units
UNDEAD Undead Creature is Undead
UNLIMITED_RETALIATIONS Unlimited retaliations Retaliate any number of attacks
DEATH_STARE Death Stare (%d%) Chance to kill single creature
FIRE_IMMUNITY Immune to Fire
WATER_IMMUNITY Immune to Water
AIR_IMMUNITY Immune to Air
EARTH_IMMUNITY Immune to Earth
DIRECT_DAMAGE_IMMUNITY Direct Damage Immunity Immune to direct damage spells
RECEPTIVE Receptive No Immunity to Friendly Spells

View File

@ -564,6 +564,12 @@ std::string CStackInstance::bonusToString(Bonus *bonus, bool description) const
case Bonus::DRAGON_NATURE:
case Bonus::NON_LIVING:
case Bonus::UNDEAD:
case Bonus::FIRE_IMMUNITY: //TODO: what about direct, hostile and total immunity?
case Bonus::WATER_IMMUNITY:
case Bonus::AIR_IMMUNITY:
case Bonus::EARTH_IMMUNITY:
case Bonus::RECEPTIVE:
case Bonus::DIRECT_DAMAGE_IMMUNITY:
break;
//One numeric value
case Bonus::MAGIC_RESISTANCE:
@ -662,7 +668,6 @@ std::string CStackInstance::bonusToGraphics(Bonus *bonus) const
fileName = "E_FEAR.bmp"; break;
case Bonus::FEARLESS:
fileName = "E_FEARL.bmp"; break;
//"E_FIRE.bmp"
case Bonus::FLYING:
fileName = "E_FLY.bmp"; break;
case Bonus::SPELL_DAMAGE_REDUCTION:
@ -677,7 +682,6 @@ std::string CStackInstance::bonusToGraphics(Bonus *bonus) const
fileName = "E_KING2.bmp"; break;
case Bonus::KING3:
fileName = "E_KING3.bmp"; break;
//"E_LIGHT.bmp"
case Bonus::CHANGES_SPELL_COST_FOR_ALLY:
fileName = "E_MANA.bmp"; break;
case Bonus::NO_MELEE_PENALTY:
@ -687,7 +691,8 @@ std::string CStackInstance::bonusToGraphics(Bonus *bonus) const
fileName = "E_MINOT.bmp"; break;
case Bonus::NO_MORALE:
fileName = "E_MORAL.bmp"; break;
//"E_NOFRIM.bmp"
case Bonus::RECEPTIVE:
fileName = "E_NOFRIM.bmp"; break;
case Bonus::NO_OBSTACLES_PENALTY:
fileName = "E_OBST.bmp"; break;
case Bonus::ENEMY_DEFENCE_REDUCTION:
@ -706,8 +711,6 @@ std::string CStackInstance::bonusToGraphics(Bonus *bonus) const
case Bonus::FREE_SHOOTING: //shooter is not blocked by enemy
fileName = "E_SHOOTA.bmp"; break;
//"E_SHOOTN.bmp"
//"E_SPAIR.bmp"
//"E_SPAIR1.bmp"
case Bonus::SPELL_IMMUNITY:
{
switch (bonus->subtype)
@ -730,15 +733,55 @@ std::string CStackInstance::bonusToGraphics(Bonus *bonus) const
}
}
//"E_SPAWILL.bmp"
//"E_SPCOLD.bmp"
//"E_SPDFIRE.bmp"
//"E_SPDIR.bmp"
case Bonus::DIRECT_DAMAGE_IMMUNITY:
fileName = "E_SPDIR.bmp"; break;
//"E_SPDISB.bmp"
//"E_SPDISP.bmp"
//"E_SPEATH.bmp"
//"E_SPEATH1.bmp"
//"E_SPFIRE.bmp"
//"E_SPFIRE1.bmp"
case Bonus::FIRE_IMMUNITY:
switch (bonus->subtype)
{
case 0:
fileName = "E_SPFIRE.bmp"; break; //all
case 1:
fileName = "E_SPFIRE1.bmp"; break; //not positive
case 2:
fileName = "E_FIRE.bmp"; break; //direct damage
}
break;
case Bonus::WATER_IMMUNITY:
switch (bonus->subtype)
{
case 0:
fileName = "E_SPWATER.bmp"; break; //all
case 1:
fileName = "E_SPWATER1.bmp"; break; //not positive
case 2:
fileName = "E_SPCOLD.bmp"; break; //direct damage
}
break;
case Bonus::AIR_IMMUNITY:
switch (bonus->subtype)
{
case 0:
fileName = "E_SPAIR.bmp"; break; //all
case 1:
fileName = "E_SPAIR1.bmp"; break; //not positive
case 2:
fileName = "E_LIGHT.bmp"; break;//direct damage
}
break;
case Bonus::EARTH_IMMUNITY:
switch (bonus->subtype)
{
case 0:
fileName = "E_SPEATH.bmp"; break; //all
case 1:
case 2: //no specific icon for direct damage immunity
fileName = "E_SPEATH1.bmp"; break; //not positive
}
break;
case Bonus::LEVEL_SPELL_IMMUNITY:
{
if (iswith(bonus->val, 1 , 5))