San Francisco - Modules - TypesVar Details - Proc Details

discipline_power

Vars

activate_soundSound file that plays to the user when this power is activated.
activeIf this Discipline is currently in use.
aggravatingIf this power will upset NPCs when used on them.
cancelableIf this power can be turned on and off.
check_flagsBitflags determining the requirements to cast this power
cooldown_lengthAmount of time it takes until this Discipline can be used again after activation.
cooldown_overrideIf this power uses its own cooldown handling rather than the default handling
cooldown_timerTimer tracking the cooldown of the power. Starts after deactivation if it has a duration and multi_active isn't true, after activation otherwise.
deactivate_soundSound file that plays to the user when this power is deactivated.
descDescription of the Discipline power
disciplineThe Discipline that this power is part of.
duration_lengthAmount of time it takes until this Discipline deactivates itself. 0 if instantaneous.
duration_overrideIf this power uses its own duration/deactivation handling rather than the default handling
duration_timersTimer(s) tracking the duration of the power. Can have multiple if multi_activate is true.
effect_soundSound file that plays to all nearby players when this power is activated.
grouped_powersList of Discipline power types that cannot be activated alongside this power and share a cooldown with it.
hostileIf this power is an aggressive action and logged as such.
levelWhat rank of the Discipline this Discipline power belongs to.
multi_activateIf this power can (theoretically, not in reality) have multiple of its effects active at once.
nameName of the Discipline power
ownerThe player using this Discipline power.
rangeHow many tiles away this power can be used from.
target_typeBitflags determining what types of entities this power is allowed to target. NONE if self-targeting only.
toggledIf this Discipline doesn't automatically expire, but rather periodically drains blood.
violates_masqueradeIf use of this power creates a visible Masquerade breach.
vitae_costHow many blood points this power costs to activate
willpower_costHow many willpower points this power costs to activate

Procs

activateTriggers all the effects of the power being fully activated.
can_activateActivation requirement checking proc that determines if a given target is valid while also checking can_activate_untargeted().
can_activate_untargetedReturns if this power can currently be activated without accounting for target restrictions.
can_affordReturns a boolean of if the caster can afford this power's vitae cost.
can_deactivateOverridable proc mirroring can_activate(), making sure that deactivation won't result in a runtime in case of the target not existing anymore while also checking can_deactivate_untargeted(). Also sends signals that allow for manual prevention of deactivation.
can_deactivate_untargetedOverridable proc called by try_deactivate() to make sure that deactivating won't result in a runtime in case of the power targeting the owner with them not existing. The equivalent of can_activate_untargeted().
clear_duration_timerClears the last active timer (usually the first in the list). If called before it expires, this immediately makes the duration_timer expire without calling the relevant proc.
cooldown_expireOverridable proc called by the cooldown timer to handle cooldown expiring. Has no behaviour besides making the action visibly available again.
deactivateCancels the effects of the previously activated power.
do_activate_soundOverridable proc handling the sound played to the owner only when using powers.
do_caster_notificationOverridable proc handling the message sent to the user when activating the power.
do_cooldownOverridable proc handling the power's cooldown, which is a timer that triggers the cooldown_expire proc when it ends, and is saved in cooldown_timer. This is called by both activate() and deactivate(), but it only actually starts the cooldown in deactivate() unless multi_activate is TRUE. The cooldown_override variable stops this from being triggered by activate() and deactivate() and allows for extra modular behaviour. Cooldowns can manually be started by calling try_deactivate(), then deltimer() and starting a new cooldown timer with your own length.
do_durationOverridable proc handling the power's duration, which is a timer that triggers the duration_expire proc when it ends, and is saved in duration_timers then deleted and cut when it ends. The duration_override variable stops this from being triggered by activate() and allows for extra modular behaviour. Duration expiring can be done manually by calling try_deactivate(direct = TRUE).
do_effect_soundOverridable proc handling the sound caused by the power's effects, audible to everyone around it.
do_loggingOverridable proc handling the combat log created by using this power.
do_masquerade_violationOverridable proc handling Masquerade violations as a result of using this power amongst NPCs.
do_refresh_checksOverridable proc that allows for extra modular code in refreshing behaviour. Can do custom checks to see if activation proceeds or not (must give its own feedback!) or can hijack the refresh proc for its own behaviour.
duration_expireOverridable proc called by the duration timer to handle duration expiring. Will refresh if toggled, or deactivate otherwise after deleting the timer calling it.
get_cooldownReturns the time left the cooldown timer, or 0 if there is none. Returning 0 means not on cooldown.
get_durationReturns the highest time left on any duration timers, or 0 if there are none. Returning 0 means not active.
post_gainOverridable proc that allows for code to affect the power's owner when it is gained. Triggered by parent /datum/discipline/post_gain().
post_lossOverridable proc that allows for code to affect the power's owner when it is lost / deleted. Triggered by parent /datum/discipline/post_loss().
pre_activationSpends necessary resources (vitae) and makes sure activation is valid before fully activating the power.
pre_activation_checksAn overridable proc that allows for custom pre_activation() behaviour.
refreshHandles refreshing toggled powers on a loop, spending necessary resources and restarting the duration timer if it can proceed. If it can't proceed, it directly deactivates the power.
spend_resourcesOverridable proc handling the spending of resources (vitae/blood) when casting the power. Returns TRUE if successfully spent, returns FALSE otherwise.
try_activateChecks if activation is possible through can_activate(), then calls pre_activation() if it is. Returns if activation successfully begun or not.
try_deactivateChecks if the power can_deactivate() and deactivate()s if it can. Also sends feedback the user if they successfully manually cancel it. The deactivation equivalent of try_activate().
was_hostile_usageOverridable proc handling how the power aggravates NPCs it's used on.

