Minor shock() refactor (#95204)

## About The Pull Request

`shock` was copy pasted across a bunch of base types
I needed the behavior unified and it was fairly trivial to do 
So now we have `/obj/proc/shock` which all the old implementations call 

## Changelog

🆑 Melbert
refactor: Made some minor changes to how things like airlocks, vendors,
and autolathes shock you. Report any wierdness with that
/🆑
This commit is contained in:
MrMelbert
2026-02-24 21:12:59 -05:00
committed by GitHub
parent f34bfa1206
commit 4fe16acd0b
22 changed files with 108 additions and 170 deletions
+9 -16
View File
@@ -322,28 +322,21 @@
update_appearance()
return TRUE
// shock user with probability prb (if all connections & power are working)
// returns 1 if shocked, 0 otherwise
/obj/structure/grille/proc/shock(mob/user, prb)
/obj/structure/grille/shock(mob/living/shocking, chance = 100, shock_source, siemens_coeff = 1)
if(!anchored || broken) // anchored/broken grilles are never connected
return FALSE
if(!prob(prb))
var/turf/grill_loc = get_turf(src)
if(grill_loc.overfloor_placed)//cant be a floor in the way!
return FALSE
if(!in_range(src, user))//To prevent TK and mech users from getting shocked
var/obj/structure/cable/grill_cable = grill_loc.get_cable_node()
if(isnull(grill_cable))
return FALSE
var/turf/T = get_turf(src)
if(T.overfloor_placed)//cant be a floor in the way!
shock_source = grill_cable
if(!..())
return FALSE
var/obj/structure/cable/cable_node = T.get_cable_node()
if(isnull(cable_node))
return FALSE
if(!electrocute_mob(user, cable_node, src, 1, TRUE))
return FALSE
if(prob(50)) // Shocking hurts the grille (to weaken monkey powersinks)
// Shocking hurts the grille (to weaken monkey powersinks)
if(prob(50))
take_damage(1, BURN, FIRE, sound_effect = FALSE)
do_sparks(3, TRUE, src)
return TRUE
/obj/structure/grille/should_atmos_process(datum/gas_mixture/air, exposed_temperature)