small talk and railings

This commit is contained in:
BongaTheProto
2022-05-06 21:43:14 -05:00
parent ec0583efc2
commit ff56882078
7 changed files with 40 additions and 13 deletions
@@ -0,0 +1,17 @@
//For small players and such
/datum/element/smalltalk
element_flags = ELEMENT_DETACH
/datum/element/smalltalk/Attach(datum/target, force = FALSE)
. = ..()
if(!(isliving(target) || (force && istype(target, /atom/movable))))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOB_SAY, .proc/handle_speech)
/datum/element/smalltalk/Detach(datum/source, force)
. = ..()
UnregisterSignal(source, COMSIG_MOB_SAY)
/datum/element/smalltalk/proc/handle_speech(datum/source, list/speech_args)
speech_args[SPEECH_SPANS] |= SPAN_SMALL