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

Spell scrolls as a reward

This commit is contained in:
Ivan Savenko
2025-05-01 17:59:32 +03:00
parent 62e774c91e
commit 5dec3efa2f
5 changed files with 39 additions and 23 deletions

View File

@@ -183,6 +183,7 @@ void Rewardable::Info::configureReward(Rewardable::Configuration & object, vstd:
reward.secondary = randomizer.loadSecondaries(source["secondary"], rng, variables);
reward.grantedArtifacts = randomizer.loadArtifacts(source["artifacts"], rng, variables);
reward.scrolls = randomizer.loadSpells(source["scrolls"], rng, variables);
reward.spells = randomizer.loadSpells(source["spells"], rng, variables);
reward.creatures = randomizer.loadCreatures(source["creatures"], rng, variables);
if(!source["spellCast"].isNull() && source["spellCast"].isStruct())
@@ -300,6 +301,12 @@ void Rewardable::Info::replaceTextPlaceholders(MetaString & target, const Variab
loot.replaceName(artifact);
}
for (const auto & scroll : info.reward.scrolls )
{
loot.appendRawString("%s");
loot.replaceName(scroll);
}
for (const auto & spell : info.reward.spells )
{
loot.appendRawString("%s");
@@ -319,6 +326,9 @@ void Rewardable::Info::replaceTextPlaceholders(MetaString & target, const Variab
for (const auto & artifact : info.reward.grantedArtifacts )
target.replaceName(artifact);
for (const auto & scroll : info.reward.scrolls )
target.replaceName(scroll);
for (const auto & spell : info.reward.spells )
target.replaceName(spell);