From bbf3b528c4aae5b788767f49c90c9545c8540dd1 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Tue, 22 Dec 2015 13:40:53 -0500 Subject: [PATCH] Field Generator Refactor+Fixes --- .../MetaStation/MetaStation.v41A.II.dmm | 8 +- _maps/map_files/MetaStation/z4.dmm | 2 +- _maps/map_files/cyberiad/cyberiad.dmm | 8 +- _maps/map_files/cyberiad/z4.dmm | 8 +- _maps/map_files/cyberiad/z6.dmm | 2 +- code/datums/supplypacks.dm | 4 +- .../gamemodes/malfunction/Malf_Modules.dm | 4 +- code/modules/admin/verbs/debug.dm | 2 +- code/modules/events/dust.dm | 2 +- .../power/singularity/containment_field.dm | 119 +++++++++++----- .../power/singularity/field_generator.dm | 130 ++++++++++-------- code/modules/power/singularity/singularity.dm | 11 +- 12 files changed, 177 insertions(+), 123 deletions(-) diff --git a/_maps/map_files/MetaStation/MetaStation.v41A.II.dmm b/_maps/map_files/MetaStation/MetaStation.v41A.II.dmm index dd967d81718..fca6de7ec3c 100644 --- a/_maps/map_files/MetaStation/MetaStation.v41A.II.dmm +++ b/_maps/map_files/MetaStation/MetaStation.v41A.II.dmm @@ -1866,7 +1866,7 @@ "aJT" = (/obj/structure/rack{dir = 8; layer = 2.9},/obj/item/weapon/storage/belt/utility,/obj/item/weapon/wrench,/obj/item/weapon/weldingtool,/obj/item/clothing/head/welding{pixel_x = -3; pixel_y = 5},/turf/simulated/floor{icon_state = "delivery"; name = "floor"},/area/engine/engineering) "aJU" = (/obj/structure/cable{d1 = 2; d2 = 4; icon_state = "2-4"; tag = ""},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = ""},/turf/simulated/floor{icon_state = "bot"; dir = 1},/area/engine/engineering) "aJV" = (/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_y = 0; tag = ""},/obj/structure/rack{dir = 8; layer = 2.9},/obj/item/weapon/crowbar,/obj/item/weapon/wirecutters,/obj/item/stack/cable_coil,/turf/simulated/floor{icon_state = "delivery"; name = "floor"},/area/engine/engineering) -"aJW" = (/obj/machinery/field_generator{anchored = 1; state = 2},/turf/simulated/floor/plating/airless,/area/space) +"aJW" = (/obj/machinery/field/generator{anchored = 1; state = 2},/turf/simulated/floor/plating/airless,/area/space) "aJX" = (/obj/structure/sign/securearea{desc = "A warning sign which reads 'RADIOACTIVE AREA'"; icon_state = "radiation"; name = "RADIOACTIVE AREA"; pixel_x = 0; pixel_y = 0},/turf/simulated/wall/r_wall,/area/space) "aJY" = (/obj/effect/spawner/window/reinforced{useFull = 1; tag = "fullReinWin"},/turf/simulated/floor/plating,/area/construction) "aJZ" = (/obj/structure/cable/yellow{d1 = 1; d2 = 4; icon_state = "1-4"},/turf/simulated/floor/plating{tag = "icon-panelscorched"; icon_state = "panelscorched"},/area/maintenance/fpmaint2{name = "Port Maintenance"}) @@ -2070,8 +2070,8 @@ "aNP" = (/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/turf/simulated/floor{dir = 2; icon_state = "neutralcorner"},/area/crew_quarters/sleep) "aNQ" = (/turf/simulated/wall,/area/hallway/secondary/construction{name = "\improper Garden"}) "aNR" = (/obj/structure/cable/yellow{d1 = 1; d2 = 2; icon_state = "1-2"},/obj/machinery/atmospherics/pipe/simple/hidden/supply,/obj/effect/spawner/lootdrop{loot = list(/obj/structure/grille,/obj/structure/grille,/obj/structure/grille,/obj/structure/grille,/obj/structure/grille,/obj/item/weapon/cigbutt,/obj/item/trash/cheesie,/obj/item/trash/candy,/obj/item/trash/chips,/obj/item/trash/pistachios,/obj/item/trash/plate,/obj/item/trash/popcorn,/obj/item/trash/raisins,/obj/item/trash/sosjerky,/obj/item/trash/syndi_cakes); name = "maint grille or trash spawner"},/turf/simulated/floor/plating,/area/maintenance/starboard) -"aNS" = (/obj/effect/decal/cleanable/cobweb,/obj/machinery/field_generator{anchored = 0; state = 2},/turf/simulated/floor/plating,/area/engine/engineering) -"aNT" = (/obj/machinery/field_generator{anchored = 0; state = 2},/turf/simulated/floor/plating,/area/engine/engineering) +"aNS" = (/obj/effect/decal/cleanable/cobweb,/obj/machinery/field/generator{anchored = 0; state = 2},/turf/simulated/floor/plating,/area/engine/engineering) +"aNT" = (/obj/machinery/field/generator{anchored = 0; state = 2},/turf/simulated/floor/plating,/area/engine/engineering) "aNU" = (/obj/machinery/shieldgen,/obj/machinery/light/small{dir = 1},/obj/machinery/camera{c_tag = "Engineering - Secure Storage"; dir = 2; network = list("SS13")},/turf/simulated/floor/plating,/area/engine/engineering) "aNV" = (/obj/machinery/shieldgen,/turf/simulated/floor/plating,/area/engine/engineering) "aNW" = (/obj/structure/table,/turf/simulated/floor{icon_state = "delivery"; name = "floor"},/area/engine/engineering) @@ -8308,7 +8308,7 @@ "ddO" = (/obj/structure/disposalpipe/segment,/turf/simulated/floor/plating/airless,/area/space) "ddP" = (/obj/structure/disposalpipe/trunk{dir = 1},/obj/structure/disposaloutlet,/turf/simulated/floor/plating/airless,/area/space) "ddQ" = (/obj/docking_port/stationary{dheight = 9; dir = 2; dwidth = 5; height = 22; id = "syndicate_s"; name = "south of station"; width = 18},/turf/space,/area/space) - + (1,1,1) = {" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/_maps/map_files/MetaStation/z4.dmm b/_maps/map_files/MetaStation/z4.dmm index 667cc8a9a9d..6abd982f907 100644 --- a/_maps/map_files/MetaStation/z4.dmm +++ b/_maps/map_files/MetaStation/z4.dmm @@ -262,7 +262,7 @@ "fb" = (/turf/simulated/wall,/area/derelict/gravity_generator) "fc" = (/obj/machinery/light/small{dir = 8},/turf/simulated/floor/plating/airless{icon_state = "damaged2"},/area/derelict/singularity_engine) "fd" = (/obj/machinery/power/emitter{dir = 1; icon_state = "emitter"},/turf/simulated/floor/plating/airless,/area/derelict/singularity_engine) -"fe" = (/obj/machinery/field_generator,/turf/simulated/floor/plating/airless,/area/derelict/singularity_engine) +"fe" = (/obj/machinery/field/generator,/turf/simulated/floor/plating/airless,/area/derelict/singularity_engine) "ff" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"},/obj/structure/window/reinforced,/turf/simulated/floor,/area/derelict/bridge/access) "fg" = (/obj/structure/window/reinforced{dir = 5},/turf/simulated/floor,/area/derelict/bridge/access) "fh" = (/obj/machinery/atmospherics/unary/vent_scrubber{on = 1; scrub_N2O = 0; scrub_Toxins = 0},/turf/simulated/floor/plating,/area/derelict/bridge) diff --git a/_maps/map_files/cyberiad/cyberiad.dmm b/_maps/map_files/cyberiad/cyberiad.dmm index 9402fdd67b7..35b0e63565d 100644 --- a/_maps/map_files/cyberiad/cyberiad.dmm +++ b/_maps/map_files/cyberiad/cyberiad.dmm @@ -7571,8 +7571,8 @@ "cPE" = (/turf/simulated/wall/r_wall,/area/maintenance/engi_shuttle) "cPF" = (/turf/space,/turf/simulated/shuttle/wall{icon_state = "swall_f10"; dir = 2},/area/shuttle/constructionsite) "cPG" = (/turf/space,/turf/simulated/shuttle/wall{tag = "icon-propulsion (EAST)"; icon_state = "propulsion"; dir = 4},/area/shuttle/constructionsite) -"cPH" = (/obj/machinery/field_generator,/turf/simulated/floor/plating,/area/storage/secure) -"cPI" = (/obj/machinery/field_generator,/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 4},/area/storage/secure) +"cPH" = (/obj/machinery/field/generator,/turf/simulated/floor/plating,/area/storage/secure) +"cPI" = (/obj/machinery/field/generator,/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 4},/area/storage/secure) "cPJ" = (/obj/machinery/light_switch{pixel_x = 27},/obj/structure/reagent_dispensers/watertank,/obj/machinery/atmospherics/unary/vent_pump{dir = 1; external_pressure_bound = 101; on = 1; pressure_checks = 1},/turf/simulated/floor/plating{tag = "icon-warnplate (NORTHWEST)"; icon_state = "warnplate"; dir = 9},/area/storage/secure) "cPK" = (/obj/machinery/atmospherics/unary/portables_connector,/obj/machinery/portable_atmospherics/canister/air,/turf/simulated/floor{dir = 2; icon_state = "warning"},/area/engine/engineering) "cPL" = (/obj/machinery/access_button{command = "cycle_interior"; frequency = 1379; master_tag = "engineering_west_airlock"; name = "interior access button"; pixel_x = -20; pixel_y = -20; req_access_txt = "10;13"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/turf/simulated/floor{dir = 2; icon_state = "warning"},/area/engine/engineering) @@ -7608,7 +7608,7 @@ "cQp" = (/obj/item/stack/sheet/cardboard,/turf/simulated/floor/plating,/area/maintenance/asmaint2) "cQq" = (/turf/simulated/shuttle/floor{icon_state = "floor2"},/area/shuttle/constructionsite) "cQr" = (/turf/simulated/shuttle/wall,/area/shuttle/constructionsite) -"cQs" = (/obj/machinery/light/small{dir = 8},/obj/machinery/field_generator,/turf/simulated/floor/plating,/area/storage/secure) +"cQs" = (/obj/machinery/light/small{dir = 8},/obj/machinery/field/generator,/turf/simulated/floor/plating,/area/storage/secure) "cQt" = (/obj/machinery/light/small{dir = 4},/obj/structure/reagent_dispensers/fueltank,/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 8},/area/storage/secure) "cQu" = (/obj/machinery/atmospherics/pipe/simple/hidden,/turf/simulated/wall,/area/engine/engineering) "cQv" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/door/airlock/external{frequency = 1379; icon_state = "door_locked"; id_tag = "engineering_west_inner"; locked = 1; name = "Engineering External Access"; req_access = null; req_access_txt = "10;13"},/turf/simulated/floor/plating,/area/engine/engineering) @@ -7736,7 +7736,7 @@ "cSN" = (/obj/machinery/floodlight,/obj/machinery/light/small{dir = 4},/turf/simulated/floor/plating{icon_state = "warnplate"; dir = 8},/area/storage/secure) "cSO" = (/obj/structure/grille,/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/structure/cable{d1 = 1; d2 = 4; icon_state = "1-4"; tag = ""},/turf/simulated/floor/plating/airless,/area/engine/engineering) "cSP" = (/obj/machinery/power/emitter{anchored = 1; dir = 4; state = 2},/obj/structure/cable{d2 = 8; icon_state = "0-8"},/turf/simulated/floor/plating/airless,/area/engine/engineering) -"cSQ" = (/obj/machinery/field_generator{anchored = 1; state = 2},/turf/simulated/floor/plating/airless,/area/space) +"cSQ" = (/obj/machinery/field/generator{anchored = 1; state = 2},/turf/simulated/floor/plating/airless,/area/space) "cSR" = (/obj/machinery/power/emitter{anchored = 1; dir = 8; state = 2},/obj/structure/cable{icon_state = "0-4"; d2 = 4},/turf/simulated/floor/plating/airless,/area/engine/engineering) "cSS" = (/obj/structure/grille,/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/structure/cable{d1 = 1; d2 = 8; icon_state = "1-8"; tag = ""},/turf/simulated/floor/plating/airless,/area/engine/engineering) "cST" = (/obj/structure/lattice,/obj/machinery/atmospherics/pipe/simple/visible/green{level = 2},/turf/space,/area/space) diff --git a/_maps/map_files/cyberiad/z4.dmm b/_maps/map_files/cyberiad/z4.dmm index 841a1301838..4745096e063 100644 --- a/_maps/map_files/cyberiad/z4.dmm +++ b/_maps/map_files/cyberiad/z4.dmm @@ -244,6 +244,7 @@ "eJ" = (/obj/machinery/door/airlock/external{id_tag = "engineering_away"; name = "Engineering Dock Airlock"; req_access_txt = "0"; req_one_access_txt = "10;24"},/turf/simulated/floor/plating,/area/engiestation) "eK" = (/obj/machinery/light/small{dir = 4},/turf/simulated/floor/plating,/area/engiestation) "eL" = (/obj/docking_port/stationary{dir = 2; dwidth = 3; height = 5; id = "engineering_away"; name = "engineering outpost dock"; width = 7},/turf/space,/area/space) +"eM" = (/obj/machinery/field/generator,/turf/simulated/floor/plating/airless,/area/space) "fe" = (/turf/simulated/floor/airless{icon_state = "white"},/area/constructionsite/medical) "ff" = (/obj/structure/grille,/turf/simulated/floor/plating/airless,/area/constructionsite/medical) "fg" = (/obj/machinery/sleeper{dir = 8},/turf/simulated/floor/airless{icon_state = "white"},/area/constructionsite/medical) @@ -321,7 +322,6 @@ "gF" = (/obj/machinery/power/smes,/turf/simulated/floor/plating/airless,/area/constructionsite/engineering) "gG" = (/obj/machinery/power/terminal{dir = 8},/turf/simulated/floor/plating/airless,/area/constructionsite/engineering) "gH" = (/obj/machinery/power/terminal{dir = 4},/turf/simulated/floor/plating/airless,/area/constructionsite/engineering) -"gI" = (/obj/machinery/field_generator,/turf/simulated/floor/plating/airless,/area/space) (1,1,1) = {" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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/_maps/map_files/cyberiad/z6.dmm b/_maps/map_files/cyberiad/z6.dmm index 789118b6940..76c9ffcb780 100644 --- a/_maps/map_files/cyberiad/z6.dmm +++ b/_maps/map_files/cyberiad/z6.dmm @@ -179,7 +179,7 @@ "dw" = (/obj/item/weapon/disk/data/demo,/turf/simulated/floor/plating/airless,/area/derelict/singularity_engine) "dx" = (/obj/machinery/light/small{dir = 8},/turf/simulated/floor/airless{icon_state = "damaged2"},/area/derelict/singularity_engine) "dy" = (/obj/machinery/power/emitter{dir = 1; icon_state = "emitter"},/turf/simulated/floor/plating/airless,/area/derelict/singularity_engine) -"dz" = (/obj/machinery/field_generator,/turf/simulated/floor/plating/airless,/area/derelict/singularity_engine) +"dz" = (/obj/machinery/field/generator,/turf/simulated/floor/plating/airless,/area/derelict/singularity_engine) "dA" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/structure/window/reinforced,/turf/simulated/floor,/area/derelict/bridge/access) "dB" = (/obj/structure/window/reinforced{dir = 5; health = 1e+007},/turf/simulated/floor,/area/derelict/bridge/access) "dC" = (/obj/structure/window/reinforced{dir = 4},/turf/simulated/floor,/area/derelict/bridge) diff --git a/code/datums/supplypacks.dm b/code/datums/supplypacks.dm index 48453278986..a0aaadd6e51 100644 --- a/code/datums/supplypacks.dm +++ b/code/datums/supplypacks.dm @@ -482,8 +482,8 @@ var/list/all_supply_groups = list(supply_emergency,supply_security,supply_engine /datum/supply_packs/engineering/engine/field_gen name = "Field Generator Crate" - contains = list(/obj/machinery/field_generator, - /obj/machinery/field_generator) + contains = list(/obj/machinery/field/generator, + /obj/machinery/field/generator) cost = 10 containername = "field generator crate" diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 6ccf91faf6a..86f921da146 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -217,7 +217,7 @@ rcd light flash thingy on matter drain return if (istype(M, /obj/machinery)) - if(istype(M,/obj/machinery/field_generator)) + if(istype(M,/obj/machinery/field/generator)) src << "This machine can not be overloaded due to a firewall." return for(var/datum/AI_Module/small/overload_machine/overload in current_modules) @@ -249,7 +249,7 @@ rcd light flash thingy on matter drain return if (istype(M, /obj/machinery)) - if(istype(M,/obj/machinery/field_generator)) + if(istype(M,/obj/machinery/field/generator)) src << "This machine can not be overloaded due to a firewall." return for(var/datum/AI_Module/small/override_machine/override in current_modules) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index d595c46abd3..a4a60a4e413 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1095,7 +1095,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(E.anchored) E.active = 1 - for(var/obj/machinery/field_generator/F in world) + for(var/obj/machinery/field/generator/F in world) if(F.anchored) F.Varedit_start = 1 spawn(30) diff --git a/code/modules/events/dust.dm b/code/modules/events/dust.dm index 5a1c647bd32..b7f1fb660c8 100644 --- a/code/modules/events/dust.dm +++ b/code/modules/events/dust.dm @@ -78,7 +78,7 @@ if(ismob(A)) A.ex_act(strength)//This should work for now I guess - else if(!istype(A,/obj/machinery/power/emitter) && !istype(A,/obj/machinery/field_generator)) //Protect the singularity from getting released every round! + else if(!istype(A,/obj/machinery/power/emitter) && !istype(A,/obj/machinery/field/generator)) //Protect the singularity from getting released every round! A.ex_act(strength) //Changing emitter/field gen ex_act would make it immune to bombs and C4 life-- diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index 2b32af83526..e4704dff26a 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -1,6 +1,6 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33 -/obj/machinery/containment_field +/obj/machinery/field/containment name = "Containment Field" desc = "An energy field." icon = 'icons/obj/singularity.dmi' @@ -10,64 +10,111 @@ unacidable = 1 use_power = 0 light_range = 4 - var/obj/machinery/field_generator/FG1 = null - var/obj/machinery/field_generator/FG2 = null - var/hasShocked = 0 //Used to add a delay between shocks. In some cases this used to crash servers by spawning hundreds of sparks every second. + layer = OBJ_LAYER + 0.1 + var/obj/machinery/field/generator/FG1 = null + var/obj/machinery/field/generator/FG2 = null -/obj/machinery/containment_field/Destroy() +/obj/machinery/field/containment/Destroy() if(FG1 && !FG1.clean_up) FG1.cleanup() if(FG2 && !FG2.clean_up) FG2.cleanup() return ..() -/obj/machinery/containment_field/attack_hand(mob/user as mob) +/obj/machinery/field/containment/attack_hand(mob/user) if(get_dist(src, user) > 1) return 0 else - shock(user) + shock_field(user) return 1 -/obj/machinery/containment_field/blob_act() +/obj/machinery/field/containment/blob_act() return 0 -/obj/machinery/containment_field/ex_act(severity) +/obj/machinery/field/containment/ex_act(severity) return 0 -/obj/machinery/containment_field/HasProximity(atom/movable/AM as mob|obj) - if(istype(AM,/mob/living/silicon) && prob(40)) - shock(AM) - return 1 - if(istype(AM,/mob/living/carbon) && prob(50)) - shock(AM) - return 1 - return 0 +/obj/machinery/field/containment/Crossed(mob/mover) + if(isliving(mover)) + shock_field(mover) -/obj/machinery/containment_field/shock(mob/living/user as mob) - if(hasShocked) - return 0 - if(!FG1 || !FG2) - qdel(src) - return 0 - if(isliving(user)) - hasShocked = 1 - var/shock_damage = min(rand(30,40),rand(30,40)) - user.electrocute_act(shock_damage, src) +/obj/machinery/field/containment/Crossed(obj/mover) + if(istype(mover, /obj/machinery) || istype(mover, /obj/structure) || istype(mover, /obj/mecha)) + bump_field(mover) - var/atom/target = get_edge_target_turf(user, get_dir(src, get_step_away(user, src))) - user.throw_at(target, 200, 4) - - sleep(20) - - hasShocked = 0 - return - -/obj/machinery/containment_field/proc/set_master(var/master1,var/master2) +/obj/machinery/field/containment/proc/set_master(master1,master2) if(!master1 || !master2) return 0 FG1 = master1 FG2 = master2 return 1 + +/obj/machinery/field/containment/shock_field(mob/living/user) + if(!FG1 || !FG2) + qdel(src) + return 0 + ..() + +/obj/machinery/field/containment/Move() + qdel(src) + +// Abstract Field Class +// Used for overriding certain procs + +/obj/machinery/field + var/hasShocked = 0 //Used to add a delay between shocks. In some cases this used to crash servers by spawning hundreds of sparks every second. + +/obj/machinery/field/CanPass(mob/mover, turf/target, height=0) + if(isliving(mover)) // Don't let mobs through + shock_field(mover) + return 0 + return ..() + +/obj/machinery/field/CanPass(obj/mover, turf/target, height=0) + if((istype(mover, /obj/machinery) && !istype(mover, /obj/singularity)) || \ + istype(mover, /obj/structure) || \ + istype(mover, /obj/mecha)) + bump_field(mover) + return 0 + return ..() + +/obj/machinery/field/proc/shock_field(mob/living/user) + if(hasShocked) + return 0 + if(isliving(user)) + hasShocked = 1 + var/shock_damage = min(rand(30,40),rand(30,40)) + + if(iscarbon(user)) + var/stun = min(shock_damage, 15) + user.Stun(stun) + user.Weaken(10) + user.burn_skin(shock_damage) + user.visible_message("[user.name] was shocked by the [src.name]!", \ + "You feel a powerful shock course through your body, sending you flying!", \ + "You hear a heavy electrical crack.") + + else if(issilicon(user)) + if(prob(20)) + user.Stun(2) + user.take_overall_damage(0, shock_damage) + user.visible_message("[user.name] was shocked by the [src.name]!", \ + "Energy pulse detected, system damaged!", \ + "You hear an electrical crack.") + + user.updatehealth() + bump_field(user) + + spawn(5) + hasShocked = 0 + return + +/obj/machinery/field/proc/bump_field(atom/movable/AM as mob|obj) + var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread + s.set_up(5, 1, AM.loc) + s.start() + var/atom/target = get_edge_target_turf(AM, get_dir(src, get_step_away(AM, src))) + AM.throw_at(target, 200, 4) diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index 4adc108f82c..cabe2b7a9b6 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -13,7 +13,7 @@ field_generator power level display */ #define field_generator_max_power 250 -/obj/machinery/field_generator +/obj/machinery/field/generator name = "Field Generator" desc = "A large thermal battery that projects a high amount of energy when powered." icon = 'icons/obj/machines/field_generator.dmi' @@ -28,37 +28,36 @@ field_generator power level display var/power = 20 // Current amount of power var/state = 0 var/warming_up = 0 - var/list/obj/machinery/containment_field/fields - var/list/obj/machinery/field_generator/connected_gens + var/list/obj/machinery/field/containment/fields + var/list/obj/machinery/field/generator/connected_gens var/clean_up = 0 -/obj/machinery/field_generator/update_icon() +/obj/machinery/field/generator/update_icon() overlays.Cut() - if(!active) - if(warming_up) - overlays += "+a[warming_up]" + if(warming_up) + overlays += "+a[warming_up]" if(fields.len) overlays += "+on" // Power level indicator // Scale % power to % num_power_levels and truncate value var/level = round(num_power_levels * power / field_generator_max_power) // Clamp between 0 and num_power_levels for out of range power values - level = between(0, level, num_power_levels) + level = Clamp(level, 0, num_power_levels) if(level) overlays += "+p[level]" return -/obj/machinery/field_generator/New() +/obj/machinery/field/generator/New() ..() fields = list() connected_gens = list() return -/obj/machinery/field_generator/process() +/obj/machinery/field/generator/process() if(Varedit_start == 1) if(active == 0) active = 1 @@ -76,116 +75,117 @@ field_generator power level display return -/obj/machinery/field_generator/attack_hand(mob/user as mob) +/obj/machinery/field/generator/attack_hand(mob/user) if(state == 2) if(get_dist(src, user) <= 1)//Need to actually touch the thing to turn it on if(src.active >= 1) - user << "You are unable to turn off the [src.name] once it is online." + user << "You are unable to turn off the [src.name] once it is online!" return 1 else - user.visible_message("[user.name] turns on the [src.name]", \ - "You turn on the [src.name].", \ - "You hear heavy droning") + user.visible_message("[user.name] turns on the [src.name].", \ + "You turn on the [src.name].", \ + "You hear heavy droning.") turn_on() investigate_log("activated by [user.key].","singulo") src.add_fingerprint(user) else - user << "The [src] needs to be firmly secured to the floor first." + user << "The [src] needs to be firmly secured to the floor first!" return -/obj/machinery/field_generator/attackby(obj/item/W, mob/user, params) +/obj/machinery/field/generator/attackby(obj/item/W, mob/user, params) if(active) - user << "The [src] needs to be off." + user << "The [src] needs to be off!" return else if(istype(W, /obj/item/weapon/wrench)) switch(state) if(0) + if(isinspace()) return state = 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) user.visible_message("[user.name] secures [src.name] to the floor.", \ - "You secure the external reinforcing bolts to the floor.", \ - "You hear ratchet") + "You secure the external reinforcing bolts to the floor.", \ + "You hear ratchet.") src.anchored = 1 if(1) state = 0 playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1) user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \ - "You undo the external reinforcing bolts.", \ - "You hear ratchet") + "You undo the external reinforcing bolts.", \ + "You hear ratchet.") src.anchored = 0 if(2) - user << "\red The [src.name] needs to be unwelded from the floor." + user << "The [src.name] needs to be unwelded from the floor!" return else if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W switch(state) if(0) - user << "\red The [src.name] needs to be wrenched to the floor." + user << "The [src.name] needs to be wrenched to the floor!" return if(1) if (WT.remove_fuel(0,user)) playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) user.visible_message("[user.name] starts to weld the [src.name] to the floor.", \ - "You start to weld the [src] to the floor.", \ - "You hear welding") + "You start to weld \the [src] to the floor...", \ + "You hear welding.") if (do_after(user,20, target = src)) if(!src || !WT.isOn()) return state = 2 - user << "You weld the field generator to the floor." + user << "You weld the field generator to the floor." else return if(2) if (WT.remove_fuel(0,user)) playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) user.visible_message("[user.name] starts to cut the [src.name] free from the floor.", \ - "You start to cut the [src] free from the floor.", \ - "You hear welding") + "You start to cut \the [src] free from the floor...", \ + "You hear welding.") if (do_after(user,20, target = src)) if(!src || !WT.isOn()) return state = 1 - user << "You cut the [src] free from the floor." + user << "You cut \the [src] free from the floor." else return else ..() - return -/obj/machinery/field_generator/emp_act() +/obj/machinery/field/generator/emp_act() return 0 -/obj/machinery/field_generator/blob_act() +/obj/machinery/field/generator/blob_act() if(active) return 0 else ..() - -/obj/machinery/field_generator/bullet_act(var/obj/item/projectile/Proj) +/obj/machinery/field/generator/bullet_act(obj/item/projectile/Proj) if(Proj.flag != "bullet") power += Proj.damage update_icon() return 0 -/obj/machinery/field_generator/Destroy() +/obj/machinery/field/generator/Destroy() src.cleanup() return ..() -/obj/machinery/field_generator/proc/turn_off() +/obj/machinery/field/generator/proc/turn_off() active = 0 spawn(1) src.cleanup() - update_icon() + while (warming_up>0 && !active) + sleep(50) + warming_up-- + update_icon() -/obj/machinery/field_generator/proc/turn_on() +/obj/machinery/field/generator/proc/turn_on() active = 1 - warming_up = 1 spawn(1) while (warming_up<3 && active) sleep(50) @@ -193,10 +193,9 @@ field_generator power level display update_icon() if(warming_up >= 3) start_fields() - update_icon() -/obj/machinery/field_generator/proc/calc_power() +/obj/machinery/field/generator/proc/calc_power() if(Varpower) return 1 @@ -205,22 +204,21 @@ field_generator power level display src.power = field_generator_max_power var/power_draw = 2 - for (var/obj/machinery/containment_field/F in fields) + for (var/obj/machinery/field/containment/F in fields) if (isnull(F)) continue power_draw++ if(draw_power(round(power_draw/2,1))) return 1 else - for(var/mob/M in viewers(src)) - M.show_message("\red The [src.name] shuts down!") + visible_message("The [src.name] shuts down!", "You hear something shutting down.") turn_off() investigate_log("ran out of power and deactivated","singulo") src.power = 0 return 0 //This could likely be better, it tends to start loopin if you have a complex generator loop setup. Still works well enough to run the engine fields will likely recode the field gens and fields sometime -Mport -/obj/machinery/field_generator/proc/draw_power(var/draw = 0, var/failsafe = 0, var/obj/machinery/field_generator/G = null, var/obj/machinery/field_generator/last = null) +/obj/machinery/field/generator/proc/draw_power(draw = 0, failsafe = 0, obj/machinery/field/generator/G = null, obj/machinery/field/generator/last = null) if(Varpower) return 1 if((G && G == src) || (failsafe >= 8))//Loopin, set fail @@ -233,7 +231,7 @@ field_generator power level display else//Need more power draw -= src.power src.power = 0 - for(var/obj/machinery/field_generator/FG in connected_gens) + for(var/obj/machinery/field/generator/FG in connected_gens) if(isnull(FG)) continue if(FG == last)//We just asked you @@ -250,7 +248,7 @@ field_generator power level display return 0 -/obj/machinery/field_generator/proc/start_fields() +/obj/machinery/field/generator/proc/start_fields() if(!src.state == 2 || !anchored) turn_off() return @@ -265,9 +263,9 @@ field_generator power level display src.active = 2 -/obj/machinery/field_generator/proc/setup_field(var/NSEW) +/obj/machinery/field/generator/proc/setup_field(NSEW) var/turf/T = src.loc - var/obj/machinery/field_generator/G + var/obj/machinery/field/generator/G var/steps = 0 if(!NSEW)//Make sure its ran right return @@ -278,11 +276,11 @@ field_generator power level display for(var/atom/A in T.contents) if(ismob(A)) continue - if(!istype(A,/obj/machinery/field_generator)) + if(!istype(A,/obj/machinery/field/generator)) if((istype(A,/obj/machinery/door)||istype(A,/obj/machinery/the_singularitygen))&&(A.density)) return 0 steps += 1 - G = locate(/obj/machinery/field_generator) in T + G = locate(/obj/machinery/field/generator) in T if(!isnull(G)) steps -= 1 if(!G.active) @@ -294,15 +292,17 @@ field_generator power level display for(var/dist = 0, dist < steps, dist += 1) // creates each field tile var/field_dir = get_dir(T,get_step(G.loc, NSEW)) T = get_step(T, NSEW) - if(!locate(/obj/machinery/containment_field) in T) - var/obj/machinery/containment_field/CF = new/obj/machinery/containment_field() + if(!locate(/obj/machinery/field/containment) in T) + var/obj/machinery/field/containment/CF = new/obj/machinery/field/containment() CF.set_master(src,G) fields += CF G.fields += CF CF.loc = T CF.dir = field_dir + for(var/mob/living/L in CF.loc) + CF.Crossed(L) var/listcheck = 0 - for(var/obj/machinery/field_generator/FG in connected_gens) + for(var/obj/machinery/field/generator/FG in connected_gens) if (isnull(FG)) continue if(FG == G) @@ -311,7 +311,7 @@ field_generator power level display if(!listcheck) connected_gens.Add(G) listcheck = 0 - for(var/obj/machinery/field_generator/FG2 in G.connected_gens) + for(var/obj/machinery/field/generator/FG2 in G.connected_gens) if (isnull(FG2)) continue if(FG2 == src) @@ -321,14 +321,14 @@ field_generator power level display G.connected_gens.Add(src) -/obj/machinery/field_generator/proc/cleanup() +/obj/machinery/field/generator/proc/cleanup() clean_up = 1 - for (var/obj/machinery/containment_field/F in fields) + for (var/obj/machinery/field/containment/F in fields) if (isnull(F)) continue qdel(F) fields = list() - for(var/obj/machinery/field_generator/FG in connected_gens) + for(var/obj/machinery/field/generator/FG in connected_gens) if (isnull(FG)) continue FG.connected_gens.Remove(src) @@ -348,6 +348,14 @@ field_generator power level display if(O.last_warning && temp) if((world.time - O.last_warning) > 50) //to stop message-spam temp = 0 - msg_admin_attack("A singulo exists and a containment field has failed.",1) + message_admins("A singulo exists and a containment field has failed.",1) investigate_log("has failed whilst a singulo exists.","singulo") - O.last_warning = world.time \ No newline at end of file + O.last_warning = world.time + +/obj/machinery/field/generator/shock_field(mob/living/user) + if(fields.len) + ..() + +/obj/machinery/field/generator/bump_field(atom/movable/AM as mob|obj) + if(fields.len) + ..() diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 338f3830766..ba8e5d34dea 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -116,7 +116,7 @@ /obj/singularity/proc/admin_investigate_setup() last_warning = world.time - var/count = locate(/obj/machinery/containment_field) in orange(30, src) + var/count = locate(/obj/machinery/field/containment) in orange(30, src) if(!count) message_admins("A singularity has been created without containment fields active at [x], [y], [z] (JMP)") investigate_log("was created. [count?"":"No containment fields were active"]","singulo") @@ -326,13 +326,13 @@ return 1 -/obj/singularity/proc/can_move(var/turf/T) +/obj/singularity/proc/can_move(turf/T) if(!T) return 0 - if((locate(/obj/machinery/containment_field) in T)||(locate(/obj/machinery/shieldwall) in T)) + if((locate(/obj/machinery/field/containment) in T)||(locate(/obj/machinery/shieldwall) in T)) return 0 - else if(locate(/obj/machinery/field_generator) in T) - var/obj/machinery/field_generator/G = locate(/obj/machinery/field_generator) in T + else if(locate(/obj/machinery/field/generator) in T) + var/obj/machinery/field/generator/G = locate(/obj/machinery/field/generator) in T if(G && G.active) return 0 else if(locate(/obj/machinery/shieldwallgen) in T) @@ -341,7 +341,6 @@ return 0 return 1 - /obj/singularity/proc/event() var/numb = pick(1,2,3,4,5,6) switch(numb)