Yogstation 13 - Modules - TypesVar Details - Proc Details

The spell action

This is the base action for how many of the game's spells (and spell adjacent) abilities function. These spells function off of a cooldown-based system.

Pre-spell checks: The spell chain: Other procs called / may be called within the chain: Other procs of note:

Vars

antimagic_flagsThis 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.
bypass_costBoolean, if true, resource costs will be ignored
cooldown_reduction_per_rankIf the spell uses the wizard spell rank system, the cooldown reduction per rank of the spell
invocationWhat is uttered when the user casts the spell
invocation_self_messageWhat is shown in chat when the user casts the spell, only matters for INVOCATION_EMOTE
invocation_typeWhat type of invocation the spell is. Can be "none", "whisper", "shout", "emote"
resource_costsAn associative list of all resource costs
schoolThe school of magic the spell belongs to. Checked by some holy sects to punish the caster for casting things that do not align with their sect's alignment - see magic.dm in defines to learn more
smoke_amtThe amount of smoke to create on cast. This is a range, so a value of 5 will create enough smoke to cover everything within 5 steps.
smoke_typeThe typepath of the smoke to create on cast.
soundThe sound played on cast.
sparks_amtIf set to a positive number, the spell will produce sparks when casted.
spell_levelThe current spell level, if taken multiple times by a wizard
spell_max_levelThe max possible spell level
spell_requirementsFlag for certain states that the spell requires the user be in to cast.

Procs

after_castActions done after the main cast is finished. This is called after the cooldown's already begun.
castActions done as the main effect of the spell.
consume_resourceCalled after the effect happens, whether that's after the button press or after hitting someone with a touch ability
delevel_spellLevels the spell down a single level, down to 1.
get_spell_titleGets the title of the spell based on its level.
invocationThe invocation that accompanies the spell, called from spell_feedback() before cast().
level_spellLevels the spell up a single level, reducing the cooldown. If bypass_cap is TRUE, will level the spell up past it's set cap.
reset_spell_cooldownResets the cooldown of the spell, sending COMSIG_SPELL_CAST_RESET and allowing it to be used immediately (+ updating button icon accordingly)
spell_feedbackProvides feedback after a spell cast occurs, in the form of a cast sound and/or invocation
try_invokeChecks if the current OWNER of the spell is in a valid state to say the spell's invocation

Var Details

antimagic_flags

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.

bypass_cost

Boolean, if true, resource costs will be ignored

cooldown_reduction_per_rank

If the spell uses the wizard spell rank system, the cooldown reduction per rank of the spell

invocation

What is uttered when the user casts the spell

invocation_self_message

What is shown in chat when the user casts the spell, only matters for INVOCATION_EMOTE

invocation_type

What type of invocation the spell is. Can be "none", "whisper", "shout", "emote"

resource_costs

An associative list of all resource costs

school

The school of magic the spell belongs to. Checked by some holy sects to punish the caster for casting things that do not align with their sect's alignment - see magic.dm in defines to learn more

smoke_amt

The amount of smoke to create on cast. This is a range, so a value of 5 will create enough smoke to cover everything within 5 steps.

smoke_type

The typepath of the smoke to create on cast.

sound

The sound played on cast.

sparks_amt

If set to a positive number, the spell will produce sparks when casted.

spell_level

The current spell level, if taken multiple times by a wizard

spell_max_level

The max possible spell level

spell_requirements

Flag for certain states that the spell requires the user be in to cast.

Proc Details

after_cast

Actions done after the main cast is finished. This is called after the cooldown's already begun.

It can be used to apply late spell effects where order matters (for example, causing smoke after a teleport occurs in cast()) or to clean up variables or references post-cast.

cast

Actions done as the main effect of the spell.

For spells without a click intercept, [cast_on] will be the owner. For click spells, [cast_on] is whatever the owner clicked on in casting the spell.

consume_resource

Called after the effect happens, whether that's after the button press or after hitting someone with a touch ability

delevel_spell

Levels the spell down a single level, down to 1.

get_spell_title

Gets the title of the spell based on its level.

invocation

The invocation that accompanies the spell, called from spell_feedback() before cast().

level_spell

Levels the spell up a single level, reducing the cooldown. If bypass_cap is TRUE, will level the spell up past it's set cap.

reset_spell_cooldown

Resets the cooldown of the spell, sending COMSIG_SPELL_CAST_RESET and allowing it to be used immediately (+ updating button icon accordingly)

spell_feedback

Provides feedback after a spell cast occurs, in the form of a cast sound and/or invocation

try_invoke

Checks if the current OWNER of the spell is in a valid state to say the spell's invocation