From d6b38aa9ff8b88ff78994beec00447eee7b213e3 Mon Sep 17 00:00:00 2001 From: Contrabang <91113370+Contrabang@users.noreply.github.com> Date: Thu, 18 Aug 2022 08:49:52 -0400 Subject: [PATCH] Makes defib shocks dangerous (#18809) * wow this is funny * remove prob at Hal suggestion * lewcc suggestion * hal review --- code/game/objects/items/weapons/defib.dm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index 5ee94588ffd..f048e5ead22 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -470,7 +470,14 @@ H.emote("gasp") if(tplus > tloss) H.setBrainLoss( max(0, min(99, ((tlimit - tplus) / tlimit * 100)))) + SEND_SIGNAL(H, COMSIG_LIVING_MINOR_SHOCK, 100) + if(ishuman(H.pulledby)) // for some reason, pulledby isnt a list despite it being possible to be pulled by multiple people + excess_shock(user, H, H.pulledby) + for(var/obj/item/grab/G in H.grabbed_by) + if(ishuman(G.assailant)) + excess_shock(user, H, G.assailant) + H.med_hud_set_health() H.med_hud_set_status() defib.deductcharge(revivecost) @@ -502,6 +509,22 @@ busy = FALSE update_icon(UPDATE_ICON_STATE) +/* + * user = the person using the defib + * origin = person being revived + * affecting = person being shocked with excess energy from the defib +*/ +/obj/item/twohanded/shockpaddles/proc/excess_shock(mob/user, mob/living/carbon/human/origin, mob/living/carbon/human/affecting) + if(user == affecting) + return + + if(electrocute_mob(affecting, defib.cell, origin)) // shock anyone touching them >:) + var/obj/item/organ/internal/heart/HE = affecting.get_organ_slot("heart") + if(HE.parent_organ == "chest" && affecting.has_both_hands()) // making sure the shock will go through their heart (drask hearts are in their head), and that they have both arms so the shock can cross their heart inside their chest + affecting.visible_message("[affecting]'s entire body shakes as a shock travels up their arm!", \ + "You feel a powerful shock travel up your [affecting.hand ? affecting.get_organ("l_arm") : affecting.get_organ("r_arm")] and back down your [affecting.hand ? affecting.get_organ("r_arm") : affecting.get_organ("l_arm")]!") + affecting.set_heartattack(TRUE) + /obj/item/borg_defib name = "defibrillator paddles" desc = "A pair of paddles with flat metal surfaces that are used to deliver powerful electric shocks."