fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Rework `Battle::Unit::CalculateSpellDamage()` method to use `fheroes2::getSpellDamage()` and `fheroes2::getMonsterData()` functions

Open ihhub opened this issue 1 year ago • 1 comments

Preliminary checks

Describe the problem requiring a solution

The current code contains hardcoded monsters and spells to evaluate spell damage. This is wrong as such code is not scalable for cases when we would add new monsters (or modding capabilities).

Describe the possible solution

Make use of fheroes2::getSpellDamage() and fheroes2::getMonsterData() functions

Additional info

No response

ihhub avatar May 22 '24 03:05 ihhub

Hello, I was wondering why the fheroes2::getSpellDamage() takes into account spell caster artefacts but not spell victim artefacts. Is that part of this issue, or should a separate issue be made for that, or should we leave the defending artefact calculation in the battle::Unit::CalculateSpellDamage() function?

Cheerfulbull avatar Jun 15 '24 20:06 Cheerfulbull