1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

get rid of CBattleInfoCallback::calculateSpellDmg

This commit is contained in:
AlexVinS
2014-11-12 09:52:11 +03:00
parent e4b726151d
commit d7800b834e
7 changed files with 66 additions and 63 deletions

View File

@@ -4105,7 +4105,7 @@ void CGameHandler::handleSpellCasting( SpellID spellID, int spellLvl, BattleHex
if (spellDamage)
bsa.damageAmount = spellDamage >> chainLightningModifier;
else
bsa.damageAmount = gs->curB->calculateSpellDmg(spell, caster, attackedCre, spellLvl, usedSpellPower) >> chainLightningModifier;
bsa.damageAmount = spell->calculateDamage(caster, attackedCre, spellLvl, usedSpellPower) >> chainLightningModifier;
sc.dmgToDisplay += bsa.damageAmount;
@@ -4710,14 +4710,14 @@ void CGameHandler::handleDamageFromObstacle(const CObstacleInstance &obstacle, c
oneTimeObstacle = true;
effect = 82; //makes
damage = gs->curB->calculateSpellDmg(SpellID(SpellID::LAND_MINE).toSpell(), hero, curStack,
damage = SpellID(SpellID::LAND_MINE).toSpell()->calculateDamage(hero, curStack,
spellObstacle->spellLevel, spellObstacle->casterSpellPower);
//TODO even if obstacle wasn't created by hero (Tower "moat") it should deal dmg as if casted by hero,
//if it is bigger than default dmg. Or is it just irrelevant H3 implementation quirk
}
else if(obstacle.obstacleType == CObstacleInstance::FIRE_WALL)
{
damage = gs->curB->calculateSpellDmg(SpellID(SpellID::FIRE_WALL).toSpell(), hero, curStack,
damage = SpellID(SpellID::FIRE_WALL).toSpell()->calculateDamage(hero, curStack,
spellObstacle->spellLevel, spellObstacle->casterSpellPower);
}
else