From 75c39c656260077b9ffff1c794e9e90f4a68b3b0 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 21 Aug 2023 21:51:06 +0300 Subject: [PATCH] vcmi: handle icons for SPELL_DAMAGE_REDUCTION For all schools and for ANY subtype --- lib/CBonusTypeHandler.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/CBonusTypeHandler.cpp b/lib/CBonusTypeHandler.cpp index 90a4aa7e7..2e4038eaf 100644 --- a/lib/CBonusTypeHandler.cpp +++ b/lib/CBonusTypeHandler.cpp @@ -99,6 +99,28 @@ std::string CBonusTypeHandler::bonusToGraphics(const std::shared_ptr & bo fileName = sp->getIconImmune(); break; } + case BonusType::SPELL_DAMAGE_REDUCTION: //Spell damage reduction for all schools + { + switch(bonus->subtype) + { + case SpellSchool(ESpellSchool::ANY): + fileName = "E_GOLEM.bmp"; + break; + case SpellSchool(ESpellSchool::AIR): + fileName = "E_LIGHT.bmp"; + break; + case SpellSchool(ESpellSchool::FIRE): + fileName = "E_FIRE.bmp"; + break; + case SpellSchool(ESpellSchool::WATER): + fileName = "E_COLD.bmp"; + break; + case SpellSchool(ESpellSchool::EARTH): + fileName = "E_SPEATH1.bmp"; //No separate icon for earth damage + break; + } + break; + } case BonusType::SPELL_SCHOOL_IMMUNITY: //for all school { switch(bonus->subtype) @@ -118,9 +140,6 @@ std::string CBonusTypeHandler::bonusToGraphics(const std::shared_ptr & bo } break; } - // fileName = "E_FIRE.bmp"; //fire damage - // fileName = "E_COLD.bmp"; //cold damage - // fileName = "E_LIGHT.bmp"; //lightning damage case BonusType::NEGATIVE_EFFECTS_IMMUNITY: { switch(bonus->subtype)