Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] [MODULAR] Readd fan_out_items to armory spawner #1086

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions modular_skyrat/modules/sec_haul/code/guns/armory_spawns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// A list of possible guns to spawn.
var/list/guns
/// Do we fan out the items spawned for a natural effect?
var/fan_out_items = TRUE
var/fan_out_items = FALSE
/// How many mags per gun do we spawn, if it takes magazines.
var/mags_to_spawn = 3
/// Do we want to angle it so that it is horizontal?
Expand All @@ -17,15 +17,18 @@
. = ..()

if(guns)
var/current_offset = -10
var/gun_count = 0
var/offset_percent = 20 / guns.len
for(var/gun in guns) // 11/20/21: Gun spawners now spawn 1 of each gun in it's list no matter what, so as to reduce the RNG of the armory stock.
var/obj/item/gun/spawned_gun = new gun(loc)

if(vertical_guns)
spawned_gun.place_on_rack()
spawned_gun.pixel_x = current_offset
current_offset += offset_percent
spawned_gun.pixel_x = -10 + (offset_percent * gun_count)
else if (fan_out_items)
spawned_gun.pixel_x = spawned_gun.pixel_y = ((!(gun_count%2)*gun_count/2)*-1)+((gun_count%2)*(gun_count+1)/2*1)

gun_count++

if(istype(spawned_gun, /obj/item/gun/ballistic))
var/obj/item/gun/ballistic/spawned_ballistic_gun = spawned_gun
Expand Down
Loading