Table of Contents

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

Combat

Elemental

Necromancy

Rogue

Witchcraft

Huntress

Elf

Priest

Plague Doctor

Rage

Nature

Shadow

Demonology

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

Mechanics

Strategy

See Also