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

remove healedHP calculation from battlestate

This commit is contained in:
AlexVinS
2014-11-25 19:43:34 +03:00
parent 20a058f3f9
commit fa9c1e8637
4 changed files with 14 additions and 19 deletions

View File

@ -159,19 +159,6 @@ CStack * BattleInfo::generateNewStack(const CStackBasicDescriptor &base, bool at
return ret;
}
//Archangel
ui32 CBattleInfoCallback::calculateHealedHP(int healedHealth, const CSpell * spell, const CStack * stack) const
{
bool resurrect = spell->isRisingSpell();
return std::min<ui32>(healedHealth, stack->MaxHealth() - stack->firstHPleft + (resurrect ? stack->baseAmount * stack->MaxHealth() : 0));
}
//Casted by stack, no hero bonus applied
ui32 CBattleInfoCallback::calculateHealedHP(const CSpell * spell, int usedSpellPower, int spellSchoolLevel, const CStack * stack) const
{
bool resurrect = spell->isRisingSpell();
int healedHealth = usedSpellPower * spell->power + spell->getPower(spellSchoolLevel);
return std::min<ui32>(healedHealth, stack->MaxHealth() - stack->firstHPleft + (resurrect ? stack->baseAmount * stack->MaxHealth() : 0));
}
bool BattleInfo::resurrects(SpellID spellid) const
{
return spellid.toSpell()->isRisingSpell();