User Tools

Site Tools


mr:elf_affinity

Elf Affinity - Code References

Entity Kind

elf_affinity

Java Classes

JSON Configuration

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