spell 
Vars | |
| 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() |
Procs | |
| 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. |
| cast_check | Checks if the user can cast 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 |
| 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 |
| 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 |
| try_perform | Will try and perform the spell using the given targets and user. Will spend one charge of the spell |
| valid_target | Allows for spell specific target validation. Will be used by the spell_targeting datums |
| write_custom_logs | Will 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:
- targets - The targets being targeted by the spell
- user - The caster of the spell
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:
- user - The caster of the spell
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:
- targets - The list of targets the spell is being cast on. Will not be empty or null
- recharge - Whether or not the spell should go recharge
- user - The caster of the spell
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:
- user - Who used this spell?
try_perform
Will try and perform the spell using the given targets and user. Will spend one charge of the spell
Arguments:
- targets - The targets the spell is being performed on
- user - The caster of the spell
valid_target
Allows for spell specific target validation. Will be used by the spell_targeting datums
Arguments:
- target - Who is being considered
- user - Who is the user of this spell
write_custom_logs
Will write additional logs if create_custom_logs is TRUE and the caster has a ckey. Override this
Arguments:
- targets - The targets being targeted by the spell
- user - The user of the spell