Skip to content

Commit

Permalink
Taking the belt to SGs (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
BonniePandora authored Aug 17, 2024
1 parent 6932693 commit 2f6b21b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
33 changes: 33 additions & 0 deletions code/game/objects/items/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 2f6b21b

Please sign in to comment.