mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 08:36:00 +01:00
851c5a5df9
## About The Pull Request This makes (almost?) all traits given by status effects use `TRAIT_STATUS_EFFECT(id)` as their source, rather than the previous mix of `id`, `type`, `REF(src)`, or some bespoke thing. ## Why It's Good For The Game Consistency is good. ## Changelog No user-facing changes
24 lines
704 B
Plaintext
24 lines
704 B
Plaintext
/datum/status_effect/silenced
|
|
id = "silent"
|
|
alert_type = null
|
|
remove_on_fullheal = TRUE
|
|
|
|
/datum/status_effect/silenced/on_creation(mob/living/new_owner, duration = 10 SECONDS)
|
|
src.duration = duration
|
|
return ..()
|
|
|
|
/datum/status_effect/silenced/on_apply()
|
|
RegisterSignal(owner, COMSIG_LIVING_DEATH, PROC_REF(clear_silence))
|
|
ADD_TRAIT(owner, TRAIT_MUTE, TRAIT_STATUS_EFFECT(id))
|
|
return TRUE
|
|
|
|
/datum/status_effect/silenced/on_remove()
|
|
UnregisterSignal(owner, COMSIG_LIVING_DEATH)
|
|
REMOVE_TRAIT(owner, TRAIT_MUTE, TRAIT_STATUS_EFFECT(id))
|
|
|
|
/// Signal proc that clears any silence we have (self-deletes).
|
|
/datum/status_effect/silenced/proc/clear_silence(mob/living/source)
|
|
SIGNAL_HANDLER
|
|
|
|
qdel(src)
|