Var Details

activate_sound

Sound file that plays to the user when this power is activated.

active

If this Discipline is currently in use.

aggravating

If this power will upset NPCs when used on them.

cancelable

If this power can be turned on and off.

check_flags

Bitflags determining the requirements to cast this power

cooldown_length

Amount of time it takes until this Discipline can be used again after activation.

cooldown_override

If this power uses its own cooldown handling rather than the default handling

cooldown_timer

Timer tracking the cooldown of the power. Starts after deactivation if it has a duration and multi_active isn't true, after activation otherwise.

deactivate_sound

Sound file that plays to the user when this power is deactivated.

desc

Description of the Discipline power

discipline

The Discipline that this power is part of.

duration_length

Amount of time it takes until this Discipline deactivates itself. 0 if instantaneous.

duration_override

If this power uses its own duration/deactivation handling rather than the default handling

duration_timers

Timer(s) tracking the duration of the power. Can have multiple if multi_activate is true.

effect_sound

Sound file that plays to all nearby players when this power is activated.

grouped_powers

List of Discipline power types that cannot be activated alongside this power and share a cooldown with it.

hostile

If this power is an aggressive action and logged as such.

level

What rank of the Discipline this Discipline power belongs to.

multi_activate

If this power can (theoretically, not in reality) have multiple of its effects active at once.

name

Name of the Discipline power

owner

The player using this Discipline power.

range

How many tiles away this power can be used from.

target_type

Bitflags determining what types of entities this power is allowed to target. NONE if self-targeting only.

toggled

If this Discipline doesn't automatically expire, but rather periodically drains blood.

violates_masquerade

If use of this power creates a visible Masquerade breach.

vitae_cost

How many blood points this power costs to activate

willpower_cost

How many willpower points this power costs to activate

Proc Details

activate

Triggers all the effects of the power being fully activated.

An overridable proc where the effects of the power are stored. This being called means that activation has fully succeeded, so duration and cooldown (when multi_activate is true) also begin here. Specific basic activation behaviour (like the sound it makes or the message it logs) can be modified by overriding the relevant proc.

Arguments:

can_activate

Activation requirement checking proc that determines if a given target is valid while also checking can_activate_untargeted().

When activating a power, this is called to get the final result on if it can be activated or not. It first checks can_activate_untargeted(), then if the power is targeted, it handles logic for determining if a given target is valid according to the given target_type.

Arguments:

can_activate_untargeted

Returns if this power can currently be activated without accounting for target restrictions.

This is where all checks according to check_flags for if a power can be activated that don't concern the target are handled. This is almost entirely checking traits on the owner to see if they're incapacitated or whatnot, but some backend like deactivation is also handled here. This is what's checked to see if the power is selectable or unselectable (red).

Arguments:

can_afford

Returns a boolean of if the caster can afford this power's vitae cost.

can_deactivate

Overridable proc mirroring can_activate(), making sure that deactivation won't result in a runtime in case of the target not existing anymore while also checking can_deactivate_untargeted(). Also sends signals that allow for manual prevention of deactivation.

Arguments:

