From 8b38b572a5b3654b58226a9cf33c9f606997afdc Mon Sep 17 00:00:00 2001 From: WolfOrion Date: Sat, 13 Apr 2024 22:45:25 -0700 Subject: [PATCH] Empty Rifles in the Gun Racks (#220) Adds a slightly more realistic way to store firearms, currently unmapped. --- code/game/objects/structures/gun_rack.dm | 11 ++++++++++- code/modules/projectiles/guns/rifles.dm | 8 ++++++++ maps/map_files/chapaev/chapaev.dmm | 4 ++-- maps/map_files/golden_arrow/golden_arrow.dmm | 4 ++-- maps/map_files/rover/rover.dmm | 4 ++-- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/code/game/objects/structures/gun_rack.dm b/code/game/objects/structures/gun_rack.dm index 400002fa35..0a3e668444 100644 --- a/code/game/objects/structures/gun_rack.dm +++ b/code/game/objects/structures/gun_rack.dm @@ -5,6 +5,7 @@ icon_state = "m41a" density = TRUE var/allowed_type + var/populate_type var/max_stored = 5 var/initial_stored = 5 @@ -17,7 +18,7 @@ if(initial_stored) var/i = 0 while(i < initial_stored) - contents += new allowed_type(src) + contents += new populate_type(src) i++ update_icon() @@ -47,6 +48,10 @@ /obj/structure/gun_rack/m41 allowed_type = /obj/item/weapon/gun/rifle/m41aMK1 + populate_type = /obj/item/weapon/gun/rifle/m41aMK1 + +/obj/structure/gun_rack/m41/unloaded + populate_type = /obj/item/weapon/gun/rifle/m41aMK1/unloaded /obj/structure/gun_rack/type71 icon_state = "type71" @@ -54,6 +59,10 @@ max_stored = 6 initial_stored = 6 allowed_type = /obj/item/weapon/gun/rifle/type71 + populate_type = /obj/item/weapon/gun/rifle/type71 + +/obj/structure/gun_rack/type71/unloaded + populate_type = /obj/item/weapon/gun/rifle/type71/unloaded /obj/structure/gun_rack/apc name = "APC ammo compartment" diff --git a/code/modules/projectiles/guns/rifles.dm b/code/modules/projectiles/guns/rifles.dm index 76470513f3..ba2e925ed5 100644 --- a/code/modules/projectiles/guns/rifles.dm +++ b/code/modules/projectiles/guns/rifles.dm @@ -409,6 +409,10 @@ /obj/item/weapon/gun/rifle/m41aMK1/ap //for making it start with ap loaded current_mag = /obj/item/ammo_magazine/rifle/m41aMK1/ap +/obj/item/weapon/gun/rifle/m41aMK1/unloaded //for making it start unloaded and with the safety on + current_mag = null + flags_gun_features = GUN_AUTO_EJECTOR|GUN_CAN_POINTBLANK|GUN_AMMO_COUNTER|GUN_TRIGGER_SAFETY + /obj/item/weapon/gun/rifle/m41aMK1/tactical starting_attachment_types = list(/obj/item/attachable/attached_gun/grenade/mk1, /obj/item/attachable/suppressor, /obj/item/attachable/magnetic_harness, /obj/item/attachable/stock/rifle/collapsible) current_mag = /obj/item/ammo_magazine/rifle/m41aMK1/ap @@ -1331,6 +1335,10 @@ STOCK.Attach(src) update_attachable(STOCK.slot) +/obj/item/weapon/gun/rifle/type71/unloaded + current_mag = null + flags_gun_features = GUN_AUTO_EJECTOR|GUN_CAN_POINTBLANK|GUN_AMMO_COUNTER|GUN_TRIGGER_SAFETY + /obj/item/weapon/gun/rifle/type71/rifleman //add GL random_spawn_chance = 100 diff --git a/maps/map_files/chapaev/chapaev.dmm b/maps/map_files/chapaev/chapaev.dmm index 947d71b406..4efd73c750 100644 --- a/maps/map_files/chapaev/chapaev.dmm +++ b/maps/map_files/chapaev/chapaev.dmm @@ -1553,7 +1553,7 @@ /obj/structure/machinery/light{ dir = 1 }, -/obj/structure/gun_rack/type71, +/obj/structure/gun_rack/type71/unloaded, /turf/open/floor/strata{ icon_state = "floor2" }, @@ -3034,7 +3034,7 @@ /obj/structure/machinery/light{ dir = 1 }, -/obj/structure/gun_rack/type71, +/obj/structure/gun_rack/type71/unloaded, /turf/open/floor/strata{ icon_state = "floor2" }, diff --git a/maps/map_files/golden_arrow/golden_arrow.dmm b/maps/map_files/golden_arrow/golden_arrow.dmm index ab5d87ee73..8c16927018 100644 --- a/maps/map_files/golden_arrow/golden_arrow.dmm +++ b/maps/map_files/golden_arrow/golden_arrow.dmm @@ -4161,7 +4161,7 @@ pixel_x = 14; pixel_y = 29 }, -/obj/structure/gun_rack/m41, +/obj/structure/gun_rack/m41/unloaded, /obj/item/ashtray/plastic{ pixel_y = 14; pixel_x = 8 @@ -6818,7 +6818,7 @@ pixel_y = 29; layer = 3 }, -/obj/structure/gun_rack/m41, +/obj/structure/gun_rack/m41/unloaded, /obj/item/reagent_container/food/drinks/cans/souto/blue{ pixel_y = 22; pixel_x = 9 diff --git a/maps/map_files/rover/rover.dmm b/maps/map_files/rover/rover.dmm index 0d4bc14fd8..ad495d23b9 100644 --- a/maps/map_files/rover/rover.dmm +++ b/maps/map_files/rover/rover.dmm @@ -175,7 +175,7 @@ pixel_y = 34; pixel_x = 8 }, -/obj/structure/gun_rack/m41, +/obj/structure/gun_rack/m41/unloaded, /turf/open/floor/almayer{ icon_state = "plate" }, @@ -3201,7 +3201,7 @@ /obj/structure/machinery/light{ dir = 1 }, -/obj/structure/gun_rack/m41, +/obj/structure/gun_rack/m41/unloaded, /turf/open/floor/almayer{ icon_state = "plate" },