Skip to content

Commit

Permalink
gun racks (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndroBetel authored Mar 11, 2024
1 parent 13bddd8 commit 84e518f
Show file tree
Hide file tree
Showing 8 changed files with 269 additions and 112 deletions.
17 changes: 15 additions & 2 deletions code/game/objects/structures/crates_lockers/largecrate_supplies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,16 @@
supplies = list(/obj/item/storage/box/explosive_mines = 5)

/obj/structure/largecrate/supply/explosives/grenades
name = "\improper M40 HDEP grenade case (x50)"
desc = "A case containing two twenty-five M40 HDEP grenade boxes."
name = "\improper M40 HEDP grenade case (x50)"
desc = "A case containing two twenty-five M40 HEDP grenade boxes."
supplies = list(/obj/item/storage/box/nade_box = 2)

/obj/structure/largecrate/supply/explosives/grenades/less
name = "\improper M40 HEDP grenade case (x25)"
desc = "A case containing one twenty-five M40 HEDP grenade box."
icon_state = "case"
supplies = list(/obj/item/storage/box/nade_box = 1)

/obj/structure/largecrate/supply/explosives/mortar_he
name = "80mm HE mortar shell case (x25)"
desc = "A case containing twenty-five 80mm HE mortar shells."
Expand Down Expand Up @@ -295,6 +301,13 @@
desc = "A crate containing a P.A.C.M.A.N. generator, some fuel, and some cable coil to get your power up and going."
supplies = list(/obj/structure/machinery/power/port_gen/pacman = 1, /obj/item/stack/sheet/mineral/phoron/medium_stack = 1, /obj/item/stack/cable_coil/yellow = 3)

/obj/structure/largecrate/supply/motiondetectors
name = "\improper motion detectors crate"
desc = "A crate containing two motiondetectors."
icon_state = "case"
supplies = list(/obj/item/device/motiondetector = 2)


/obj/structure/largecrate/supply/medicine
name = "medical crate"
desc = "A crate containing medical supplies."
Expand Down
56 changes: 56 additions & 0 deletions code/game/objects/structures/gun_rack.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/obj/structure/gun_rack
name = "gun rack"
desc = "ARMAT-produced gun rack for storage of long guns. While initial model was supposed to be extremely modifiable, USCM comissioned racks with fixed slots which only fit M41A rifles. Some say they were cheaper, and some say the main reason was marine's ability to easily break anything more complex than a tungsten ball."
icon = 'icons/obj/structures/gun_racks.dmi'
icon_state = "m41a"
density = TRUE
var/allowed_type
var/max_stored = 5
var/initial_stored = 5

/obj/structure/gun_rack/Initialize()
. = ..()
if(!allowed_type)
icon_state = "m41a_0"
return

if(initial_stored)
var/i = 0
while(i < initial_stored)
contents += new allowed_type(src)
i++
update_icon()

/obj/structure/gun_rack/attackby(obj/item/O, mob/user)
if(istype(O, allowed_type) && contents.len < max_stored)
user.drop_inv_item_to_loc(O, src)
contents += O
update_icon()

/obj/structure/gun_rack/attack_hand(mob/living/user)
if(!contents.len)
to_chat(user, SPAN_WARNING("[src] is empty."))
return

var/obj/stored_obj = contents[contents.len]
contents -= stored_obj
user.put_in_hands(stored_obj)
to_chat(user, SPAN_NOTICE("You grab [stored_obj] from [src]."))
playsound(src, "gunequip", 25, TRUE)
update_icon()

/obj/structure/gun_rack/update_icon()
if(contents.len)
icon_state = "[initial(icon_state)]_[contents.len]"
else
icon_state = "[initial(icon_state)]_0"

/obj/structure/gun_rack/m41
allowed_type = /obj/item/weapon/gun/rifle/m41aMK1

/obj/structure/gun_rack/type71
icon_state = "type71"
desc = "Some off-branded gun rack. Per SOF and UPPA regulations, weapons should be stored in secure safes and only given out when necessary. Of course, most (but not all!) units overlook this regulation, only storing their firearms in safes when inspection arrives."
max_stored = 6
initial_stored = 6
allowed_type = /obj/item/weapon/gun/rifle/type71
21 changes: 11 additions & 10 deletions code/modules/cm_marines/equipment/guncases.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

/obj/item/storage/box/guncase/update_icon()
if(LAZYLEN(contents))
icon_state = "guncase"
icon_state = initial(icon_state)
else
icon_state = "guncase_e"
icon_state = "[initial(icon_state)]_e"

/obj/item/storage/box/guncase/Initialize()
. = ..()
Expand Down Expand Up @@ -142,13 +142,12 @@
/obj/item/storage/box/guncase/flamer
name = "\improper M240 incinerator case"
desc = "A gun case containing the M240A1 incinerator unit. It does come loaded, but you'll still have to find extra tanks as you go."
storage_slots = 4
storage_slots = 3
can_hold = list(/obj/item/weapon/gun/flamer, /obj/item/ammo_magazine/flamer_tank, /obj/item/attachable/attached_gun/extinguisher)

/obj/item/storage/box/guncase/flamer/fill_preset_inventory()
new /obj/item/weapon/gun/flamer(src)
new /obj/item/ammo_magazine/flamer_tank(src)
new /obj/item/ammo_magazine/flamer_tank(src)
new /obj/item/attachable/attached_gun/extinguisher(src)

//------------
Expand Down Expand Up @@ -201,6 +200,7 @@
/obj/item/storage/box/guncase/pumpshotgun
name = "\improper M37A2 Pump Shotgun case"
desc = "A gun case containing the M37A2 Pump Shotgun."
icon_state = "guncase_red"
storage_slots = 4
can_hold = list(/obj/item/weapon/gun/shotgun/pump, /obj/item/ammo_magazine/shotgun/buckshot, /obj/item/ammo_magazine/shotgun/flechette, /obj/item/ammo_magazine/shotgun/slugs)

Expand All @@ -216,6 +216,13 @@
if(3)
new /obj/item/ammo_magazine/shotgun/slugs(src)

/obj/item/storage/box/guncase/pumpshotgun/special
storage_slots = 2

/obj/item/storage/box/guncase/pumpshotgun/special/fill_preset_inventory()
new /obj/item/weapon/gun/shotgun/pump(src)
new /obj/item/ammo_magazine/shotgun/buckshot/special(src)

/obj/item/storage/box/guncase/mk45_automag
name = "\improper MK-45 Automagnum case"
desc = "A gun case containing the MK-45 'High-Power' Automagnum sidearm. While this weapon was rejected as a replacement for the M44 Combat Revolver, it is often back-issued to troops who prefer its powerful bullets over more common sidearms."
Expand Down Expand Up @@ -323,12 +330,6 @@
/obj/item/pamphlet/trait/vulture,
)

