Refactors Electrocution and Tesla Zapping (#15357)

* Refactors Electrocution and Tesla Zapping---Improves Supermatter and Tesla

* forgot this one

* fixes and styling

* last tidbits hopefully

* machine frames

* use flags

* styling
This commit is contained in:
Fox McCloud
2021-02-03 20:52:03 +00:00
committed by GitHub
parent 5608f36a4b
commit 8947e97f3b
50 changed files with 598 additions and 384 deletions
+1 -1
View File
@@ -168,7 +168,7 @@
/obj/effect/anomaly/flux/proc/mobShock(mob/living/M)
if(canshock && istype(M))
canshock = FALSE //Just so you don't instakill yourself if you slam into the anomaly five times in a second.
M.electrocute_act(shockdamage, "[name]", safety = TRUE)
M.electrocute_act(shockdamage, name, flags = SHOCK_NOGLOVES)
/obj/effect/anomaly/flux/detonate()
if(explosive)
-3
View File
@@ -69,9 +69,6 @@
/obj/effect/abstract/decompile_act(obj/item/matter_decompiler/C, mob/user)
return
/obj/effect/abstract/tesla_act(power)
return
/obj/effect/abstract/singularity_act()
return
+13 -4
View File
@@ -224,15 +224,24 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
SSfires.processing -= src
///Called when the obj is hit by a tesla bolt.
/obj/proc/tesla_act(power)
/obj/zap_act(power, zap_flags)
if(QDELETED(src))
return FALSE
being_shocked = TRUE
var/power_bounced = power * 0.5
tesla_zap(src, 3, power_bounced)
addtimer(CALLBACK(src, .proc/reset_shocked), 10)
addtimer(CALLBACK(src, .proc/reset_shocked), 1 SECONDS)
return power / 2
/obj/proc/reset_shocked()
being_shocked = FALSE
//The surgeon general warns that being buckled to certain objects receiving powerful shocks is greatly hazardous to your health
///Only tesla coils, vehicles, 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/zap_buckle_check(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, flags = SHOCK_TESLA)
//the obj is deconstructed into pieces, whether through careful disassembly or when destroyed.
/obj/proc/deconstruct(disassembled = TRUE)
SEND_SIGNAL(src, COMSIG_OBJ_DECONSTRUCT, disassembled)
+6
View File
@@ -166,3 +166,9 @@
/obj/structure/proc/prevents_buckled_mobs_attacking()
return FALSE
/obj/structure/zap_act(power, zap_flags)
if(zap_flags & ZAP_OBJ_DAMAGE)
take_damage(power / 8000, BURN, "energy")
power -= power / 2000 //walls take a lot out of ya
. = ..()
@@ -349,11 +349,6 @@
BD.attack_hand(usr)
open()
/obj/structure/closet/tesla_act(var/power)
..()
visible_message("<span class='danger'>[src] is blown apart by the bolt of electricity!</span>", "<span class='danger'>You hear a metallic screeching sound.</span>")
qdel(src)
/obj/structure/closet/get_remote_view_fullscreens(mob/user)
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
+1 -1
View File
@@ -254,7 +254,7 @@
var/obj/structure/cable/C = T.get_cable_node()
if(C)
playsound(src, 'sound/magic/lightningshock.ogg', 100, TRUE, extrarange = 5)
tesla_zap(src, 3, C.newavail() * 0.01) //Zap for 1/100 of the amount of power. At a million watts in the grid, it will be as powerful as a tesla revolver shot.
tesla_zap(src, 3, C.newavail() * 0.01, ZAP_MOB_DAMAGE | ZAP_OBJ_DAMAGE | ZAP_MOB_STUN | ZAP_ALLOW_DUPLICATES) //Zap for 1/100 of the amount of power. At a million watts in the grid, it will be as powerful as a tesla revolver shot.
C.add_delayedload(C.newavail() * 0.0375) // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock.
return ..()
+2 -2
View File
@@ -122,7 +122,7 @@
if(!shockcd)
if(isliving(user))
var/mob/living/M = user
M.electrocute_act(15, "Energy Barrier", safety = TRUE)
M.electrocute_act(15, "Energy Barrier")
shockcd = TRUE
addtimer(CALLBACK(src, .proc/cooldown), 5)
@@ -134,6 +134,6 @@
return
var/mob/living/M = AM
M.electrocute_act(15, "Energy Barrier", safety = TRUE)
M.electrocute_act(15, "Energy Barrier")
shockcd = TRUE
addtimer(CALLBACK(src, .proc/cooldown), 5)