can_deactivate_untargeted

Overridable proc called by try_deactivate() to make sure that deactivating won't result in a runtime in case of the power targeting the owner with them not existing. The equivalent of can_activate_untargeted().

clear_duration_timer

Clears the last active timer (usually the first in the list). If called before it expires, this immediately makes the duration_timer expire without calling the relevant proc.

cooldown_expire

Overridable proc called by the cooldown timer to handle cooldown expiring. Has no behaviour besides making the action visibly available again.

deactivate

Cancels the effects of the previously activated power.

Handles all logic for deactivating the power, including playing the deactivation sound, sending relevant signals, and starting the cooldown. If directly called rather than as a result of duration_expire, this also deletes the relevant duration timer. Still called if duration_length is 0.

Arguments:

do_activate_sound

Overridable proc handling the sound played to the owner only when using powers.

do_caster_notification

Overridable proc handling the message sent to the user when activating the power.

do_cooldown

Overridable proc handling the power's cooldown, which is a timer that triggers the cooldown_expire proc when it ends, and is saved in cooldown_timer. This is called by both activate() and deactivate(), but it only actually starts the cooldown in deactivate() unless multi_activate is TRUE. The cooldown_override variable stops this from being triggered by activate() and deactivate() and allows for extra modular behaviour. Cooldowns can manually be started by calling try_deactivate(), then deltimer() and starting a new cooldown timer with your own length.

Arguments:

do_duration

Overridable proc handling the power's duration, which is a timer that triggers the duration_expire proc when it ends, and is saved in duration_timers then deleted and cut when it ends. The duration_override variable stops this from being triggered by activate() and allows for extra modular behaviour. Duration expiring can be done manually by calling try_deactivate(direct = TRUE).

do_effect_sound

Overridable proc handling the sound caused by the power's effects, audible to everyone around it.

do_logging

Overridable proc handling the combat log created by using this power.

do_masquerade_violation

Overridable proc handling Masquerade violations as a result of using this power amongst NPCs.

do_refresh_checks

Overridable proc that allows for extra modular code in refreshing behaviour. Can do custom checks to see if activation proceeds or not (must give its own feedback!) or can hijack the refresh proc for its own behaviour.

duration_expire

Overridable proc called by the duration timer to handle duration expiring. Will refresh if toggled, or deactivate otherwise after deleting the timer calling it.

get_cooldown

Returns the time left the cooldown timer, or 0 if there is none. Returning 0 means not on cooldown.

get_duration

Returns the highest time left on any duration timers, or 0 if there are none. Returning 0 means not active.

post_gain

Overridable proc that allows for code to affect the power's owner when it is gained. Triggered by parent /datum/discipline/post_gain().

post_loss

Overridable proc that allows for code to affect the power's owner when it is lost / deleted. Triggered by parent /datum/discipline/post_loss().

pre_activation

Spends necessary resources (vitae) and makes sure activation is valid before fully activating the power.

The intermediary between can_activate() and activate(), this proc spends resources, sends signals, checks an overridable proc to see if it should continue or not, then fully activates the power. This can only fail if an override of pre_activation_checks() or a signal handler forces it to. This is useful for code that should trigger after activation is initiated, but before the effects (probably) start.

Arguments:

pre_activation_checks

An overridable proc that allows for custom pre_activation() behaviour.

This is meant to be overridden by powers to allow for extra checks on activation (eg. Social vs. Mentality for mental disciplines), to delay activation with a do_after() (eg. Valeren 5 taking 10 seconds), or possibly to hijack the pre_activation() proc by returning FALSE and using its own logic instead (like activating on several targets in an AoE rather than on one). Don't be fooled by the name, this is not just for checks.

Arguments:

refresh

Handles refreshing toggled powers on a loop, spending necessary resources and restarting the duration timer if it can proceed. If it can't proceed, it directly deactivates the power.

Arguments:

spend_resources

Overridable proc handling the spending of resources (vitae/blood) when casting the power. Returns TRUE if successfully spent, returns FALSE otherwise.

try_activate

Checks if activation is possible through can_activate(), then calls pre_activation() if it is. Returns if activation successfully begun or not.

Arguments:

try_deactivate

Checks if the power can_deactivate() and deactivate()s if it can. Also sends feedback the user if they successfully manually cancel it. The deactivation equivalent of try_activate().

Arguments:

was_hostile_usage

Overridable proc handling how the power aggravates NPCs it's used on.