Skip to content

Commit

Permalink
[MODULAR] Readd fan_out_items to armory spawner (#1086)
Browse files Browse the repository at this point in the history
Readd fan_out_items to armory spawner

[SQUASH] Fix fan_out_items

Co-authored-by: Penelope Haze <[email protected]>
  • Loading branch information
Steals-The-PRs and out-of-phaze authored Dec 12, 2023
1 parent 26dbbda commit 10739a8
Showing 1 changed file with 7 additions and 4 deletions.
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

0 comments on commit 10739a8

Please sign in to comment.