SS1984 - Modules - TypesVar Details - Proc Details

spell

Vars

actionAction with a button linked to this spell.
action_background_iconSame as action icon, but used for image background overlay. Usefull when our action icon has no background at all.
action_background_icon_stateState of the icon found in file, passed in "action_background_icon" variable.
action_iconAction icon file. Its a main image overlay, often without background.
action_icon_stateState of the icon found in file, passed in "action_icon" variable.
base_cooldownRecharge time in deciseconds
centcom_cancastWhether or not the spell should be allowed on admin Z-level.
clothes_reqSpell can only be cast with special wizard garb, equipped in appropriete slots.
cooldown_handlerHandles a given spells cooldowns. Tracks the time until its off cooldown.
cooldown_minThis defines what spell quickened four timeshas as a cooldown. Make sure to set this for every spell.
create_attack_logsdoes this spell generate attack logs?
create_custom_logsIf this spell creates custom logs using the write_custom_logs() proc. Will ignore create_attack_logs
custom_handlerWhich spell_handler is used in addition to the normal spells behaviour, can be null. Set this in create_new_handler if needed
gain_descThis message will be shown to user upon receiving the spell.
ghostIf set to TRUE spell will skip stat check, defined in "stat_allowed" variable.
holy_area_cancastWhether or not the spell functions in a holy place
human_reqSpell can only be cast by humans.
interaction_flags_clickWhat panel the proc holder needs to go on.
invocationWhat is uttered when the wizard casts the spell.
invocation_emote_selfIf invocation_type is "emote", caster will perform emote on cast, should be same style as in [mob/living/emote.dm].
invocation_typeCan be "none", "whisper", "shout" and "emote".
level_maxThe max possible level_max is 4.
messageWhatever it says to the guy affected by it.
need_active_overlayWhether this spell need a white frame around the button while active, usefull for click based targeting.
nonabstract_reqSpell can only be cast by mobs that are physical entities. Currently checks whether caster is brain or pAI.
overlayWheter special overlay effect should be played on user, after spell cast.
overlay_iconSpecial overlay icon file.
overlay_icon_stateSpecial overlay icon state.
overlay_lifespanTime before special effect will be deleted.
phase_allowedIf set to TRUE, spell can be cast while phased, eg. blood crawling, ethereal jaunting.
schoolNot relevant at now, but may be important later if there are changes to how spells work. the ones I used for now will probably be changed... maybe spell presets? lacking flexibility but with some other benefit?
selection_activated_messageThe message displayed when a click based spell gets activated
selection_deactivated_messageThe message displayed when a click based spell gets deactivated
should_recharge_after_castWhether an ability should start cooldown after cast or not.
smoke_typeDetermines if the spell has smoke, and if so what effect the smoke has. See spell defines.
soundThe sound the spell makes when it is cast.
sparks_amtAmount of sparks if "sparks_spread" is set to TRUE.
sparks_spreadWhether spell should make sparks visual effect on targets location, after the main cast.
spell_handlersList with the handler datums per spell type. Key = src.type, value = the handler datum created by create_new_handler()
spell_levelIf a spell can be taken multiple times, this raises.
starts_chargedDoes this spell start ready to go?
stat_allowedChecks user stat on cast, could be "CONSCIOUS", "UNCONSCIOUS", "DEAD".
still_recharging_msgMessace user get when clicks on rechargins spell button.
targetingWhich targeting system is used. Set this in create_new_targeting
targeting_datumsList with the targeting datums per spell type. Key = src.type, value = the targeting datum created by create_new_targeting()

Procs

adjust_varHandles the adjustment of the var when the spell is used. Has some hardcoded types.
after_spell_initThis proc will trigger when all necessary initialization is done. Usefull for staff like changing spell name.
castThe proc where the actual spell gets cast.
cast_checkChecks if the user can cast the spell
choose_targetsWill try to choose targets using the targeting variable and perform the spell if it can Do not override this! Override create_new_targeting instead
create_new_cooldownCreates and returns the spells cooldown handler, defaults to the standard recharge handler. Override this if you wish to use a different method of cooldown
create_new_handlerCreates and returns the handler datum for this spell type. Override this if you want a custom spell handler. Should return a value of type /datum/spell_handler or NONE
create_new_targetingCreates and returns the targeting datum for this spell type. Override this! Should return a value of type /datum/spell_targeting
on_cooldown_tickThis will apply on every tick of cooldown process.
on_purchase_upgradeLets the spell have a special effect applied to it when upgraded. By default, does nothing.
on_spell_gainCalled when a spell is added
performHandles all the code for performing a spell once the targets are known
revert_castResets recharge or readds a charge.
should_remove_click_interceptCalled in try_perform before removing the click interceptor. Useful to override if you have a spell that requires more than 1 click
spend_spell_costWill spend the cost of using this spell once. Will update the action button's icon if there is any
try_performWill try and perform the spell using the given targets and user. Will spend one charge of the spell
valid_targetAllows for spell specific target validation. Will be used by the spell_targeting datums
write_custom_logsWill write additional logs if create_custom_logs is TRUE and the caster has a ckey. Override this

