diff --git a/code/__DEFINES/greyscale_guns.dm b/code/__DEFINES/greyscale_guns.dm index 648f85338c8..2baf80377da 100644 --- a/code/__DEFINES/greyscale_guns.dm +++ b/code/__DEFINES/greyscale_guns.dm @@ -1,8 +1,8 @@ // bands #define AMMO_BAND_COLOR_EXTENDED "#9C9A19" #define AMMO_BAND_COLOR_AP "#1F951F" -#define AMMO_BAND_COLOR_HOLLOWPOINT "#a8ff9d" -#define AMMO_BAND_COLOR_INCENDIARY "#9C2219" +#define AMMO_BAND_COLOR_HOLLOWPOINT "#FF4837" +#define AMMO_BAND_COLOR_INCENDIARY "#D49622" #define AMMO_BAND_COLOR_EXPLOSIVE "#3f1111" #define AMMO_BAND_COLOR_SABOT "#663618" #define AMMO_BAND_COLOR_IMPACT "#0052CC" diff --git a/code/_globalvars/lists/vending.dm b/code/_globalvars/lists/vending.dm index ae020e219cc..ffeacbfe23e 100644 --- a/code/_globalvars/lists/vending.dm +++ b/code/_globalvars/lists/vending.dm @@ -8,5 +8,4 @@ */ GLOBAL_LIST_EMPTY(vending_records) -GLOBAL_LIST_EMPTY(vending_hidden_records) -GLOBAL_LIST_EMPTY(vending_coin_records) +GLOBAL_LIST_EMPTY(vending_inverse_records) diff --git a/code/datums/loadout/loadout_helper.dm b/code/datums/loadout/loadout_helper.dm index f25ea448920..b9b6e195e2f 100644 --- a/code/datums/loadout/loadout_helper.dm +++ b/code/datums/loadout/loadout_helper.dm @@ -13,7 +13,7 @@ //If we can find it for in a shared vendor, we buy it for(var/type in (GLOB.loadout_linked_vendor[seller.faction] + GLOB.loadout_linked_vendor[user_job])) for(var/datum/vending_product/item_datum AS in GLOB.vending_records[type]) - if(item_datum.product_path == item_to_buy_type && item_datum.amount != 0) + if(item_datum.product_paths == item_to_buy_type && item_datum.amount != 0) item_datum.amount-- return TRUE @@ -111,7 +111,7 @@ /// Return TRUE if this handful should be buyable, aka if it's corresponding aka box is in a linked vendor /proc/is_handful_buyable(ammo_type) for(var/datum/vending_product/item_datum AS in GLOB.vending_records[/obj/machinery/vending/weapon]) - var/product_path = item_datum.product_path + var/product_path = item_datum.product_paths if(!ispath(product_path, /obj/item/ammo_magazine)) continue var/obj/item/ammo_magazine/ammo = product_path diff --git a/code/datums/wires/vending.dm b/code/datums/wires/vending.dm index 668b56dc762..d71fe89b29c 100644 --- a/code/datums/wires/vending.dm +++ b/code/datums/wires/vending.dm @@ -28,7 +28,6 @@ var/list/status = list() status += "The orange light is [V.seconds_electrified ? "on" : "off"]." status += "The red light is [V.shoot_inventory ? "off" : "blinking"]." - status += "The green light is [V.extended_inventory ? "on" : "off"]." status += "A [V.scan_id ? "purple" : "yellow"] light is on." status += "The speaker light is [V.shut_up ? "off" : "on"]." return status @@ -39,8 +38,6 @@ switch(wire) if(WIRE_THROW) V.shoot_inventory = !V.shoot_inventory - if(WIRE_CONTRABAND) - V.extended_inventory = !V.extended_inventory if(WIRE_SHOCK) V.seconds_electrified = MACHINE_DEFAULT_ELECTRIFY_TIME if(WIRE_IDSCAN) @@ -54,8 +51,6 @@ switch(wire) if(WIRE_THROW) V.shoot_inventory = !mend - if(WIRE_CONTRABAND) - V.extended_inventory = FALSE if(WIRE_SHOCK) if(mend) V.seconds_electrified = MACHINE_NOT_ELECTRIFIED diff --git a/code/game/objects/machinery/bots/roomba.dm b/code/game/objects/machinery/bots/roomba.dm index 3fc67a11800..bdd1924dd96 100644 --- a/code/game/objects/machinery/bots/roomba.dm +++ b/code/game/objects/machinery/bots/roomba.dm @@ -71,7 +71,7 @@ //Here we try to restock whatever we sucked up for(var/type in GLOB.loadout_linked_vendor[VENDOR_FACTION_NEUTRAL]) for(var/datum/vending_product/item_to_restock AS in GLOB.vending_records[type]) - if(sucker.type != item_to_restock.product_path) + if(sucker.type != item_to_restock.product_paths) continue if(item_to_restock.attempt_restock(sucker, null, FALSE)) return TRUE diff --git a/code/game/objects/machinery/vending/marine_vending.dm b/code/game/objects/machinery/vending/marine_vending.dm index 414253953f0..589bcf47f25 100644 --- a/code/game/objects/machinery/vending/marine_vending.dm +++ b/code/game/objects/machinery/vending/marine_vending.dm @@ -1,3 +1,11 @@ +#define VEND_DESCRIPTION_MAGAZINES "Majority of modern firearms come with several types of ammunition.\nFMJ is all-around ammo. AP is armor-piercing, able to hit harder targets, but with lesser consequences. HP is hollow-point, which fragments on impact and is devastating against unprotected flesh, but barely scratches harder targets. IC is incendiary, bursting into flames on impact." +#define VEND_COLOR_DEFAULT "#4972a1" //Marine theme primary color from colors.scss +#define VEND_COLOR_AMMO "grey" +#define VEND_COLOR_FMJ "white" +#define VEND_COLOR_AP "blue" +#define VEND_COLOR_HP "red" +#define VEND_COLOR_IC "orange" + /obj/machinery/vending/weapon name = "automated weapons rack" desc = "An automated weapon rack hooked up to a colossal storage of standard-issue weapons." @@ -11,40 +19,75 @@ products = list( "Винтовки" = list( /obj/item/weapon/gun/rifle/ar12 = -1, - /obj/item/ammo_magazine/rifle/ar12 = -1, - /obj/item/ammo_magazine/rifle/ar12/ap = -1, - /obj/item/ammo_magazine/rifle/ar12/hp = -1, + "AR-12 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/ar12, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/ar12/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/ar12/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), /obj/item/weapon/gun/rifle/ar18 = -1, - /obj/item/ammo_magazine/rifle/ar18 = -1, - /obj/item/ammo_magazine/rifle/ar18/ap = -1, - /obj/item/ammo_magazine/rifle/ar18/hp = -1, - /obj/item/weapon/gun/shotgun/pump/lever/repeater = -1, - /obj/item/ammo_magazine/packet/p4570 = -1, - /obj/item/weapon/gun/shotgun/double/martini = -1, - /obj/item/ammo_magazine/rifle/martini = -1, - /obj/item/ammo_magazine/rifle/martini/white = -1, + "AR-18 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/ar18, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/ar18/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/ar18/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), /obj/item/weapon/gun/rifle/type71 = -1, - /obj/item/ammo_magazine/rifle/type71 = -1, - /obj/item/ammo_magazine/rifle/type71/ap = -1, - /obj/item/ammo_magazine/rifle/type71/hp = -1, + "Type 71 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/type71, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/type71/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/type71/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), /obj/item/weapon/gun/rifle/ar21 = -1, - /obj/item/ammo_magazine/rifle/ar21 = -1, - /obj/item/ammo_magazine/rifle/ar21/ap = -1, - /obj/item/ammo_magazine/rifle/ar21/hp = -1, + "AR-21 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/ar21, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/ar21/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/ar21/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), + "Leicester Repeater" = list(-1, list( + list(/obj/item/weapon/gun/shotgun/pump/lever/repeater, "WEAP"), + list(/obj/item/ammo_magazine/packet/p4570, "AMMO", "black"), + ), + ), + /obj/item/weapon/gun/shotgun/double/martini = -1, + "Martini Henry Ammo" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/martini, "BLK", "black"), + list(/obj/item/ammo_magazine/rifle/martini/white, "WHT", "white") + ) + ), ), "Пистолеты-пулемёты" = list( /obj/item/weapon/gun/smg/vector = -1, - /obj/item/ammo_magazine/smg/vector = -1, - /obj/item/ammo_magazine/smg/vector/ap = -1, - /obj/item/ammo_magazine/smg/vector/hp = -1, + "Vector Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/smg/vector, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/smg/vector/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/smg/vector/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), ), "Снайперские винтовки" = list( - /obj/item/weapon/gun/rifle/dmr37 = -1, - /obj/item/ammo_magazine/rifle/dmr37 = -1, - /obj/item/weapon/gun/rifle/sr127= -1, - /obj/item/ammo_magazine/rifle/sr127 = -1, - /obj/item/weapon/gun/rifle/sniper/svd = -1, - /obj/item/ammo_magazine/sniper/svd = -1, + "DMR-37" = list(-1, list( + list(/obj/item/weapon/gun/rifle/dmr37, "WEAP"), + list(/obj/item/ammo_magazine/rifle/dmr37, "AMMO", VEND_COLOR_AMMO) + ), + ), + "SVD" = list(-1, list( + list(/obj/item/weapon/gun/rifle/sniper/svd, "WEAP"), + list(/obj/item/ammo_magazine/sniper/svd, "AMMO", VEND_COLOR_AMMO) + ), + ), + "SR-127" = list(-1, list( + list(/obj/item/weapon/gun/rifle/sr127, "WEAP"), + list(/obj/item/ammo_magazine/rifle/sr127, "AMMO", VEND_COLOR_AMMO) + ), + ) ), "Энергетическое" = list( /obj/item/cell/lasgun/lasrifle = -1, @@ -59,20 +102,35 @@ /obj/item/weapon/gun/shotgun/pump/t35 = -1, /obj/item/weapon/gun/shotgun/combat/standardmarine = -1, /obj/item/weapon/gun/shotgun/combat/shq6 = -1, - /obj/item/ammo_magazine/shotgun = -1, - /obj/item/ammo_magazine/shotgun/buckshot = -1, - /obj/item/ammo_magazine/shotgun/flechette = -1, - /obj/item/ammo_magazine/shotgun/tracker = -1, + "Shotgun ammo" = list(-1, list( + list(/obj/item/ammo_magazine/shotgun, "SLUG", "green"), + list(/obj/item/ammo_magazine/shotgun/buckshot, "BUCK", "red"), + list(/obj/item/ammo_magazine/shotgun/flechette, "FLCH", "purple"), + list(/obj/item/ammo_magazine/shotgun/tracker, "TRCK", "pink") + ), + ), /obj/item/weapon/gun/rifle/sh15 = -1, - /obj/item/ammo_magazine/rifle/sh15_flechette = -1, - /obj/item/ammo_magazine/rifle/sh15_slug = -1, - /obj/item/storage/holster/belt/ts34/full = 5, + "SH-15 Ammo" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/sh15_slug, "SLUG", "green"), + list(/obj/item/ammo_magazine/rifle/sh15_flechette, "FLCH", "purple") + ), + ), + "SH-34 rig" = list(5, list( + list(/obj/item/storage/holster/belt/ts34/full, "Vend") + ), + ), ), "Пулемёты" = list( - /obj/item/weapon/gun/rifle/mg60 = -1, - /obj/item/ammo_magazine/mg60 = -1, - /obj/item/weapon/gun/mg27 = 5, - /obj/item/ammo_magazine/mg27 = -1, + "MG-60" = list(-1, list( + list(/obj/item/weapon/gun/rifle/mg60, "WEAP"), + list(/obj/item/ammo_magazine/mg60, "AMMO", VEND_COLOR_AMMO), + ), + ), + "MG-27" = list(-1, list( + list(/obj/item/weapon/gun/mg27, "WEAP"), + list(/obj/item/ammo_magazine/mg27, "AMMO", VEND_COLOR_AMMO), + ), + ), /obj/item/storage/box/hsg102 = 1, /obj/item/weapon/gun/hmg08 = 1, /obj/item/ammo_magazine/hmg08 = 5, @@ -98,19 +156,35 @@ /obj/item/weapon/gun/revolver/r44 = 5, /obj/item/ammo_magazine/revolver/r44 = -1, /obj/item/storage/box/t500case = 10, - /obj/item/ammo_magazine/revolver/t500 = -1, - /obj/item/ammo_magazine/revolver/t500/slavs = -1, + "T-500 ammo" = list(-1, list( + list(/obj/item/ammo_magazine/revolver/t500, "NEXP", "black"), + list(/obj/item/ammo_magazine/revolver/t500/slavs, "SLAV", "white"), + ), + ), /obj/item/ammo_magazine/revolver/t312 = -1, - /obj/item/weapon/gun/pistol/p17 = -1, - /obj/item/ammo_magazine/pistol/p17 = -1, + "P-17" = list(-1, list( + list(/obj/item/weapon/gun/pistol/p17, "WEAP"), + list(/obj/item/ammo_magazine/pistol/p17, "AMMO", VEND_COLOR_AMMO), + ), + ), /obj/item/weapon/gun/pistol/vp70 = -1, - /obj/item/ammo_magazine/pistol/vp70 = -1, - /obj/item/ammo_magazine/pistol/vp70/hp = -1, - /obj/item/ammo_magazine/pistol/vp70/incendiary = -1, - /obj/item/weapon/gun/pistol/plasma_pistol = -1, - /obj/item/ammo_magazine/pistol/plasma_pistol = -1, - /obj/item/weapon/gun/shotgun/double/derringer = -1, - /obj/item/ammo_magazine/pistol/derringer = -1, + "VP-70 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/pistol/vp70, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/pistol/vp70/hp, "HP", VEND_COLOR_HP), + list(/obj/item/ammo_magazine/pistol/vp70/incendiary, "IC", VEND_COLOR_IC) + ), + VEND_DESCRIPTION_MAGAZINES + ), + "Plasma Pistol" = list(-1, list( + list(/obj/item/weapon/gun/pistol/plasma_pistol, "WEAP"), + list(/obj/item/ammo_magazine/pistol/plasma_pistol, "AMMO", VEND_COLOR_AMMO), + ), + ), + "Derringer" = list(-1, list( + list(/obj/item/weapon/gun/shotgun/double/derringer, "WEAP"), + list(/obj/item/ammo_magazine/pistol/derringer, "AMMO", VEND_COLOR_AMMO), + ), + ), ), "Гранаты" = list( /obj/item/weapon/gun/grenade_launcher/single_shot = 4, @@ -182,45 +256,64 @@ /obj/item/attachable/flamer_nozzle/long = -1, ), "Коробки" = list( - /obj/item/ammo_magazine/packet/p9mm = -1, - /obj/item/ammo_magazine/packet/p9mm/ap = -1, - /obj/item/ammo_magazine/packet/p9mm/hp = -1, - /obj/item/ammo_magazine/packet/acp = -1, - /obj/item/ammo_magazine/packet/acp/ap = -1, - /obj/item/ammo_magazine/packet/acp/hp = -1, - /obj/item/ammo_magazine/packet/rifle762X39 = -1, - /obj/item/ammo_magazine/packet/p380acp = -1, - /obj/item/ammo_magazine/packet/magnum = -1, - /obj/item/ammo_magazine/packet/t500 = -1, - /obj/item/ammo_magazine/packet/t500/qk = -1, - /obj/item/ammo_magazine/packet/t500/slavs = -1, - /obj/item/ammo_magazine/packet/t312 = -1, /obj/item/ammo_magazine/packet/p10x20mm = -1, - /obj/item/ammo_magazine/packet/p10x24mm = -1, - /obj/item/ammo_magazine/packet/p10x24mm/ap = -1, - /obj/item/ammo_magazine/packet/p10x24mm/hp = -1, - /obj/item/ammo_magazine/packet/p10x25mm = -1, - /obj/item/ammo_magazine/packet/p10x25mm/ap = -1, - /obj/item/ammo_magazine/packet/p10x25mm/hp = -1, - /obj/item/ammo_magazine/packet/groza = -1, - /obj/item/ammo_magazine/packet/groza/ap = -1, - /obj/item/ammo_magazine/packet/groza/hp = -1, - /obj/item/ammo_magazine/packet/p10x25mm = -1, + "10x24" = list(-1, list( + list(/obj/item/ammo_magazine/packet/p10x24mm, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/p10x24mm/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/p10x24mm/hp, "HP", VEND_COLOR_HP) + ), + ), + "10x25" = list(-1, list( + list(/obj/item/ammo_magazine/packet/p10x25mm, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/p10x25mm/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/p10x25mm/hp, "HP", VEND_COLOR_HP) + ), + ), /obj/item/ammo_magazine/packet/p10x26mm = -1, /obj/item/ammo_magazine/packet/p10x27mm = -1, + "7.62x39" = list(-1, list( + list(/obj/item/ammo_magazine/packet/groza, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/groza/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/groza/hp, "HP", VEND_COLOR_HP) + ), + ), + "9mm" = list(-1, list( + list(/obj/item/ammo_magazine/packet/p9mm, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/p9mm/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/p9mm/hp, "HP", VEND_COLOR_HP) + ), + ), + ".45 ACP" = list(-1, list( + list(/obj/item/ammo_magazine/packet/acp, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/acp/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/acp/hp, "HP", VEND_COLOR_HP) + ), + ), /obj/item/ammo_magazine/packet/p86x70mm = -1, /obj/item/ammo_magazine/packet/svd762x54mmR = -1, + /obj/item/ammo_magazine/packet/p4570 = -1, /obj/item/ammo_magazine/packet/standardautoshotgun = -1, /obj/item/ammo_magazine/packet/standardautoshotgun/flechette = -1, - /obj/item/ammo_magazine/packet/p4570 = -1, + /obj/item/ammo_magazine/packet/p380acp = -1, + /obj/item/ammo_magazine/packet/magnum = -1, /obj/item/ammo_magazine/packet/long_special = -1, + "T-500" = list(-1, list( + list(/obj/item/ammo_magazine/packet/t500, "NEXP", "black"), + list(/obj/item/ammo_magazine/packet/t500/qk, "QKIL", "purple"), + list(/obj/item/ammo_magazine/packet/t500/slavs, "SLAV", "white") + ), + ), + /obj/item/ammo_magazine/packet/t312 = -1, /obj/item/storage/box/visual/magazine = -1, /obj/item/storage/box/visual/grenade = -1, /obj/structure/closet/crate/mass_produced_crate = 5, - /obj/structure/closet/crate/mass_produced_crate/alpha = 5, - /obj/structure/closet/crate/mass_produced_crate/bravo = 5, - /obj/structure/closet/crate/mass_produced_crate/charlie = 5, - /obj/structure/closet/crate/mass_produced_crate/delta = 5, + "Squad Crates" = list(20, list( + list(/obj/structure/closet/crate/mass_produced_crate/alpha, "A", "red"), + list(/obj/structure/closet/crate/mass_produced_crate/bravo, "B", "yellow"), + list(/obj/structure/closet/crate/mass_produced_crate/charlie, "C", "purple"), + list(/obj/structure/closet/crate/mass_produced_crate/delta, "D", "blue"), + ), + ), /obj/structure/closet/crate/mass_produced_crate/ammo = 5, /obj/structure/closet/crate/mass_produced_crate/construction = 5, /obj/structure/closet/crate/mass_produced_crate/explosives = 5, @@ -253,35 +346,75 @@ products = list( "Винтовки" = list( /obj/item/weapon/gun/rifle/ar12 = -1, - /obj/item/ammo_magazine/rifle/ar12 = -1, - /obj/item/ammo_magazine/rifle/ar12/ap = -1, - /obj/item/ammo_magazine/rifle/ar12/hp = -1, + "AR-12 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/ar12, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/ar12/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/ar12/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), /obj/item/weapon/gun/rifle/ar18 = -1, - /obj/item/ammo_magazine/rifle/ar18 = -1, - /obj/item/ammo_magazine/rifle/ar18/ap = -1, - /obj/item/ammo_magazine/rifle/ar18/hp = -1, - /obj/item/weapon/gun/shotgun/pump/lever/repeater = -1, - /obj/item/ammo_magazine/packet/p4570 = -1, - /obj/item/weapon/gun/shotgun/double/martini = -1, - /obj/item/ammo_magazine/rifle/martini = -1, - /obj/item/ammo_magazine/rifle/martini/white = -1, + "AR-18 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/ar18, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/ar18/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/ar18/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), /obj/item/weapon/gun/rifle/type71 = -1, - /obj/item/ammo_magazine/rifle/type71 = -1, - /obj/item/ammo_magazine/rifle/type71/ap = -1, - /obj/item/ammo_magazine/rifle/type71/hp = -1, + "Type 71 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/type71, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/type71/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/type71/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), /obj/item/weapon/gun/rifle/ar21 = -1, - /obj/item/ammo_magazine/rifle/ar21 = -1, - /obj/item/ammo_magazine/rifle/ar21/ap = -1, - /obj/item/ammo_magazine/rifle/ar21/hp = -1, - /obj/item/weapon/gun/revolver/r44/coltrifle = -1, - /obj/item/ammo_magazine/revolver/rifle = -1, - + "AR-21 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/ar21, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/ar21/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/ar21/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), + "Leicester Repeater" = list(-1, list( + list(/obj/item/weapon/gun/shotgun/pump/lever/repeater, "WEAP"), + list(/obj/item/ammo_magazine/packet/p4570, "AMMO", "black"), + ), + ), + /obj/item/weapon/gun/shotgun/double/martini = -1, + "Martini Henry Ammo" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/martini, "BLK", "black"), + list(/obj/item/ammo_magazine/rifle/martini/white, "WHT", "white") + ) + ), ), "Пистолеты-пулемёты" = list( /obj/item/weapon/gun/smg/vector = -1, - /obj/item/ammo_magazine/smg/vector = -1, - /obj/item/ammo_magazine/smg/vector/ap = -1, - /obj/item/ammo_magazine/smg/vector/hp = -1, + "Vector Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/smg/vector, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/smg/vector/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/smg/vector/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), + ), + "Снайперские винтовки" = list( + "DMR-37" = list(-1, list( + list(/obj/item/weapon/gun/rifle/dmr37, "WEAP"), + list(/obj/item/ammo_magazine/rifle/dmr37, "AMMO", VEND_COLOR_AMMO) + ), + ), + "SVD" = list(-1, list( + list(/obj/item/weapon/gun/rifle/sniper/svd, "WEAP"), + list(/obj/item/ammo_magazine/sniper/svd, "AMMO", VEND_COLOR_AMMO) + ), + ), + "SR-127" = list(-1, list( + list(/obj/item/weapon/gun/rifle/sr127, "WEAP"), + list(/obj/item/ammo_magazine/rifle/sr127, "AMMO", VEND_COLOR_AMMO) + ), + ) ), "Энергетическое" = list( /obj/item/cell/lasgun/lasrifle = -1, @@ -292,32 +425,39 @@ /obj/item/weapon/gun/energy/lasgun/lasrifle/standard_marine_pistol = -1, /obj/item/weapon/gun/energy/lasgun/lasrifle/tesla = -1, ), - "Снайперские винтовки" = list( - /obj/item/weapon/gun/rifle/dmr37 = -1, - /obj/item/ammo_magazine/rifle/dmr37 = -1, - /obj/item/weapon/gun/rifle/sr127= -1, - /obj/item/ammo_magazine/rifle/sr127 = -1, - /obj/item/weapon/gun/rifle/sniper/svd = -1, - /obj/item/ammo_magazine/sniper/svd = -1, - ), "Дробовики" = list( /obj/item/weapon/gun/shotgun/pump/t35 = -1, /obj/item/weapon/gun/shotgun/combat/standardmarine = -1, /obj/item/weapon/gun/shotgun/combat/shq6 = -1, - /obj/item/ammo_magazine/shotgun = -1, - /obj/item/ammo_magazine/shotgun/buckshot = -1, - /obj/item/ammo_magazine/shotgun/flechette = -1, - /obj/item/ammo_magazine/shotgun/tracker = -1, + "Shotgun ammo" = list(-1, list( + list(/obj/item/ammo_magazine/shotgun, "SLUG", "green"), + list(/obj/item/ammo_magazine/shotgun/buckshot, "BUCK", "red"), + list(/obj/item/ammo_magazine/shotgun/flechette, "FLCH", "purple"), + list(/obj/item/ammo_magazine/shotgun/tracker, "TRCK", "pink") + ), + ), /obj/item/weapon/gun/rifle/sh15 = -1, - /obj/item/ammo_magazine/rifle/sh15_flechette = -1, - /obj/item/ammo_magazine/rifle/sh15_slug = -1, - /obj/item/storage/holster/belt/ts34/full = 5, + "SH-15 Ammo" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/sh15_slug, "SLUG", "green"), + list(/obj/item/ammo_magazine/rifle/sh15_flechette, "FLCH", "purple") + ), + ), + "SH-34 rig" = list(5, list( + list(/obj/item/storage/holster/belt/ts34/full, "Vend") + ), + ), ), "Пулемёты" = list( - /obj/item/weapon/gun/rifle/mg60 = -1, - /obj/item/ammo_magazine/mg60 = -1, - /obj/item/weapon/gun/mg27 = 5, - /obj/item/ammo_magazine/mg27 = -1, + "MG-60" = list(-1, list( + list(/obj/item/weapon/gun/rifle/mg60, "WEAP"), + list(/obj/item/ammo_magazine/mg60, "AMMO", VEND_COLOR_AMMO), + ), + ), + "MG-27" = list(-1, list( + list(/obj/item/weapon/gun/mg27, "WEAP"), + list(/obj/item/ammo_magazine/mg27, "AMMO", VEND_COLOR_AMMO), + ), + ), ), "Ближний бой" = list( /obj/item/weapon/combat_knife = -1, @@ -329,8 +469,8 @@ /obj/item/storage/holster/blade/harvester/full = -1, /obj/item/weapon/twohanded/spear/tactical = -1, /obj/item/weapon/twohanded/spear/tactical/harvester = -1, - /obj/item/weapon/twohanded/glaive/harvester = -1, /obj/item/weapon/powerfist = -1, + /obj/item/weapon/twohanded/glaive/harvester = -1, /obj/item/weapon/shield/riot/marine = 6, /obj/item/weapon/shield/riot/marine/deployable = 6, /obj/item/weapon/combat_knife/harvester = 12, @@ -339,19 +479,35 @@ /obj/item/weapon/gun/revolver/r44 = 5, /obj/item/ammo_magazine/revolver/r44 = -1, /obj/item/storage/box/t500case = 10, - /obj/item/ammo_magazine/revolver/t500 = -1, - /obj/item/ammo_magazine/revolver/t500/slavs = -1, + "T-500 ammo" = list(-1, list( + list(/obj/item/ammo_magazine/revolver/t500, "NEXP", "black"), + list(/obj/item/ammo_magazine/revolver/t500/slavs, "SLAV", "white"), + ), + ), /obj/item/ammo_magazine/revolver/t312 = -1, - /obj/item/weapon/gun/pistol/p17 = -1, - /obj/item/ammo_magazine/pistol/p17 = -1, + "P-17" = list(-1, list( + list(/obj/item/weapon/gun/pistol/p17, "WEAP"), + list(/obj/item/ammo_magazine/pistol/p17, "AMMO", VEND_COLOR_AMMO), + ), + ), /obj/item/weapon/gun/pistol/vp70 = -1, - /obj/item/ammo_magazine/pistol/vp70 = -1, - /obj/item/ammo_magazine/pistol/vp70/hp = -1, - /obj/item/ammo_magazine/pistol/vp70/incendiary = -1, - /obj/item/weapon/gun/pistol/plasma_pistol = -1, - /obj/item/ammo_magazine/pistol/plasma_pistol = -1, - /obj/item/weapon/gun/shotgun/double/derringer = -1, - /obj/item/ammo_magazine/pistol/derringer = -1, + "VP-70 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/pistol/vp70, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/pistol/vp70/hp, "HP", VEND_COLOR_HP), + list(/obj/item/ammo_magazine/pistol/vp70/incendiary, "IC", VEND_COLOR_IC) + ), + VEND_DESCRIPTION_MAGAZINES + ), + "Plasma Pistol" = list(-1, list( + list(/obj/item/weapon/gun/pistol/plasma_pistol, "WEAP"), + list(/obj/item/ammo_magazine/pistol/plasma_pistol, "AMMO", VEND_COLOR_AMMO), + ), + ), + "Derringer" = list(-1, list( + list(/obj/item/weapon/gun/shotgun/double/derringer, "WEAP"), + list(/obj/item/ammo_magazine/pistol/derringer, "AMMO", VEND_COLOR_AMMO), + ), + ), ), "Гранаты" = list( /obj/item/weapon/gun/grenade_launcher/single_shot = 4, @@ -412,45 +568,64 @@ /obj/item/attachable/flamer_nozzle/long = -1, ), "Коробки" = list( - /obj/item/ammo_magazine/packet/p9mm = -1, - /obj/item/ammo_magazine/packet/p9mm/ap = -1, - /obj/item/ammo_magazine/packet/p9mm/hp = -1, - /obj/item/ammo_magazine/packet/acp = -1, - /obj/item/ammo_magazine/packet/acp/ap = -1, - /obj/item/ammo_magazine/packet/acp/hp = -1, - /obj/item/ammo_magazine/packet/rifle762X39 = -1, - /obj/item/ammo_magazine/packet/p380acp = -1, - /obj/item/ammo_magazine/packet/magnum = -1, - /obj/item/ammo_magazine/packet/t500 = -1, - /obj/item/ammo_magazine/packet/t500/qk = -1, - /obj/item/ammo_magazine/packet/t500/slavs = -1, - /obj/item/ammo_magazine/packet/t312 = -1, /obj/item/ammo_magazine/packet/p10x20mm = -1, - /obj/item/ammo_magazine/packet/p10x24mm = -1, - /obj/item/ammo_magazine/packet/p10x24mm/ap = -1, - /obj/item/ammo_magazine/packet/p10x24mm/hp = -1, - /obj/item/ammo_magazine/packet/p10x25mm = -1, - /obj/item/ammo_magazine/packet/p10x25mm/ap = -1, - /obj/item/ammo_magazine/packet/p10x25mm/hp = -1, - /obj/item/ammo_magazine/packet/groza = -1, - /obj/item/ammo_magazine/packet/groza/ap = -1, - /obj/item/ammo_magazine/packet/groza/hp = -1, - /obj/item/ammo_magazine/packet/p10x25mm = -1, + "10x24" = list(-1, list( + list(/obj/item/ammo_magazine/packet/p10x24mm, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/p10x24mm/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/p10x24mm/hp, "HP", VEND_COLOR_HP) + ), + ), + "10x25" = list(-1, list( + list(/obj/item/ammo_magazine/packet/p10x25mm, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/p10x25mm/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/p10x25mm/hp, "HP", VEND_COLOR_HP) + ), + ), /obj/item/ammo_magazine/packet/p10x26mm = -1, /obj/item/ammo_magazine/packet/p10x27mm = -1, + "7.62x39" = list(-1, list( + list(/obj/item/ammo_magazine/packet/groza, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/groza/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/groza/hp, "HP", VEND_COLOR_HP) + ), + ), + "9mm" = list(-1, list( + list(/obj/item/ammo_magazine/packet/p9mm, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/p9mm/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/p9mm/hp, "HP", VEND_COLOR_HP) + ), + ), + ".45 ACP" = list(-1, list( + list(/obj/item/ammo_magazine/packet/acp, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/acp/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/acp/hp, "HP", VEND_COLOR_HP) + ), + ), /obj/item/ammo_magazine/packet/p86x70mm = -1, /obj/item/ammo_magazine/packet/svd762x54mmR = -1, + /obj/item/ammo_magazine/packet/p4570 = -1, /obj/item/ammo_magazine/packet/standardautoshotgun = -1, /obj/item/ammo_magazine/packet/standardautoshotgun/flechette = -1, - /obj/item/ammo_magazine/packet/p4570 = -1, + /obj/item/ammo_magazine/packet/p380acp = -1, + /obj/item/ammo_magazine/packet/magnum = -1, /obj/item/ammo_magazine/packet/long_special = -1, + "T-500" = list(-1, list( + list(/obj/item/ammo_magazine/packet/t500, "NEXP", "black"), + list(/obj/item/ammo_magazine/packet/t500/qk, "QKIL", "purple"), + list(/obj/item/ammo_magazine/packet/t500/slavs, "SLAV", "white") + ), + ), + /obj/item/ammo_magazine/packet/t312 = -1, /obj/item/storage/box/visual/magazine = -1, /obj/item/storage/box/visual/grenade = -1, /obj/structure/closet/crate/mass_produced_crate = 5, - /obj/structure/closet/crate/mass_produced_crate/alpha = 5, - /obj/structure/closet/crate/mass_produced_crate/bravo = 5, - /obj/structure/closet/crate/mass_produced_crate/charlie = 5, - /obj/structure/closet/crate/mass_produced_crate/delta = 5, + "Squad Crates" = list(20, list( + list(/obj/structure/closet/crate/mass_produced_crate/alpha, "A", "red"), + list(/obj/structure/closet/crate/mass_produced_crate/bravo, "B", "yellow"), + list(/obj/structure/closet/crate/mass_produced_crate/charlie, "C", "purple"), + list(/obj/structure/closet/crate/mass_produced_crate/delta, "D", "blue"), + ), + ), /obj/structure/closet/crate/mass_produced_crate/ammo = 5, /obj/structure/closet/crate/mass_produced_crate/construction = 5, /obj/structure/closet/crate/mass_produced_crate/explosives = 5, @@ -484,43 +659,76 @@ products = list( "Винтовки" = list( /obj/item/weapon/gun/rifle/ar12 = -1, - /obj/item/ammo_magazine/rifle/ar12 = -1, - /obj/item/ammo_magazine/rifle/ar12/ap = -1, - /obj/item/ammo_magazine/rifle/ar12/hp = -1, + "AR-12 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/ar12, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/ar12/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/ar12/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), /obj/item/weapon/gun/rifle/ar18 = -1, - /obj/item/ammo_magazine/rifle/ar18 = -1, - /obj/item/ammo_magazine/rifle/ar18/ap = -1, - /obj/item/ammo_magazine/rifle/ar18/hp = -1, - /obj/item/weapon/gun/shotgun/pump/lever/repeater = -1, - /obj/item/ammo_magazine/packet/p4570 = -1, - /obj/item/weapon/gun/shotgun/double/martini = -1, - /obj/item/ammo_magazine/rifle/martini = -1, - /obj/item/ammo_magazine/rifle/martini/white = -1, + "AR-18 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/ar18, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/ar18/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/ar18/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), /obj/item/weapon/gun/rifle/type71 = -1, - /obj/item/ammo_magazine/rifle/type71 = -1, - /obj/item/ammo_magazine/rifle/type71/ap = -1, - /obj/item/ammo_magazine/rifle/type71/hp = -1, + "Type 71 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/type71, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/type71/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/type71/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), /obj/item/weapon/gun/rifle/ar21 = -1, - /obj/item/ammo_magazine/rifle/ar21 = -1, - /obj/item/ammo_magazine/rifle/ar21/ap = -1, - /obj/item/ammo_magazine/rifle/ar21/hp = -1, + "AR-21 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/ar21, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/rifle/ar21/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/rifle/ar21/hp, "HP", VEND_COLOR_HP), + ), + VEND_DESCRIPTION_MAGAZINES + ), + "Leicester Repeater" = list(-1, list( + list(/obj/item/weapon/gun/shotgun/pump/lever/repeater, "WEAP"), + list(/obj/item/ammo_magazine/packet/p4570, "AMMO", "black"), + ), + ), + /obj/item/weapon/gun/shotgun/double/martini = -1, + "Martini Henry Ammo" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/martini, "BLK", "black"), + list(/obj/item/ammo_magazine/rifle/martini/white, "WHT", "white") + ) + ), ), "Пистолеты-пулемёты" = list( /obj/item/weapon/gun/smg/vector = -1, - /obj/item/ammo_magazine/smg/vector = -1, - /obj/item/ammo_magazine/smg/vector/ap = -1, - /obj/item/ammo_magazine/smg/vector/hp = -1, - /obj/item/ammo_magazine/smg/vector/incendiary = -1, - ), + "Vector Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/smg/vector, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/smg/vector/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/smg/vector/hp, "HP", VEND_COLOR_HP), + list(/obj/item/ammo_magazine/smg/vector/incendiary, "IC", VEND_COLOR_IC), + ), + VEND_DESCRIPTION_MAGAZINES + ), + ), "Снайперские винтовки" = list( - /obj/item/weapon/gun/rifle/dmr37 = -1, - /obj/item/ammo_magazine/rifle/dmr37 = -1, - /obj/item/weapon/gun/rifle/sr127= -1, - /obj/item/ammo_magazine/rifle/sr127 = -1, - /obj/item/weapon/gun/rifle/sniper/svd = -1, - /obj/item/ammo_magazine/sniper/svd = -1, - /obj/item/weapon/gun/revolver/r44/coltrifle = -1, - /obj/item/ammo_magazine/revolver/rifle = -1, + "DMR-37" = list(-1, list( + list(/obj/item/weapon/gun/rifle/dmr37, "WEAP"), + list(/obj/item/ammo_magazine/rifle/dmr37, "AMMO", VEND_COLOR_AMMO) + ), + ), + "SVD" = list(-1, list( + list(/obj/item/weapon/gun/rifle/sniper/svd, "WEAP"), + list(/obj/item/ammo_magazine/sniper/svd, "AMMO", VEND_COLOR_AMMO) + ), + ), + "SR-127" = list(-1, list( + list(/obj/item/weapon/gun/rifle/sr127, "WEAP"), + list(/obj/item/ammo_magazine/rifle/sr127, "AMMO", VEND_COLOR_AMMO) + ), + ) ), "Энергетическое" = list( /obj/item/cell/lasgun/lasrifle = -1, @@ -535,21 +743,35 @@ /obj/item/weapon/gun/shotgun/pump/t35 = -1, /obj/item/weapon/gun/shotgun/combat/standardmarine = -1, /obj/item/weapon/gun/shotgun/combat/shq6 = -1, - /obj/item/ammo_magazine/shotgun = -1, - /obj/item/ammo_magazine/shotgun/buckshot = -1, - /obj/item/ammo_magazine/shotgun/flechette = -1, - /obj/item/ammo_magazine/shotgun/tracker = -1, + "Shotgun Ammo" = list(-1, list( + list(/obj/item/ammo_magazine/shotgun, "SLUG", "green"), + list(/obj/item/ammo_magazine/shotgun/buckshot, "BUCK", "red"), + list(/obj/item/ammo_magazine/shotgun/flechette, "FLCH", "purple"), + list(/obj/item/ammo_magazine/shotgun/tracker, "TRCK", "pink") + ), + ), /obj/item/weapon/gun/rifle/sh15 = -1, - /obj/item/ammo_magazine/rifle/sh15_flechette = -1, - /obj/item/ammo_magazine/rifle/sh15_slug = -1, - /obj/item/weapon/gun/shotgun/double/marine = -1, - /obj/item/storage/holster/belt/ts34/full = -1, + "SH-15 Ammo" = list(-1, list( + list(/obj/item/ammo_magazine/rifle/sh15_slug, "SLUG", "green"), + list(/obj/item/ammo_magazine/rifle/sh15_flechette, "FLCH", "purple") + ), + ), + "SH-34 rig" = list(-1, list( + list(/obj/item/storage/holster/belt/ts34/full, "Vend") + ), + ), ), "Пулемёты" = list( - /obj/item/weapon/gun/rifle/mg60 = -1, - /obj/item/ammo_magazine/mg60 = -1, - /obj/item/weapon/gun/mg27 = -1, - /obj/item/ammo_magazine/mg27 = -1, + "MG-60" = list(-1, list( + list(/obj/item/weapon/gun/rifle/mg60, "WEAP"), + list(/obj/item/ammo_magazine/mg60, "AMMO", VEND_COLOR_AMMO), + ), + ), + "MG-27" = list(-1, list( + list(/obj/item/weapon/gun/mg27, "WEAP"), + list(/obj/item/ammo_magazine/mg27, "AMMO", VEND_COLOR_AMMO), + ), + ), /obj/item/storage/box/hsg102 = -1, /obj/item/weapon/gun/hmg08 = -1, /obj/item/ammo_magazine/hmg08 = -1, @@ -565,8 +787,8 @@ /obj/item/storage/holster/blade/harvester/full = -1, /obj/item/weapon/twohanded/spear/tactical = -1, /obj/item/weapon/twohanded/spear/tactical/harvester = -1, - /obj/item/weapon/twohanded/glaive/harvester = -1, /obj/item/weapon/powerfist = -1, + /obj/item/weapon/twohanded/glaive/harvester = -1, /obj/item/weapon/shield/riot/marine = -1, /obj/item/weapon/shield/riot/marine/deployable = -1, /obj/item/weapon/combat_knife/harvester = -1, @@ -575,54 +797,69 @@ /obj/item/weapon/gun/revolver/r44 = -1, /obj/item/ammo_magazine/revolver/r44 = -1, /obj/item/storage/box/t500case = -1, - /obj/item/ammo_magazine/revolver/t500 = -1, - /obj/item/ammo_magazine/revolver/t500/slavs = -1, + "T-500 ammo" = list(-1, list( + list(/obj/item/ammo_magazine/revolver/t500, "NEXP", "black"), + list(/obj/item/ammo_magazine/revolver/t500/slavs, "SLAV", "white"), + ), + ), /obj/item/ammo_magazine/revolver/t312 = -1, - /obj/item/weapon/gun/pistol/p17 = -1, - /obj/item/ammo_magazine/pistol/p17 = -1, + "P-17" = list(-1, list( + list(/obj/item/weapon/gun/pistol/p17, "WEAP"), + list(/obj/item/ammo_magazine/pistol/p17, "AMMO", VEND_COLOR_AMMO), + ), + ), /obj/item/weapon/gun/pistol/vp70 = -1, - /obj/item/ammo_magazine/pistol/vp70 = -1, - /obj/item/ammo_magazine/pistol/vp70/hp = -1, - /obj/item/ammo_magazine/pistol/vp70/incendiary = -1, - /obj/item/weapon/gun/pistol/plasma_pistol = -1, - /obj/item/ammo_magazine/pistol/plasma_pistol = -1, - /obj/item/weapon/gun/shotgun/double/derringer = -1, - /obj/item/ammo_magazine/pistol/derringer = -1, + "VP-70 Magazines" = list(-1, list( + list(/obj/item/ammo_magazine/pistol/vp70, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/pistol/vp70/hp, "HP", VEND_COLOR_HP), + list(/obj/item/ammo_magazine/pistol/vp70/incendiary, "IC", VEND_COLOR_IC) + ), + VEND_DESCRIPTION_MAGAZINES + ), + "Plasma Pistol" = list(-1, list( + list(/obj/item/weapon/gun/pistol/plasma_pistol, "WEAP"), + list(/obj/item/ammo_magazine/pistol/plasma_pistol, "AMMO", VEND_COLOR_AMMO), + ), + ), + "Derringer" = list(-1, list( + list(/obj/item/weapon/gun/shotgun/double/derringer, "WEAP"), + list(/obj/item/ammo_magazine/pistol/derringer, "AMMO", VEND_COLOR_AMMO), + ), + ), ), "Гранаты" = list( /obj/item/weapon/gun/grenade_launcher/single_shot = -1, - /obj/item/weapon/gun/grenade_launcher/multinade_launcher/unloaded = -1, /obj/item/weapon/gun/rifle/tx54 = -1, /obj/item/ammo_magazine/rifle/tx54 = -1, /obj/item/ammo_magazine/rifle/tx54/incendiary = -1, /obj/item/ammo_magazine/rifle/tx54/smoke = -1, - /obj/item/ammo_magazine/rifle/tx54/smoke/dense = -1, /obj/item/ammo_magazine/rifle/tx54/smoke/tangle = -1, /obj/item/explosive/grenade = -1, /obj/item/explosive/grenade/m15 = -1, /obj/item/explosive/grenade/sticky = -1, /obj/item/explosive/grenade/sticky/trailblazer = -1, - /obj/item/explosive/grenade/sticky/trailblazer/phosphorus = -1, - /obj/item/explosive/grenade/sticky/cloaker = -1, /obj/item/explosive/grenade/incendiary = -1, /obj/item/explosive/grenade/smokebomb = -1, /obj/item/explosive/grenade/smokebomb/cloak = -1, + /obj/item/explosive/grenade/sticky/cloaker = -1, /obj/item/explosive/grenade/smokebomb/drain = -1, /obj/item/explosive/grenade/mirage = -1, /obj/item/storage/box/m94 = -1, /obj/item/storage/box/m94/cas = -1, ), "Специализированное" = list( + /obj/item/storage/box/crate/sentry = -1, /obj/item/weapon/gun/rifle/pepperball = -1, /obj/item/ammo_magazine/rifle/pepperball = -1, /obj/item/weapon/gun/flamer/big_flamer/marinestandard = -1, /obj/item/ammo_magazine/flamer_tank/large = -1, /obj/item/ammo_magazine/flamer_tank/large/G = -1, /obj/item/ammo_magazine/flamer_tank/backtank = -1, + /obj/item/ammo_magazine/flamer_tank/water = -1, /obj/item/jetpack_marine = -1, /obj/item/bodybag/tarp = -1, - /obj/item/mortar_kit/knee = 4, - /obj/item/mortal_shell/knee = 40, + /obj/item/mortar_kit/knee = -1, + /obj/item/mortal_shell/knee = -1, ), "Тяжёлое вооружение" = list( /obj/structure/closet/crate/mortar_ammo/mortar_kit = -1, @@ -674,45 +911,64 @@ /obj/item/attachable/flamer_nozzle/long = -1, ), "Коробки" = list( - /obj/item/ammo_magazine/packet/p9mm = -1, - /obj/item/ammo_magazine/packet/p9mm/ap = -1, - /obj/item/ammo_magazine/packet/p9mm/hp = -1, - /obj/item/ammo_magazine/packet/p9mm/incendiary = -1, - /obj/item/ammo_magazine/packet/acp = -1, - /obj/item/ammo_magazine/packet/acp/ap = -1, - /obj/item/ammo_magazine/packet/acp/hp = -1, - /obj/item/ammo_magazine/packet/rifle762X39 = -1, - /obj/item/ammo_magazine/packet/p380acp = -1, - /obj/item/ammo_magazine/packet/magnum = -1, - /obj/item/ammo_magazine/packet/t500 = -1, - /obj/item/ammo_magazine/packet/t500/qk = -1, - /obj/item/ammo_magazine/packet/t500/slavs = -1, - /obj/item/ammo_magazine/packet/t312 = -1, /obj/item/ammo_magazine/packet/p10x20mm = -1, - /obj/item/ammo_magazine/packet/p10x24mm = -1, - /obj/item/ammo_magazine/packet/p10x24mm/ap = -1, - /obj/item/ammo_magazine/packet/p10x24mm/hp = -1, - /obj/item/ammo_magazine/packet/p10x24mm/incendiary = -1, - /obj/item/ammo_magazine/packet/groza = -1, - /obj/item/ammo_magazine/packet/groza/ap = -1, - /obj/item/ammo_magazine/packet/groza/hp = -1, - /obj/item/ammo_magazine/packet/p10x25mm = -1, - /obj/item/ammo_magazine/packet/p10x25mm/ap = -1, - /obj/item/ammo_magazine/packet/p10x25mm/hp = -1, + "10x24" = list(-1, list( + list(/obj/item/ammo_magazine/packet/p10x24mm, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/p10x24mm/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/p10x24mm/hp, "HP", VEND_COLOR_HP) + ), + ), + "10x25" = list(-1, list( + list(/obj/item/ammo_magazine/packet/p10x25mm, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/p10x25mm/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/p10x25mm/hp, "HP", VEND_COLOR_HP) + ), + ), /obj/item/ammo_magazine/packet/p10x26mm = -1, /obj/item/ammo_magazine/packet/p10x27mm = -1, + "7.62x39" = list(-1, list( + list(/obj/item/ammo_magazine/packet/groza, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/groza/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/groza/hp, "HP", VEND_COLOR_HP) + ), + ), + "9mm" = list(-1, list( + list(/obj/item/ammo_magazine/packet/p9mm, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/p9mm/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/p9mm/hp, "HP", VEND_COLOR_HP) + ), + ), + ".45 ACP" = list(-1, list( + list(/obj/item/ammo_magazine/packet/acp, "FMJ", VEND_COLOR_FMJ), + list(/obj/item/ammo_magazine/packet/acp/ap, "AP", VEND_COLOR_AP), + list(/obj/item/ammo_magazine/packet/acp/hp, "HP", VEND_COLOR_HP) + ), + ), /obj/item/ammo_magazine/packet/p86x70mm = -1, + /obj/item/ammo_magazine/packet/svd762x54mmR = -1, + /obj/item/ammo_magazine/packet/p4570 = -1, /obj/item/ammo_magazine/packet/standardautoshotgun = -1, /obj/item/ammo_magazine/packet/standardautoshotgun/flechette = -1, - /obj/item/ammo_magazine/packet/p4570 = -1, + /obj/item/ammo_magazine/packet/p380acp = -1, + /obj/item/ammo_magazine/packet/magnum = -1, /obj/item/ammo_magazine/packet/long_special = -1, + "T-500" = list(-1, list( + list(/obj/item/ammo_magazine/packet/t500, "NEXP", "black"), + list(/obj/item/ammo_magazine/packet/t500/qk, "QKIL", "purple"), + list(/obj/item/ammo_magazine/packet/t500/slavs, "SLAV", "white") + ), + ), + /obj/item/ammo_magazine/packet/t312 = -1, /obj/item/storage/box/visual/magazine = -1, /obj/item/storage/box/visual/grenade = -1, /obj/structure/closet/crate/mass_produced_crate = -1, - /obj/structure/closet/crate/mass_produced_crate/alpha = -1, - /obj/structure/closet/crate/mass_produced_crate/bravo = -1, - /obj/structure/closet/crate/mass_produced_crate/charlie = -1, - /obj/structure/closet/crate/mass_produced_crate/delta = -1, + "Squad Crates" = list(20, list( + list(/obj/structure/closet/crate/mass_produced_crate/alpha, "A", "red"), + list(/obj/structure/closet/crate/mass_produced_crate/bravo, "B", "yellow"), + list(/obj/structure/closet/crate/mass_produced_crate/charlie, "C", "purple"), + list(/obj/structure/closet/crate/mass_produced_crate/delta, "D", "blue"), + ), + ), /obj/structure/closet/crate/mass_produced_crate/ammo = -1, /obj/structure/closet/crate/mass_produced_crate/construction = -1, /obj/structure/closet/crate/mass_produced_crate/explosives = -1, @@ -735,7 +991,7 @@ /obj/item/deployable_floodlight = -1, /obj/item/fulton_extraction_pack = -1, /obj/item/facepaint/premium = -1, - ) + ), ) /obj/machinery/vending/cigarette @@ -769,10 +1025,10 @@ /obj/item/storage/box/matches = -1, /obj/item/tool/lighter/random = -1, /obj/item/tool/lighter/zippo = -1, - /obj/item/clothing/mask/cigarette/cigar/havana = 5 + /obj/item/clothing/mask/cigarette/cigar/havana = 5, + /obj/item/storage/fancy/cigar = 25 ) - premium = list(/obj/item/storage/fancy/cigar = 25) seasonal_items = list() /obj/machinery/vending/cigarette/colony @@ -1093,41 +1349,72 @@ product_slogans = "The best blood on the market!;Totally came from an ethical source!;O negative is the universal donor, use it!;Prevent hypovolemic shock starting today!" req_one_access = list(ACCESS_MARINE_MEDBAY, ACCESS_MARINE_CHEMISTRY, ACCESS_MARINE_MEDPREP) products = list( - /obj/item/reagent_containers/blood/APlus = 5, - /obj/item/reagent_containers/blood/AMinus = 5, - /obj/item/reagent_containers/blood/BPlus = 5, - /obj/item/reagent_containers/blood/BMinus = 5, - /obj/item/reagent_containers/blood/OPlus = 5, - /obj/item/reagent_containers/blood/OMinus = 5, - /obj/item/reagent_containers/blood/empty = 10, - ) - -/obj/machinery/vending/MarineMed/Blood/build_inventory(list/productlist, category) - . = ..() - var/temp_list[] = productlist - var/obj/item/reagent_containers/blood/temp_path - var/blood_type - for(var/datum/vending_product/R AS in (product_records + coin_records)) - if(R.product_path in temp_list) - temp_path = R.product_path - blood_type = initial(temp_path.blood_type) - R.product_name += blood_type? " [blood_type]" : "" - temp_list -= R.product_path - if(!length(temp_list)) break + "Blood Packs" = list( + "Blood Pack A+" = list(5, list( + list(/obj/item/reagent_containers/blood/APlus, "Vend") + ) + ), + "Blood Pack A-" = list(5, list( + list(/obj/item/reagent_containers/blood/AMinus, "Vend") + ) + ), + "Blood Pack B+" = list(5, list( + list(/obj/item/reagent_containers/blood/BPlus, "Vend") + ) + ), + "Blood Pack B-" = list(5, list( + list(/obj/item/reagent_containers/blood/BMinus, "Vend") + ) + ), + "Blood Pack O+" = list(5, list( + list(/obj/item/reagent_containers/blood/OPlus, "Vend") + ) + ), + "Blood Pack O-" = list(5, list( + list(/obj/item/reagent_containers/blood/OMinus, "Vend") + ) + ), + "Empty Blood Pack" = list(5, list( + list(/obj/item/reagent_containers/blood/empty, "Vend") + ) + ) + )) /obj/machinery/vending/MarineMed/Blood/valhalla resistance_flags = INDESTRUCTIBLE use_power = NO_POWER_USE req_one_access = null products = list( - /obj/item/reagent_containers/blood/APlus = -1, - /obj/item/reagent_containers/blood/AMinus = -1, - /obj/item/reagent_containers/blood/BPlus = -1, - /obj/item/reagent_containers/blood/BMinus = -1, - /obj/item/reagent_containers/blood/OPlus = -1, - /obj/item/reagent_containers/blood/OMinus = -1, - /obj/item/reagent_containers/blood/empty = -1, - ) + "Blood Packs" = list( + "Blood Pack A+" = list(-1, list( + list(/obj/item/reagent_containers/blood/APlus, "Vend") + ) + ), + "Blood Pack A-" = list(-1, list( + list(/obj/item/reagent_containers/blood/AMinus, "Vend") + ) + ), + "Blood Pack B+" = list(-1, list( + list(/obj/item/reagent_containers/blood/BPlus, "Vend") + ) + ), + "Blood Pack B-" = list(-1, list( + list(/obj/item/reagent_containers/blood/BMinus, "Vend") + ) + ), + "Blood Pack O+" = list(-1, list( + list(/obj/item/reagent_containers/blood/OPlus, "Vend") + ) + ), + "Blood Pack O-" = list(-1, list( + list(/obj/item/reagent_containers/blood/OMinus, "Vend") + ) + ), + "Empty Blood Pack" = list(-1, list( + list(/obj/item/reagent_containers/blood/empty, "Vend") + ) + ) + )) /obj/machinery/vending/armor_supply name = "\improper Surplus Armor Equipment Vendor" @@ -1852,3 +2139,11 @@ /obj/item/clothing/shoes/white = -1, ), ) + +#undef VEND_DESCRIPTION_MAGAZINES +#undef VEND_COLOR_DEFAULT +#undef VEND_COLOR_AMMO +#undef VEND_COLOR_FMJ +#undef VEND_COLOR_AP +#undef VEND_COLOR_HP +#undef VEND_COLOR_IC diff --git a/code/game/objects/machinery/vending/vending.dm b/code/game/objects/machinery/vending/vending.dm index 64906af27cf..e1ae34d3f48 100644 --- a/code/game/objects/machinery/vending/vending.dm +++ b/code/game/objects/machinery/vending/vending.dm @@ -1,6 +1,4 @@ #define CAT_NORMAL 0 -#define CAT_HIDDEN 1 -#define CAT_COIN 2 #define VENDING_RESTOCK_IDLE 0 #define VENDING_RESTOCK_DENY 1 @@ -10,46 +8,42 @@ #define MAKE_VENDING_RECORD_DATA(record) list(\ "product_name" = record.product_name,\ - "product_color" = record.display_color,\ - "prod_desc" = initial(record.product_path.desc),\ + "prod_desc" = record.desc,\ "ref" = REF(record),\ "tab" = record.tab,\ + "products" = record.product_paths,\ ) /datum/vending_product ///Name of the product var/product_name = "generic" - ///Path of the item this product makes - var/atom/product_path = null + ///Description to be put under ? button + var/desc = null + ///Path for the items this product makes, in format {item/path, button_label, color} + var/product_paths = list() + ///Vended product + var/product_vended = null ///How much of this product there is var/amount = 0 ///The price of this product if any. var/price = 0 - ///What color it stays on the vend button, considering just nuking this. - var/display_color = "white" - ///What category it belongs to, Normal, contraband or coin. + ///What category it belongs to - only normal (contraband or coin are removed) var/category = CAT_NORMAL ///Incase its a tabbed vendor what tab this belongs to. var/tab -/datum/vending_product/New(name, atom/typepath, product_amount, product_price, product_display_color, category = CAT_NORMAL, tab) - product_path = typepath +/datum/vending_product/New(name, typepath, product_amount, product_price, category = CAT_NORMAL, tab, product_description) + product_paths = typepath amount = product_amount price = product_price src.category = category src.tab = tab - if(!name) - product_name = initial(typepath.name) - else + if(name) product_name = name - if(product_display_color) - display_color = product_display_color - else if(ispath(typepath, /obj/item/ammo_magazine)) - display_color = "black" - else - display_color = "white" + if(product_description) + desc = product_description /obj/machinery/vending name = "Vendomat" @@ -99,16 +93,13 @@ ) ) */ + /// Normal products that are always available on the vendor. var/list/products = list() /** List of seasons whose products are added to the vendor's. * Format for each entry is SEASON_NAME = "tab name" */ var/list/seasonal_items = list() - /// Contraband products that are only available on vendor when hacked. - var/list/contraband = list() - /// Premium products that are only available when using a coin to pay for it. - var/list/premium = list() /// String of slogans separated by semicolons, optional var/product_slogans = "" ///String of small ad messages in the vending screen - random chance @@ -116,10 +107,8 @@ //These are where the vendor holds their item info with /datum/vending_product ///list of /datum/vending_product's that are always available on the vendor var/list/product_records = list() - ///list of /datum/vending_product's that are available when vendor is hacked. - var/list/hidden_records = list() - ///list of /datum/vending_product's that are available on the vendor when a coin is used. - var/list/coin_records = list() + /// For lookup after vending + var/list/products_inverse = list() var/list/slogan_list = list() /// small ad messages in the vending screen - random chance of popping up whenever you open it var/list/small_ads = list() @@ -141,8 +130,6 @@ var/shoot_inventory = FALSE ///If true the machine won't be speaking slogans randomly. Stop spouting those godawful pitches! var/shut_up = FALSE - ///If the vending machine is hacked, makes the items on contraband list available. - var/extended_inventory = FALSE ///How much tipped we are. var/tipped_level = 0 ///Stops the machine from being hacked to shoot inventory or allow all access @@ -170,13 +157,9 @@ build_shared_inventory() else build_inventory(products) - build_inventory(contraband, CAT_HIDDEN) - build_inventory(premium, CAT_COIN) // we won't use these anymore so we can just null them - premium = null products = null - contraband = null start_processing() update_icon() return INITIALIZE_HINT_LATELOAD @@ -213,45 +196,63 @@ if(!GLOB.vending_records[type]) build_inventory(products) GLOB.vending_records[type] = product_records + GLOB.vending_inverse_records[type] = products_inverse else product_records = GLOB.vending_records[type] - - if(!GLOB.vending_hidden_records[type]) - build_inventory(contraband, CAT_HIDDEN) - GLOB.vending_hidden_records[type] = hidden_records - else - hidden_records = GLOB.vending_hidden_records[type] - - if(!GLOB.vending_coin_records[type]) - build_inventory(premium, CAT_COIN) - GLOB.vending_coin_records[type] = coin_records - else - coin_records = GLOB.vending_coin_records[type] + products_inverse = GLOB.vending_inverse_records[type] ///Builds a vending machine inventory from the given list into their records depending of category. /obj/machinery/vending/proc/build_inventory(list/productlist, category = CAT_NORMAL) var/list/recordlist = product_records - if(category == CAT_HIDDEN) - recordlist = hidden_records - if(category == CAT_COIN) - recordlist = coin_records - for(var/entry in productlist) - //if this is true then this is supposed to be tab dependant. - if(islist(productlist[entry])) - for(var/typepath in productlist[entry]) - var/amount = productlist[entry][typepath] - if(isnull(amount)) - amount = 1 - var/datum/vending_product/record = new(typepath = typepath, product_amount = amount, category = category, tab = entry) - recordlist += record + if(islist(productlist[entry])) //if this is true then this is supposed to be tab dependant. + var/list/tab_products = productlist[entry] + for(var/product_entry in tab_products) + if(islist(tab_products[product_entry])) // new entry format: group label = {amount, {items with info}, desc} + var/list/group_info = tab_products[product_entry] + var/list/group_products = group_info[2] + if(length(group_info[2]) == 0) + continue // Somebody forgot to populate the list + var/prod_desc = null + if(length(group_info) >= 3) + prod_desc = group_info[3] + else // Try to get desc of the first item in the list + var/atom/product_entry_atom = group_products[1][1] + prod_desc = initial(product_entry_atom.desc) + + var/datum/vending_product/record = new( + name = product_entry, + product_amount = group_info[1], + typepath = group_products, + category = category, + tab = entry, + product_description = prod_desc + ) + recordlist += record + // build inverse list for lookup later + for(var/product_in_group in group_products) + products_inverse[product_in_group[1]] = REF(record) //add record as key, and group name as value + continue + + else // classic entry: item/path = amount + var/atom/product_entry_atom = product_entry + var/amount = tab_products[product_entry] + if(isnull(amount)) + amount = 1 + var/list/created_product_list = list(list(product_entry, "Vend")) + var/datum/vending_product/record = new(name = initial(product_entry_atom.name), typepath = created_product_list, product_amount = amount, category = category, tab = entry, product_description = initial(product_entry_atom.desc)) + recordlist += record + products_inverse[product_entry] = REF(record) continue //This item is not tab dependent + var/atom/product_entry_atom = entry var/amount = productlist[entry] if(isnull(amount)) amount = 1 - var/datum/vending_product/record = new(typepath = entry, product_amount = amount, category = category) + var/list/created_product_list = list(list(entry, "Vend")) + var/datum/vending_product/record = new(name = initial(product_entry_atom.name), typepath = created_product_list, product_amount = amount, category = category, product_description = initial(product_entry_atom.desc)) recordlist += record + products_inverse[entry] = REF(record) ///Makes additional tabs/adds to the tabs based on the seasonal_items vendor specification /obj/machinery/vending/proc/build_seasonal_tabs() @@ -403,8 +404,6 @@ . = list() .["vendor_name"] = name .["displayed_records"] = list() - .["hidden_records"] = list() - .["coin_records"] = list() .["tabs"] = list() for(var/datum/vending_product/R AS in product_records) @@ -412,26 +411,15 @@ .["tabs"] += R.tab .["displayed_records"] += list(MAKE_VENDING_RECORD_DATA(R)) - for(var/datum/vending_product/R AS in hidden_records) - if(R.tab && !(R.tab in .["tabs"])) - .["tabs"] += R.tab - .["hidden_records"] += list(MAKE_VENDING_RECORD_DATA(R)) - - for(var/datum/vending_product/R AS in coin_records) - if(R.tab && !(R.tab in .["tabs"])) - .["tabs"] += R.tab - .["coin_records"] += list(MAKE_VENDING_RECORD_DATA(R)) - /obj/machinery/vending/ui_data(mob/user) . = list() .["stock"] = list() - for(var/datum/vending_product/R AS in product_records + hidden_records + coin_records) + for(var/datum/vending_product/R AS in product_records) .["stock"][R.product_name] = R.amount if(currently_vending) .["currently_vending"] = MAKE_VENDING_RECORD_DATA(currently_vending) - .["extended"] = extended_inventory .["isshared"] = isshared .["ui_theme"] = "main" @@ -448,14 +436,15 @@ flick(icon_deny, src) return - var/datum/vending_product/R = locate(params["vend"]) in product_records | hidden_records | coin_records - if(!istype(R) || !R.product_path || R.amount == 0) + var/list/ans = params["vend"] + var/datum/vending_product/R = locate(ans[1]) in product_records + var/datum/vending_product/vended_path = text2path(ans[2]) + + if(!istype(R) || !R.product_paths || R.amount == 0) return - if(isAI(usr)) - vend(R, usr) - else if(R.price == null) - vend(R, usr) + if((isAI(usr)) || (R.price == null)) + vend(R, usr, vended_path) else currently_vending = R . = TRUE @@ -464,16 +453,13 @@ stock_vacuum(usr) . = TRUE -/obj/machinery/vending/proc/vend(datum/vending_product/R, mob/user) +/obj/machinery/vending/proc/vend(datum/vending_product/R, mob/user, vended_product_path) if(!allowed(user) && (!wires.is_cut(WIRE_IDSCAN) || hacking_safety)) //For SECURE VENDING MACHINES YEAH to_chat(user, span_warning("Access denied.")) if(icon_deny) flick(icon_deny, src) return - if(R.category == CAT_HIDDEN && !extended_inventory) - return - var/turf/T = loc if(length(T.contents) > 30 || locate(/obj/structure/closet/crate) in loc) // let's make crashing the server a bit harder to_chat(user, span_warning("The floor is too cluttered, make some space.")) @@ -487,7 +473,7 @@ if(((last_reply + (src.vend_delay + 200)) <= world.time) && vend_reply) INVOKE_ASYNC(src, PROC_REF(speak_on_vend)) - var/obj/item/new_item = release_item(R, vend_delay) + var/obj/item/new_item = release_item(R, vend_delay, vended_product_path=vended_product_path) if(istype(new_item)) new_item.on_vend(user, faction, fill_container = TRUE) @@ -497,7 +483,8 @@ speak(vend_reply) last_reply = world.time -/obj/machinery/vending/proc/release_item(datum/vending_product/R, delay_vending = 0, dump_product = 0) +/obj/machinery/vending/proc/release_item(datum/vending_product/R, delay_vending = 0, dump_product = 0, vended_product_path) + if(delay_vending) if(powered(power_channel)) use_power(active_power_usage) //actuators and stuff @@ -520,10 +507,10 @@ playsound(src, vending_sound, 25, 0) else playsound(src, SFX_VENDING, 25, 0) - if(ispath(R.product_path,/obj/item/weapon/gun)) - return new R.product_path(get_turf(src), 1) + if(ispath(vended_product_path,/obj/item/weapon/gun)) + return new vended_product_path(get_turf(src), 1) else - return new R.product_path(get_turf(src)) + return new vended_product_path(get_turf(src)) /obj/machinery/vending/MouseDrop_T(atom/movable/A, mob/user) . = ..() @@ -551,16 +538,12 @@ display_message_and_visuals(user, show_feedback, "Vendor is unresponsive!", VENDING_RESTOCK_IDLE) return FALSE - var/datum/vending_product/record //The found record matching the item_to_stock in the vending_records lists - for(var/datum/vending_product/checked_record AS in product_records + hidden_records + coin_records) - if(item_to_stock.type != checked_record.product_path) - continue - record = checked_record - - if(!record) //Item isn't listed in the vending records. + if(!(item_to_stock.type in products_inverse)) //Item isn't listed in the vending records. user?.balloon_alert(user, "[item_to_stock] doesn't belong here!") return FALSE + var/datum/vending_product/record = locate(products_inverse[item_to_stock.type]) in product_records + return do_stock(item_to_stock, user, show_feedback, record) ///Actually does the restock. Overridden by lasgun vendor for snowflake behaviour @@ -754,7 +737,7 @@ for(var/datum/vending_product/R AS in product_records) if (R.amount <= 0) //Try to use a record that actually has something to dump. continue - var/dump_path = R.product_path + var/dump_path = R.product_paths if (!dump_path) continue @@ -776,7 +759,7 @@ for(var/datum/vending_product/R AS in product_records) if (R.amount <= 0) //Try to use a record that actually has something to dump. continue - var/dump_path = R.product_path + var/dump_path = R.product_paths if (!dump_path) continue @@ -810,8 +793,6 @@ tip_over() #undef CAT_NORMAL -#undef CAT_HIDDEN -#undef CAT_COIN #undef VENDING_RESTOCK_IDLE #undef VENDING_RESTOCK_DENY diff --git a/tgui/packages/tgui/interfaces/Vending.tsx b/tgui/packages/tgui/interfaces/Vending.tsx index 953c4fab161..7e2e1f8343f 100644 --- a/tgui/packages/tgui/interfaces/Vending.tsx +++ b/tgui/packages/tgui/interfaces/Vending.tsx @@ -15,36 +15,24 @@ import { Window } from '../layouts'; type VendingData = { vendor_name: string; displayed_records: VendingRecord[]; - hidden_records: VendingRecord[]; - coin_records: VendingRecord[]; tabs: string[]; stock: number; currently_vending: VendingRecord | null; - extended: number; - coin: string; ui_theme: string; }; type VendingRecord = { product_name: string; - product_color: string; prod_desc: string; ref: string; tab: string; + products: any[]; }; export const Vending = () => { const { act, data } = useBackend(); - const { - vendor_name, - currently_vending, - hidden_records, - coin_records, - extended, - tabs, - ui_theme, - } = data; + const { vendor_name, currently_vending, tabs, ui_theme } = data; const [showDesc, setShowDesc] = useLocalState('showDesc', null); @@ -115,8 +103,6 @@ export const Vending = () => { )} - {!!(coin_records.length > 0) && } - {hidden_records.length > 0 && !!extended && } @@ -127,10 +113,10 @@ export const Vending = () => { type VendingProductEntryProps = { stock: number; key: string; - product_color: string; product_name: string; prod_desc: string; prod_ref: string; + products: any[]; }; const ProductEntry = (props: VendingProductEntryProps) => { @@ -138,8 +124,7 @@ const ProductEntry = (props: VendingProductEntryProps) => { const { currently_vending } = data; - const { stock, key, product_color, product_name, prod_desc, prod_ref } = - props; + const { stock, key, product_name, prod_desc, prod_ref, products } = props; const [showDesc, setShowDesc] = useLocalState( 'showDesc', @@ -166,19 +151,25 @@ const ProductEntry = (props: VendingProductEntryProps) => { )} - - + + {products.map((product) => ( + + ))} } label={product_name} @@ -214,10 +205,10 @@ const Products = () => { ) ); @@ -227,78 +218,3 @@ const Products = () => { ); }; - -const Hacked = () => { - const { data } = useBackend(); - - const { hidden_records, stock, tabs } = data; - - const [selectedTab] = useLocalState( - 'selectedTab', - tabs.length ? tabs[0] : null, - ); - - return ( -
- - {hidden_records - .filter((record) => !record.tab || record.tab === selectedTab) - .map((hidden_record) => { - return ( - - ); - })} - -
- ); -}; - -const Premium = () => { - const { act, data } = useBackend(); - - const { coin_records, stock, coin, tabs } = data; - - const [selectedTab] = useLocalState( - 'selectedTab', - tabs.length ? tabs[0] : null, - ); - - return ( -
act('remove_coin')}> - Remove - - ) - } - > - {!!coin && ( - - {coin_records - .filter((record) => !record.tab || record.tab === selectedTab) - .map((coin_record) => { - return ( - - ); - })} - - )} -
- ); -};