Space Station 13 - Modules - TypesVar Details - Proc Details

spell_targeting

The base class for the targeting systems spells use.

To create a new targeting datum you just inherit from this base type and override the /datum/spell_targeting/proc/choose_targets proc. Override the /datum/spell_targeting/proc/valid_target proc for more complex validations. More complex behaviour like auto targeting and click based activation is possible.

Vars

allowed_typeWhich type the targets have to be
include_userIf it includes user. Not always used in all spell_targeting objects
max_targetsHow many targets are allowed. INFINITY is used to target unlimited targets
rangeThe range of the spell; outer radius for aoe spells
selection_typeCan be SPELL_SELECTION_RANGE or SPELL_SELECTION_VIEW
try_auto_targetWhether or not the spell will try to auto target first before setting up the intercept click
use_intercept_clickWhether or not the targeting is done by intercepting a click or not
use_obstacle_checkIf the spell should do an obstacle check from the user to the target. Windows, for example, will block the spell if this is true.
use_turf_of_userWhether or not the spell should use the turf of the user as starting point

Procs

InterceptClickOnCalled when the parent spell intercepts the click
attempt_auto_targetWill attempt to auto target the spell. Only works with 1 target currently
choose_targetsCalled when choosing the targets for the parent spell
obstacle_checkChecks if the path from the source to the target is free. Mobs won't block the path. But any dense object (other than tables) will.
valid_targetChecks whether or not the given target is valid. Calls spell.valid_target as well

Var Details

allowed_type

Which type the targets have to be

include_user

If it includes user. Not always used in all spell_targeting objects

max_targets

How many targets are allowed. INFINITY is used to target unlimited targets

range

The range of the spell; outer radius for aoe spells

selection_type

Can be SPELL_SELECTION_RANGE or SPELL_SELECTION_VIEW

try_auto_target

Whether or not the spell will try to auto target first before setting up the intercept click

use_intercept_click

Whether or not the targeting is done by intercepting a click or not

use_obstacle_check

If the spell should do an obstacle check from the user to the target. Windows, for example, will block the spell if this is true.

use_turf_of_user

Whether or not the spell should use the turf of the user as starting point

Proc Details

InterceptClickOn

Called when the parent spell intercepts the click

Arguments:

attempt_auto_target

Will attempt to auto target the spell. Only works with 1 target currently

choose_targets

Called when choosing the targets for the parent spell

Arguments:

obstacle_check

Checks if the path from the source to the target is free. Mobs won't block the path. But any dense object (other than tables) will.

Arguments:

valid_target

Checks whether or not the given target is valid. Calls spell.valid_target as well

Arguments: