Skip to content

Commit

Permalink
Merge pull request #5803 from Trilbyspaceclone/locker_fixes
Browse files Browse the repository at this point in the history
Fixes GP lockers not properly stacking spawns
  • Loading branch information
Trilbyspaceclone authored Oct 27, 2024
2 parents 38896f7 + 093788b commit b254dd3
Showing 1 changed file with 38 additions and 77 deletions.
115 changes: 38 additions & 77 deletions code/game/objects/structures/crates_lockers/closets/onestar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

//// Loot table on all tiers
// Tier 1
/obj/structure/closet/onestar/populate_contents()
populated_contents = TRUE

/obj/structure/closet/onestar/proc/dont_spawn_items()
if(populated_contents)
return TRUE
return FALSE

/obj/structure/closet/onestar/tier1
name = "\improper Greyson forgotten closet"
desc = "It's an old Greyson closet. Doesn't seem like it contains anything worthwhile. Probably."
icon_state = "lootcloset"

/obj/structure/closet/onestar/tier1/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
..()
new /obj/random/contraband/low_chance(src)
new /obj/random/contraband/low_chance(src)
new /obj/random/pack/rare/low_chance(src)
Expand All @@ -31,6 +37,7 @@
new /obj/random/gun_parts/low(src)
if(prob(40))
new /obj/random/gun_parts/frames(src)
..()

// Tier 2
/obj/structure/closet/onestar/tier2
Expand All @@ -39,10 +46,8 @@
icon_state = "lootcloset1"

/obj/structure/closet/onestar/tier2/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
..()
new /obj/random/contraband/low_chance(src)
new /obj/random/contraband/low_chance(src)
new /obj/random/pack/rare/low_chance(src)
Expand All @@ -63,6 +68,7 @@
if(prob(80))
new /obj/random/gun_parts/frames(src)
new /obj/random/gun_parts/frames(src)
..()


// Tier 3
Expand All @@ -72,10 +78,8 @@
icon_state = "lootcloset2"

/obj/structure/closet/onestar/tier3/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
..()
new /obj/random/contraband/low_chance(src)
new /obj/random/contraband/low_chance(src)
new /obj/random/pack/rare/low_chance(src)
Expand Down Expand Up @@ -103,6 +107,7 @@
if(prob(80))
new /obj/random/gun_parts/frames(src)
new /obj/random/gun_parts/frames(src)
..()

////// Closets

Expand All @@ -116,10 +121,7 @@
// Empty
/obj/structure/closet/onestar/tier1/normal/empty
/obj/structure/closet/onestar/tier1/normal/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

//Tier 2
/obj/structure/closet/onestar/tier2/normal
Expand All @@ -130,10 +132,7 @@
// Empty
/obj/structure/closet/onestar/tier2/normal/empty
/obj/structure/closet/onestar/tier2/normal/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

//Tier 3
/obj/structure/closet/onestar/tier3/normal
Expand All @@ -144,10 +143,7 @@
// Empty
/obj/structure/closet/onestar/tier3/normal/empty
/obj/structure/closet/onestar/tier3/normal/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return


////Special
Expand All @@ -158,24 +154,20 @@
old_chance = 70

