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
+5 -14
View File
@@ -500,21 +500,12 @@ GLOBAL_VAR_INIT(fax_autoprinting, FALSE)
return TRUE
return FALSE
/**
* Attempts to shock the passed user, returns true if they are shocked.
*
* Arguments:
* * user - the user to shock
* * chance - probability the shock happens
*/
/obj/machinery/fax/proc/shock(mob/living/user, chance)
if(!istype(user) || machine_stat & (BROKEN|NOPOWER))
/obj/machinery/fax/shock(mob/living/shocking, chance = 100, shock_source, siemens_coeff = 1)
if( machine_stat & (BROKEN|NOPOWER))
return FALSE
if(!prob(chance))
return FALSE
do_sparks(5, TRUE, src)
var/check_range = TRUE
return electrocute_mob(user, get_area(src), src, 0.7, check_range)
if(isnull(siemens_coeff))
siemens_coeff = 0.7
return ..()
/obj/machinery/fax/add_context(atom/source, list/context, obj/item/held_item, mob/user)