From 806a8d1c1a758bd0444df6f1914be681f2f78fbc Mon Sep 17 00:00:00 2001 From: Miniature Date: Tue, 3 Jan 2012 01:38:01 +1030 Subject: [PATCH 1/4] First bunch of emlocker stuffs, going to fix when its not 1am and 24C --- code/defines/global.dm | 1 + code/game/landmarks.dm | 4 +++ code/game/objects/closets/emergency.dm | 35 ++++++-------------------- maps/tgstation.2.0.8.dmm | 24 +++++++++--------- 4 files changed, 25 insertions(+), 39 deletions(-) diff --git a/code/defines/global.dm b/code/defines/global.dm index 5f3b6e027b2..caa40a1891a 100644 --- a/code/defines/global.dm +++ b/code/defines/global.dm @@ -108,6 +108,7 @@ var // list/traitors = list() //traitor list list/cardinal = list( NORTH, SOUTH, EAST, WEST ) list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) + list/emclosets = list() //random emergency closets woo datum/station_state/start_state = null datum/configuration/config = null diff --git a/code/game/landmarks.dm b/code/game/landmarks.dm index de376a82157..31cd58b45ce 100644 --- a/code/game/landmarks.dm +++ b/code/game/landmarks.dm @@ -61,6 +61,10 @@ xeno_spawn += loc del(src) + if(name == "emcloset") + emclosets += loc + del(src) + return 1 /obj/effect/landmark/start/New() diff --git a/code/game/objects/closets/emergency.dm b/code/game/objects/closets/emergency.dm index aa713838a24..5456e56c383 100644 --- a/code/game/objects/closets/emergency.dm +++ b/code/game/objects/closets/emergency.dm @@ -4,30 +4,11 @@ if (prob(40)) new /obj/item/weapon/storage/toolbox/emergency(src) - switch (pickweight(list("small" = 20, "aid" = 15, "tank" = 10, "both" = 50, "nothing" = 4, "delete" = 1))) - if ("small") - new /obj/item/weapon/tank/emergency_oxygen(src) - new /obj/item/weapon/tank/emergency_oxygen(src) - - if ("aid") - new /obj/item/weapon/tank/emergency_oxygen(src) - new /obj/item/weapon/storage/firstaid/o2(src) - - if ("tank") - new /obj/item/weapon/tank/air(src) - - if ("both") - new /obj/item/weapon/tank/emergency_oxygen(src) - new /obj/item/clothing/mask/breath(src) - - if ("nothing") - // doot - - // teehee - if ("delete") - del(src) - - //If you want to re-add fire, just add "fire" = 15 to the pick list. - /*if ("fire") - new /obj/structure/closet/firecloset(src.loc) - del(src)*/ + new /obj/item/clothing/mask/breath(src) + new /obj/item/weapon/tank/emergency_oxygen(src) + var/counter = 0 + while(prob(60) && counter < 3) + new /obj/item/weapon/tank/emergency_oxygen(src) + counter = 0 + while(prob(60) && counter < 3) + new /obj/item/clothing/mask/breath(src) diff --git a/maps/tgstation.2.0.8.dmm b/maps/tgstation.2.0.8.dmm index 5f80354a559..5b75a9423af 100644 --- a/maps/tgstation.2.0.8.dmm +++ b/maps/tgstation.2.0.8.dmm @@ -1039,8 +1039,8 @@ "atY" = (/turf/simulated/wall/r_wall,/area/hallway/secondary/entry) "atZ" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/turf/simulated/floor/plating,/area/hallway/secondary/entry) "aua" = (/turf/simulated/floor/plating,/area/hallway/secondary/entry) -"aub" = (/obj/structure/closet/emcloset,/turf/simulated/floor{dir = 10; icon_state = "warning"},/area/hallway/secondary/entry) -"auc" = (/obj/structure/closet/emcloset,/turf/simulated/floor{icon_state = "warning"},/area/hallway/secondary/entry) +"aub" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor{dir = 10; icon_state = "warning"},/area/hallway/secondary/entry) +"auc" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor{icon_state = "warning"},/area/hallway/secondary/entry) "aud" = (/obj/machinery/camera{c_tag = "Arrivals North"; dir = 1},/turf/simulated/floor{icon_state = "warning"},/area/hallway/secondary/entry) "aue" = (/obj/machinery/vending/coffee,/turf/simulated/floor{dir = 6; icon_state = "warning"},/area/hallway/secondary/entry) "auf" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 8},/turf/simulated/floor/plating,/area/hallway/secondary/entry) @@ -1715,8 +1715,8 @@ "aGY" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/obj/structure/window/reinforced,/obj/machinery/atmospherics/pipe/manifold{color = "red"; dir = 4; icon_state = "manifold-r-f"; initialize_directions = 11; level = 1; name = "pipe manifold"},/turf/simulated/floor/plating,/area/chapel/main) "aGZ" = (/obj/machinery/vending/snack,/turf/simulated/floor{dir = 9; icon_state = "warning"},/area/hallway/secondary/entry) "aHa" = (/obj/item/device/radio/beacon,/obj/machinery/camera{c_tag = "Arrivals South"},/turf/simulated/floor{dir = 1; icon_state = "warning"},/area/hallway/secondary/entry) -"aHb" = (/obj/structure/closet/emcloset,/turf/simulated/floor{dir = 1; icon_state = "warning"},/area/hallway/secondary/entry) -"aHc" = (/obj/structure/closet/emcloset,/turf/simulated/floor{dir = 5; icon_state = "warning"},/area/hallway/secondary/entry) +"aHb" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor{dir = 1; icon_state = "warning"},/area/hallway/secondary/entry) +"aHc" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor{dir = 5; icon_state = "warning"},/area/hallway/secondary/entry) "aHd" = (/obj/structure/grille,/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 1},/turf/simulated/floor/plating,/area/hallway/secondary/entry) "aHe" = (/obj/structure/stool/chair{dir = 8},/turf/simulated/floor{dir = 10; icon_state = "carpetside"},/area/hallway/secondary/entry) "aHf" = (/turf/simulated/floor{icon_state = "carpetside"},/area/hallway/secondary/entry) @@ -1783,7 +1783,7 @@ "aIo" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced,/turf/simulated/floor/plating,/area/mint) "aIp" = (/obj/machinery/door/firedoor/border_only,/obj/machinery/door/airlock/glass,/turf/simulated/floor{icon_state = "dark"},/area/mint) "aIq" = (/turf/simulated/wall/r_wall,/area/mint) -"aIr" = (/obj/structure/closet/emcloset,/turf/simulated/floor,/area/hallway/primary/port) +"aIr" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor,/area/hallway/primary/port) "aIs" = (/obj/structure/table,/turf/simulated/floor,/area/hallway/primary/port) "aIt" = (/obj/machinery/camera{c_tag = "Port Hallway"; dir = 1},/obj/structure/table,/turf/simulated/floor,/area/hallway/primary/port) "aIu" = (/obj/structure/closet/extinguisher{pixel_x = -5; pixel_y = -32},/turf/simulated/floor,/area/hallway/primary/port) @@ -1847,7 +1847,7 @@ "aJA" = (/obj/structure/disposalpipe/segment{dir = 8; icon_state = "pipe-c"},/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = "Streight"},/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{dir = 4},/turf/simulated/floor/plating,/area/maintenance/port) "aJB" = (/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{dir = 4},/turf/simulated/wall,/area/crew_quarters/locker) "aJC" = (/obj/machinery/atmospherics/unary/vent_scrubber{dir = 8; icon_state = "off"; on = 1; scrub_N2O = 0; scrub_Toxins = 0},/obj/structure/closet/emcloset,/turf/simulated/floor,/area/crew_quarters/locker) -"aJD" = (/obj/structure/closet/emcloset,/turf/simulated/floor,/area/crew_quarters/locker) +"aJD" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor,/area/crew_quarters/locker) "aJE" = (/obj/structure/reagent_dispensers/watertank,/turf/simulated/floor,/area/crew_quarters/locker) "aJF" = (/obj/structure/reagent_dispensers/fueltank,/turf/simulated/floor,/area/crew_quarters/locker) "aJG" = (/obj/machinery/vending/cola,/turf/simulated/floor,/area/crew_quarters/locker) @@ -1905,8 +1905,8 @@ "aKG" = (/obj/structure/stool,/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{dir = 9},/turf/simulated/floor,/area/hallway/secondary/exit) "aKH" = (/turf/simulated/floor,/area/hallway/secondary/exit) "aKI" = (/obj/machinery/alarm{pixel_y = 25},/turf/simulated/floor,/area/hallway/secondary/exit) -"aKJ" = (/obj/structure/closet/emcloset,/turf/simulated/floor{dir = 1; icon_state = "warning"},/area/hallway/secondary/exit) -"aKK" = (/obj/structure/closet/emcloset,/turf/simulated/floor{dir = 5; icon_state = "warning"},/area/hallway/secondary/exit) +"aKJ" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor{dir = 1; icon_state = "warning"},/area/hallway/secondary/exit) +"aKK" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor{dir = 5; icon_state = "warning"},/area/hallway/secondary/exit) "aKL" = (/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/turf/simulated/floor/plating,/area/hallway/secondary/exit) "aKM" = (/obj/machinery/light,/turf/simulated/floor,/area/hallway/secondary/entry) "aKN" = (/obj/machinery/door/firedoor/border_only{dir = 8},/turf/simulated/floor,/area/hallway/secondary/entry) @@ -2326,7 +2326,7 @@ "aSL" = (/turf/simulated/floor{icon_state = "carpetside"},/area/chapel/main) "aSM" = (/obj/machinery/atmospherics/unary/vent_scrubber{on = 1},/obj/machinery/light{dir = 4},/turf/simulated/floor{icon_state = "dark"},/area/chapel/main) "aSN" = (/obj/machinery/power/apc{dir = 8; name = "Escape Hallway APC"; pixel_x = -25},/obj/structure/cable,/turf/simulated/floor{dir = 8; icon_state = "escape"},/area/hallway/secondary/exit) -"aSO" = (/obj/structure/closet/emcloset,/turf/simulated/floor{dir = 9; icon_state = "warning"},/area/hallway/secondary/entry) +"aSO" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor{dir = 9; icon_state = "warning"},/area/hallway/secondary/entry) "aSP" = (/obj/structure/table/woodentable,/turf/simulated/floor,/area/security/vacantoffice) "aSQ" = (/obj/structure/table/woodentable,/turf/simulated/floor/plating,/area/security/vacantoffice) "aSR" = (/obj/machinery/power/apc{dir = 2; name = "Vacant Office APC"; pixel_y = -24},/obj/structure/cable{icon_state = "0-4"; d2 = 4},/turf/simulated/floor,/area/security/vacantoffice) @@ -2881,7 +2881,7 @@ "bdu" = (/turf/simulated/floor{dir = 2; icon_state = "warnwhite"; tag = "icon-warnwhite (NORTH)"},/area/toxins/lab) "bdv" = (/obj/structure/disposalpipe/sortjunction{dir = 2; icon_state = "pipe-j2s"; sortType = 22},/turf/simulated/floor{icon_state = "white"},/area/toxins/lab) "bdw" = (/obj/structure/disposalpipe/trunk{dir = 8},/obj/machinery/disposal,/obj/machinery/firealarm{dir = 4; pixel_x = 24},/turf/simulated/floor{icon_state = "white"},/area/toxins/lab) -"bdx" = (/obj/structure/closet/emcloset,/obj/machinery/light{icon_state = "tube1"; dir = 8},/obj/structure/window/reinforced{dir = 1},/turf/simulated/floor{dir = 5; icon_state = "warning"},/area/medical/research{name = "Research Division"}) +"bdx" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor{dir = 5; icon_state = "warning"},/area/medical/research{name = "Research Division"}) "bdy" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden,/turf/simulated/floor{icon_state = "white"},/area/medical/research{name = "Research Division"}) "bdz" = (/obj/machinery/atmospherics/unary/vent_scrubber{on = 1; scrub_N2O = 0; scrub_Toxins = 0},/turf/simulated/floor{icon_state = "white"},/area/medical/research{name = "Research Division"}) "bdA" = (/obj/structure/closet/l3closet/general,/obj/machinery/light{icon_state = "tube1"; dir = 4},/obj/structure/window/reinforced,/turf/simulated/floor{dir = 10; icon_state = "warning"},/area/medical/research{name = "Research Division"}) @@ -3596,7 +3596,7 @@ "brh" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 4},/obj/machinery/portable_atmospherics/canister/nitrogen,/obj/structure/window/reinforced{dir = 4},/turf/simulated/floor{icon_state = "delivery"; name = "floor"},/area/toxins/storage) "bri" = (/obj/machinery/portable_atmospherics/canister/carbon_dioxide,/obj/structure/window/reinforced{dir = 8},/obj/machinery/atmospherics/pipe/manifold{color = "blue"; dir = 4; icon_state = "manifold-b-f"; initialize_directions = 11; level = 1; name = "pipe manifold"},/turf/simulated/floor{icon_state = "delivery"; name = "floor"},/area/toxins/storage) "brj" = (/obj/machinery/portable_atmospherics/canister/carbon_dioxide,/obj/structure/window/reinforced{dir = 4},/turf/simulated/floor{icon_state = "delivery"; name = "floor"},/area/toxins/storage) -"brk" = (/obj/structure/closet/emcloset,/turf/simulated/floor/plating,/area/maintenance/asmaint2) +"brk" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor/plating,/area/maintenance/asmaint2) "brl" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; pixel_y = 0; tag = "Streight"},/obj/structure/disposalpipe/segment,/turf/simulated/floor/plating,/area/maintenance/apmaint) "brm" = (/obj/structure/grille,/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/turf/simulated/floor/plating,/area/quartermaster/qm) "brn" = (/obj/structure/closet,/obj/machinery/light_switch{pixel_y = -22},/turf/simulated/floor,/area/quartermaster/qm) @@ -4875,7 +4875,7 @@ "bPM" = (/obj/structure/grille,/obj/structure/window/reinforced,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 1},/obj/structure/window/reinforced{dir = 8},/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{dir = 4},/turf/simulated/floor/plating,/area/assembly/assembly_line) "bPN" = (/obj/machinery/light{dir = 1},/obj/machinery/atmospherics/pipe/manifold{color = "red"; dir = 4; icon_state = "manifold-r-f"; initialize_directions = 11; level = 1; name = "pipe manifold"},/turf/simulated/floor,/area/hallway/primary/aft) "bPO" = (/obj/machinery/light{dir = 4; icon_state = "tube1"},/turf/simulated/floor{icon_state = "yellowcorner"},/area/hallway/primary/aft) -"bPP" = (/obj/structure/closet/emcloset,/turf/simulated/floor{icon_state = "cautioncorner"; dir = 2},/area/hallway/primary/aft) +"bPP" = (/obj/effect/landmark{name = "emcloset"},/turf/simulated/floor{icon_state = "cautioncorner"; dir = 2},/area/hallway/primary/aft) "bPQ" = (/obj/machinery/light/small,/turf/simulated/floor{icon_state = "cautioncorner"; dir = 2},/area/hallway/primary/aft) "bPR" = (/turf/simulated/floor{icon_state = "caution"; dir = 6},/area/hallway/primary/aft) "bPS" = (/obj/effect/sign/securearea,/turf/simulated/wall/r_wall,/area/atmos) From 9a81f4496bec1d684f48681e7443e2381fd11a66 Mon Sep 17 00:00:00 2001 From: Miniature Date: Wed, 4 Jan 2012 02:15:38 +1030 Subject: [PATCH 2/4] Finished emlocker stuff if someone wants to move where the spawning is done feel free --- code/game/master_controller.dm | 7 +++++++ code/game/objects/closets/emergency.dm | 2 ++ 2 files changed, 9 insertions(+) diff --git a/code/game/master_controller.dm b/code/game/master_controller.dm index 1c5ec008e3a..a04c8421fdf 100644 --- a/code/game/master_controller.dm +++ b/code/game/master_controller.dm @@ -65,6 +65,13 @@ datum/controller/game_controller for(var/obj/machinery/atmospherics/unary/vent_scrubber/T in world) T.broadcast_status() + var/emclosetcount = rand((emclosets.len)/2, (emclosets.len)*2/3) + while(emclosetcount > 0) + var/turf/loc = pick(emclosets) + emclosets -= loc + new /obj/structure/closet/emcloset(loc) + emclosetcount-- + world << "\red \b Initializations complete." diff --git a/code/game/objects/closets/emergency.dm b/code/game/objects/closets/emergency.dm index 5456e56c383..80e87c6367f 100644 --- a/code/game/objects/closets/emergency.dm +++ b/code/game/objects/closets/emergency.dm @@ -9,6 +9,8 @@ var/counter = 0 while(prob(60) && counter < 3) new /obj/item/weapon/tank/emergency_oxygen(src) + counter++ counter = 0 while(prob(60) && counter < 3) new /obj/item/clothing/mask/breath(src) + counter++ From 8aba29cc9c6cd6a763ddb238e4cdc3ba4d6c7d39 Mon Sep 17 00:00:00 2001 From: Miniature Date: Wed, 4 Jan 2012 03:15:20 +1030 Subject: [PATCH 3/4] Fixing some null runtimes --- code/game/objects/structures.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index aef7dff3fec..87b458c5651 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -74,6 +74,8 @@ obj/structure else if((istype(W, /obj/item/stack/sheet/metal)) && (W:amount >= 2)) user << "\blue Now adding plating..." if (do_after(user,40)) + if(!W) + return user << "\blue You added the plating!" var/turf/Tsrc = get_turf(src) Tsrc.ReplaceWithWall() @@ -85,6 +87,8 @@ obj/structure if (src.icon_state == "reinforced") //Time to finalize! user << "\blue Now finalising reinforced wall." if(do_after(user, 50)) + if(!W) + return user << "\blue Wall fully reinforced!" var/turf/Tsrc = get_turf(src) Tsrc.ReplaceWithRWall() @@ -95,6 +99,8 @@ obj/structure else user << "\blue Now reinforcing girders" if (do_after(user,60)) + if(!W) + return user << "\blue Girders reinforced!" W:use(1) new/obj/structure/girder/reinforced( src.loc ) From 719c6a3b31d693a978d10f34dba501c15f787c92 Mon Sep 17 00:00:00 2001 From: Miniature Date: Wed, 4 Jan 2012 03:22:07 +1030 Subject: [PATCH 4/4] Don't ask me why this didn't work already, another runtime fixed --- code/modules/recycling/disposal.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index e4a15e3b6b1..e10ccec4d5b 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -95,7 +95,7 @@ return else - if(isnull(I)) + if(!I || isnull(I)) //CRASH("disposal/attackby() was called, but I was nulled before calling user.drop_item()") return // No idea why, but somehow I gets nulled before it goes into the else, and that leads to a lot of spam with runtime errors.