1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

* added native terrain bonuses in battles

* number of units in stack in battle should now fit the box
* non-living and undead creatures have now always 0 morale
This commit is contained in:
mateuszb
2009-06-30 12:28:22 +00:00
parent 97287bb7d1
commit 1cac083239
8 changed files with 64 additions and 12 deletions

View File

@ -540,6 +540,9 @@ ui8 CStack::howManyEffectsSet(ui16 id) const
si8 CStack::Morale() const
{
si8 ret = morale;
if(hasFeatureOfType(StackFeature::NON_LIVING) || hasFeatureOfType(StackFeature::UNDEAD))
return 0;
ret += valOfFeatures(StackFeature::MORALE_BONUS); //mirth & sorrow & other
@ -578,7 +581,7 @@ si32 CStack::Attack() const
ret += (VLC->spellh->spells[56].powers[getEffect(56)->level]/100.0) * Defense(false);
}
ret += valOfFeatures(StackFeature::ATTACK_BONUS, -1);
ret += valOfFeatures(StackFeature::ATTACK_BONUS);
return ret;
}
@ -592,7 +595,7 @@ si32 CStack::Defense(bool withFrenzy /*= true*/) const
return 0;
}
ret += valOfFeatures(StackFeature::DEFENCE_BONUS, -1);
ret += valOfFeatures(StackFeature::DEFENCE_BONUS);
return ret;
}