spell
Vars | |
base_cooldown | recharge time in deciseconds |
---|---|
cooldown_handler | handles a given spells cooldowns. tracks the time until its off cooldown, |
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 |
holy_area_cancast | Whether or not the spell functions in a holy place |
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 |
smoke_type | Determines if the spell has smoke, and if so what effect the smoke has. See spell defines. |
spell_handlers | List with the handler datums per spell type. Key = src.type, value = the handler datum created by create_new_handler() |
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 | |
cast | The proc where the actual spell gets cast. |
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_mind_transfer | 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 |
on_purchase_upgrade | Lets the spell have a special effect applied to it when upgraded. By default, does nothing. |
perform | Handles all the code for performing a spell once the targets are known |
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
base_cooldown
recharge time in deciseconds
cooldown_handler
handles a given spells cooldowns. tracks the time until its off cooldown,
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
holy_area_cancast
Whether or not the spell functions in a holy place
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
smoke_type
Determines if the spell has smoke, and if so what effect the smoke has. See spell defines.
spell_handlers
List with the handler datums per spell type. Key = src.type, value = the handler datum created by create_new_handler()
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
cast
The proc where the actual spell gets cast.
Arguments:
- targets - The targets being targeted by the spell
- 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_mind_transfer
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
on_purchase_upgrade
Lets the spell have a special effect applied to it when upgraded. By default, does nothing.
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
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