User Tools

Site Tools


en:rpd:affinities_mechanic

Magic Affinities Mechanic

Magic Affinities in Remixed Dungeon determine which spells are available to a character class or hero subclass. Each class typically has a primary affinity which grants access to specific spells.

Affinity System Code

The magic affinity system is implemented in several Java files:

// In SpellHelper.java
public static final String AFFINITY_NECROMANCY = "Necromancy";
public static final String AFFINITY_ELEMENTAL  = "Elemental";
public static final String AFFINITY_RAGE       = "Rage";
public static final String AFFINITY_DEMONOLOGY  = "Demolonogy";
public static final String AFFINITY_NATURE      = "Nature";
public static final String AFFINITY_SHADOW      = "Shadow";
public static final String AFFINITY_COMMON      = "Common";
 
// In HeroClass.java
private String magicAffinity = Utils.EMPTY_STRING;
 
// In SpellFactory.java
static private Map<String,ArrayList<String>> mSpellsByAffinity;

List of Magic Affinities

Common

  • Description: Basic utility spells
  • Classes: Available to most classes
  • Code Reference: SpellHelper.AFFINITY_COMMON
  • String Resource: Abilities_Common → “Common Spells”

Combat

  • Description: Spells focused on combat enhancement
  • String Resource: Abilities_Default → “Mastery”

Elemental

  • Description: Spells related to elemental damage and effects
  • Code Reference: SpellHelper.AFFINITY_ELEMENTAL
  • String Resource: Abilities_Elemental → “Elemental Spells”

Necromancy

  • Description: Undead summoning and dark magic
  • Code Reference: SpellHelper.AFFINITY_NECROMANCY
  • String Resource: Abilities_Necromancy → “Necromancy”

Rogue

  • Description: Spells focused on stealth and utility
  • String Resource: Abilities_Default → “Mastery”

Witchcraft

  • Description: Control and manipulation spells
  • Classes: Gnoll class
  • String Resource: Abilities_Default → “Mastery”

Huntress

Elf

Priest

  • Description: Holy magic and healing
  • Classes: Plague Doctor class
  • Spells: Heal, Calm, Charm, Order
  • String Resource: Abilities_Default → “Mastery”

Plague Doctor

  • Description: Disease and poison-based magic
  • Classes: Plague Doctor class
  • Spells: Heal, Calm, Charm, Order
  • String Resource: Abilities_Default → “Mastery”

Rage

  • Code Reference: SpellHelper.AFFINITY_RAGE
  • String Resource: Abilities_Default → “Mastery”

Nature

  • Code Reference: SpellHelper.AFFINITY_NATURE
  • String Resource: Abilities_Default → “Mastery”

Shadow

  • Code Reference: SpellHelper.AFFINITY_SHADOW
  • String Resource: Abilities_Default → “Mastery”

Demonology

  • Code Reference: SpellHelper.AFFINITY_DEMONOLOGY
  • String Resource: Abilities_Default → “Mastery”

Dev

Affinity Implementation

The affinity system is implemented using Lua scripts in scripts/spells/SpellsByAffinity.lua and scripts/spells/CustomSpellsList.lua:

-- In CustomSpellsList.lua
local spells = {}
spells["Necromancy"] = {"RaiseDead","Exhumation", "DarkSacrifice","Possess"}
spells["Common"] = {"TownPortal","Heal","RaiseDead","Cloak","Calm","Charm"}
 
spells["Combat"] = {"DieHard","Dash","BodyArmor","Smash"}
spells["Rogue"] = {"Cloak","Backstab","KunaiThrow","Haste"}
spells["Witchcraft"] = {"Roar","LightningBolt","Heal","Order"}
spells["Huntress"] = {"Calm","Charm","ShootInEye","SummonBeast"}
spells["Elf"] = {"MagicArrow","Sprout","HideInGrass","NatureArmor"}
spells["Priest"] = {"Heal","Calm","Charm","Order"}
spells["PlagueDoctor"] = {"Heal","Calm","Charm","Order"}
 
spells["Dev"] = {"TestSpell", "CurseItem"}
 
return spells

Class Implementation

The hero class determines the magic affinity:

// In Hero.java
public boolean hasMagicAffinity() {
    return !heroClass.getMagicAffinity().isEmpty();
}
 
// In HeroClass.java
private String magicAffinity = Utils.EMPTY_STRING;

Code References

  • Abilities_Default: “Mastery”
  • Abilities_Common: “Common Spells”
  • Abilities_Elemental: “Elemental Spells”
  • Abilities_Necromancy: “Necromancy”

Mechanics

  • Spell availability - Characters have primary access to spells matching their affinity
  • Cross-affinity access - Some classes may have access to multiple affinities
  • Spell learning - Affinity affects how spells are learned and used
  • Mastery titles - Different affinities have different mastery titles determined by string resources

Strategy

  • Choose classes based on preferred spell affinities
  • Understand which spells are available to your character
  • Plan spell usage around your character's affinity
  • Consider class-specific affinities when building your character

See Also

en/rpd/affinities_mechanic.txt · Last modified: by 127.0.0.1