mr:self_targeting_spell
Table of Contents
Self Targeting Spell - Code References
Java Classes
- Spell.java - Base spell class with targetingType field
- SpellHelper.java - Defines targeting type constants
- CustomSpell.java - Lua spell implementation
JSON Configuration
This is a spell targeting type concept, no JSON configuration exists
Lua Scripts
Self-targeted spells are implemented in Lua with `targetingType = “self�`. Examples:
- Smash.lua - Combat affinity, level 4
- BodyArmor.lua - Combat affinity, level 3
- DieHard.lua - Combat affinity, level 1
- Dash.lua - Combat affinity, level 2 (targets cell but self-initiated)
- Cloak.lua - Rogue affinity
- Haste.lua - Rogue affinity
- Calm.lua - Huntress affinity (char_not_self but similar)
- HideInGrass.lua - Elf affinity
Targeting Type Constants (SpellHelper.java)
public static final String TARGET_SELF = "self"; public static final String TARGET_CELL = "cell"; public static final String TARGET_CHAR = "char"; public static final String TARGET_CHAR_NOT_SELF = "char_not_self"; public static final String TARGET_ALLY = "ally"; public static final String TARGET_ENEMY = "enemy"; public static final String TARGET_NONE = "none";
Self-Targeting Behavior
When `targetingType = “self�`:
- Spell is cast on the caster directly
- No target selection UI is shown
- `CustomSpell.cast(Char chr)` is called (the no-argument version)
- Lua `cast(self, spell, caster)` function receives only the caster
- Typical for buffs, self-buffs, and area effects centered on caster
String Resources
Spell-specific strings for self-targeted spells (e.g., Smash):
<string name="SmashSpell_Name">Smash</string> <string name="SmashSpell_Info">Jump upwards and create a powerful smash upon hitting the ground,that temporarily stuns enemies around and at the same time deals physical damage.</string> <string name="SmashSpell_NeedWeapon">I need a weapon for this move.</string>
Related mr Entities
- CustomSpell (Class) - Base class for Lua spells
- Combat Affinity - Uses self-targeting extensively
- Smash Spell - Self-targeted Combat spell
- BodyArmor Spell - Self-targeted Combat spell
- DieHard Spell - Self-targeted Combat spell
- Cloak Spell - Self-targeted Rogue spell
- Haste Spell - Self-targeted Rogue spell
mr/self_targeting_spell.txt · Last modified: by 127.0.0.1
