mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Support for special upgrades (like Gelu).
This commit is contained in:
@ -1746,8 +1746,19 @@ UpgradeInfo CGameState::getUpgradeInfo(const CStackInstance &stack)
|
||||
if(stack.armyObj->ID == TOWNI_TYPE)
|
||||
t = static_cast<const CGTownInstance *>(stack.armyObj);
|
||||
else if(h)
|
||||
{ //TODO: check if hero specialty makes some upgrades possible
|
||||
BonusList lista = h->speciality.getBonuses(Selector::typeSybtype(Bonus::SPECIAL_UPGRADE, base->idNumber));
|
||||
for (BonusList::iterator it = lista.begin(); it != lista.end(); it++)
|
||||
{
|
||||
ui16 nid = it->additionalInfo;
|
||||
if (nid != base->idNumber) //sharpshooter appears to be default upgrade of minor creatures (?)
|
||||
{
|
||||
ret.newID.push_back(nid);
|
||||
ret.cost.push_back(costDiff(VLC->creh->creatures[nid]->cost, base->cost));
|
||||
}
|
||||
}
|
||||
t = h->visitedTown;
|
||||
|
||||
}
|
||||
if(t)
|
||||
{
|
||||
BOOST_FOREACH(si32 bid, t->builtBuildings)
|
||||
@ -1777,8 +1788,6 @@ UpgradeInfo CGameState::getUpgradeInfo(const CStackInstance &stack)
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: check if hero specialty makes some upgrades possible
|
||||
|
||||
if(ret.newID.size())
|
||||
ret.oldID = base->idNumber;
|
||||
|
||||
|
Reference in New Issue
Block a user