discipline_power 
Vars | |
| 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 |
Procs | |
| activate | Triggers all the effects of the power being fully activated. |
| can_activate | Activation requirement checking proc that determines if a given target is valid while also checking can_activate_untargeted(). |
| can_activate_untargeted | Returns if this power can currently be activated without accounting for target restrictions. |
| 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. |
| 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. |
| 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. |
| 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. |
| pre_activation_checks | An overridable proc that allows for custom pre_activation() behaviour. |
| 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. |
| 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. |
| 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(). |
| was_hostile_usage | Overridable 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:
- target - what the targeted Discipline (null otherwise) is being used on.
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:
- target - what the targeted Discipline (null otherwise) is being used on.
- alert - if this is being checked by the user and should give feedback on why it can't activate.
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:
- alert - if this is being checked by the user and should give feedback on why it can't activate.
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:
- target - what the targeted Discipline (null otherwise) is being used on.
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:
- target - what the targeted Discipline (null otherwise) is being used on.
- direct - if this is being directly called instead of by duration_expire, and should delete the timer.
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:
- on_activation - if this proc is being called by activate(), which will stop it from triggering unless multi_activate is true.
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:
- target - what the targeted Discipline (null otherwise) is being used on.
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:
- target - what the targeted Discipline (null otherwise) is being used on.
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:
- target - what the targeted Discipline (null otherwise) is being used on.
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:
- target - what the targeted Discipline (null otherwise) is being used on.
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:
- target - what the targeted Discipline (null otherwise) is being used on.
- direct - if the power is being directly deactivated or as a result of duration_expire.
- alert - if the caster is manually deactivating and feedback should be sent on success.
was_hostile_usage
Overridable proc handling how the power aggravates NPCs it's used on.