/obj/structure/closet/onestar/tier1/special/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
..()
new /obj/random/pack/rare/low_chance(src)
new /obj/random/pack/rare/low_chance(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
new /obj/random/gun_parts/low(src)
..()


// Empty
/obj/structure/closet/onestar/tier1/special/empty
/obj/structure/closet/onestar/tier1/special/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

//Tier 2
/obj/structure/closet/onestar/tier2/special
Expand All @@ -184,25 +176,21 @@
old_chance = 30

/obj/structure/closet/onestar/tier2/special/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
..()
new /obj/random/pack/rare/low_chance(src)
new /obj/random/pack/rare/low_chance(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
new /obj/random/gun_parts/low(src)
new /obj/random/gun_parts/frames(src)
..()


// Empty
/obj/structure/closet/onestar/tier2/special/empty
/obj/structure/closet/onestar/tier2/special/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

//Tier 3
/obj/structure/closet/onestar/tier3/special
Expand All @@ -211,9 +199,8 @@
old_chance = 10

/obj/structure/closet/onestar/tier3/special/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
new /obj/random/pack/rare/low_chance(src)
new /obj/random/pack/rare/low_chance(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
Expand All @@ -222,13 +209,11 @@
new /obj/random/gun_parts/frames(src)
new /obj/random/gun_parts/frames(src)
..()

// Empty
/obj/structure/closet/onestar/tier3/special/empty
/obj/structure/closet/onestar/tier3/special/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

////Mineral
//Tier 1
Expand All @@ -238,9 +223,8 @@
old_chance = 70

/obj/structure/closet/onestar/tier1/mineral/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
new /obj/random/pack/tech_loot/low_chance(src)
new /obj/random/pack/tech_loot/low_chance(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
Expand All @@ -251,10 +235,7 @@
// Empty
/obj/structure/closet/onestar/tier1/mineral/empty
/obj/structure/closet/onestar/tier1/mineral/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

//Tier 2
/obj/structure/closet/onestar/tier2/mineral
Expand All @@ -263,9 +244,8 @@
old_chance = 30

/obj/structure/closet/onestar/tier2/mineral/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
new /obj/random/pack/tech_loot/low_chance(src)
new /obj/random/pack/tech_loot/low_chance(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
Expand All @@ -276,10 +256,7 @@
// Empty
/obj/structure/closet/onestar/tier2/mineral/empty
/obj/structure/closet/onestar/tier2/mineral/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

//Tier 3
/obj/structure/closet/onestar/tier3/mineral
Expand All @@ -288,9 +265,8 @@
old_chance = 10

/obj/structure/closet/onestar/tier3/mineral/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
new /obj/random/pack/tech_loot/low_chance(src)
new /obj/random/pack/tech_loot/low_chance(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
Expand All @@ -301,10 +277,7 @@
// Empty
/obj/structure/closet/onestar/tier3/mineral/empty
/obj/structure/closet/onestar/tier3/mineral/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

////Medical
//Tier 1
Expand All @@ -314,9 +287,8 @@
old_chance = 70

/obj/structure/closet/onestar/tier1/medical/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
new /obj/random/lowkeyrandom(src)
new /obj/random/lowkeyrandom(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
Expand All @@ -327,10 +299,7 @@
// Empty
/obj/structure/closet/onestar/tier1/medical/empty
/obj/structure/closet/onestar/tier1/medical/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

//Tier 2
/obj/structure/closet/onestar/tier2/medical
Expand All @@ -339,9 +308,8 @@
old_chance = 30

/obj/structure/closet/onestar/tier2/medical/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
new /obj/random/lowkeyrandom(src)
new /obj/random/lowkeyrandom(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
Expand All @@ -350,10 +318,7 @@
// Empty
/obj/structure/closet/onestar/tier2/medical/empty
/obj/structure/closet/onestar/tier2/medical/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

//Tier 3
/obj/structure/closet/onestar/tier3/medical
Expand All @@ -362,9 +327,8 @@
old_chance = 10

/obj/structure/closet/onestar/tier3/medical/populate_contents()
if(populated_contents)
if(dont_spawn_items())
return
populated_contents = TRUE
new /obj/random/lowkeyrandom(src)
new /obj/random/lowkeyrandom(src)
new /obj/random/cloth/greyson_clothing/low_chance(src)
Expand All @@ -374,7 +338,4 @@
// Empty
/obj/structure/closet/onestar/tier3/medical/empty
/obj/structure/closet/onestar/tier3/medical/empty/populate_contents()
if(populated_contents)
return
populated_contents = TRUE
..()
return

0 comments on commit b254dd3

Please sign in to comment.