Merge branch 'master' of https://github.com/Skyrat-SS13/Skyrat-tg into upstream-2407c

This commit is contained in:
Waterpig
2024-07-15 10:13:59 +02:00
526 changed files with 25275 additions and 26192 deletions
@@ -211,7 +211,7 @@
/obj/item/clothing/head/costume/lobsterhat,
/obj/item/clothing/head/costume/cardborg,
/obj/item/clothing/head/costume/football_helmet,
/obj/item/clothing/head/costume/tv_head/fov_less,
/obj/item/clothing/head/costume/tv_head,
/obj/item/clothing/head/costume/tmc,
/obj/item/clothing/head/costume/deckers,
/obj/item/clothing/head/costume/yuri,
@@ -2,14 +2,17 @@
name = "maintenance loot spawner"
desc = "Come on Lady Luck, spawn me a pair of sunglasses."
icon_state = "loot"
remove_if_cant_spawn = FALSE //don't remove stuff from the global maint list, which other can use.
// see code/_globalvars/lists/maintenance_loot.dm for loot table
/// A subtype of maintenance loot spawner that does not spawn any decals, for when you want to place them on chasm turfs and such
/// decals such as ashes will cause NeverShouldHaveComeHere() to fail on such turfs, which creates annoying rng based CI failures
/obj/effect/spawner/random/maintenance/no_decals
/obj/effect/spawner/random/maintenance/no_decals/can_spawn(atom/loot)
return !ispath(loot, /obj/effect/decal)
/obj/effect/spawner/random/maintenance/no_decals/can_spawn(loot)
if(ispath(loot, /obj/effect/decal))
return FALSE
return ..()
/obj/effect/spawner/random/maintenance/examine(mob/user)
. = ..()
@@ -29,6 +32,14 @@
//BUBBERSTATION CHANGE END
return ..()
/obj/effect/spawner/random/maintenance/skew_loot_weights(list/loot_list, exponent)
///We only need to skew the weights once, since it's a global list used by all maint spawners.
var/static/already_done = FALSE
if(loot_list == GLOB.maintenance_loot && already_done)
return
already_done = TRUE
return ..()
/obj/effect/spawner/random/maintenance/proc/hide()
SetInvisibility(INVISIBILITY_OBSERVER)
alpha = 100
@@ -29,6 +29,8 @@
var/spawn_scatter_radius = 0
/// Whether the items should have a random pixel_x/y offset (maxium offset distance is ±16 pixels for x/y)
var/spawn_random_offset = FALSE
/// Whether items that cannot be spawned will be removed from the loot list. Keep it TRUE unless you've a good reason.
var/remove_if_cant_spawn = TRUE
/obj/effect/spawner/random/Initialize(mapload)
. = ..()
@@ -53,7 +55,7 @@
loot += subtypesof(loot_subtype_path)
if(CONFIG_GET(number/random_loot_weight_modifier) != 1)
skew_loot_weights(CONFIG_GET(number/random_loot_weight_modifier))
skew_loot_weights(loot, CONFIG_GET(number/random_loot_weight_modifier))
if(loot?.len)
var/loot_spawned = 0
@@ -61,7 +63,8 @@
while((spawn_loot_count-loot_spawned) && loot.len)
var/lootspawn = pick_weight_recursive(loot)
if(!can_spawn(lootspawn))
loot.Remove(lootspawn)
if(remove_if_cant_spawn)
loot.Remove(lootspawn)
continue
if(!spawn_loot_double)
loot.Remove(lootspawn)