1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Extend rewards & limiters functionality

This commit is contained in:
Ivan Savenko
2025-05-06 16:00:21 +03:00
parent 0212b6e37d
commit f1d9d8479f
10 changed files with 117 additions and 31 deletions

View File

@@ -242,7 +242,7 @@ uint64_t RewardEvaluator::getArmyReward(
case Obj::CREATURE_GENERATOR4:
return getDwellingArmyValue(ai->cb.get(), target, checkGold);
case Obj::SPELL_SCROLL:
//FALL_THROUGH
return evaluateSpellScrollArmyValue(dynamic_cast<const CGArtifact *>(target)->getArtifactInstance()->getScrollSpellID());
case Obj::ARTIFACT:
return evaluateArtifactArmyValue(dynamic_cast<const CGArtifact *>(target)->getArtifactInstance()->getType());
case Obj::HERO:
@@ -273,7 +273,7 @@ uint64_t RewardEvaluator::getArmyReward(
for(auto artID : info.reward.grantedArtifacts)
rewardValue += evaluateArtifactArmyValue(artID.toArtifact());
for(auto scroll : info.reward.scrolls)
for(auto scroll : info.reward.grantedScrolls)
rewardValue += evaluateSpellScrollArmyValue(scroll);
for(const auto & stackInfo : info.reward.creatures)