spell

Vars | |
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 |
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_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 |
perform | Handles all the code for performing a spell once the targets are known |
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
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
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_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
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
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