diff --git a/Mods/vcmi/Content/config/english.json b/Mods/vcmi/Content/config/english.json index 494e43e79..1d8f6a831 100644 --- a/Mods/vcmi/Content/config/english.json +++ b/Mods/vcmi/Content/config/english.json @@ -607,6 +607,11 @@ "mapObject.core.hillFort.object.description" : "Upgrades creatures. Levels 1 - 4 are less expensive than in associated town.", + "core.spellSchools.0": "Air", + "core.spellSchools.1": "Fire", + "core.spellSchools.2": "Water", + "core.spellSchools.3": "Earth", + "core.bonus.ADDITIONAL_ATTACK.name": "Double Strike", "core.bonus.ADDITIONAL_ATTACK.description": "Attacks twice", "core.bonus.ADDITIONAL_RETALIATION.name": "Additional retaliations", @@ -763,8 +768,10 @@ "core.bonus.MECHANICAL.description": "Immunity to many effects, repairable", "core.bonus.PRISM_HEX_ATTACK_BREATH.name": "Prism Breath", "core.bonus.PRISM_HEX_ATTACK_BREATH.description": "Prism Breath Attack (three directions)", - "core.bonus.SPELL_SCHOOL_IMMUNITY.name": "${subtype.spellSchool} immunity", - "core.bonus.SPELL_SCHOOL_IMMUNITY.description": "Immune to ${subtype.spellSchool}", + "core.bonus.SPELL_SCHOOL_IMMUNITY.name": "Spell immunity", + "core.bonus.SPELL_SCHOOL_IMMUNITY.description": "Immune to all spell schools", + "core.bonus.SPELL_SCHOOL_IMMUNITY.name.specific": "${subtype.spellSchool} immunity", + "core.bonus.SPELL_SCHOOL_IMMUNITY.description.specific": "Immune to ${subtype.spellSchool} school", "core.bonus.OPENING_BATTLE_SPELL.name": "Starts with spell", "core.bonus.OPENING_BATTLE_SPELL.description": "Casts ${subtype.spell} on battle start" } diff --git a/Mods/vcmi/Content/config/german.json b/Mods/vcmi/Content/config/german.json index 595cedc6b..6a31e0fb6 100644 --- a/Mods/vcmi/Content/config/german.json +++ b/Mods/vcmi/Content/config/german.json @@ -607,6 +607,11 @@ "mapObject.core.hillFort.object.description" : "Aufwertungen von Kreaturen. Die Stufen 1 - 4 sind billiger als in der zugehörigen Stadt.", + "core.spellSchools.0": "Luft", + "core.spellSchools.1": "Feuer", + "core.spellSchools.2": "Wasser", + "core.spellSchools.3": "Erde", + "core.bonus.ADDITIONAL_ATTACK.name": "Doppelschlag", "core.bonus.ADDITIONAL_ATTACK.description": "Greift zweimal an", "core.bonus.ADDITIONAL_RETALIATION.name": "Zusätzliche Vergeltungsmaßnahmen", @@ -763,8 +768,10 @@ "core.bonus.MECHANICAL.description": "Immunität gegen viele Effekte, reparierbar", "core.bonus.PRISM_HEX_ATTACK_BREATH.name": "Prisma-Atem", "core.bonus.PRISM_HEX_ATTACK_BREATH.description": "Prisma-Atem-Angriff (drei Richtungen)", - "core.bonus.SPELL_SCHOOL_IMMUNITY.name": "${subtype.spellSchool}-Immunität", - "core.bonus.SPELL_SCHOOL_IMMUNITY.description": "Immunität gegen ${subtype.spellSchool}", + "core.bonus.SPELL_SCHOOL_IMMUNITY.name": "Zauber-Immunität", + "core.bonus.SPELL_SCHOOL_IMMUNITY.description": "Immunität gegen alle Zauber-Schulen", + "core.bonus.SPELL_SCHOOL_IMMUNITY.name.specific": "${subtype.spellSchool}-Immunität", + "core.bonus.SPELL_SCHOOL_IMMUNITY.description.specific": "Immunität gegen Zauber der ${subtype.spellSchool}-Schule", "core.bonus.OPENING_BATTLE_SPELL.name": "Startet mit Zauber", "core.bonus.OPENING_BATTLE_SPELL.description": "Wirkt ${subtype.spell} beim Start des Kampfes" } diff --git a/lib/CBonusTypeHandler.cpp b/lib/CBonusTypeHandler.cpp index 92bee1dd6..1b4e0afdf 100644 --- a/lib/CBonusTypeHandler.cpp +++ b/lib/CBonusTypeHandler.cpp @@ -75,6 +75,23 @@ std::string CBonusTypeHandler::bonusToString(const std::shared_ptr & bonu std::string textID = description ? bt.getDescriptionTextID() : bt.getNameTextID(); std::string text = VLC->generaltexth->translate(textID); + if (bonus->subtype.as().hasValue()) + { + auto school = bonus->subtype.as(); + if(school != SpellSchool::ANY) + { + auto specificTextID = description ? bt.getDescriptionTextID() + ".specific" : bt.getNameTextID() + ".specific"; + auto specificText = VLC->generaltexth->translate(specificTextID); + + if(specificText.find("${subtype.spellSchool}") != std::string::npos) + { + auto schoolName = VLC->generaltexth->translate(TextIdentifier("core.spellSchools", school).get()); + boost::algorithm::replace_all(specificText, "${subtype.spellSchool}", schoolName); + text = specificText; + } + } + } + if (text.find("${val}") != std::string::npos) boost::algorithm::replace_all(text, "${val}", std::to_string(bearer->valOfBonuses(Selector::typeSubtype(bonus->type, bonus->subtype)))); @@ -84,13 +101,6 @@ std::string CBonusTypeHandler::bonusToString(const std::shared_ptr & bonu if (text.find("${subtype.spell}") != std::string::npos && bonus->subtype.as().hasValue()) boost::algorithm::replace_all(text, "${subtype.spell}", bonus->subtype.as().toSpell()->getNameTranslated()); - if (text.find("${subtype.spellSchool}") != std::string::npos && bonus->subtype.as().hasValue()) - { - auto school = bonus->subtype.as(); - auto schoolName = VLC->generaltexth->zelp[school == SpellSchool::ANY ? 458 : 454 + school].first; - boost::algorithm::replace_all(text, "${subtype.spellSchool}", schoolName); - } - return text; }