From 73e349d0dffc4f6b74ce2fe19297e6876f3a4923 Mon Sep 17 00:00:00 2001 From: Vi3trice <80771500+Vi3trice@users.noreply.github.com> Date: Tue, 12 Apr 2022 10:49:12 -0400 Subject: [PATCH] Cigarette and drinks vendors generate the right circuitboard when disassembled, beach cigarette vendor can be reassembled properly (#17565) * Could use a refactor on its own, but * Added other mapped in machines * Making two lists was simpler * List still had issues * So var edited vendors with different names are a thing --- code/game/machinery/constructable_frame.dm | 10 +++++++--- code/game/machinery/vending.dm | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm index 8de3cd73131..3771f2a0665 100644 --- a/code/game/machinery/constructable_frame.dm +++ b/code/game/machinery/constructable_frame.dm @@ -231,7 +231,7 @@ to destroy them and players will be able to make replacements. build_path = /obj/machinery/vending/boozeomat req_components = list(/obj/item/vending_refill/boozeomat = 1) - var/static/list/vending_names_paths = list( + var/static/list/station_vendors = list( "Booze-O-Mat" = /obj/machinery/vending/boozeomat, "Solar's Best Hot Drinks" = /obj/machinery/vending/coffee, "Getmore Chocolate Corp" = /obj/machinery/vending/snack, @@ -272,18 +272,22 @@ to destroy them and players will be able to make replacements. "ChefDrobe" = /obj/machinery/vending/chefdrobe, "BarDrobe" = /obj/machinery/vending/bardrobe, "HydroDrobe" = /obj/machinery/vending/hydrodrobe) + var/static/list/unique_vendors = list( + "ShadyCigs Ultra" = /obj/machinery/vending/cigarette/beach, + "SyndiMed Plus" = /obj/machinery/vending/wallmed/syndicate) /obj/item/circuitboard/vendor/screwdriver_act(mob/user, obj/item/I) . = TRUE if(!I.use_tool(src, user, 0, volume = I.tool_volume)) return - var/choice = input(user, "Choose a new brand", "Select an Item") as null|anything in vending_names_paths + var/choice = input(user, "Choose a new brand", "Select an Item") as null|anything in station_vendors if(!choice) return set_type(choice) /obj/item/circuitboard/vendor/proc/set_type(type) - var/obj/machinery/vending/typepath = vending_names_paths[type] + var/static/list/buildable_vendors = station_vendors + unique_vendors + var/obj/machinery/vending/typepath = buildable_vendors[type] build_path = typepath board_name = "[type] Vendor" format_board_name() diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index 3d635ab0dec..ca4689fafb7 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -116,7 +116,7 @@ else component_parts = list() var/obj/item/circuitboard/vendor/V = new - V.set_type(replacetext(name, "\improper", "")) + V.set_type(replacetext(initial(name), "\improper", "")) component_parts += V component_parts += new refill_canister RefreshParts() @@ -942,7 +942,7 @@ /obj/machinery/vending/coffee - name = "\improper Hot Drinks machine" + name = "\improper Solar's Best Hot Drinks" desc = "A vending machine which dispenses hot drinks." ads_list = list("Have a drink!","Drink up!","It's good for you!","Would you like a hot joe?","I'd kill for some coffee!","The best beans in the galaxy.","Only the finest brew for you.","Mmmm. Nothing like a coffee.","I like coffee, don't you?","Coffee helps you work!","Try some tea.","We hope you like the best!","Try our new chocolate!","Admin conspiracies") icon_state = "coffee" @@ -1117,7 +1117,7 @@ resistance_flags = FIRE_PROOF /obj/machinery/vending/cigarette - name = "cigarette machine" + name = "\improper ShadyCigs Deluxe" desc = "If you want to get cancer, might as well do it in style." slogan_list = list("Space cigs taste good like a cigarette should.","I'd rather toolbox than switch.","Smoke!","Don't believe the reports - smoke today!") ads_list = list("Probably not bad for you!","Don't believe the scientists!","It's good for you!","Don't quit, buy more!","Smoke!","Nicotine heaven.","Best cigarettes since 2150.","Award-winning cigs.") @@ -1533,16 +1533,16 @@ icon_state = "tool" icon_deny = "tool_deny" icon_panel = "generic" + armor = list(melee = 50, bullet = 20, laser = 20, energy = 20, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 70) + resistance_flags = FIRE_PROOF products = list(/obj/item/stack/cable_coil/random = 10,/obj/item/crowbar = 5,/obj/item/weldingtool = 3,/obj/item/wirecutters = 5, /obj/item/wrench = 5,/obj/item/analyzer = 5,/obj/item/t_scanner = 5,/obj/item/screwdriver = 5) contraband = list(/obj/item/weldingtool/hugetank = 2,/obj/item/clothing/gloves/color/fyellow = 2) premium = list(/obj/item/clothing/gloves/color/yellow = 1) refill_canister = /obj/item/vending_refill/youtool - armor = list(melee = 50, bullet = 20, laser = 20, energy = 20, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 70) - resistance_flags = FIRE_PROOF /obj/machinery/vending/engivend - name = "\improper Engi-vend" + name = "\improper Engi-Vend" desc = "Spare tool vending. What? Did you expect some witty description?" icon_state = "engivend" icon_deny = "engivend_deny"