====== Elf Affinity ====== The **Elf Affinity** is the primary magic affinity associated with the [[en:rpd:elf_class|Elf]] hero class in Remixed Dungeon. This affinity governs the Elf's natural connection to nature-based spells and abilities. ==== Description ==== The Elf class has an innate connection to nature and natural magic, making it particularly effective with nature-based spells. This affinity determines which spells the Elf can use most effectively, with reduced mana costs and increased potency. ==== Associated Spells ==== Spells that fall under the Elf Affinity include: * [[en:rpd:magic_arrow_spell|Magic Arrow]] - A basic ranged attack spell * [[en:rpd:hide_in_grass_spell|Hide in Grass]] - A stealth spell for grassy terrain * [[en:rpd:sprout_spell|Sprout]] - A nature spell that creates useful vegetation * [[en:rpd:shoot_in_eye_spell|Shoot in Eye]] - An attack spell targeting vision * [[en:rpd:root_spell|Root]] - A control spell that restricts movement * Other nature and plant-related spells ==== Mechanics ==== * The Elf class has maximum effectiveness with Elf Affinity spells * Other classes may use Elf Affinity spells but with reduced effectiveness * Spell effectiveness is tied to the hero's primary magic affinity * Affinity may affect spell damage, mana costs, and success rates ==== Strategy ==== * Elfs should focus on nature-themed spells for maximum effectiveness * These spells synergize well with the Elf's other abilities and starting attributes * Understanding spell affinities helps optimize spell selection for each hero class ==== Code References ==== * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/HeroClass.java|HeroClass.java]] - Contains magicAffinity field and related methods * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/Hero.java#L1170|Hero.java#L1170]] - Uses magic affinity to determine if hero has affinity * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/windows/WndHeroSpells.java#L34|WndHeroSpells.java]] - References hero.getHeroClass().getMagicAffinity() * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/mechanics/spells/SpellHelper.java#L42|SpellHelper.java#L42]] - Maps "Elf" affinity to icon ID 19 * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/java/com/nyrds/pixeldungeon/mechanics/spells/Spell.java#L37|Spell.java#L37]] - Spell class has magicAffinity field * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/hero/initHeroes.json|initHeroes.json]] - Defines magic affinity for each hero class * [[mr:elf_affinity|Elf Affinity - Code References]] - Machine-readable data with more implementation details ==== String Resources ==== * No specific strings for "elf_affinity" itself, but relevant spell strings are linked to the affinity system * [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/res/values/strings_all.xml|strings_all.xml]] - Contains spell name and description strings ==== See Also ==== * [[en:rpd:elf_class|Elf Class]] * [[en:rpd:spell_affinities|Spell Affinities]] * [[en:rpd:spells|All Spells]] * [[en:rpd:magic|Magic System]] {{tag> rpd magic affinity elf nature}}