From 9dd9d9413add613e6d36c1080a2f366062bab88d Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Sun, 31 Dec 2017 10:26:43 +0200 Subject: [PATCH] Improves loot drop spawners, adds AI law spawners to cores (#33945) * hymn to breaking strain * remove subtypes as requested * no-one saw that --- _maps/map_files/BoxStation/BoxStation.dmm | 5 ++- .../map_files/Deltastation/DeltaStation2.dmm | 40 +++++++++---------- _maps/map_files/MetaStation/MetaStation.dmm | 5 ++- _maps/map_files/OmegaStation/OmegaStation.dmm | 40 +++++++++---------- _maps/map_files/PubbyStation/PubbyStation.dmm | 5 ++- .../game/objects/effects/spawners/lootdrop.dm | 16 ++++++-- 6 files changed, 58 insertions(+), 53 deletions(-) diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm index 335393adac..2f9716406c 100644 --- a/_maps/map_files/BoxStation/BoxStation.dmm +++ b/_maps/map_files/BoxStation/BoxStation.dmm @@ -22174,7 +22174,8 @@ req_access_txt = "20" }, /obj/structure/window/reinforced, -/obj/item/aiModule/core/full/corp, +/obj/effect/spawner/lootdrop/aimodule_harmless, +/obj/effect/spawner/lootdrop/aimodule_neutral, /obj/structure/window/reinforced{ dir = 1 }, @@ -22235,7 +22236,7 @@ }, /obj/item/aiModule/reset/purge, /obj/structure/window/reinforced, -/obj/item/aiModule/core/full/antimov, +/obj/effect/spawner/lootdrop/aimodule_harmful, /obj/structure/window/reinforced{ dir = 1 }, diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index 2852c76257..fe77452705 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -54219,14 +54219,10 @@ name = "Core Modules"; req_access_txt = "20" }, -/obj/item/aiModule/core/full/paladin{ - pixel_x = 3; - pixel_y = 3 - }, -/obj/item/aiModule/core/full/asimov, -/obj/item/aiModule/core/full/corp{ - pixel_x = -3; - pixel_y = -3 +/obj/effect/spawner/lootdrop/aimodule_harmless{ + fan_out_items = 1; + lootdoubles = 0; + lootcount = 3 }, /obj/structure/sign/nanotrasen{ pixel_x = -32 @@ -54279,12 +54275,12 @@ name = "Core Modules"; req_access_txt = "20" }, -/obj/item/aiModule/core/full/antimov{ - pixel_x = 3; - pixel_y = 3 +/obj/effect/spawner/lootdrop/aimodule_harmful{ + fan_out_items = 1; + lootdoubles = 0; + lootcount = 2 }, -/obj/item/aiModule/supplied/oxygen, -/obj/item/aiModule/supplied/protectStation{ +/obj/item/aiModule/supplied/oxygen{ pixel_x = -3; pixel_y = -3 }, @@ -55144,6 +55140,10 @@ pixel_y = 3 }, /obj/item/aiModule/core/full/custom, +/obj/item/aiModule/core/full/asimov{ + pixel_x = -3; + pixel_y = -3 + }, /turf/open/floor/plasteel/vault{ dir = 8 }, @@ -55226,7 +55226,7 @@ req_access_txt = "20" }, /obj/structure/window/reinforced, -/obj/item/aiModule/core/full/tyrant{ +/obj/item/aiModule/supplied/protectStation{ pixel_x = 3; pixel_y = 3 }, @@ -57252,14 +57252,10 @@ /area/ai_monitored/turret_protected/ai_upload) "clQ" = ( /obj/structure/table/reinforced, -/obj/item/aiModule/core/full/drone{ - pixel_x = 3; - pixel_y = 3 - }, -/obj/item/aiModule/core/full/reporter, -/obj/item/aiModule/core/full/liveandletlive{ - pixel_x = -3; - pixel_y = -3 +/obj/effect/spawner/lootdrop/aimodule_neutral{ + fan_out_items = 1; + lootdoubles = 0; + lootcount = 3 }, /turf/open/floor/plasteel/vault{ dir = 8 diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 8ed9acf09f..3480f9d6c4 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -18443,6 +18443,7 @@ "aMG" = ( /obj/structure/table, /obj/item/aiModule/core/full/asimov, +/obj/effect/spawner/lootdrop/aimodule_harmless, /obj/item/aiModule/core/freeformcore, /obj/machinery/door/window{ base_state = "right"; @@ -18452,7 +18453,7 @@ req_access_txt = "20" }, /obj/structure/window/reinforced, -/obj/item/aiModule/core/full/corp, +/obj/effect/spawner/lootdrop/aimodule_neutral, /obj/item/aiModule/core/full/custom, /obj/machinery/flasher{ pixel_y = 24; @@ -18477,7 +18478,7 @@ pixel_y = 24; id = "AI" }, -/obj/item/aiModule/core/full/antimov, +/obj/effect/spawner/lootdrop/aimodule_harmful, /obj/item/aiModule/supplied/oxygen, /obj/item/aiModule/supplied/protectStation, /obj/item/aiModule/zeroth/oneHuman, diff --git a/_maps/map_files/OmegaStation/OmegaStation.dmm b/_maps/map_files/OmegaStation/OmegaStation.dmm index ffda1f471d..0352106ad4 100644 --- a/_maps/map_files/OmegaStation/OmegaStation.dmm +++ b/_maps/map_files/OmegaStation/OmegaStation.dmm @@ -2376,14 +2376,10 @@ name = "Core Modules"; req_access_txt = "20" }, -/obj/item/aiModule/core/full/paladin{ - pixel_x = 3; - pixel_y = 3 - }, -/obj/item/aiModule/core/full/asimov, -/obj/item/aiModule/core/full/corp{ - pixel_x = -3; - pixel_y = -3 +/obj/effect/spawner/lootdrop/aimodule_harmless{ + fan_out_items = 1; + lootdoubles = 0; + lootcount = 3 }, /obj/structure/sign/nanotrasen{ pixel_x = -32 @@ -2499,12 +2495,12 @@ name = "Core Modules"; req_access_txt = "20" }, -/obj/item/aiModule/core/full/antimov{ - pixel_x = 3; - pixel_y = 3 +/obj/effect/spawner/lootdrop/aimodule_harmful{ + fan_out_items = 1; + lootdoubles = 0; + lootcount = 2 }, -/obj/item/aiModule/supplied/oxygen, -/obj/item/aiModule/supplied/protectStation{ +/obj/item/aiModule/supplied/oxygen{ pixel_x = -3; pixel_y = -3 }, @@ -2875,6 +2871,10 @@ pixel_y = 3 }, /obj/item/aiModule/core/full/custom, +/obj/item/aiModule/core/full/asimov{ + pixel_x = -3; + pixel_y = -3 + }, /obj/machinery/camera{ c_tag = "AI Core - Port"; dir = 4; @@ -2900,7 +2900,7 @@ req_access_txt = "20" }, /obj/structure/window/reinforced, -/obj/item/aiModule/core/full/tyrant{ +/obj/item/aiModule/supplied/protectStation{ pixel_x = 3; pixel_y = 3 }, @@ -4361,14 +4361,10 @@ /area/ai_monitored/turret_protected/ai) "ahV" = ( /obj/structure/table/reinforced, -/obj/item/aiModule/core/full/drone{ - pixel_x = 3; - pixel_y = 3 - }, -/obj/item/aiModule/core/full/reporter, -/obj/item/aiModule/core/full/liveandletlive{ - pixel_x = -3; - pixel_y = -3 +/obj/effect/spawner/lootdrop/aimodule_neutral{ + fan_out_items = 1; + lootdoubles = 0; + lootcount = 3 }, /turf/open/floor/plasteel/vault{ dir = 8 diff --git a/_maps/map_files/PubbyStation/PubbyStation.dmm b/_maps/map_files/PubbyStation/PubbyStation.dmm index 7eb9a7ac7a..a504dc4a0b 100644 --- a/_maps/map_files/PubbyStation/PubbyStation.dmm +++ b/_maps/map_files/PubbyStation/PubbyStation.dmm @@ -12140,6 +12140,7 @@ "aED" = ( /obj/structure/table, /obj/item/aiModule/core/full/asimov, +/obj/effect/spawner/lootdrop/aimodule_harmless, /obj/item/aiModule/core/freeformcore, /obj/machinery/door/window{ base_state = "right"; @@ -12148,7 +12149,7 @@ name = "Core Modules"; req_access_txt = "20" }, -/obj/item/aiModule/core/full/corp, +/obj/effect/spawner/lootdrop/aimodule_neutral, /obj/item/aiModule/core/full/custom, /obj/structure/window/reinforced{ dir = 1; @@ -12197,7 +12198,7 @@ req_access_txt = "20" }, /obj/item/aiModule/reset/purge, -/obj/item/aiModule/core/full/antimov, +/obj/effect/spawner/lootdrop/aimodule_harmful, /obj/item/aiModule/supplied/protectStation, /obj/structure/window/reinforced{ dir = 1; diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm index 34e6793d5b..a2ff5b0674 100644 --- a/code/game/objects/effects/spawners/lootdrop.dm +++ b/code/game/objects/effects/spawners/lootdrop.dm @@ -5,19 +5,29 @@ var/lootcount = 1 //how many items will be spawned var/lootdoubles = TRUE //if the same item can be spawned twice var/list/loot //a list of possible items to spawn e.g. list(/obj/item, /obj/structure, /obj/effect) + var/fan_out_items = FALSE //Whether the items should be distributed to offsets 0,3,-3,6,-6,9,-9.. This overrides pixel_x/y on the spawner itself /obj/effect/spawner/lootdrop/Initialize(mapload) ..() if(loot && loot.len) var/turf/T = get_turf(src) - while(lootcount && loot.len) + var/loot_spawned = 0 + while((lootcount-loot_spawned) && loot.len) var/lootspawn = pickweight(loot) if(!lootdoubles) loot.Remove(lootspawn) if(lootspawn) - new lootspawn(T) - lootcount-- + var/atom/movable/spawned_loot = new lootspawn(T) + if (!fan_out_items) + if (pixel_x != 0) + spawned_loot.pixel_x = pixel_x + if (pixel_y != 0) + spawned_loot.pixel_y = pixel_y + else + if (loot_spawned) + spawned_loot.pixel_x = spawned_loot.pixel_y = ((!(loot_spawned%2)*loot_spawned/2)*-3)+((loot_spawned%2)*(loot_spawned+1)/2*3) + loot_spawned++ return INITIALIZE_HINT_QDEL /obj/effect/spawner/lootdrop/armory_contraband