|
@@ -134,6 +134,8 @@ void Rewardable::Info::configureLimiter(Rewardable::Configuration & object, vstd
|
|
|
limiter.heroExperience = randomizer.loadValue(source["heroExperience"], rng, variables);
|
|
limiter.heroExperience = randomizer.loadValue(source["heroExperience"], rng, variables);
|
|
|
limiter.heroLevel = randomizer.loadValue(source["heroLevel"], rng, variables);
|
|
limiter.heroLevel = randomizer.loadValue(source["heroLevel"], rng, variables);
|
|
|
limiter.canLearnSkills = source["canLearnSkills"].Bool();
|
|
limiter.canLearnSkills = source["canLearnSkills"].Bool();
|
|
|
|
|
+ limiter.commanderAlive = source["commanderAlive"].Bool();
|
|
|
|
|
+ limiter.hasExtraCreatures = source["hasExtraCreatures"].Bool();
|
|
|
|
|
|
|
|
limiter.manaPercentage = randomizer.loadValue(source["manaPercentage"], rng, variables);
|
|
limiter.manaPercentage = randomizer.loadValue(source["manaPercentage"], rng, variables);
|
|
|
limiter.manaPoints = randomizer.loadValue(source["manaPoints"], rng, variables);
|
|
limiter.manaPoints = randomizer.loadValue(source["manaPoints"], rng, variables);
|
|
@@ -143,9 +145,12 @@ void Rewardable::Info::configureLimiter(Rewardable::Configuration & object, vstd
|
|
|
limiter.primary = randomizer.loadPrimaries(source["primary"], rng, variables);
|
|
limiter.primary = randomizer.loadPrimaries(source["primary"], rng, variables);
|
|
|
limiter.secondary = randomizer.loadSecondaries(source["secondary"], rng, variables);
|
|
limiter.secondary = randomizer.loadSecondaries(source["secondary"], rng, variables);
|
|
|
limiter.artifacts = randomizer.loadArtifacts(source["artifacts"], rng, variables);
|
|
limiter.artifacts = randomizer.loadArtifacts(source["artifacts"], rng, variables);
|
|
|
|
|
+ limiter.availableSlots = randomizer.loadArtifactSlots(source["availableSlots"], rng, variables);
|
|
|
limiter.spells = randomizer.loadSpells(source["spells"], rng, variables);
|
|
limiter.spells = randomizer.loadSpells(source["spells"], rng, variables);
|
|
|
|
|
+ limiter.scrolls = randomizer.loadSpells(source["scrolls"], rng, variables);
|
|
|
limiter.canLearnSpells = randomizer.loadSpells(source["canLearnSpells"], rng, variables);
|
|
limiter.canLearnSpells = randomizer.loadSpells(source["canLearnSpells"], rng, variables);
|
|
|
limiter.creatures = randomizer.loadCreatures(source["creatures"], rng, variables);
|
|
limiter.creatures = randomizer.loadCreatures(source["creatures"], rng, variables);
|
|
|
|
|
+ limiter.canReceiveCreatures = randomizer.loadCreatures(source["canReceiveCreatures"], rng, variables);
|
|
|
|
|
|
|
|
limiter.players = randomizer.loadColors(source["colors"], rng, variables);
|
|
limiter.players = randomizer.loadColors(source["colors"], rng, variables);
|
|
|
limiter.heroes = randomizer.loadHeroes(source["heroes"], rng);
|
|
limiter.heroes = randomizer.loadHeroes(source["heroes"], rng);
|
|
@@ -174,16 +179,23 @@ void Rewardable::Info::configureReward(Rewardable::Configuration & object, vstd:
|
|
|
reward.movePercentage = randomizer.loadValue(source["movePercentage"], rng, variables, -1);
|
|
reward.movePercentage = randomizer.loadValue(source["movePercentage"], rng, variables, -1);
|
|
|
|
|
|
|
|
reward.removeObject = source["removeObject"].Bool();
|
|
reward.removeObject = source["removeObject"].Bool();
|
|
|
- reward.bonuses = randomizer.loadBonuses(source["bonuses"]);
|
|
|
|
|
|
|
+ reward.heroBonuses = randomizer.loadBonuses(source["bonuses"]);
|
|
|
|
|
+ reward.commanderBonuses = randomizer.loadBonuses(source["commanderBonuses"]);
|
|
|
|
|
+ reward.playerBonuses = randomizer.loadBonuses(source["playerBonuses"]);
|
|
|
|
|
|
|
|
reward.guards = randomizer.loadCreatures(source["guards"], rng, variables);
|
|
reward.guards = randomizer.loadCreatures(source["guards"], rng, variables);
|
|
|
|
|
|
|
|
reward.primary = randomizer.loadPrimaries(source["primary"], rng, variables);
|
|
reward.primary = randomizer.loadPrimaries(source["primary"], rng, variables);
|
|
|
reward.secondary = randomizer.loadSecondaries(source["secondary"], rng, variables);
|
|
reward.secondary = randomizer.loadSecondaries(source["secondary"], rng, variables);
|
|
|
|
|
|
|
|
- reward.artifacts = randomizer.loadArtifacts(source["artifacts"], rng, variables);
|
|
|
|
|
|
|
+ reward.grantedArtifacts = randomizer.loadArtifacts(source["artifacts"], rng, variables);
|
|
|
|
|
+ reward.takenArtifacts = randomizer.loadArtifacts(source["takenArtifacts"], rng, variables);
|
|
|
|
|
+ reward.takenArtifactSlots = randomizer.loadArtifactSlots(source["takenArtifactSlots"], rng, variables);
|
|
|
|
|
+ reward.grantedScrolls = randomizer.loadSpells(source["scrolls"], rng, variables);
|
|
|
|
|
+ reward.takenScrolls = randomizer.loadSpells(source["takenScrolls"], rng, variables);
|
|
|
reward.spells = randomizer.loadSpells(source["spells"], rng, variables);
|
|
reward.spells = randomizer.loadSpells(source["spells"], rng, variables);
|
|
|
reward.creatures = randomizer.loadCreatures(source["creatures"], rng, variables);
|
|
reward.creatures = randomizer.loadCreatures(source["creatures"], rng, variables);
|
|
|
|
|
+ reward.takenCreatures = randomizer.loadCreatures(source["takenCreatures"], rng, variables);
|
|
|
if(!source["spellCast"].isNull() && source["spellCast"].isStruct())
|
|
if(!source["spellCast"].isNull() && source["spellCast"].isStruct())
|
|
|
{
|
|
{
|
|
|
reward.spellCast.first = randomizer.loadSpell(source["spellCast"]["spell"], rng, variables);
|
|
reward.spellCast.first = randomizer.loadSpell(source["spellCast"]["spell"], rng, variables);
|
|
@@ -293,12 +305,18 @@ void Rewardable::Info::replaceTextPlaceholders(MetaString & target, const Variab
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- for (const auto & artifact : info.reward.artifacts )
|
|
|
|
|
|
|
+ for (const auto & artifact : info.reward.grantedArtifacts )
|
|
|
{
|
|
{
|
|
|
loot.appendRawString("%s");
|
|
loot.appendRawString("%s");
|
|
|
loot.replaceName(artifact);
|
|
loot.replaceName(artifact);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ for (const auto & scroll : info.reward.grantedScrolls )
|
|
|
|
|
+ {
|
|
|
|
|
+ loot.appendRawString("%s");
|
|
|
|
|
+ loot.replaceName(scroll);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
for (const auto & spell : info.reward.spells )
|
|
for (const auto & spell : info.reward.spells )
|
|
|
{
|
|
{
|
|
|
loot.appendRawString("%s");
|
|
loot.appendRawString("%s");
|
|
@@ -315,9 +333,12 @@ void Rewardable::Info::replaceTextPlaceholders(MetaString & target, const Variab
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- for (const auto & artifact : info.reward.artifacts )
|
|
|
|
|
|
|
+ for (const auto & artifact : info.reward.grantedArtifacts )
|
|
|
target.replaceName(artifact);
|
|
target.replaceName(artifact);
|
|
|
|
|
|
|
|
|
|
+ for (const auto & scroll : info.reward.grantedScrolls )
|
|
|
|
|
+ target.replaceName(scroll);
|
|
|
|
|
+
|
|
|
for (const auto & spell : info.reward.spells )
|
|
for (const auto & spell : info.reward.spells )
|
|
|
target.replaceName(spell);
|
|
target.replaceName(spell);
|
|
|
|
|
|
|
@@ -444,6 +465,7 @@ void Rewardable::Info::configureObject(Rewardable::Configuration & object, vstd:
|
|
|
|
|
|
|
|
object.canRefuse = parameters["canRefuse"].Bool();
|
|
object.canRefuse = parameters["canRefuse"].Bool();
|
|
|
object.showScoutedPreview = parameters["showScoutedPreview"].Bool();
|
|
object.showScoutedPreview = parameters["showScoutedPreview"].Bool();
|
|
|
|
|
+ object.forceCombat = parameters["forceCombat"].Bool();
|
|
|
object.guardsLayout = parameters["guardsLayout"].String();
|
|
object.guardsLayout = parameters["guardsLayout"].String();
|
|
|
object.coastVisitable = parameters["coastVisitable"].Bool();
|
|
object.coastVisitable = parameters["coastVisitable"].Bool();
|
|
|
|
|
|
|
@@ -457,7 +479,7 @@ void Rewardable::Info::configureObject(Rewardable::Configuration & object, vstd:
|
|
|
{
|
|
{
|
|
|
if(Rewardable::VisitModeString[i] == visitMode)
|
|
if(Rewardable::VisitModeString[i] == visitMode)
|
|
|
{
|
|
{
|
|
|
- object.visitMode = i;
|
|
|
|
|
|
|
+ object.visitMode = static_cast<EVisitMode>(i);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -467,7 +489,7 @@ void Rewardable::Info::configureObject(Rewardable::Configuration & object, vstd:
|
|
|
{
|
|
{
|
|
|
if(Rewardable::SelectModeString[i] == selectMode)
|
|
if(Rewardable::SelectModeString[i] == selectMode)
|
|
|
{
|
|
{
|
|
|
- object.selectMode = i;
|
|
|
|
|
|
|
+ object.selectMode = static_cast<ESelectMode>(i);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|