From 49ccc130cc61e426de1fbdae991ed6eb8eb70181 Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Thu, 6 Jun 2024 07:47:19 -0700 Subject: [PATCH 01/14] Added handful ammo boxes mapping --- code/modules/projectiles/ammo_boxes/ammo_boxes.dm | 2 +- code/modules/projectiles/item_to_box_mapping.dm | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/code/modules/projectiles/ammo_boxes/ammo_boxes.dm b/code/modules/projectiles/ammo_boxes/ammo_boxes.dm index 9676b71f52f1..c0139c97f66f 100644 --- a/code/modules/projectiles/ammo_boxes/ammo_boxes.dm +++ b/code/modules/projectiles/ammo_boxes/ammo_boxes.dm @@ -78,7 +78,7 @@ var/overlay_ammo_type = "_reg" //used for ammo type color overlay var/overlay_gun_type = "_m41" //used for text overlay var/overlay_content = "_reg" - var/magazine_type = /obj/item/ammo_magazine/rifle + var/obj/item/ammo_magazine/magazine_type = /obj/item/ammo_magazine/rifle var/num_of_magazines = 10 var/handfuls = FALSE var/icon_state_deployed = null diff --git a/code/modules/projectiles/item_to_box_mapping.dm b/code/modules/projectiles/item_to_box_mapping.dm index 45277d194b38..6fbd4dc63298 100644 --- a/code/modules/projectiles/item_to_box_mapping.dm +++ b/code/modules/projectiles/item_to_box_mapping.dm @@ -33,16 +33,17 @@ if(initial(ammo_box.empty)) //Ignore all the empty boxes continue - if(initial(ammo_box.handfuls)) - //Ignore all the loose ammo boxes because they map with really bad numbers - continue var/datum/item_box_pairing/item_box_pairing = new() item_box_pairing.box = ammo_box item_box_pairing.item = initial(ammo_box.magazine_type) if(!item_box_pairing.item) //if the item is null somehow continue - item_box_pairing.items_in_box = initial(ammo_box.num_of_magazines) + if(initial(ammo_box.handfuls)) + //If we are using handfuls we need to do some wonky conversion + item_box_pairing.items_in_box = initial(ammo_box.num_of_magazines) / initial(ammo_box.magazine_type.max_rounds) + else + item_box_pairing.items_in_box = initial(ammo_box.num_of_magazines) add_pairing(item_box_pairing) //Grenade packets From ecb77110083e1afa3c04626a83ddbc4bb3b7dd9c Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Thu, 6 Jun 2024 07:47:53 -0700 Subject: [PATCH 02/14] Box stocking now checks if boxes already exist in the item list --- code/game/machinery/vending/cm_vending.dm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index 217ed870cd75..0924a3514b02 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -990,10 +990,24 @@ GLOBAL_LIST_EMPTY(vending_products) for(var/datum/item_box_pairing/IBP as anything in IMBP.item_box_pairings) tmp_list += list(list(initial(IBP.box.name), floor(L[2] / IBP.items_in_box), IBP.box, VENDOR_ITEM_REGULAR)) - //Putting Ammo and other boxes on the bottom of the list as per player preferences - if(length(tmp_list) > 0) + //For every item that goes into a box, check if the box is already listed in the vendor and if so, update its amount + var/list/box_list = list() + if(tmp_list.len > 0) + var/item_found = FALSE + for(var/list/tmp_item as anything in tmp_list) + for(var/list/LP as anything in listed_products) + if(tmp_item[3] == LP[3]) //We found a box we already have! + LP[2] = tmp_item[2] //Update box amount + item_found = TRUE + break + if(!item_found) + //We will be adding this box item at the end of the list + box_list += tmp_item + + //Putting Ammo and other boxes on the bottom of the list if they haven't been accounted for already + if(box_list.len > 0) listed_products += list(list("BOXES", -1, null, null)) - for(var/list/L as anything in tmp_list) + for(var/list/L as anything in box_list) listed_products += list(L) /obj/structure/machinery/cm_vending/sorted/ui_static_data(mob/user) From 18f738305e2e6917dd73d70803a4f669393c08ae Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Thu, 6 Jun 2024 10:00:54 -0700 Subject: [PATCH 03/14] Unifying shotgun box scaling --- .../machinery/vending/vendor_types/requisitions.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/vending/vendor_types/requisitions.dm b/code/game/machinery/vending/vendor_types/requisitions.dm index 1b35cbe238d2..f9c0915e5012 100644 --- a/code/game/machinery/vending/vendor_types/requisitions.dm +++ b/code/game/machinery/vending/vendor_types/requisitions.dm @@ -208,9 +208,9 @@ /obj/structure/machinery/cm_vending/sorted/cargo_ammo/populate_product_list(scale) listed_products = list( list("REGULAR AMMUNITION", -1, null, null), - list("Box Of Buckshot Shells", floor(scale * 40), /obj/item/ammo_magazine/shotgun/buckshot, VENDOR_ITEM_REGULAR), - list("Box Of Flechette Shells", floor(scale * 40), /obj/item/ammo_magazine/shotgun/flechette, VENDOR_ITEM_REGULAR), - list("Box Of Shotgun Slugs", floor(scale * 40), /obj/item/ammo_magazine/shotgun/slugs, VENDOR_ITEM_REGULAR), + list("Box Of Buckshot Shells", floor(scale * 56), /obj/item/ammo_magazine/shotgun/buckshot, VENDOR_ITEM_REGULAR), + list("Box Of Flechette Shells", floor(scale * 56), /obj/item/ammo_magazine/shotgun/flechette, VENDOR_ITEM_REGULAR), + list("Box Of Shotgun Slugs", floor(scale * 56), /obj/item/ammo_magazine/shotgun/slugs, VENDOR_ITEM_REGULAR), list("M4RA Magazine (10x24mm)", floor(scale * 60), /obj/item/ammo_magazine/rifle/m4ra, VENDOR_ITEM_REGULAR), list("M41A MK2 Magazine (10x24mm)", floor(scale * 100), /obj/item/ammo_magazine/rifle, VENDOR_ITEM_REGULAR), list("M39 HV Magazine (10x20mm)", floor(scale * 100), /obj/item/ammo_magazine/smg/m39, VENDOR_ITEM_REGULAR), @@ -248,9 +248,9 @@ list("XM51 Magazine (16g)", floor(scale * 3), /obj/item/ammo_magazine/rifle/xm51, VENDOR_ITEM_REGULAR), list("SHOTGUN SHELL BOXES", -1, null, null), - list("Shotgun Shell Box (Buckshot x 100)", floor(scale * 4), /obj/item/ammo_box/magazine/shotgun/buckshot, VENDOR_ITEM_REGULAR), - list("Shotgun Shell Box (Flechette x 100)", floor(scale * 4), /obj/item/ammo_box/magazine/shotgun/flechette, VENDOR_ITEM_REGULAR), - list("Shotgun Shell Box (Slugs x 100)", floor(scale * 4), /obj/item/ammo_box/magazine/shotgun, VENDOR_ITEM_REGULAR), + list("Shotgun Shell Box (Buckshot x 100)", 0, /obj/item/ammo_box/magazine/shotgun/buckshot, VENDOR_ITEM_REGULAR), + list("Shotgun Shell Box (Flechette x 100)", 0, /obj/item/ammo_box/magazine/shotgun/flechette, VENDOR_ITEM_REGULAR), + list("Shotgun Shell Box (Slugs x 100)", 0, /obj/item/ammo_box/magazine/shotgun, VENDOR_ITEM_REGULAR), list("Shotgun Shell Box (16g) (Breaching x 120)", 1, /obj/item/ammo_box/magazine/shotgun/light/breaching, VENDOR_ITEM_REGULAR), ) From 6f620b29a17b2261befa2d1ea2816c28a7315204 Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Thu, 6 Jun 2024 10:01:38 -0700 Subject: [PATCH 04/14] Restoring old boxes --- .../vending/vendor_types/requisitions.dm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/vending/vendor_types/requisitions.dm b/code/game/machinery/vending/vendor_types/requisitions.dm index f9c0915e5012..c0e238ebb7ec 100644 --- a/code/game/machinery/vending/vendor_types/requisitions.dm +++ b/code/game/machinery/vending/vendor_types/requisitions.dm @@ -247,11 +247,26 @@ list("M2C Box Magazine", floor(scale * 2), /obj/item/ammo_magazine/m2c, VENDOR_ITEM_REGULAR), list("XM51 Magazine (16g)", floor(scale * 3), /obj/item/ammo_magazine/rifle/xm51, VENDOR_ITEM_REGULAR), - list("SHOTGUN SHELL BOXES", -1, null, null), + list("MAGAZINE BOXES", -1, null, null), + list("Magazine Box (88 Mod 4 AP x 16)", 0, /obj/item/ammo_box/magazine/mod88, VENDOR_ITEM_REGULAR), + list("Magazine Box (AP L42A x 16)", 0, /obj/item/ammo_box/magazine/l42a/ap, VENDOR_ITEM_REGULAR), + list("Magazine Box (AP M39 x 12)", 0, /obj/item/ammo_box/magazine/m39/ap, VENDOR_ITEM_REGULAR), + list("Magazine Box (AP M41A x 10)", 0, /obj/item/ammo_box/magazine/ap, VENDOR_ITEM_REGULAR), + list("Magazine Box (Ext M39 x 10)", 0, /obj/item/ammo_box/magazine/m39/ext, VENDOR_ITEM_REGULAR), + list("Magazine Box (Ext M41A x 8)", 0, /obj/item/ammo_box/magazine/ext, VENDOR_ITEM_REGULAR), + list("Magazine Box (L42A x 16)", 0, /obj/item/ammo_box/magazine/l42a, VENDOR_ITEM_REGULAR), + list("Magazine Box (M39 x 12)", 0, /obj/item/ammo_box/magazine/m39, VENDOR_ITEM_REGULAR), + list("Magazine Box (M41A x 10)", 0, /obj/item/ammo_box/magazine, VENDOR_ITEM_REGULAR), + list("Magazine Box (M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3, VENDOR_ITEM_REGULAR), + list("Magazine Box (SU-6 x 16)", 0, /obj/item/ammo_box/magazine/su6, VENDOR_ITEM_REGULAR), + list("Magazine Box (VP78 x 16)", 0, /obj/item/ammo_box/magazine/vp78, VENDOR_ITEM_REGULAR), list("Shotgun Shell Box (Buckshot x 100)", 0, /obj/item/ammo_box/magazine/shotgun/buckshot, VENDOR_ITEM_REGULAR), list("Shotgun Shell Box (Flechette x 100)", 0, /obj/item/ammo_box/magazine/shotgun/flechette, VENDOR_ITEM_REGULAR), list("Shotgun Shell Box (Slugs x 100)", 0, /obj/item/ammo_box/magazine/shotgun, VENDOR_ITEM_REGULAR), list("Shotgun Shell Box (16g) (Breaching x 120)", 1, /obj/item/ammo_box/magazine/shotgun/light/breaching, VENDOR_ITEM_REGULAR), + list("Speed Loaders Box (M44 x 16)", 0, /obj/item/ammo_box/magazine/m44, VENDOR_ITEM_REGULAR), + list("Speed Loaders Box (Marksman M44 x 16)", 0, /obj/item/ammo_box/magazine/m44/marksman, VENDOR_ITEM_REGULAR), + list("Speed Loaders Box (Heavy M44 x 16)", 0, /obj/item/ammo_box/magazine/m44/heavy, VENDOR_ITEM_REGULAR), ) /obj/structure/machinery/cm_vending/sorted/cargo_ammo/stock(obj/item/item_to_stock, mob/user) From cdad86b8753ec31e41004155e2557e4751e24686 Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Thu, 6 Jun 2024 10:15:45 -0700 Subject: [PATCH 05/14] Cleanup --- code/game/machinery/vending/vendor_types/requisitions.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/game/machinery/vending/vendor_types/requisitions.dm b/code/game/machinery/vending/vendor_types/requisitions.dm index c0e238ebb7ec..f4baec1bf6a1 100644 --- a/code/game/machinery/vending/vendor_types/requisitions.dm +++ b/code/game/machinery/vending/vendor_types/requisitions.dm @@ -249,12 +249,10 @@ list("MAGAZINE BOXES", -1, null, null), list("Magazine Box (88 Mod 4 AP x 16)", 0, /obj/item/ammo_box/magazine/mod88, VENDOR_ITEM_REGULAR), - list("Magazine Box (AP L42A x 16)", 0, /obj/item/ammo_box/magazine/l42a/ap, VENDOR_ITEM_REGULAR), list("Magazine Box (AP M39 x 12)", 0, /obj/item/ammo_box/magazine/m39/ap, VENDOR_ITEM_REGULAR), list("Magazine Box (AP M41A x 10)", 0, /obj/item/ammo_box/magazine/ap, VENDOR_ITEM_REGULAR), list("Magazine Box (Ext M39 x 10)", 0, /obj/item/ammo_box/magazine/m39/ext, VENDOR_ITEM_REGULAR), list("Magazine Box (Ext M41A x 8)", 0, /obj/item/ammo_box/magazine/ext, VENDOR_ITEM_REGULAR), - list("Magazine Box (L42A x 16)", 0, /obj/item/ammo_box/magazine/l42a, VENDOR_ITEM_REGULAR), list("Magazine Box (M39 x 12)", 0, /obj/item/ammo_box/magazine/m39, VENDOR_ITEM_REGULAR), list("Magazine Box (M41A x 10)", 0, /obj/item/ammo_box/magazine, VENDOR_ITEM_REGULAR), list("Magazine Box (M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3, VENDOR_ITEM_REGULAR), From 7ac7ebeb44312f19dc7d1bb2cf0afd46999aa342 Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Thu, 6 Jun 2024 10:28:33 -0700 Subject: [PATCH 06/14] Fix --- code/game/machinery/vending/cm_vending.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index 0924a3514b02..33d83bfb1d75 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -1002,7 +1002,7 @@ GLOBAL_LIST_EMPTY(vending_products) break if(!item_found) //We will be adding this box item at the end of the list - box_list += tmp_item + box_list += list(tmp_item) //Putting Ammo and other boxes on the bottom of the list if they haven't been accounted for already if(box_list.len > 0) From 7a4b36fd113d884d2a9e76335437e307abb95715 Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Fri, 7 Jun 2024 03:02:11 -0700 Subject: [PATCH 07/14] Fix --- code/game/machinery/vending/cm_vending.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index 33d83bfb1d75..0e21dc0940f3 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -993,8 +993,8 @@ GLOBAL_LIST_EMPTY(vending_products) //For every item that goes into a box, check if the box is already listed in the vendor and if so, update its amount var/list/box_list = list() if(tmp_list.len > 0) - var/item_found = FALSE for(var/list/tmp_item as anything in tmp_list) + var/item_found = FALSE for(var/list/LP as anything in listed_products) if(tmp_item[3] == LP[3]) //We found a box we already have! LP[2] = tmp_item[2] //Update box amount From 437d952bcdd2ffc349b2ada5f1b1ac212cadf822 Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Fri, 7 Jun 2024 03:53:20 -0700 Subject: [PATCH 08/14] Added grenade boxes to Requisitions --- .../vending/vendor_types/requisitions.dm | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/vending/vendor_types/requisitions.dm b/code/game/machinery/vending/vendor_types/requisitions.dm index f4baec1bf6a1..07f4678a0fc2 100644 --- a/code/game/machinery/vending/vendor_types/requisitions.dm +++ b/code/game/machinery/vending/vendor_types/requisitions.dm @@ -138,7 +138,28 @@ list("Engineering Pamphlet", floor(scale * 1), /obj/item/pamphlet/skill/engineer, VENDOR_ITEM_REGULAR), list("Powerloader Certification", 0.75, /obj/item/pamphlet/skill/powerloader, VENDOR_ITEM_REGULAR), list("Spare PDT/L Battle Buddy Kit", floor(scale * 4), /obj/item/storage/box/pdt_kit, VENDOR_ITEM_REGULAR), - list("W-Y brand rechargeable mini-battery", floor(scale * 3), /obj/item/cell/crap, VENDOR_ITEM_REGULAR) + list("W-Y brand rechargeable mini-battery", floor(scale * 3), /obj/item/cell/crap, VENDOR_ITEM_REGULAR), + + list("EXPLOSIVES BOXES", -1, null, null), + list("M15 Fragmentation Grenade Packet", 0, /obj/item/storage/box/packet/m15, VENDOR_ITEM_REGULAR), + list("M40 HEDP Grenade Packet", 0, /obj/item/storage/box/packet/high_explosive, VENDOR_ITEM_REGULAR), + list("M40 HEDP Grenade Box", 0, /obj/item/storage/box/nade_box, VENDOR_ITEM_REGULAR), + list("M40 HIDP Grenade Packet", 0, /obj/item/storage/box/packet/incendiary, VENDOR_ITEM_REGULAR), + list("M40 HPDP Grenade Box", 0, /obj/item/storage/box/nade_box/phophorus, VENDOR_ITEM_REGULAR), + list("M40 HSDP Grenade Packet", 0, /obj/item/storage/box/packet/smoke, VENDOR_ITEM_REGULAR), + list("M40 HIRR Baton Slug Packet", 0, /obj/item/storage/box/packet/baton_slug, VENDOR_ITEM_REGULAR), + list("M74 AGM-Airburst Grenade Packet", 0, /obj/item/storage/box/packet/airburst_he, VENDOR_ITEM_REGULAR), + list("M74 AGM-F grenade box", 0, /obj/item/storage/box/nade_box/airburst, VENDOR_ITEM_REGULAR), + list("M74 AGM-Airburst Incendiary Grenade Packet", 0, /obj/item/storage/box/packet/airburst_incen, VENDOR_ITEM_REGULAR), + list("M74 AGM-Airburst Smoke Grenade Packet", 0, /obj/item/storage/box/packet/airburst_smoke, VENDOR_ITEM_REGULAR), + list("M74 AGM-S Star Shell Packet", 0, /obj/item/storage/box/packet/flare, VENDOR_ITEM_REGULAR), + list("M74 AGM-H Hornet Shell Packet", 0, /obj/item/storage/box/packet/hornet, VENDOR_ITEM_REGULAR), + list("M20 mine box", 0, /obj/item/storage/box/explosive_mines, VENDOR_ITEM_REGULAR), + + list("OTHER BOXES", -1, null, null), + list("Box of M94 Marking Flare Packs", 0, /obj/item/ammo_box/magazine/misc/flares, VENDOR_ITEM_REGULAR), + list("Box of M89 Signal Flare Packs", 0, /obj/item/ammo_box/magazine/misc/flares/signal, VENDOR_ITEM_REGULAR), + list("Box of High-Capacity Power Cells", 0, /obj/item/ammo_box/magazine/misc/power_cell, VENDOR_ITEM_REGULAR) ) /obj/structure/machinery/cm_vending/sorted/cargo_guns/stock(obj/item/item_to_stock, mob/user) From a1eddfddcc68946cd7bebc4f213a3b2bad6fde40 Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Fri, 7 Jun 2024 05:24:54 -0700 Subject: [PATCH 09/14] Fix --- code/modules/projectiles/item_to_box_mapping.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/item_to_box_mapping.dm b/code/modules/projectiles/item_to_box_mapping.dm index 6fbd4dc63298..5111ffc0033b 100644 --- a/code/modules/projectiles/item_to_box_mapping.dm +++ b/code/modules/projectiles/item_to_box_mapping.dm @@ -29,7 +29,7 @@ /datum/item_to_box_mapping/New() //Ammo magazine boxes, minus loose ammo boxes - for(var/obj/item/ammo_box/magazine/ammo_box as anything in typesof(/obj/item/ammo_box/magazine) - /obj/item/ammo_box/magazine/misc) + for(var/obj/item/ammo_box/magazine/ammo_box as anything in typesof(/obj/item/ammo_box/magazine) - /obj/item/ammo_box/magazine/misc - /obj/item/ammo_box/magazine/shotgun/light) if(initial(ammo_box.empty)) //Ignore all the empty boxes continue From d2fd7148455e974261db2f9844569a215b79c83e Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Fri, 7 Jun 2024 05:49:55 -0700 Subject: [PATCH 10/14] Added missing boxes --- .../vending/vendor_types/requisitions.dm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/code/game/machinery/vending/vendor_types/requisitions.dm b/code/game/machinery/vending/vendor_types/requisitions.dm index 07f4678a0fc2..fdc40ee7c413 100644 --- a/code/game/machinery/vending/vendor_types/requisitions.dm +++ b/code/game/machinery/vending/vendor_types/requisitions.dm @@ -286,6 +286,21 @@ list("Speed Loaders Box (M44 x 16)", 0, /obj/item/ammo_box/magazine/m44, VENDOR_ITEM_REGULAR), list("Speed Loaders Box (Marksman M44 x 16)", 0, /obj/item/ammo_box/magazine/m44/marksman, VENDOR_ITEM_REGULAR), list("Speed Loaders Box (Heavy M44 x 16)", 0, /obj/item/ammo_box/magazine/m44/heavy, VENDOR_ITEM_REGULAR), + + list("Magazine Box (M4RA x 16)", 0, /obj/item/ammo_box/magazine/m4ra, VENDOR_ITEM_REGULAR), + list("Magazine Box (AP M4RA x 16)", 0, /obj/item/ammo_box/magazine/m4ra/ap, VENDOR_ITEM_REGULAR), + list("Magazine Box (M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3, VENDOR_ITEM_REGULAR), + list("Drum Box (M56B x 8)", 0, /obj/item/ammo_box/magazine/m56b, VENDOR_ITEM_REGULAR), + list("Magazine Box (HP M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3/hp, VENDOR_ITEM_REGULAR), + list("Magazine Box (AP M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3/ap, VENDOR_ITEM_REGULAR), + list("Magazine Box (M41AE2 Holo-Target x 8)", 0, /obj/item/ammo_box/magazine/m41ae2/holo, VENDOR_ITEM_REGULAR), + list("Flamer Tank Box (UT-Napthal Fuel x 8)", 0, /obj/item/ammo_box/magazine/flamer, VENDOR_ITEM_REGULAR), + list("Magazine Box (M41AE2 x 8)", 0, /obj/item/ammo_box/magazine/m41ae2, VENDOR_ITEM_REGULAR), + list("Magazine Box (M41A MK1 x 8)", 0, /obj/item/ammo_box/magazine/mk1, VENDOR_ITEM_REGULAR), + list("Magazine Box (M41A MK1 AP x 8)", 0, /obj/item/ammo_box/magazine/mk1/ap, VENDOR_ITEM_REGULAR), + list("Drum Box (M56D x 8)", 0, /obj/item/ammo_box/magazine/m56d, VENDOR_ITEM_REGULAR), + list("Ammo Box (M2C x 8)", 0, /obj/item/ammo_box/magazine/m2c, VENDOR_ITEM_REGULAR), + list("Magazine Box (XM51 x 8)", 0, /obj/item/ammo_box/magazine/xm51, VENDOR_ITEM_REGULAR), ) /obj/structure/machinery/cm_vending/sorted/cargo_ammo/stock(obj/item/item_to_stock, mob/user) From 9f097ab5d8b1256a531b15bc838676d45b9a9bbd Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Fri, 7 Jun 2024 06:05:29 -0700 Subject: [PATCH 11/14] Reordering stuff --- .../vending/vendor_types/requisitions.dm | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/code/game/machinery/vending/vendor_types/requisitions.dm b/code/game/machinery/vending/vendor_types/requisitions.dm index fdc40ee7c413..a8d44a8b5012 100644 --- a/code/game/machinery/vending/vendor_types/requisitions.dm +++ b/code/game/machinery/vending/vendor_types/requisitions.dm @@ -269,38 +269,36 @@ list("XM51 Magazine (16g)", floor(scale * 3), /obj/item/ammo_magazine/rifle/xm51, VENDOR_ITEM_REGULAR), list("MAGAZINE BOXES", -1, null, null), - list("Magazine Box (88 Mod 4 AP x 16)", 0, /obj/item/ammo_box/magazine/mod88, VENDOR_ITEM_REGULAR), + list("Magazine Box (M39 x 12)", 0, /obj/item/ammo_box/magazine/m39, VENDOR_ITEM_REGULAR), list("Magazine Box (AP M39 x 12)", 0, /obj/item/ammo_box/magazine/m39/ap, VENDOR_ITEM_REGULAR), - list("Magazine Box (AP M41A x 10)", 0, /obj/item/ammo_box/magazine/ap, VENDOR_ITEM_REGULAR), list("Magazine Box (Ext M39 x 10)", 0, /obj/item/ammo_box/magazine/m39/ext, VENDOR_ITEM_REGULAR), - list("Magazine Box (Ext M41A x 8)", 0, /obj/item/ammo_box/magazine/ext, VENDOR_ITEM_REGULAR), - list("Magazine Box (M39 x 12)", 0, /obj/item/ammo_box/magazine/m39, VENDOR_ITEM_REGULAR), list("Magazine Box (M41A x 10)", 0, /obj/item/ammo_box/magazine, VENDOR_ITEM_REGULAR), + list("Magazine Box (AP M41A x 10)", 0, /obj/item/ammo_box/magazine/ap, VENDOR_ITEM_REGULAR), + list("Magazine Box (Ext M41A x 8)", 0, /obj/item/ammo_box/magazine/ext, VENDOR_ITEM_REGULAR), list("Magazine Box (M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3, VENDOR_ITEM_REGULAR), - list("Magazine Box (SU-6 x 16)", 0, /obj/item/ammo_box/magazine/su6, VENDOR_ITEM_REGULAR), - list("Magazine Box (VP78 x 16)", 0, /obj/item/ammo_box/magazine/vp78, VENDOR_ITEM_REGULAR), + list("Magazine Box (AP M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3/ap, VENDOR_ITEM_REGULAR), + list("Magazine Box (HP M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3/hp, VENDOR_ITEM_REGULAR), + list("Magazine Box (M4RA x 16)", 0, /obj/item/ammo_box/magazine/m4ra, VENDOR_ITEM_REGULAR), + list("Magazine Box (AP M4RA x 16)", 0, /obj/item/ammo_box/magazine/m4ra/ap, VENDOR_ITEM_REGULAR), + list("Magazine Box (M41AE2 x 8)", 0, /obj/item/ammo_box/magazine/m41ae2, VENDOR_ITEM_REGULAR), + list("Magazine Box (M41AE2 Holo-Target x 8)", 0, /obj/item/ammo_box/magazine/m41ae2/holo, VENDOR_ITEM_REGULAR), + list("Magazine Box (M41A MK1 x 8)", 0, /obj/item/ammo_box/magazine/mk1, VENDOR_ITEM_REGULAR), + list("Magazine Box (M41A MK1 AP x 8)", 0, /obj/item/ammo_box/magazine/mk1/ap, VENDOR_ITEM_REGULAR), list("Shotgun Shell Box (Buckshot x 100)", 0, /obj/item/ammo_box/magazine/shotgun/buckshot, VENDOR_ITEM_REGULAR), list("Shotgun Shell Box (Flechette x 100)", 0, /obj/item/ammo_box/magazine/shotgun/flechette, VENDOR_ITEM_REGULAR), list("Shotgun Shell Box (Slugs x 100)", 0, /obj/item/ammo_box/magazine/shotgun, VENDOR_ITEM_REGULAR), list("Shotgun Shell Box (16g) (Breaching x 120)", 1, /obj/item/ammo_box/magazine/shotgun/light/breaching, VENDOR_ITEM_REGULAR), + list("Magazine Box (88 Mod 4 AP x 16)", 0, /obj/item/ammo_box/magazine/mod88, VENDOR_ITEM_REGULAR), + list("Magazine Box (SU-6 x 16)", 0, /obj/item/ammo_box/magazine/su6, VENDOR_ITEM_REGULAR), + list("Magazine Box (VP78 x 16)", 0, /obj/item/ammo_box/magazine/vp78, VENDOR_ITEM_REGULAR), + list("Magazine Box (XM51 x 8)", 0, /obj/item/ammo_box/magazine/xm51, VENDOR_ITEM_REGULAR), + list("Ammo Box (M2C x 8)", 0, /obj/item/ammo_box/magazine/m2c, VENDOR_ITEM_REGULAR), + list("Drum Box (M56B x 8)", 0, /obj/item/ammo_box/magazine/m56b, VENDOR_ITEM_REGULAR), + list("Drum Box (M56D x 8)", 0, /obj/item/ammo_box/magazine/m56d, VENDOR_ITEM_REGULAR), list("Speed Loaders Box (M44 x 16)", 0, /obj/item/ammo_box/magazine/m44, VENDOR_ITEM_REGULAR), list("Speed Loaders Box (Marksman M44 x 16)", 0, /obj/item/ammo_box/magazine/m44/marksman, VENDOR_ITEM_REGULAR), list("Speed Loaders Box (Heavy M44 x 16)", 0, /obj/item/ammo_box/magazine/m44/heavy, VENDOR_ITEM_REGULAR), - - list("Magazine Box (M4RA x 16)", 0, /obj/item/ammo_box/magazine/m4ra, VENDOR_ITEM_REGULAR), - list("Magazine Box (AP M4RA x 16)", 0, /obj/item/ammo_box/magazine/m4ra/ap, VENDOR_ITEM_REGULAR), - list("Magazine Box (M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3, VENDOR_ITEM_REGULAR), - list("Drum Box (M56B x 8)", 0, /obj/item/ammo_box/magazine/m56b, VENDOR_ITEM_REGULAR), - list("Magazine Box (HP M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3/hp, VENDOR_ITEM_REGULAR), - list("Magazine Box (AP M4A3 x 16)", 0, /obj/item/ammo_box/magazine/m4a3/ap, VENDOR_ITEM_REGULAR), - list("Magazine Box (M41AE2 Holo-Target x 8)", 0, /obj/item/ammo_box/magazine/m41ae2/holo, VENDOR_ITEM_REGULAR), list("Flamer Tank Box (UT-Napthal Fuel x 8)", 0, /obj/item/ammo_box/magazine/flamer, VENDOR_ITEM_REGULAR), - list("Magazine Box (M41AE2 x 8)", 0, /obj/item/ammo_box/magazine/m41ae2, VENDOR_ITEM_REGULAR), - list("Magazine Box (M41A MK1 x 8)", 0, /obj/item/ammo_box/magazine/mk1, VENDOR_ITEM_REGULAR), - list("Magazine Box (M41A MK1 AP x 8)", 0, /obj/item/ammo_box/magazine/mk1/ap, VENDOR_ITEM_REGULAR), - list("Drum Box (M56D x 8)", 0, /obj/item/ammo_box/magazine/m56d, VENDOR_ITEM_REGULAR), - list("Ammo Box (M2C x 8)", 0, /obj/item/ammo_box/magazine/m2c, VENDOR_ITEM_REGULAR), - list("Magazine Box (XM51 x 8)", 0, /obj/item/ammo_box/magazine/xm51, VENDOR_ITEM_REGULAR), ) /obj/structure/machinery/cm_vending/sorted/cargo_ammo/stock(obj/item/item_to_stock, mob/user) From bf4c197982a1d8573042db559d898f53162df0c1 Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Mon, 24 Jun 2024 04:59:26 -0700 Subject: [PATCH 12/14] Update code/game/machinery/vending/cm_vending.dm Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> --- code/game/machinery/vending/cm_vending.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index 0e21dc0940f3..77c230a74259 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -1005,7 +1005,7 @@ GLOBAL_LIST_EMPTY(vending_products) box_list += list(tmp_item) //Putting Ammo and other boxes on the bottom of the list if they haven't been accounted for already - if(box_list.len > 0) + if(length(box_list)) listed_products += list(list("BOXES", -1, null, null)) for(var/list/L as anything in box_list) listed_products += list(L) From d6bbb5b55319449d128c7c75f468ec76d5fe672c Mon Sep 17 00:00:00 2001 From: ThePiachu Date: Mon, 24 Jun 2024 04:59:36 -0700 Subject: [PATCH 13/14] Update code/game/machinery/vending/cm_vending.dm Co-authored-by: harryob <55142896+harryob@users.noreply.github.com> --- code/game/machinery/vending/cm_vending.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index 77c230a74259..57d93a7fcf85 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -995,9 +995,9 @@ GLOBAL_LIST_EMPTY(vending_products) if(tmp_list.len > 0) for(var/list/tmp_item as anything in tmp_list) var/item_found = FALSE - for(var/list/LP as anything in listed_products) - if(tmp_item[3] == LP[3]) //We found a box we already have! - LP[2] = tmp_item[2] //Update box amount + for(var/list/product as anything in listed_products) + if(tmp_item[3] == product[3]) //We found a box we already have! + product[2] = tmp_item[2] //Update box amount item_found = TRUE break if(!item_found) From 7c724a5b2678ca1d2f9fd96cf3221e0436e5344a Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sun, 7 Jul 2024 07:08:15 +0100 Subject: [PATCH 14/14] len -> length per https://github.com/cmss13-devs/cmss13/pull/6546 --- code/game/machinery/vending/cm_vending.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index 57d93a7fcf85..d4f56504be72 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -992,7 +992,7 @@ GLOBAL_LIST_EMPTY(vending_products) //For every item that goes into a box, check if the box is already listed in the vendor and if so, update its amount var/list/box_list = list() - if(tmp_list.len > 0) + if(length(tmp_list)) for(var/list/tmp_item as anything in tmp_list) var/item_found = FALSE for(var/list/product as anything in listed_products)