Use monster abilities instead of hardcoded monster IDs
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Hi @ihhub I introduced a few changes:
-
Introduced the creature traits
EARTH_CREATURE,AIR_CREATURE,FIRE_CREATUREandWATER_CREATUREand 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_XXXmeans that this weakness has a specific extra damage percent in itspercentfield, whileDOUBLE_DAMAGE_FROM_XXXmeans that damage is always doubled. -
Introduced the
CERTAIN_SPELL_DAMAGE_REDUCTIONability 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 themasterbranch - Earth Elemental didn't get the 200% damage from the Meteor Shower, even though it was displayed in its properties:masterbranch: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 , thank you so much for these changes!
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code