mr:backstab_spell
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| mr:backstab_spell [2026/09/05 14:32] – Wiki maintenance: Fix compliance issues for 5 random pages Wiki Maintenance | mr:backstab_spell [2026/09/05 14:36] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Backstab Spell - Code References ====== | ||
| + | This page contains raw code references and configuration excerpts for the Backstab spell entity. | ||
| + | |||
| + | ==== Entity Kind ==== | ||
| + | * **Spell Type:** Rogue Affinity Spell (Lua implementation) | ||
| + | * **Targeting: | ||
| + | |||
| + | ==== Java Implementation ==== | ||
| + | * No dedicated Java class for this spell | ||
| + | * Spell is implemented entirely in Lua | ||
| + | |||
| + | ==== Lua Script ==== | ||
| + | * **Script location:** [[https:// | ||
| + | * **Spell library:** [[https:// | ||
| + | |||
| + | ==== Lua Script Content ==== | ||
| + | <code lua> | ||
| + | local RPD = require " | ||
| + | local spell = require " | ||
| + | |||
| + | local distracted | ||
| + | distracted[" | ||
| + | distracted[" | ||
| + | distracted[" | ||
| + | distracted[" | ||
| + | distracted[" | ||
| + | |||
| + | return spell.init{ | ||
| + | desc = function () | ||
| + | return { | ||
| + | image = 2, | ||
| + | imageFile | ||
| + | name = " | ||
| + | info = " | ||
| + | magicAffinity = " | ||
| + | targetingType = " | ||
| + | level = 2, | ||
| + | castTime | ||
| + | spellCost | ||
| + | } | ||
| + | end, | ||
| + | |||
| + | cast = function(self, | ||
| + | |||
| + | local level = caster: | ||
| + | local ownPos = caster: | ||
| + | |||
| + | local victim = caster: | ||
| + | |||
| + | if victim == nil or level: | ||
| + | RPD.glogn(" | ||
| + | return false | ||
| + | end | ||
| + | |||
| + | if not distracted[victim: | ||
| + | RPD.glogn(" | ||
| + | return false | ||
| + | end | ||
| + | |||
| + | victim: | ||
| + | |||
| + | local weapon = caster: | ||
| + | local secondaryWeapon = caster: | ||
| + | local damage = math.sqrt(caster: | ||
| + | |||
| + | victim: | ||
| + | RPD.Sfx.Wound: | ||
| + | |||
| + | return true | ||
| + | end | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Key Properties from Code ==== | ||
| + | * **Magic Affinity:** Rogue | ||
| + | * **Targeting: | ||
| + | * **Level:** 2 | ||
| + | * **Mana Cost:** 2 | ||
| + | * **Cast Time:** 1 turn | ||
| + | * **Damage Formula:** sqrt(caster' | ||
| + | * **Conditions: | ||
| + | * **Range:** 1 tile distance from caster | ||
| + | |||
| + | ==== String Resources ==== | ||
| + | <code xml> | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | <string name=" | ||
| + | </ | ||
| + | |||
| + | ==== JSON Configuration ==== | ||
| + | This entity does not use JSON configuration. | ||
| + | |||
| + | ==== Code Behavior ==== | ||
| + | * Implemented as Lua spell using the spell library | ||
| + | * Checks if nearest enemy is within 1 tile distance | ||
| + | * Requires target to be distracted (PASSIVE, SLEEPING, FLEEING, HORRIFIED, RUNNINGAMOK) or paralyzed | ||
| + | * Calculates damage using both main hand and off-hand weapon damage rolls | ||
| + | * Damage scales with square root of caster' | ||
| + | * Ignores victim' | ||
| + | * Shows visual status effect (0xff2030 " | ||
| + | * Plays Wound sound effect after attack | ||
| + | |||
| + | ==== Spell Registration ==== | ||
| + | * Registered in [[https:// | ||
| + | * Part of Rogue class spell set | ||
| + | |||
| + | ==== Related Entities ==== | ||
| + | * **Rogue Class:** [[mr: | ||
| + | * **Assassin Subclass:** [[mr: | ||
| + | * **English Page:** [[en: | ||
| + | * **Russian Page:** [[ru: | ||
| + | |||
| + | {{tag> mr rpd spells rogue lua_defined}} | ||
mr/backstab_spell.txt · Last modified: by 127.0.0.1
