Merge pull request #11285 from Fox-McCloud/elecrocution-refactor

Refactors Electrocution
This commit is contained in:
variableundefined
2019-04-16 19:47:42 +08:00
committed by GitHub
31 changed files with 158 additions and 143 deletions
@@ -1171,6 +1171,6 @@
shock_timer++
if(shock_timer >= rand(5,30)) //Random shocks are wildly unpredictable
shock_timer = 0
M.electrocute_act(rand(5,20), "Teslium in their body", 1, 1) //Override because it's caused from INSIDE of you
M.electrocute_act(rand(5, 20), "Teslium in their body", 1, TRUE) //Override because it's caused from INSIDE of you
playsound(M, "sparks", 50, 1)
return ..()
@@ -376,9 +376,9 @@
/datum/chemical_reaction/shock_explosion/on_reaction(datum/reagents/holder, created_volume)
var/turf/T = get_turf(holder.my_atom)
for(var/mob/living/carbon/C in view(min(8, round(created_volume * 2)), T))
C.Beam(T,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5) //What? Why are we beaming from the mob to the turf? Turf to mob generates really odd results.
C.electrocute_act(3.5, "electrical blast")
for(var/mob/living/L in view(min(8, round(created_volume * 2)), T))
L.Beam(T, icon_state = "lightning[rand(1, 12)]", icon = 'icons/effects/effects.dmi', time = 5) //What? Why are we beaming from the mob to the turf? Turf to mob generates really odd results.
L.electrocute_act(3.5, "electrical blast")
holder.del_reagent("teslium") //Clear all remaining Teslium and Uranium, but leave all other reagents untouched.
holder.del_reagent("uranium")