fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Use monster abilities instead of hardcoded monster IDs

Open ihhub opened this issue 1 year ago • 1 comments

ihhub avatar Jun 08 '24 06:06 ihhub

Hi @ihhub I introduced a few changes:

  • Introduced the creature traits EARTH_CREATURE, AIR_CREATURE, FIRE_CREATURE and WATER_CREATURE and separated "damage from spells of a certain type" (e.g. Fire spells) from "damage from creatures of a certain type" (e.g. Fire creatures).

  • Renamed some weaknesses. EXTRA_DAMAGE_FROM_XXX means that this weakness has a specific extra damage percent in its percent field, while DOUBLE_DAMAGE_FROM_XXX means that damage is always doubled.

  • Introduced the CERTAIN_SPELL_DAMAGE_REDUCTION ability to allow Golems have damage reduction for the Armageddon spell (Armageddon is not considered as an Elemental spell).

  • Reworked the Battle::Unit::CalculateSpellDamage() to use the unit's abilities and weaknesses. At the same time, I fixed a bug in the master branch - Earth Elemental didn't get the 200% damage from the Meteor Shower, even though it was displayed in its properties:

    master branch:

    https://github.com/user-attachments/assets/3b7cece3-3b38-4bb3-9a6e-718323615439

    This PR:

    https://github.com/user-attachments/assets/ffed0f58-f5fc-4e71-a400-ed5736b6d8c3

oleg-derevenetz avatar Dec 04 '24 00:12 oleg-derevenetz

@oleg-derevenetz , thank you so much for these changes!

ihhub avatar Dec 04 '24 00:12 ihhub