/tg/ Station 13 - Modules - TypesVar Details - Proc Details

Pain controller

Attatched to a mob, this datum tracks all the pain values on all their bodyparts and handles updating them. This datum processes on alive humans every 2 seconds.

Vars

base_pain_decayThe base amount of pain decay received.
natural_pain_decayNatural amount of decay given to each limb per 5 ticks of process, increases over time
pain_modifierModifier that determines how much of the "pain" the mob actually feels.]
pain_modsLazy Assoc list [id] to [modifier], all our pain modifiers affecting our final mod
parentThe parent mob we're tracking.
time_since_last_pain_lossCooldown to track the last time we lost pain.
time_since_last_pain_messageCooldown to track last time we sent a pain message.
traumatic_shockAmount of traumatic shock building up from higher levels of pain

Procs

add_bodypartAdd a bodypart to be tracked. Also causes pain if the limb was added non-'special'.
add_damage_painHooks into [apply_damage] to apply pain to the parent based on incoming damage.
add_wound_painGaining a wound applies a flat amount of pain based on severity.
adjust_bodypart_min_painSet the minimum amount of pain in all [def_zones] by [amount].
adjust_bodypart_painAdjust the amount of pain in all [def_zones] provided by [amount] (multiplied by the [pain_modifier] if positive).
adjust_traumatic_shockAdjusts the progress of pain shock on the current mob.
do_pain_emoteRun a pain related emote, if a few checks are successful.
do_pain_messageRun a pain related message, if a few checks are successful.
get_total_painGet the total pain of all bodyparts.
handle_messageAdds a custom stammer to people under the effects of pain.
on_analyzedSignal proc for COMSIG_LIVING_HEALTHSCAN Reports how much pain [parent] is sustaining to [user].
on_mob_fired_gunAffect accuracy of fired guns while in pain.
on_pain_gainCalled when pain is gained to apply side effects. Calls [affected_part]'s [on_gain_pain_effects] proc with arguments [amount].
on_pain_lossCalled when pain is lost, if the mob did not lose pain in the last 60 seconds. Calls [affected_part]'s [on_lose_pain_effects] proc with arguments [amount].
on_parent_statchanceDetermines if we should be processing or not.
refresh_pain_attributesApply or remove pain various modifiers from pain (mood, action speed, movement speed) based on the [average_pain].
remove_all_painRemove all pain, pain paralysis, side effects, etc. from our mob after we're fully healed by something (like an adminheal)
remove_bodypartRemoves a limb from being tracked. Also causes pain if the limb was removed non-'special'.
remove_wound_painRemoves pain when a wound is healed.
revivedWhen we are revived, reduced shock & pain
set_pain_modifierAdd a pain modifier and update our overall modifier.
unregister_pain_signalsUnregister all of our signals from our parent when we're done, if we have signals to unregister.
unset_pain_modifierRemove a pain modifier and update our overall modifier.
update_pain_modifierUpdate our overall pain modifier. The pain modifier is multiplicative based on all the pain modifiers we have.

Var Details

base_pain_decay

The base amount of pain decay received.

natural_pain_decay

Natural amount of decay given to each limb per 5 ticks of process, increases over time

pain_modifier

Modifier that determines how much of the "pain" the mob actually feels.]

Affects:

Below 0.5, a mob is treated as "numb", and will outright no longer experience pain feedback messages or effects (but it'll still accumulate!)

pain_mods

Lazy Assoc list [id] to [modifier], all our pain modifiers affecting our final mod

parent

The parent mob we're tracking.

time_since_last_pain_loss

Cooldown to track the last time we lost pain.

time_since_last_pain_message

Cooldown to track last time we sent a pain message.

traumatic_shock

Amount of traumatic shock building up from higher levels of pain

Proc Details

add_bodypart

Add a bodypart to be tracked. Also causes pain if the limb was added non-'special'.

add_damage_pain

Hooks into [apply_damage] to apply pain to the parent based on incoming damage.

add_wound_pain

Gaining a wound applies a flat amount of pain based on severity.

adjust_bodypart_min_pain

Set the minimum amount of pain in all [def_zones] by [amount].

adjust_bodypart_pain

Adjust the amount of pain in all [def_zones] provided by [amount] (multiplied by the [pain_modifier] if positive).

This is the bread and butter way to apply pain to a mob.

Returns the amount of pain caused, or 0 if no pain was caused.

adjust_traumatic_shock

Adjusts the progress of pain shock on the current mob.

do_pain_emote

Run a pain related emote, if a few checks are successful.

Comes with defaults so you can just call it straight up to do a random emote

Returns TRUE if successful. Returns FALSE if we failed to send an emote.

do_pain_message

Run a pain related message, if a few checks are successful.

Returns TRUE if successful. Returns FALSE if we failed to send a message, even if painless_message was provided and sent.

get_total_pain

Get the total pain of all bodyparts.

handle_message

Adds a custom stammer to people under the effects of pain.

on_analyzed

Signal proc for COMSIG_LIVING_HEALTHSCAN Reports how much pain [parent] is sustaining to [user].

Note, this report is relatively vague intentionally - rather than sending a detailed report of which bodyparts are in pain and how much, the patient is encouraged to elaborate on which bodyparts hurt the most, and how much they hurt.

(To encourage a bit more interaction between the doctors and their patients)

on_mob_fired_gun

Affect accuracy of fired guns while in pain.

on_pain_gain

Called when pain is gained to apply side effects. Calls [affected_part]'s [on_gain_pain_effects] proc with arguments [amount].

on_pain_loss

Called when pain is lost, if the mob did not lose pain in the last 60 seconds. Calls [affected_part]'s [on_lose_pain_effects] proc with arguments [amount].

on_parent_statchance

Determines if we should be processing or not.

refresh_pain_attributes

Apply or remove pain various modifiers from pain (mood, action speed, movement speed) based on the [average_pain].

remove_all_pain

Remove all pain, pain paralysis, side effects, etc. from our mob after we're fully healed by something (like an adminheal)

remove_bodypart

Removes a limb from being tracked. Also causes pain if the limb was removed non-'special'.

remove_wound_pain

Removes pain when a wound is healed.

revived

When we are revived, reduced shock & pain

set_pain_modifier

Add a pain modifier and update our overall modifier.

Returns TRUE if our pain mod actually changed

unregister_pain_signals

Unregister all of our signals from our parent when we're done, if we have signals to unregister.

unset_pain_modifier

Remove a pain modifier and update our overall modifier.

Returns TRUE if our pain mod actually changed

update_pain_modifier

Update our overall pain modifier. The pain modifier is multiplicative based on all the pain modifiers we have.

Returns TRUE if our pain modifier was changed after update, FALSE if it remained the same