1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Feature: Opposite Side Limiter

This commit is contained in:
Dmitry Orlov
2021-03-23 17:47:07 +03:00
parent f861d3a509
commit 25d9ea1ddf
24 changed files with 464 additions and 246 deletions

View File

@@ -497,13 +497,6 @@ void CCreatureHandler::loadBonuses(JsonNode & creature, std::string bonuses)
node["propagator"].String() = "HERO";
creature["abilities"]["const_raises_morale"] = node;
}
if(hasAbility("const_lowers_morale"))
{
JsonNode node = makeBonusNode("MORALE");
node["val"].Float() = -1;
node["effectRange"].String() = "ONLY_ENEMY_ARMY";
creature["abilities"]["const_lowers_morale"] = node;
}
}
std::vector<JsonNode> CCreatureHandler::loadLegacyData(size_t dataSize)
@@ -870,6 +863,10 @@ void CCreatureHandler::loadCreatureJson(CCreature * creature, const JsonNode & c
if (!ability.second.isNull())
{
auto b = JsonUtils::parseBonus(ability.second);
if(b->effectRange == Bonus::ONLY_ENEMY_ARMY) //Opposite Side bonuses should not be exported from CREATURE node.
b->propagator.reset();
b->source = Bonus::CREATURE_ABILITY;
b->sid = creature->getIndex();
b->duration = Bonus::PERMANENT;