====== Roar Spell - Code References ======
{{ rpd:images:roar_spell.png|Roar Spell }}
===== Lua Script =====
* [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/spells/Roar.lua|Roar.lua]] - Main spell implementation
* [[https://github.com/NYRDS/remixed-dungeon/blob/master/RemixedDungeon/src/main/assets/scripts/spells/CustomSpellsList.lua|CustomSpellsList.lua]] - Spell registration (line 13: spells["Witchcraft"] = {"Roar","LightningBolt","Heal","Order"})
===== Full Lua Script Content =====
---
--- Generated by EmmyLua(https://github.com/EmmyLua)
--- Created by mike.
--- DateTime: 1/6/21 1:43 AM
---
local RPD = require "scripts/lib/commonClasses"
local spell = require "scripts/lib/spell"
return spell.init{
desc = function ()
return {
image = 0,
imageFile = "spellsIcons/witchcraft.png",
name = "Roar_Name",
info = "Roar_Info",
magicAffinity = "Witchcraft",
targetingType = "self",
level = 1,
castTime = 0,
spellCost = 1
}
end,
cast = function(self, spell, caster)
RPD.Sfx.Flare:attach( 6, 32, 0xFF0000, true, caster:getSprite(), 2);
RPD.playSound("snd_challenge")
local duration = caster:lvl()
for _ = 1, caster:skillLevel() do
local tgt = caster:randomEnemy()
if tgt:valid() then
RPD.Sfx.Flare:attach( 4, 16, 0xFF0000, true, tgt:getSprite(), 2);
RPD.affectBuff(tgt, RPD.Buffs.Terror, duration):setSource(caster)
end
end
return true
end
}
===== String Resources =====
Roar
The mighty roar will surely terrify your enemies and inspire allies.
===== Spell Properties (from desc function) =====
* **Magic Affinity:** Witchcraft (line 20)
* **Targeting Type:** self (line 21)
* **Level:** 1 (line 22)
* **Cast Time:** 0 seconds (line 23)
* **Mana Cost:** 1 (line 24)
* **Image File:** spellsIcons/witchcraft.png (line 17)
* **Image Index:** 0 (line 16)
===== Mechanics (from cast function) =====
* Creates visual flare effect on caster: 6 rays, 32 pixels, red (#FF0000), 2 seconds (line 29)
* Plays sound effect: "snd_challenge" (line 30)
* Terror duration equals caster's level (line 32)
* Affects up to caster's skill level random enemies (line 33)
* For each affected enemy: flare effect 4 rays, 16 pixels, red (#FF0000), 2 seconds (line 37)
* Applies Terror buff with caster as source (line 38)
===== Entity Usage Analysis =====
Using find_entity_usage.py:
* Lua file: ./RemixedDungeon/src/main/assets/scripts/spells/CustomSpellsList.lua (line 13) - Registered as Witchcraft spell
* Lua file: ./RemixedDungeon/src/main/assets/scripts/spells/Roar.lua - Main spell implementation
* String resources: Roar_Name, Roar_Info
* No Java class implementation (Lua-based spell)
* No JSON configuration (Lua-based spell)
===== Related mr Entities =====
* [[mr:terror_buff|Terror (Buff)]] - Applied by Roar spell
* [[mr:witchcraft_affinity|Witchcraft Affinity]] - Spell affinity
{{tag>mr spells code_reference}}