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
+6 -6
View File
@@ -231,7 +231,7 @@
return ..()
/obj/item/mod/control/wrench_act(mob/living/user, obj/item/wrench)
if(seconds_electrified && get_charge() && shock(user))
if(seconds_electrified && get_charge() && shock(user, 100))
return ITEM_INTERACT_BLOCKING
if(open)
if(!core)
@@ -541,12 +541,12 @@
return
picked_module.on_select()
/obj/item/mod/control/proc/shock(mob/living/user)
if(!istype(user) || get_charge() < 1)
/obj/item/mod/control/shock(mob/living/shocking, chance, shock_source, siemens_coeff)
if(get_charge() < 1)
return FALSE
do_sparks(5, TRUE, src)
var/check_range = TRUE
return electrocute_mob(user, get_charge_source(), src, 0.7, check_range)
if(isnull(siemens_coeff))
siemens_coeff = 0.7
return ..()
/obj/item/mod/control/proc/install(obj/item/mod/module/new_module, mob/user)
for(var/obj/item/mod/module/old_module as anything in modules)
+1 -1
View File
@@ -227,7 +227,7 @@
/obj/item/mod/core/standard/proc/on_attack_hand(datum/source, mob/living/user)
SIGNAL_HANDLER
if(mod.seconds_electrified && charge_amount() && mod.shock(user))
if(mod.seconds_electrified && charge_amount() && mod.shock(user, 100))
return COMPONENT_CANCEL_ATTACK_CHAIN
if(mod.open && mod.loc == user)
INVOKE_ASYNC(src, PROC_REF(mod_uninstall_cell), user)