mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Fixed #599
This commit is contained in:
@@ -846,8 +846,8 @@ void CGHeroInstance::initHero()
|
|||||||
boost::algorithm::replace_first(hoverName,"%s",name);
|
boost::algorithm::replace_first(hoverName,"%s",name);
|
||||||
boost::algorithm::replace_first(hoverName,"%s", type->heroClass->name);
|
boost::algorithm::replace_first(hoverName,"%s", type->heroClass->name);
|
||||||
|
|
||||||
if(mana < 0)
|
if (mana < 0)
|
||||||
mana = manaLimit(); //after all bonuses are taken into account
|
mana = manaLimit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGHeroInstance::initArmy(CCreatureSet *dst /*= NULL*/)
|
void CGHeroInstance::initArmy(CCreatureSet *dst /*= NULL*/)
|
||||||
@@ -1135,14 +1135,6 @@ void CGHeroInstance::initObj()
|
|||||||
bonus.subtype = PrimarySkill::DEFENSE;
|
bonus.subtype = PrimarySkill::DEFENSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// for (std::vector<CCreature*>::iterator i = VLC->creh->creatures.begin(); i != VLC->creh->creatures.end(); i++)
|
|
||||||
// { //TODO: what if creature changes type during the game (Dragon Eye Ring?)
|
|
||||||
// if ((*i)->hasBonusOfType(Bonus::DRAGON_NATURE)) //TODO: implement it!
|
|
||||||
// {
|
|
||||||
// bonus.limiter = new CCreatureTypeLimiter (**i, false);
|
|
||||||
// speciality.bonuses.push_back (bonus);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
bonus.limiter = new HasAnotherBonusLimiter(Bonus::DRAGON_NATURE);
|
bonus.limiter = new HasAnotherBonusLimiter(Bonus::DRAGON_NATURE);
|
||||||
speciality.bonuses.push_back (bonus);
|
speciality.bonuses.push_back (bonus);
|
||||||
break;
|
break;
|
||||||
@@ -1154,6 +1146,8 @@ void CGHeroInstance::initObj()
|
|||||||
for (std::vector<std::pair<ui8,ui8> >::iterator it = secSkills.begin(); it != secSkills.end(); it++)
|
for (std::vector<std::pair<ui8,ui8> >::iterator it = secSkills.begin(); it != secSkills.end(); it++)
|
||||||
updateSkill(it->first, it->second);
|
updateSkill(it->first, it->second);
|
||||||
UpdateSpeciality();
|
UpdateSpeciality();
|
||||||
|
|
||||||
|
mana = manaLimit(); //after all bonuses are taken into account, make sure this line is the last one
|
||||||
}
|
}
|
||||||
void CGHeroInstance::UpdateSpeciality()
|
void CGHeroInstance::UpdateSpeciality()
|
||||||
{
|
{
|
||||||
@@ -4828,7 +4822,7 @@ void CGPandoraBox::giveContents( const CGHeroInstance *h, bool afterBattle ) con
|
|||||||
|
|
||||||
if(gainedExp || changesPrimSkill || abilities.size())
|
if(gainedExp || changesPrimSkill || abilities.size())
|
||||||
{
|
{
|
||||||
int expVal = gainedExp*(100+h->getSecSkillLevel(21)*5)/100.0f;
|
expType expVal = gainedExp*(100+h->getSecSkillLevel(21)*5)/100.0f;
|
||||||
getText(iw,afterBattle,175,h);
|
getText(iw,afterBattle,175,h);
|
||||||
|
|
||||||
if(expVal)
|
if(expVal)
|
||||||
|
@@ -1960,12 +1960,12 @@ UpgradeInfo CGameState::getUpgradeInfo(const CStackInstance &stack)
|
|||||||
if(stack.armyObj->ID == TOWNI_TYPE)
|
if(stack.armyObj->ID == TOWNI_TYPE)
|
||||||
t = static_cast<const CGTownInstance *>(stack.armyObj);
|
t = static_cast<const CGTownInstance *>(stack.armyObj);
|
||||||
else if(h)
|
else if(h)
|
||||||
{ //TODO: check if hero specialty makes some upgrades possible
|
{ //hero speciality
|
||||||
BonusList lista = h->speciality.getBonuses(Selector::typeSybtype(Bonus::SPECIAL_UPGRADE, base->idNumber));
|
BonusList lista = h->speciality.getBonuses(Selector::typeSybtype(Bonus::SPECIAL_UPGRADE, base->idNumber));
|
||||||
for (BonusList::iterator it = lista.begin(); it != lista.end(); it++)
|
for (BonusList::iterator it = lista.begin(); it != lista.end(); it++)
|
||||||
{
|
{
|
||||||
ui16 nid = it->additionalInfo;
|
ui16 nid = it->additionalInfo;
|
||||||
if (nid != base->idNumber) //sharpshooter appears to be default upgrade of minor creatures (?)
|
if (nid != base->idNumber) //in very specific case the upgrade is avaliable by default (?)
|
||||||
{
|
{
|
||||||
ret.newID.push_back(nid);
|
ret.newID.push_back(nid);
|
||||||
ret.cost.push_back(costDiff(VLC->creh->creatures[nid]->cost, base->cost));
|
ret.cost.push_back(costDiff(VLC->creh->creatures[nid]->cost, base->cost));
|
||||||
|
Reference in New Issue
Block a user