Ports "Cleans up saycode by removing random hook stubs and using a signal where relevant"
This commit is contained in:
@@ -230,9 +230,6 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
research_msg += "."
|
||||
to_chat(user, research_msg.Join())
|
||||
|
||||
/obj/item/proc/speechModification(message) //for message modding by mask slot.
|
||||
return message
|
||||
|
||||
/obj/item/interact(mob/user)
|
||||
add_fingerprint(user)
|
||||
ui_interact(user)
|
||||
@@ -647,11 +644,6 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
else
|
||||
. = ""
|
||||
|
||||
|
||||
//when an item modify our speech spans when in our active hand. Override this to modify speech spans.
|
||||
/obj/item/proc/get_held_item_speechspans(mob/living/carbon/user)
|
||||
return
|
||||
|
||||
/obj/item/hitby(atom/movable/AM)
|
||||
return
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
. = ..()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/obj
|
||||
var/crit_fail = FALSE
|
||||
animate_movement = 2
|
||||
speech_span = SPAN_ROBOT
|
||||
var/obj_flags = CAN_BE_HIT
|
||||
var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT.
|
||||
|
||||
@@ -204,9 +205,6 @@
|
||||
if(!anchored || current_size >= STAGE_FIVE)
|
||||
step_towards(src,S)
|
||||
|
||||
/obj/get_spans()
|
||||
return ..() | SPAN_ROBOT
|
||||
|
||||
/obj/get_dumping_location(datum/component/storage/source,mob/user)
|
||||
return get_turf(src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user