From bc2ee386913bda736a970d5124fde00ae5869f15 Mon Sep 17 00:00:00 2001 From: Pandora Date: Sat, 10 Aug 2024 07:28:44 +0100 Subject: [PATCH 1/2] Update job_closets.dm Adds new belts to SG closet --- .../objects/structures/crates_lockers/closets/job_closets.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/game/objects/structures/crates_lockers/closets/job_closets.dm b/code/game/objects/structures/crates_lockers/closets/job_closets.dm index ae476b0f73..2379837c97 100644 --- a/code/game/objects/structures/crates_lockers/closets/job_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/job_closets.dm @@ -139,6 +139,7 @@ new /obj/item/weapon/gun/smartgun(src) new /obj/item/smartgun_battery(src) new /obj/item/clothing/suit/storage/marine/smartgunner(src) + new /obj/item/storage/belt/gun/smartgunner/garrow(src) new /obj/item/ammo_magazine/smartgun(src) new /obj/item/ammo_magazine/smartgun(src) new /obj/item/ammo_magazine/smartgun(src) @@ -157,6 +158,7 @@ new /obj/item/weapon/gun/smartgun(src) new /obj/item/smartgun_battery(src) new /obj/item/clothing/suit/storage/marine/smartgunner/standard(src) + new /obj/item/storage/belt/gun/smartgunner/garrow(src) new /obj/item/ammo_magazine/smartgun(src) new /obj/item/ammo_magazine/smartgun(src) new /obj/item/ammo_magazine/smartgun(src) From 8f071f3cef5be3f813d0a826aed1d679f133200a Mon Sep 17 00:00:00 2001 From: Pandora Date: Sat, 10 Aug 2024 07:30:03 +0100 Subject: [PATCH 2/2] Update belt.dm Adds a new variant of the SG belt with limited drum-slots --- code/game/objects/items/storage/belt.dm | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index 04e765dec5..2c17f447f1 100644 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -1696,6 +1696,39 @@ new /obj/item/ammo_magazine/smartgun(src) new /obj/item/ammo_magazine/smartgun(src) +#define MAXIMUM_MAGAZINE_COUNT 2 + +/obj/item/storage/belt/gun/smartgunner/garrow + name = "\improper M802 pattern smartgunner sidearm rig" + desc = "The M802 is a limited-issue mark of USCM load-bearing equipment, designed to carry a limited quantity of smartgun and pistol ammunition, along with a sidearm." + + //Keep a track of how many magazines are inside the belt. + var/magazines = 0 + +/obj/item/storage/belt/gun/smartgunner/garrow/can_be_inserted(obj/item/item, mob/user, stop_messages = FALSE) + . = ..() + if(magazines >= MAXIMUM_MAGAZINE_COUNT && istype(item, /obj/item/ammo_magazine/smartgun)) + if(!stop_messages) + to_chat(usr, SPAN_WARNING("[src] can't hold any more drums.")) + return FALSE + +/obj/item/storage/belt/gun/smartgunner/garrow/handle_item_insertion(obj/item/item, prevent_warning = FALSE, mob/user) + . = ..() + if(istype(item, /obj/item/ammo_magazine/smartgun)) + magazines++ + +/obj/item/storage/belt/gun/smartgunner/garrow/remove_from_storage(obj/item/item as obj, atom/new_location) + . = ..() + if(istype(item, /obj/item/ammo_magazine/smartgun)) + magazines-- + +//If a magazine disintegrates due to acid or something else while in the belt, remove it from the count. +/obj/item/storage/belt/gun/smartgunner/garrow/on_stored_atom_del(atom/movable/item) + if(istype(item, /obj/item/ammo_magazine/smartgun)) + magazines-- + +#undef MAXIMUM_MAGAZINE_COUNT + /obj/item/storage/belt/gun/smartgunner/pmc name = "\improper M802 pattern 'Dirty' smartgunner sidearm rig" desc = "A modification of the standard M802 load-bearing equipment, designed to carry smartgun ammunition and a sidearm."