From e5907040273980024ec45a1024ff51647ab684f6 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Thu, 8 Aug 2024 00:12:20 +0300 Subject: [PATCH 1/2] a --- code/modules/defenses/tesla_coil.dm | 21 +++++++++++++++---- .../FOP_v3_Sciannex/Fiorina_SciAnnex.dmm | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/code/modules/defenses/tesla_coil.dm b/code/modules/defenses/tesla_coil.dm index 0f7a0090300a..03887b0def4a 100644 --- a/code/modules/defenses/tesla_coil.dm +++ b/code/modules/defenses/tesla_coil.dm @@ -11,6 +11,7 @@ var/last_fired = 0 var/tesla_range = TESLA_COIL_RANGE var/fire_delay = TESLA_COIL_FIREDELAY + var/attack_defenses = TRUE handheld_type = /obj/item/defenses/handheld/tesla_coil disassemble_time = 10 health = 150 @@ -83,10 +84,11 @@ targets += M FOR_DOVIEW_END - FOR_DOVIEW(var/obj/structure/machinery/defenses/D, tesla_range, src, HIDE_INVISIBLE_OBSERVER) - if(D.turned_on) - targets += D - FOR_DOVIEW_END + if(attack_defenses) + FOR_DOVIEW(var/obj/structure/machinery/defenses/D, tesla_range, src, HIDE_INVISIBLE_OBSERVER) + if(D.turned_on) + targets += D + FOR_DOVIEW_END /obj/structure/machinery/defenses/tesla_coil/proc/fire(atoms) if(!(world.time - last_fired >= fire_delay) || !turned_on) @@ -159,6 +161,17 @@ . = ..() +// For mapping +/obj/structure/machinery/defenses/tesla_coil/premade + turned_on = TRUE + static = TRUE + +/obj/structure/machinery/defenses/tesla_coil/premade/attackby(obj/item/O, mob/user) + return + +/obj/structure/machinery/defenses/tesla_coil/premade/smart + attack_defenses = FALSE + #define TESLA_COIL_STUN_FIRE_DELAY 3 SECONDS #define TESLA_COIL_STUN_EFFECT 1 /obj/structure/machinery/defenses/tesla_coil/stun diff --git a/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm b/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm index 54a56be13283..6878a0c1ed20 100644 --- a/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm +++ b/maps/map_files/FOP_v3_Sciannex/Fiorina_SciAnnex.dmm @@ -845,7 +845,7 @@ /turf/open/floor/prison/floor_plate, /area/fiorina/station/telecomm/lz1_cargo) "aFp" = ( -/obj/structure/machinery/defenses/tesla_coil{ +/obj/structure/machinery/defenses/tesla_coil/premade/smart{ faction_group = list("CLF") }, /turf/open/floor/plating/plating_catwalk, @@ -30182,7 +30182,7 @@ /turf/open/floor/corsat/squares, /area/fiorina/station/medbay) "xgx" = ( -/obj/structure/machinery/defenses/tesla_coil{ +/obj/structure/machinery/defenses/tesla_coil/premade{ faction_group = list("USCM") }, /turf/open/organic/grass/astroturf, From 3e8808bd2cf4fa30f96867ceb83ff7c4fedf8bc6 Mon Sep 17 00:00:00 2001 From: Git-Nivrak <59925169+Git-Nivrak@users.noreply.github.com> Date: Thu, 22 Aug 2024 19:36:55 +0300 Subject: [PATCH 2/2] Update code/modules/defenses/tesla_coil.dm Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> --- code/modules/defenses/tesla_coil.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/defenses/tesla_coil.dm b/code/modules/defenses/tesla_coil.dm index 03887b0def4a..bb150acc1e95 100644 --- a/code/modules/defenses/tesla_coil.dm +++ b/code/modules/defenses/tesla_coil.dm @@ -84,11 +84,13 @@ targets += M FOR_DOVIEW_END - if(attack_defenses) - FOR_DOVIEW(var/obj/structure/machinery/defenses/D, tesla_range, src, HIDE_INVISIBLE_OBSERVER) - if(D.turned_on) - targets += D - FOR_DOVIEW_END + if(!attack_defenses) + return + + FOR_DOVIEW(var/obj/structure/machinery/defenses/D, tesla_range, src, HIDE_INVISIBLE_OBSERVER) + if(D.turned_on) + targets += D + FOR_DOVIEW_END /obj/structure/machinery/defenses/tesla_coil/proc/fire(atoms) if(!(world.time - last_fired >= fire_delay) || !turned_on)