mr:elf_affinity
Table of Contents
Elf Affinity - Code References
Entity Kind
elf_affinity
Java Classes
- HeroClass.java - Contains magicAffinity field and related methods
- Hero.java - Uses magic affinity for spell selection
- WndHeroSpells.java - Displays spells based on affinity
- SpellHelper.java - Contains affinity mappings and icon assignments
- Spell.java - Base spell class with magicAffinity field
JSON Configuration
- https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/hero/initHeroes.json - Defines magic affinity for each hero class (in classDesc.optString(“magicAffinity”, magicAffinity))
String Resources
(No specific string resources for “elf_affinity” itself, but related to spell system)
Lua Scripts
- Various spell scripts in RemixedDungeon/src/main/assets/scripts/spells/ - Implement spells that may be associated with elf affinity
Code Implementation
In HeroClass.java:
- private String magicAffinity = Utils.EMPTY_STRING; (field)
- getMagicAffinity() and setMagicAffinity() methods (auto-generated via annotations)
- When initializing hero class stats, magic affinity is set from JSON: hero.getHeroClass().setMagicAffinity(classDesc.optString(“magicAffinity”, magicAffinity))
In SpellHelper.java:
- affinityToIcon map includes: affinityToIcon.put(“Elf”, 19); (maps Elf affinity to icon id 19)
- iconIdByAffinity() method returns icon ID based on hero's magic affinity
Affinity System Mechanics
- Magic affinities determine which spells are displayed with appropriate icons in spell selection
- Each hero class can have a default magic affinity
- Spell classes define their magic affinity which determines which hero classes they're accessible to
- The spell system checks hero.getHeroClass().getMagicAffinity() to determine which spells to show
mr/elf_affinity.txt · Last modified: by 127.0.0.1
