Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions code/datums/actions/mobs/sign_language.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,20 @@
if(!owner)
return

RegisterSignal(grant_to, SIGNAL_REMOVETRAIT(TRAIT_MUTE), PROC_REF(on_unmuted))
RegisterSignal(grant_to, SIGNAL_ADDTRAIT(TRAIT_MUTE), PROC_REF(on_muted))

if (HAS_TRAIT(grant_to, TRAIT_MUTE))
// Convenience. Mute Carbons can only speak with sign language.
if (!active)
Activate()
else
// Convenience. Only display action if the Carbon isn't mute.
show_action()
show_action()

/datum/action/innate/sign_language/Remove(mob/living/carbon/grant_to)
. = ..()
UnregisterSignal(grant_to, list(
SIGNAL_ADDTRAIT(TRAIT_SIGN_LANG),
SIGNAL_REMOVETRAIT(TRAIT_SIGN_LANG),
SIGNAL_ADDTRAIT(TRAIT_MUTE),
SIGNAL_REMOVETRAIT(TRAIT_MUTE)
))
REMOVE_TRAIT(grant_to, TRAIT_SIGN_LANG, TRAIT_GENERIC)

Expand Down Expand Up @@ -78,14 +74,6 @@
/datum/action/innate/sign_language/proc/on_muted()
SIGNAL_HANDLER

hide_action()
// Enable sign language if the Carbon knows it and just gained TRAIT_MUTE
if (!HAS_TRAIT(owner, TRAIT_SIGN_LANG))
Activate()

/// Signal handler for SIGNAL_REMOVETRAIT(TRAIT_MUTE)
/// Re-shows the action if the signing Carbon loses TRAIT_MUTE.
/datum/action/innate/sign_language/proc/on_unmuted()
SIGNAL_HANDLER

show_action()
Loading