Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taking the belt to SGs #367

Merged
merged 2 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading