mr:combat_magic_affinity
Table of Contents
Combat Affinity - Code References
Java Classes
- SpellHelper.java - Maps Combat affinity to icon ID 15
- HeroClass.java - Hero class magic affinity field
- Spell.java - Base spell class with magicAffinity field
JSON Configuration
- initHeroes.json - Defines magic affinity for hero classes (Warrior has Combat affinity)
Lua Scripts
- CustomSpellsList.lua - Defines Combat affinity spells: DieHard, Dash, BodyArmor, Smash
- Smash.lua - Combat affinity spell (level 4, self-targeted)
- DieHard.lua - Combat affinity spell
- Dash.lua - Combat affinity spell
- BodyArmor.lua - Combat affinity spell
String Resources
- strings_all.xml - Combat spell names and descriptions
Affinity Implementation
In SpellHelper.java:
- `affinityToIcon.put(“Combat�, 15);` - Maps Combat affinity to icon ID 15
- `iconIdByAffinity()` method returns icon ID based on affinity string
In HeroClass.java:
- `magicAffinity` field stores the hero class's default affinity
- `getMagicAffinity()` / `setMagicAffinity()` accessor methods
Combat Affinity Spells
| Spell | Level | Targeting | Cost | Cooldown | Description |
| ——- | ——- | ———– | —— | ———- | ————- |
| DieHard | 1 | self | 5 | 10 | Temporary damage reduction |
| Dash | 2 | cell | 5 | 10 | Quick movement to target cell |
| BodyArmor | 3 | self | 10 | 15 | Temporary armor boost |
| Smash | 4 | self | 10 | 10 | AoE stun + weapon damage |
Related mr Entities
- CustomSpell (Class) - Base class for Lua spells
- Self Targeting Spell - Targeting type used by Combat spells
- Smash Spell - Combat affinity spell
- DieHard Spell - Combat affinity spell
- Warrior Class - Has Combat affinity
- Elemental Affinity - Another magic affinity
mr/combat_magic_affinity.txt · Last modified: by 127.0.0.1
