Status effect absorption 
Applies temporal or permanent immunities for certain status effects, with additional info tied to it, such as showing a message on trigger / examine, or only blocking a limited amount.
Currently works with incapacitating effects: stun, weaken, knockdown, immobile, paralyze, sleep. Also generic effects are accepted, like stamina crit (look at [/mob/living/carbon/proc/enter_stamcrit()])
Apply this via /mob/living/proc/add_status_effect_absorption. If you do not supply a duration, remove this via /mob/living/proc/remove_status_effect_absorption.
Vars | |
| delete_after_passing_max | If TRUE, after passing the max seconds of effect blocked, we will delete ourself.
If FALSE, we will instead recharge after some time. |
|---|---|
| effect2flag | Static associative list of all generic disabling effects we can work with. In a form: key = effect_type, value = bitflag check from [/proc/check_incapacitating_immunity()]. |
| effect_type | Type of the effect we are absorbing |
| examine_message | Message shown on anyone examining the owner. |
| max_seconds_of_effect_blocked | The max number of seconds we can block before self-deleting. |
| priority | The priority of the effect absorption. Used so that multiple sources will not trigger at once. This number is arbitrary but try to keep in sane / in line with other sources that exist. |
| recharge_time | If [delete_after_passing_max] is FALSE, this is how long we will wait before recharging. |
| seconds_of_effect_absorbed | How many total seconds of effect that have been blocked. |
| self_message | The message shown to the owner when the effect triggers. |
| shown_message | The message shown via visible message to all nearby mobs when the effect triggers. |
| source | The string key sourcer of the absorption, used for logging |
| status_effect_signals | Static associative list of all status effects we can work with. In a form: key = effect_type, value = signal sent from the corresponding proc. |
Procs | |
| absorb_effect | Absorb a number of seconds of effect. If we hit the max amount of absorption, we will qdel ourself in this proc. |
| can_absorb_effect | Simply checks if the owner of the effect is in a valid state to absorb effects. |
| recharge_absorption | Used in callbacks to "recharge" the effect after passing the max seconds of blocked time. |
| try_absorb_generic_effect | Signal proc for COMSIG_LIVING_GENERIC_INCAPACITATE_CHECK. |
| try_absorb_status_effect | Signal proc for all the signals in var/static/list/status_effect_signals. |
Var Details
delete_after_passing_max 
If TRUE, after passing the max seconds of effect blocked, we will delete ourself.
If FALSE, we will instead recharge after some time.
effect2flag 
Static associative list of all generic disabling effects we can work with. In a form: key = effect_type, value = bitflag check from [/proc/check_incapacitating_immunity()].
effect_type 
Type of the effect we are absorbing
examine_message 
Message shown on anyone examining the owner.
max_seconds_of_effect_blocked 
The max number of seconds we can block before self-deleting.
priority 
The priority of the effect absorption. Used so that multiple sources will not trigger at once. This number is arbitrary but try to keep in sane / in line with other sources that exist.
recharge_time 
If [delete_after_passing_max] is FALSE, this is how long we will wait before recharging.
seconds_of_effect_absorbed 
How many total seconds of effect that have been blocked.
self_message 
The message shown to the owner when the effect triggers.
shown_message 
The message shown via visible message to all nearby mobs when the effect triggers.
source 
The string key sourcer of the absorption, used for logging
status_effect_signals 
Static associative list of all status effects we can work with. In a form: key = effect_type, value = signal sent from the corresponding proc.
Proc Details
absorb_effect
Absorb a number of seconds of effect. If we hit the max amount of absorption, we will qdel ourself in this proc.
- amount - this is the number of deciseconds being absorbed at once.
Returns TRUE on successful absorption, FALSE otherwise.
can_absorb_effect
Simply checks if the owner of the effect is in a valid state to absorb effects.
recharge_absorption
Used in callbacks to "recharge" the effect after passing the max seconds of blocked time.
try_absorb_generic_effect
Signal proc for COMSIG_LIVING_GENERIC_INCAPACITATE_CHECK.
Whenever a special incapacitating non-status effect is applied (like stamina crit) this proc will try to absorb it. Pretty similar to the proc above
try_absorb_status_effect
Signal proc for all the signals in var/static/list/status_effect_signals.
When effect we are protecting from is applied, we will try to absorb a number of seconds from it, and return [COMPONENT_NO_EFFECT] if we succeed.