Files

50 lines
20 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/spell - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="datum/spell.html#var">Var Details</a> - <a href="datum/spell.html#proc">Proc Details</a></header><main><h1>spell <aside>/<a href="datum.html">datum</a>/<a href="datum/spell.html">spell</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L17"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 17"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/spell.html#var/antimagic_flags">antimagic_flags</a></th><td>This determines what type of antimagic is needed to block the spell.
(MAGIC_RESISTANCE, MAGIC_RESISTANCE_MIND, MAGIC_RESISTANCE_HOLY)
If SPELL_REQUIRES_NO_ANTIMAGIC is set in Spell requirements,
The spell cannot be cast if the caster has any of the antimagic flags set.</td></tr><tr><th><a href="datum/spell.html#var/base_cooldown">base_cooldown</a></th><td>recharge time in deciseconds</td></tr><tr><th><a href="datum/spell.html#var/cooldown_handler">cooldown_handler</a></th><td>handles a given spells cooldowns. tracks the time until its off cooldown,</td></tr><tr><th><a href="datum/spell.html#var/create_attack_logs">create_attack_logs</a></th><td>does this spell generate attack logs?</td></tr><tr><th><a href="datum/spell.html#var/create_custom_logs">create_custom_logs</a></th><td>If this spell creates custom logs using the write_custom_logs() proc. Will ignore create_attack_logs</td></tr><tr><th><a href="datum/spell.html#var/custom_handler">custom_handler</a></th><td>Which spell_handler is used in addition to the normal spells behaviour, can be null. Set this in create_new_handler if needed</td></tr><tr><th><a href="datum/spell.html#var/holy_area_cancast">holy_area_cancast</a></th><td>Whether or not the spell functions in a holy place</td></tr><tr><th><a href="datum/spell.html#var/is_a_heretic_spell">is_a_heretic_spell</a></th><td>Is it a heretic spell? Used by heretics.</td></tr><tr><th><a href="datum/spell.html#var/selection_activated_message">selection_activated_message</a></th><td>The message displayed when a click based spell gets activated</td></tr><tr><th><a href="datum/spell.html#var/selection_deactivated_message">selection_deactivated_message</a></th><td>The message displayed when a click based spell gets deactivated</td></tr><tr><th><a href="datum/spell.html#var/smoke_type">smoke_type</a></th><td>Determines if the spell has smoke, and if so what effect the smoke has. See spell defines.</td></tr><tr><th><a href="datum/spell.html#var/spell_handlers">spell_handlers</a></th><td>List with the handler datums per spell type. Key = src.type, value = the handler datum created by create_new_handler()</td></tr><tr><th><a href="datum/spell.html#var/spell_requirements">spell_requirements</a></th><td>Flag for certain states that the spell requires the user be in to cast.</td></tr><tr><th><a href="datum/spell.html#var/targeting">targeting</a></th><td>Which targeting system is used. Set this in create_new_targeting</td></tr><tr><th><a href="datum/spell.html#var/targeting_datums">targeting_datums</a></th><td>List with the targeting datums per spell type. Key = src.type, value = the targeting datum created by create_new_targeting()</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/spell.html#proc/cast">cast</a></th><td>The proc where the actual spell gets cast.</td></tr><tr><th><a href="datum/spell.html#proc/choose_targets">choose_targets</a></th><td>Will try to choose targets using the targeting variable and perform the spell if it can
Do not override this! Override create_new_targeting instead</td></tr><tr><th><a href="datum/spell.html#proc/create_new_cooldown">create_new_cooldown</a></th><td>Creates and returns the spells cooldown handler, defaults to the standard recharge handler.
Override this if you wish to use a different method of cooldown</td></tr><tr><th><a href="datum/spell.html#proc/create_new_handler">create_new_handler</a></th><td>Creates and returns the handler datum for this spell type.
Override this if you want a custom spell handler.
Should return a value of type <a href="datum.html" title="/datum">/datum/spell_handler</a> or NONE</td></tr><tr><th><a href="datum/spell.html#proc/create_new_targeting">create_new_targeting</a></th><td>Creates and returns the targeting datum for this spell type. Override this!
Should return a value of type <a href="datum/spell_targeting.html" title="/datum/spell_targeting">/datum/spell_targeting</a></td></tr><tr><th><a href="datum/spell.html#proc/on_mind_transfer">on_mind_transfer</a></th><td>This proc is ran when a mind is transfered to a new mob. Tells it if the action should be transfered on return true, and tells it not to remove it on false</td></tr><tr><th><a href="datum/spell.html#proc/on_purchase_upgrade">on_purchase_upgrade</a></th><td>Lets the spell have a special effect applied to it when upgraded. By default, does nothing.</td></tr><tr><th><a href="datum/spell.html#proc/perform">perform</a></th><td>Handles all the code for performing a spell once the targets are known</td></tr><tr><th><a href="datum/spell.html#proc/should_remove_click_intercept">should_remove_click_intercept</a></th><td>Called in <code>try_perform</code> before removing the click interceptor. useful to override if you have a spell that requires more than 1 click</td></tr><tr><th><a href="datum/spell.html#proc/spend_spell_cost">spend_spell_cost</a></th><td>Will spend the cost of using this spell once. Will update the action button's icon if there is any</td></tr><tr><th><a href="datum/spell.html#proc/try_perform">try_perform</a></th><td>Will try and perform the spell using the given targets and user. Will spend one charge of the spell</td></tr><tr><th><a href="datum/spell.html#proc/valid_target">valid_target</a></th><td>Allows for spell specific target validation. Will be used by the spell_targeting datums</td></tr><tr><th><a href="datum/spell.html#proc/write_custom_logs">write_custom_logs</a></th><td>Will write additional logs if create_custom_logs is TRUE and the caster has a ckey. Override this</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/antimagic_flags"><aside class="declaration">var </aside>antimagic_flags <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L93"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 93"></a></h3><p>This determines what type of antimagic is needed to block the spell.
(MAGIC_RESISTANCE, MAGIC_RESISTANCE_MIND, MAGIC_RESISTANCE_HOLY)
If SPELL_REQUIRES_NO_ANTIMAGIC is set in Spell requirements,
The spell cannot be cast if the caster has any of the antimagic flags set.</p><h3 id="var/base_cooldown"><aside class="declaration">var </aside>base_cooldown <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L21"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 21"></a></h3><p>recharge time in deciseconds</p><h3 id="var/cooldown_handler"><aside class="declaration">var </aside>cooldown_handler <aside> /<a href="datum.html">datum</a>/<a href="datum/spell_cooldown.html">spell_cooldown</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L86"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 86"></a></h3><p>handles a given spells cooldowns. tracks the time until its off cooldown,</p><h3 id="var/create_attack_logs"><aside class="declaration">var </aside>create_attack_logs <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L71"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 71"></a></h3><p>does this spell generate attack logs?</p><h3 id="var/create_custom_logs"><aside class="declaration">var </aside>create_custom_logs <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L74"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 74"></a></h3><p>If this spell creates custom logs using the write_custom_logs() proc. Will ignore create_attack_logs</p><h3 id="var/custom_handler"><aside class="declaration">var </aside>custom_handler <aside> /<a href="datum.html">datum</a>/spell_handler</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L82"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 82"></a></h3><p>Which spell_handler is used in addition to the normal spells behaviour, can be null. Set this in create_new_handler if needed</p><h3 id="var/holy_area_cancast"><aside class="declaration">var </aside>holy_area_cancast <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L54"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 54"></a></h3><p>Whether or not the spell functions in a holy place</p><h3 id="var/is_a_heretic_spell"><aside class="declaration">var </aside>is_a_heretic_spell <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L95"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 95"></a></h3><p>Is it a heretic spell? Used by heretics.</p><h3 id="var/selection_activated_message"><aside class="declaration">var </aside>selection_activated_message <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L66"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 66"></a></h3><p>The message displayed when a click based spell gets activated</p><h3 id="var/selection_deactivated_message"><aside class="declaration">var </aside>selection_deactivated_message <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L68"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 68"></a></h3><p>The message displayed when a click based spell gets deactivated</p><h3 id="var/smoke_type"><aside class="declaration">var </aside>smoke_type <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L49"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 49"></a></h3><p>Determines if the spell has smoke, and if so what effect the smoke has. See spell defines.</p><h3 id="var/spell_handlers"><aside class="declaration">var </aside>spell_handlers <aside> /static/list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L84"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 84"></a></h3><p>List with the handler datums per spell type. Key = src.type, value = the handler datum created by create_new_handler()</p><h3 id="var/spell_requirements"><aside class="declaration">var </aside>spell_requirements <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L88"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 88"></a></h3><p>Flag for certain states that the spell requires the user be in to cast.</p><h3 id="var/targeting"><aside class="declaration">var </aside>targeting <aside> /<a href="datum.html">datum</a>/<a href="datum/spell_targeting.html">spell_targeting</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L77"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 77"></a></h3><p>Which targeting system is used. Set this in create_new_targeting</p><h3 id="var/targeting_datums"><aside class="declaration">var </aside>targeting_datums <aside> /static/list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L79"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 79"></a></h3><p>List with the targeting datums per spell type. Key = src.type, value = the targeting datum created by create_new_targeting()</p><h2 id="proc">Proc Details</h2><h3 id="proc/cast"><aside class="declaration">proc </aside>cast<aside>(/list/targets, /<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L418"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 418"></a></aside></h3><p>The proc where the actual spell gets cast.</p>
<p>Arguments:</p>
<ul>
<li>targets - The targets being targeted by the spell</li>
<li>user - The caster of the spell</li>
</ul><h3 id="proc/choose_targets"><aside class="declaration">proc </aside>choose_targets<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L288"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 288"></a></aside></h3><p>Will try to choose targets using the targeting variable and perform the spell if it can
Do not override this! Override create_new_targeting instead</p>
<p>Arguments:</p>
<ul>
<li>user - The caster of the spell</li>
</ul><h3 id="proc/create_new_cooldown"><aside class="declaration">proc </aside>create_new_cooldown<aside>() <span class="as"> as </span>/<a href="datum.html">datum</a>/<a href="datum/spell_cooldown.html">spell_cooldown</a> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L262"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 262"></a></aside></h3><p>Creates and returns the spells cooldown handler, defaults to the standard recharge handler.
Override this if you wish to use a different method of cooldown</p><h3 id="proc/create_new_handler"><aside class="declaration">proc </aside>create_new_handler<aside>() <span class="as"> as </span>/<a href="datum.html">datum</a>/spell_handler <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L253"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 253"></a></aside></h3><p>Creates and returns the handler datum for this spell type.
Override this if you want a custom spell handler.
Should return a value of type <a href="datum.html" title="/datum">/datum/spell_handler</a> or NONE</p><h3 id="proc/create_new_targeting"><aside class="declaration">proc </aside>create_new_targeting<aside>() <span class="as"> as </span>/<a href="datum.html">datum</a>/<a href="datum/spell_targeting.html">spell_targeting</a> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L244"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 244"></a></aside></h3><p>Creates and returns the targeting datum for this spell type. Override this!
Should return a value of type <a href="datum/spell_targeting.html" title="/datum/spell_targeting">/datum/spell_targeting</a></p><h3 id="proc/on_mind_transfer"><aside class="declaration">proc </aside>on_mind_transfer<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/L) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L453"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 453"></a></aside></h3><p>This proc is ran when a mind is transfered to a new mob. Tells it if the action should be transfered on return true, and tells it not to remove it on false</p><h3 id="proc/on_purchase_upgrade"><aside class="declaration">proc </aside>on_purchase_upgrade<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L278"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 278"></a></aside></h3><p>Lets the spell have a special effect applied to it when upgraded. By default, does nothing.</p><h3 id="proc/perform"><aside class="declaration">proc </aside>perform<aside>(/list/targets, /<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L336"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 336"></a></aside></h3><p>Handles all the code for performing a spell once the targets are known</p>
<p>Arguments:</p>
<ul>
<li>targets - The list of targets the spell is being cast on. Will not be empty or null</li>
<li>user - The caster of the spell</li>
</ul><h3 id="proc/should_remove_click_intercept"><aside class="declaration">proc </aside>should_remove_click_intercept<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L326"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 326"></a></aside></h3><p>Called in <code>try_perform</code> before removing the click interceptor. useful to override if you have a spell that requires more than 1 click</p><h3 id="proc/spend_spell_cost"><aside class="declaration">proc </aside>spend_spell_cost<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L211"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 211"></a></aside></h3><p>Will spend the cost of using this spell once. Will update the action button's icon if there is any</p>
<p>Arguments:</p>
<ul>
<li>user - Who used this spell?</li>
</ul><h3 id="proc/try_perform"><aside class="declaration">proc </aside>try_perform<aside>(/list/targets, /<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L310"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 310"></a></aside></h3><p>Will try and perform the spell using the given targets and user. Will spend one charge of the spell</p>
<p>Arguments:</p>
<ul>
<li>targets - The targets the spell is being performed on</li>
<li>user - The caster of the spell</li>
</ul><h3 id="proc/valid_target"><aside class="declaration">proc </aside>valid_target<aside>(target, user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L202"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 202"></a></aside></h3><p>Allows for spell specific target validation. Will be used by the spell_targeting datums</p>
<p>Arguments:</p>
<ul>
<li>target - Who is being considered</li>
<li>user - Who is the user of this spell</li>
</ul><h3 id="proc/write_custom_logs"><aside class="declaration">proc </aside>write_custom_logs<aside>(/list/targets, /<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/spells/spell_base.dm#L364"><img src="git.png" width="16" height="16" title="code/datums/spells/spell_base.dm 364"></a></aside></h3><p>Will write additional logs if create_custom_logs is TRUE and the caster has a ckey. Override this</p>
<p>Arguments:</p>
<ul>
<li>targets - The targets being targeted by the spell</li>
<li>user - The user of the spell</li>
</ul></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/8a8a00a2a9bec485351e5f219982b7315d3504fa">8a8a00a</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html>