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:
@@ -194,9 +194,16 @@ void Rewardable::Interface::grantRewardAfterLevelup(const Rewardable::VisitInfo
|
||||
// TODO: handle locked slots?
|
||||
}
|
||||
|
||||
for(const SpellID & spell : info.reward.scrolls)
|
||||
for(const SpellID & spell : info.reward.grantedScrolls)
|
||||
cb->giveHeroNewScroll(hero, spell, ArtifactPosition::FIRST_AVAILABLE);
|
||||
|
||||
|
||||
for(const SpellID & spell : info.reward.takenScrolls)
|
||||
{
|
||||
if(hero->hasScroll(spell, false))
|
||||
cb->removeArtifact(ArtifactLocation(hero->id, hero->getScrollPos(spell, false)));
|
||||
}
|
||||
|
||||
if(!info.reward.spells.empty())
|
||||
{
|
||||
std::set<SpellID> spellsToGive;
|
||||
@@ -209,6 +216,11 @@ void Rewardable::Interface::grantRewardAfterLevelup(const Rewardable::VisitInfo
|
||||
cb->changeSpells(hero, true, spellsToGive);
|
||||
}
|
||||
|
||||
if (!info.reward.takenCreatures.empty())
|
||||
{
|
||||
cb->takeCreatures(hero->id, info.reward.takenCreatures);
|
||||
}
|
||||
|
||||
if(!info.reward.creaturesChange.empty())
|
||||
{
|
||||
for(const auto & slot : hero->Slots())
|
||||
|
||||
Reference in New Issue
Block a user