mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-19 00:17:56 +02:00
Merge remote-tracking branch 'remotes/origin/develop' into SpellsRefactoring8
# Conflicts: # client/battle/CBattleInterface.cpp # lib/spells/BattleSpellMechanics.cpp
This commit is contained in:
@ -624,7 +624,7 @@ DLL_LINKAGE void HeroRecruited::applyGs( CGameState *gs )
|
||||
h->attachTo(p);
|
||||
if(fresh)
|
||||
{
|
||||
h->initObj();
|
||||
h->initObj(gs->getRandomGenerator());
|
||||
}
|
||||
gs->map->addBlockVisTiles(h);
|
||||
|
||||
@ -689,7 +689,7 @@ DLL_LINKAGE void NewObject::applyGs( CGameState *gs )
|
||||
|
||||
gs->map->objects.push_back(o);
|
||||
gs->map->addBlockVisTiles(o);
|
||||
o->initObj();
|
||||
o->initObj(gs->getRandomGenerator());
|
||||
gs->map->calculateGuardingGreaturePositions();
|
||||
|
||||
logGlobal->debugStream() << "added object id=" << id << "; address=" << (intptr_t)o << "; name=" << o->getObjectName();
|
||||
@ -1162,6 +1162,21 @@ DLL_LINKAGE void SetObjectProperty::applyGs( CGameState *gs )
|
||||
}
|
||||
}
|
||||
|
||||
DLL_LINKAGE void PrepareHeroLevelUp::applyGs(CGameState *gs)
|
||||
{
|
||||
CGHeroInstance * h = gs->getHero(hero->id);
|
||||
auto proposedSkills = h->getLevelUpProposedSecondarySkills();
|
||||
|
||||
if(skills.size() == 1 || hero->tempOwner == PlayerColor::NEUTRAL) //choose skill automatically
|
||||
{
|
||||
skills.push_back(*RandomGeneratorUtil::nextItem(proposedSkills, h->skillsInfo.rand));
|
||||
}
|
||||
else
|
||||
{
|
||||
skills = proposedSkills;
|
||||
}
|
||||
}
|
||||
|
||||
DLL_LINKAGE void HeroLevelUp::applyGs( CGameState *gs )
|
||||
{
|
||||
CGHeroInstance * h = gs->getHero(hero->id);
|
||||
|
Reference in New Issue
Block a user