Var Details

action

Action with a button linked to this spell.

action_background_icon

Same as action icon, but used for image background overlay. Usefull when our action icon has no background at all.

action_background_icon_state

State of the icon found in file, passed in "action_background_icon" variable.

action_icon

Action icon file. Its a main image overlay, often without background.

action_icon_state

State of the icon found in file, passed in "action_icon" variable.

base_cooldown

Recharge time in deciseconds

centcom_cancast

Whether or not the spell should be allowed on admin Z-level.

clothes_req

Spell can only be cast with special wizard garb, equipped in appropriete slots.

cooldown_handler

Handles a given spells cooldowns. Tracks the time until its off cooldown.

cooldown_min

This defines what spell quickened four timeshas as a cooldown. Make sure to set this for every spell.

create_attack_logs

does this spell generate attack logs?

create_custom_logs

If this spell creates custom logs using the write_custom_logs() proc. Will ignore create_attack_logs

custom_handler

Which spell_handler is used in addition to the normal spells behaviour, can be null. Set this in create_new_handler if needed

gain_desc

This message will be shown to user upon receiving the spell.

ghost

If set to TRUE spell will skip stat check, defined in "stat_allowed" variable.

holy_area_cancast

Whether or not the spell functions in a holy place

human_req

Spell can only be cast by humans.

interaction_flags_click

What panel the proc holder needs to go on.

invocation

What is uttered when the wizard casts the spell.

invocation_emote_self

If invocation_type is "emote", caster will perform emote on cast, should be same style as in [mob/living/emote.dm].

invocation_type

Can be "none", "whisper", "shout" and "emote".

level_max

The max possible level_max is 4.

message

Whatever it says to the guy affected by it.

need_active_overlay

Whether this spell need a white frame around the button while active, usefull for click based targeting.

nonabstract_req

Spell can only be cast by mobs that are physical entities. Currently checks whether caster is brain or pAI.

overlay

Wheter special overlay effect should be played on user, after spell cast.

overlay_icon

Special overlay icon file.

overlay_icon_state

Special overlay icon state.

overlay_lifespan

Time before special effect will be deleted.

phase_allowed

If set to TRUE, spell can be cast while phased, eg. blood crawling, ethereal jaunting.

school

Not relevant at now, but may be important later if there are changes to how spells work. the ones I used for now will probably be changed... maybe spell presets? lacking flexibility but with some other benefit?

selection_activated_message

The message displayed when a click based spell gets activated

selection_deactivated_message

The message displayed when a click based spell gets deactivated

should_recharge_after_cast

Whether an ability should start cooldown after cast or not.

smoke_type

Determines if the spell has smoke, and if so what effect the smoke has. See spell defines.

sound

The sound the spell makes when it is cast.

sparks_amt

Amount of sparks if "sparks_spread" is set to TRUE.

sparks_spread

Whether spell should make sparks visual effect on targets location, after the main cast.

spell_handlers

List with the handler datums per spell type. Key = src.type, value = the handler datum created by create_new_handler()

spell_level

If a spell can be taken multiple times, this raises.

starts_charged

Does this spell start ready to go?

stat_allowed

Checks user stat on cast, could be "CONSCIOUS", "UNCONSCIOUS", "DEAD".

still_recharging_msg

Messace user get when clicks on rechargins spell button.

targeting

Which targeting system is used. Set this in create_new_targeting

targeting_datums

List with the targeting datums per spell type. Key = src.type, value = the targeting datum created by create_new_targeting()

Proc Details

adjust_var

Handles the adjustment of the var when the spell is used. Has some hardcoded types.

after_spell_init

This proc will trigger when all necessary initialization is done. Usefull for staff like changing spell name.

cast

The proc where the actual spell gets cast.

Arguments:

cast_check

Checks if the user can cast the spell

Arguments: charge_check - If the proc should do the cooldown check start_recharge - If the proc should set the cooldown user - The caster of the spell

choose_targets

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

Arguments:

create_new_cooldown

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

create_new_handler

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 /datum/spell_handler or NONE

create_new_targeting

Creates and returns the targeting datum for this spell type. Override this! Should return a value of type /datum/spell_targeting

on_cooldown_tick

This will apply on every tick of cooldown process.

on_purchase_upgrade

Lets the spell have a special effect applied to it when upgraded. By default, does nothing.

on_spell_gain

Called when a spell is added

perform

Handles all the code for performing a spell once the targets are known

Arguments:

revert_cast

Resets recharge or readds a charge.

should_remove_click_intercept

Called in try_perform before removing the click interceptor. Useful to override if you have a spell that requires more than 1 click

spend_spell_cost

Will spend the cost of using this spell once. Will update the action button's icon if there is any

Arguments:

try_perform

Will try and perform the spell using the given targets and user. Will spend one charge of the spell

Arguments:

valid_target

Allows for spell specific target validation. Will be used by the spell_targeting datums

Arguments:

write_custom_logs

Will write additional logs if create_custom_logs is TRUE and the caster has a ckey. Override this

Arguments: