Tesla coils and grounding rods actually shock buckled mobs. (#36437)

* coils and grounding rods shock buckled things

* general tesla buckle shock proc
This commit is contained in:
RandomMarine
2018-03-17 15:48:56 +02:00
committed by vuonojenmustaturska
parent b460a8e192
commit 093cfdfe45
2 changed files with 13 additions and 1 deletions
+8
View File
@@ -227,6 +227,14 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
tesla_zap(src, 3, power_bounced)
addtimer(CALLBACK(src, .proc/reset_shocked), 10)
//The surgeon general warns that being buckled to certain objects recieving powerful shocks is greatly hazardous to your health
//Only tesla coils and grounding rods currently call this because mobs are already targeted over all other objects, but this might be useful for more things later.
/obj/proc/tesla_buckle_check(var/strength)
if(has_buckled_mobs())
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
buckled_mob.electrocute_act((CLAMP(round(strength/400), 10, 90) + rand(-5, 5)), src, tesla_shock = 1)
/obj/proc/reset_shocked()
obj_flags &= ~BEING_SHOCKED
+5 -1
View File
@@ -89,6 +89,7 @@
if(istype(linked_techweb))
linked_techweb.research_points += min(power_produced, 1) // x4 coils = ~240/m point bonus for R&D
addtimer(CALLBACK(src, .proc/reset_shocked), 10)
tesla_buckle_check(power)
else
..()
@@ -102,6 +103,7 @@
add_load(power)
playsound(src.loc, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = 5)
tesla_zap(src, 10, power/(coeff/2))
tesla_buckle_check(power/(coeff/2))
// Tesla R&D researcher
/obj/machinery/power/tesla_coil/research
@@ -122,6 +124,7 @@
if(istype(linked_techweb))
linked_techweb.research_points += min(power_produced, 3) // x4 coils with a pulse per second or so = ~720/m point bonus for R&D
addtimer(CALLBACK(src, .proc/reset_shocked), 10)
tesla_buckle_check(power)
else
..()
@@ -185,5 +188,6 @@
/obj/machinery/power/grounding_rod/tesla_act(var/power)
if(anchored && !panel_open)
flick("grounding_rodhit", src)
tesla_buckle_check(power)
else
..()
..()