mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user