mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Converts sec armories to using the (not) random mapping spawners (#76392)
## About The Pull Request Title. ## Why It's Good For The Game Armories aren't really a dense area mapping wise, just a few guns there, armor there, and some fluff security stuff (like HUDs or whatever). This PR just converts most of the heavy stuff (armor, helmets, guns) into spawning helpers with the aim to make mapping armories just a tad bit quicker and easier. The only thing this does kinda nuke is the neatly stacked stuff, which the mapping helpers kinda suck at doing, but its not totally woeful. ## Changelog 🆑 Jolly, timothymtorres code: Jolly: Armories across all maps have been tweaked slightly. Report to a Nanotrasen security advisor for any missing guns, armor, helmets or anything else that was there previously (that means, post an issue on Github if theres an issue!!) code: timothymtorres: Random item spawners now support better control of their X/Y pixel offset. /🆑 --------- Co-authored-by: Tim <timothymtorres@gmail.com>
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
/obj/effect/spawner/random/armory
|
||||
name = "generic armory spawner"
|
||||
spawn_loot_split = TRUE
|
||||
spawn_loot_count = 3
|
||||
spawn_loot_split_pixel_offsets = 4
|
||||
|
||||
// Misc armory stuff
|
||||
/obj/effect/spawner/random/armory/barrier_grenades
|
||||
name = "barrier grenade spawner"
|
||||
icon_state = "barrier_grenade"
|
||||
loot = list(/obj/item/grenade/barrier)
|
||||
|
||||
/obj/effect/spawner/random/armory/barrier_grenades/six
|
||||
name = "six barrier grenade spawner"
|
||||
spawn_loot_count = 6
|
||||
|
||||
/obj/effect/spawner/random/armory/riot_shield
|
||||
name = "riot shield spawner"
|
||||
icon_state = "riot_shield"
|
||||
loot = list(/obj/item/shield/riot)
|
||||
|
||||
/obj/effect/spawner/random/armory/rubbershot
|
||||
name = "rubbershot spawner"
|
||||
icon_state = "rubbershot"
|
||||
loot = list(/obj/item/storage/box/rubbershot)
|
||||
|
||||
// Weapons
|
||||
/obj/effect/spawner/random/armory/disablers
|
||||
name = "disabler spawner"
|
||||
icon_state = "disabler"
|
||||
loot = list(/obj/item/gun/energy/disabler)
|
||||
|
||||
/obj/effect/spawner/random/armory/laser_gun
|
||||
name = "laser gun spawner"
|
||||
icon_state = "laser_gun"
|
||||
loot = list(/obj/item/gun/energy/laser)
|
||||
|
||||
/obj/effect/spawner/random/armory/e_gun
|
||||
name = "energy gun spawner"
|
||||
icon_state = "e_gun"
|
||||
loot = list(/obj/item/gun/energy/e_gun)
|
||||
|
||||
/obj/effect/spawner/random/armory/shotgun
|
||||
name = "shotgun spawner"
|
||||
icon_state = "shotgun"
|
||||
loot = list(/obj/item/gun/ballistic/shotgun/riot)
|
||||
|
||||
// Armor
|
||||
/obj/effect/spawner/random/armory/bulletproof_helmet
|
||||
name = "bulletproof helmet spawner"
|
||||
icon_state = "armor_helmet"
|
||||
loot = list(/obj/item/clothing/head/helmet/alt)
|
||||
|
||||
/obj/effect/spawner/random/armory/riot_helmet
|
||||
name = "riot helmet spawner"
|
||||
icon_state = "riot_helmet"
|
||||
loot = list(/obj/item/clothing/head/helmet/toggleable/riot)
|
||||
|
||||
/obj/effect/spawner/random/armory/bulletproof_armor
|
||||
name = "bulletproof armor spawner"
|
||||
icon_state = "bulletproof_armor"
|
||||
loot = list(/obj/item/clothing/suit/armor/bulletproof)
|
||||
|
||||
/obj/effect/spawner/random/armory/riot_armor
|
||||
name = "riot armor spawner"
|
||||
icon_state = "riot_armor"
|
||||
loot = list(/obj/item/clothing/suit/armor/riot)
|
||||
@@ -19,6 +19,8 @@
|
||||
var/spawn_loot_double = TRUE
|
||||
/// Whether the items should be distributed to offsets 0,1,-1,2,-2,3,-3.. This overrides pixel_x/y on the spawner itself
|
||||
var/spawn_loot_split = FALSE
|
||||
/// The pixel x/y divider offsets for spawn_loot_split (spaced 1 pixel apart by default)
|
||||
var/spawn_loot_split_pixel_offsets = 2
|
||||
/// Whether the spawner should spawn all the loot in the list
|
||||
var/spawn_all_loot = FALSE
|
||||
/// The chance for the spawner to create loot (ignores spawn_loot_count)
|
||||
@@ -52,6 +54,7 @@
|
||||
|
||||
if(loot?.len)
|
||||
var/loot_spawned = 0
|
||||
var/pixel_divider = FLOOR(16 / spawn_loot_split_pixel_offsets, 1) // 16 pixels offsets is max that should be allowed in any direction
|
||||
while((spawn_loot_count-loot_spawned) && loot.len)
|
||||
var/lootspawn = pick_weight_recursive(loot)
|
||||
if(!spawn_loot_double)
|
||||
@@ -74,7 +77,9 @@
|
||||
spawned_loot.pixel_y = rand(-16, 16)
|
||||
else if (spawn_loot_split)
|
||||
if (loot_spawned)
|
||||
spawned_loot.pixel_x = spawned_loot.pixel_y = ((!(loot_spawned%2)*loot_spawned/2)*-1)+((loot_spawned%2)*(loot_spawned+1)/2*1)
|
||||
var/column = FLOOR(loot_spawned / pixel_divider, 1)
|
||||
spawned_loot.pixel_x = spawn_loot_split_pixel_offsets * (loot_spawned % pixel_divider) + (column * spawn_loot_split_pixel_offsets)
|
||||
spawned_loot.pixel_y = spawn_loot_split_pixel_offsets * (loot_spawned % pixel_divider)
|
||||
loot_spawned++
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user