/obj/item/storage/box/guncase/vulture/update_icon()
if(LAZYLEN(contents))
icon_state = "guncase_blue"
else
icon_state = "guncase_blue_e"

/obj/item/storage/box/guncase/vulture/fill_preset_inventory()
var/obj/item/weapon/gun/boltaction/vulture/rifle = new(src)
new /obj/item/ammo_magazine/rifle/boltaction/vulture(src)
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,7 @@
#include "code\game\objects\structures\flora.dm"
#include "code\game\objects\structures\girders.dm"
#include "code\game\objects\structures\grille.dm"
#include "code\game\objects\structures\gun_rack.dm"
#include "code\game\objects\structures\ice_caves.dm"
#include "code\game\objects\structures\inflatable.dm"
#include "code\game\objects\structures\janicart.dm"
Expand Down
Binary file modified icons/obj/items/storage.dmi
Binary file not shown.
Binary file added icons/obj/structures/gun_racks.dmi
Binary file not shown.
109 changes: 77 additions & 32 deletions maps/map_files/chapaev/chapaev.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1532,14 +1532,10 @@
},
/area/golden_arrow/engineering)
"pw" = (
/obj/structure/surface/rack,
/obj/item/weapon/gun/rifle/type71,
/obj/item/weapon/gun/rifle/type71{
pixel_y = 10
},
/obj/structure/machinery/light{
dir = 1
},
/obj/structure/gun_rack/type71,
/turf/open/floor/strata{
icon_state = "floor2"
},
Expand All @@ -1558,11 +1554,14 @@
},
/area/golden_arrow/squad_one)
"pz" = (
/obj/structure/surface/rack,
/obj/item/weapon/gun/rifle/type71,
/obj/item/weapon/gun/rifle/type71{
pixel_y = 10
/obj/structure/surface/table/reinforced/almayer_B,
/obj/item/ammo_magazine/minigun{
name = "GSh-7.62 rotating ammo drum (7.62x51mm)";
desc = "A huge ammo drum for a huge gun. Your platoon got issued with magazines first which happened several months ago. When will the miniguns come, you wonder?";
pixel_y = 8;
pixel_x = 6
},
/obj/item/reagent_container/food/drinks/dry_ramen,
/turf/open/floor/strata{
icon_state = "floor2"
},
Expand Down Expand Up @@ -1801,6 +1800,17 @@
icon_state = "floor3"
},
/area/golden_arrow/cryo_cells)
"rv" = (
/obj/effect/decal/cleanable/dirt,
/obj/structure/largecrate/supply/ammo/type71,
/obj/structure/largecrate/supply/ammo/type71{
pixel_x = 3;
pixel_y = 8
},
/turf/open/floor/strata{
icon_state = "floor2"
},
/area/golden_arrow/squad_one)
"rE" = (
/obj/structure/pipes/vents/pump{
dir = 4
Expand Down Expand Up @@ -2969,14 +2979,10 @@
},
/area/golden_arrow/prep_hallway)
"CU" = (
/obj/structure/surface/rack,
/obj/item/weapon/gun/rifle/type71,
/obj/item/weapon/gun/rifle/type71{
pixel_y = 10
},
/obj/structure/machinery/light{
dir = 1
},
/obj/structure/gun_rack/type71,
/turf/open/floor/strata{
icon_state = "floor2"
},
Expand Down Expand Up @@ -4299,6 +4305,10 @@
/obj/item/clothing/accessory/armband{
pixel_x = 6
},
/obj/item/tool/screwdriver{
pixel_y = 8;
pixel_x = -9
},
/turf/open/floor/strata{
dir = 4;
icon_state = "floor3"
Expand Down Expand Up @@ -4358,6 +4368,24 @@
icon_state = "floor3"
},
/area/golden_arrow/medical)
"RM" = (
/obj/structure/surface/table/reinforced/almayer_B,
/obj/item/attachable/bayonet/upp,
/obj/effect/decal/cleanable/blood/drip{
layer = 6;
plane = 2.8;
pixel_y = 20
},
/obj/effect/decal/cleanable/blood/drip{
layer = 6;
plane = 2.8;
pixel_y = 16;
pixel_x = -7
},
/turf/open/floor/strata{
icon_state = "floor2"
},
/area/golden_arrow/squad_one)
"RN" = (
/obj/structure/machinery/camera/autoname/golden_arrow{
name = "ship-grade camera";
Expand Down Expand Up @@ -4392,10 +4420,20 @@
},
/area/golden_arrow/medical)
"Sf" = (
/obj/structure/surface/rack,
/obj/item/weapon/gun/rifle/type71,
/obj/item/weapon/gun/rifle/type71{
pixel_y = 10
/obj/structure/surface/table/reinforced/almayer_B,
/obj/item/ammo_magazine/handful/shotgun/heavy/flechette{
current_rounds = 1;
pixel_y = 6;
pixel_x = 7
},
/obj/item/ammo_magazine/handful/shotgun/heavy{
pixel_y = 5;
current_rounds = 1
},
/obj/item/ammo_magazine/handful/shotgun/heavy/beanbag{
pixel_y = 5;
pixel_x = -8;
current_rounds = 1
},
/turf/open/floor/strata{
icon_state = "floor2"
Expand Down Expand Up @@ -4495,16 +4533,23 @@
/turf/closed/wall/strata_outpost/reinforced/hull,
/area/golden_arrow/supply)
"Tw" = (
/obj/effect/decal/cleanable/dirt,
/obj/structure/largecrate/supply/ammo/type71,
/obj/structure/largecrate/supply/ammo/type71{
pixel_x = 4;
pixel_y = 8
/obj/structure/surface/table/reinforced/almayer_B,
/obj/item/reagent_container/food/drinks/cans/boda{
pixel_x = -6;
pixel_y = 11
},
/obj/item/reagent_container/food/drinks/cans/boda{
pixel_x = 2;
pixel_y = 11
},
/obj/item/reagent_container/food/drinks/cans/boda{
pixel_x = -3;
pixel_y = 24
},
/turf/open/floor/strata{
icon_state = "floor2"
},
/area/golden_arrow/squad_one)
/area/golden_arrow/squad_two)
"Tx" = (
/obj/structure/machinery/cryopod,
/obj/structure/machinery/camera/autoname/golden_arrow{
Expand Down Expand Up @@ -12375,23 +12420,23 @@ tZ
tZ
tZ
ei
uS
RM
dU
dU
dU
IW
rv
ww
vW
vW
PL
Rm
mv
NU
Lm
Tw
Hp
Hp
Hp
bw
bR
IS
IS
IS
Expand Down Expand Up @@ -12831,7 +12876,7 @@ TB
VP
TB
ww
pz
IW
dU
MH
dU
Expand All @@ -12843,7 +12888,7 @@ es
Rm
vW
NU
Sf
bw
Hp
Jt
Hp
Expand Down Expand Up @@ -12983,7 +13028,7 @@ uA
zU
Ar
ww
Tw
uS
mT
Mm
TF
Expand All @@ -12995,7 +13040,7 @@ zb
vQ
sy
NU
bR
Lm
OL
bc
hV
Expand Down
Loading

0 comments on commit 84e518f

Please sign in to comment.