1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

vcmi: add PERCENT_TO_TARGET_SOURCE value type

It will break saves!!!

Added a new value type to bonuses which allows to add percentage
only to one foreign bonus source, for example, to add percentage to all
bonuses from secondary skills from hero special.
This commit is contained in:
Konstantin
2023-02-15 22:19:35 +03:00
parent 98218adea5
commit 7e9a15c20b
4 changed files with 66 additions and 42 deletions

View File

@ -849,6 +849,10 @@ bool JsonUtils::parseBonus(const JsonNode &ability, Bonus *b)
if (!value->isNull())
b->source = static_cast<Bonus::BonusSource>(parseByMap(bonusSourceMap, value, "source type "));
value = &ability["targetSourceType"];
if (!value->isNull())
b->targetSourceType = static_cast<Bonus::BonusSource>(parseByMap(bonusSourceMap, value, "target type "));
value = &ability["limiters"];
if (!value->isNull())
b->limiter = parseLimiter(*value);