Ports "Cleans up saycode by removing random hook stubs and using a signal where relevant"

This commit is contained in:
Ghommie
2019-07-09 07:58:22 +02:00
parent d61732472c
commit 490ae9daf2
63 changed files with 523 additions and 452 deletions
@@ -234,11 +234,18 @@
w_class = WEIGHT_CLASS_SMALL
actions_types = list(/datum/action/item_action/instrument)
/obj/item/instrument/harmonica/speechModification(message)
/obj/item/instrument/harmonica/proc/handle_speech(datum/source, list/speech_args)
if(song.playing && ismob(loc))
to_chat(loc, "<span class='warning'>You stop playing the harmonica to talk...</span>")
song.playing = FALSE
return message
/obj/item/instrument/harmonica/equipped(mob/M, slot)
. = ..()
RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech)
/obj/item/instrument/harmonica/dropped(mob/M)
. = ..()
UnregisterSignal(M, COMSIG_MOB_SAY)
/obj/item/instrument/bikehorn
name = "gilded bike horn"
+18 -6
View File
@@ -17,13 +17,25 @@
user.say("AAAAAAAAAAAARGHHHHH", forced="megaphone suicide")//he must have died while coding this
return OXYLOSS
/obj/item/megaphone/get_held_item_speechspans(mob/living/carbon/user)
if(spamcheck > world.time)
to_chat(user, "<span class='warning'>\The [src] needs to recharge!</span>")
/obj/item/megaphone/equipped(mob/M, slot)
. = ..()
if (slot == SLOT_HANDS)
RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech)
else
playsound(loc, 'sound/items/megaphone.ogg', 100, 0, 1)
spamcheck = world.time + 50
return voicespan
UnregisterSignal(M, COMSIG_MOB_SAY)
/obj/item/megaphone/dropped(mob/M)
. = ..()
UnregisterSignal(M, COMSIG_MOB_SAY)
/obj/item/megaphone/proc/handle_speech(mob/living/carbon/user, list/speech_args)
if (user.get_active_held_item() == src)
if(spamcheck > world.time)
to_chat(user, "<span class='warning'>\The [src] needs to recharge!</span>")
else
playsound(loc, 'sound/items/megaphone.ogg', 100, 0, 1)
spamcheck = world.time + 50
speech_args[SPEECH_SPANS] |= voicespan
/obj/item/megaphone/emag_act(mob/user)
if(obj_flags & EMAGGED)
@@ -189,7 +189,7 @@
/obj/item/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language)
if(!spans)
spans = M.get_spans()
spans = list(M.speech_span)
if(!language)
language = M.get_default_language()
INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans.Copy(), language)
+1 -3
View File
@@ -282,9 +282,7 @@
var/obj/item/clothing/mask/horsehead/magichead = new /obj/item/clothing/mask/horsehead
magichead.item_flags |= NODROP //curses!
magichead.flags_inv &= ~HIDEFACE //so you can still see their face
magichead.voicechange = TRUE //NEEEEIIGHH
if(!user.dropItemToGround(user.wear_mask))
qdel(user.wear_mask)
user.dropItemToGround(user.wear_mask, TRUE)
user.equip_to_slot_if_possible(magichead, SLOT_WEAR_MASK, TRUE, TRUE)
qdel(src)
else
+2 -3
View File
@@ -6,10 +6,9 @@
w_class = WEIGHT_CLASS_TINY
var/taste_sensitivity = 15
speech_span = null
/obj/item/taster/get_spans()
return list()
var/taste_sensitivity = 15
/obj/item/taster/afterattack(atom/O, mob/user, proximity)
. = ..()