diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index 22f293aedfc..3a481521206 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -121,6 +121,69 @@ security_lock = TRUE locked = FALSE +/obj/item/clothing/mask/muzzle/safety/shock + name = "shock muzzle" + desc = "A muzzle designed to prevent biting. This one is fitted with a behavior correction system." + var/obj/item/assembly/trigger = null + origin_tech = "materials=1;engineering=1" + +/obj/item/clothing/mask/muzzle/safety/shock/attackby(obj/item/W, mob/user, params) + if(isscrewdriver(W)) + to_chat(user, "You disassemble [src].") + trigger.forceMove(get_turf(user)) + trigger.master = null + trigger.holder = null + trigger = null + else if(trigger) + to_chat(user, "Something is already attached to [src].") + else if(istype(W, /obj/item/assembly/signaler) || istype(W, /obj/item/assembly/voice)) + user.drop_item() + trigger = W + trigger.forceMove(src) + trigger.master = src + trigger.holder = src + to_chat(user, "You attach the [W] to [src].") + else + return ..() + + +/obj/item/clothing/mask/muzzle/safety/shock/equipped(obj/item/clothing/C) + if(istype(C)) + if(isliving(C.loc)) + return C.loc + else if(isliving(loc)) + return loc + return FALSE + +/obj/item/clothing/mask/muzzle/safety/shock/proc/process_activation(var/obj/D, var/normal = 1, var/special = 1) + visible_message("[bicon(src)] *beep* *beep*", "*beep* *beep*") + if(equipped(loc)) + var/mob/M = equipped(loc) + to_chat(M, "You feel a sharp shock!") + var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread + s.set_up(3, 1, M) + s.start() + + M.Weaken(5) + if(ishuman(M)) + M.Stuttering(1) + M.Jitter(20) + return + +/obj/item/clothing/mask/muzzle/safety/shock/HasProximity(atom/movable/AM as mob|obj) + if(trigger) + trigger.HasProximity(AM) + + +/obj/item/clothing/mask/muzzle/safety/shock/hear_talk(mob/living/M as mob, msg) + if(trigger) + trigger.hear_talk(M, msg) + +/obj/item/clothing/mask/muzzle/safety/shock/hear_message(mob/living/M as mob, msg) + if(trigger) + trigger.hear_message(M, msg) + + /obj/item/clothing/mask/surgical name = "sterile mask" diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 623f5b6b353..577aa408383 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -31,8 +31,13 @@ to_chat(usr, "You are unable to emote.") return - var/muzzled = istype(src.wear_mask, /obj/item/clothing/mask/muzzle) - if(m_type == 2 && muzzled) return + var/muzzled = is_muzzled() + if(muzzled) + var/obj/item/clothing/mask/muzzle/M = wear_mask + if(M.mute) + return //Not all muzzles block sound + if(m_type == 2 && !can_speak()) + return var/input if(!message) diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index c1eb8641820..6f29de90a17 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -10,6 +10,10 @@ act = copytext(act, 1, t1) var/muzzled = is_muzzled() + if(muzzled) + var/obj/item/clothing/mask/muzzle/M = wear_mask + if(!M.mute) + muzzled = 0 //Not all muzzles block sound if(!can_speak()) muzzled = 1 //var/m_type = 1 diff --git a/code/modules/mob/living/update_status.dm b/code/modules/mob/living/update_status.dm index f7498392c02..b083832919d 100644 --- a/code/modules/mob/living/update_status.dm +++ b/code/modules/mob/living/update_status.dm @@ -49,7 +49,7 @@ // Whether the mob is capable of talking /mob/living/can_speak() - return !(silent || (disabilities & MUTE) || is_muzzled()) + return !(silent || (disabilities & MUTE)) // Whether the mob is capable of standing or not /mob/living/proc/can_stand()