Files
Roxy 7a9b25c2b7 Refactor custom vending machine brand selection (#92205)
The list of options you could choose from when screwdrivering a custom
vending machine circuit board was hard-coded and also contained copy
pastes of every vending machine name (some of which were outdated). It
was yucky
- Add a new var on `/obj/machinery/vending` called `allow_custom`,
defaults to FALSE and determines whether that type shows up as an option
when screwdrivering a custom vending machine board, I've went through
and made assignments for it mirror what was in the old static list i.e.
this won't introduce any new options
- Change the hard-coded static list to be built on Initialize,
populating with every subtype that has `allow_custom` set to TRUE
- Eliminate a second static list that was just the inverse of the first
one (first one was typepath = name and this one was just name =
typepath)
- Changed an `istype` check to `==` because old behavior meant subtypes
of a given vending machine would have their type set to the supertype if
that was also a valid custom vending machine option

Cleaner code, no needing to maintain two separate entries for the name
of a vending machine, eligibility for a machine to be used in custom
vending machines is now a var on the type instead of in a random file
pertaining to circuit boards

🆑
refactor: refactored custom vending machine brand code, a new var on
/obj/machinery/vending called allow_custom now determines whether the
machine can be chosen when screwdrivering the circuit board
/🆑
2025-07-30 17:37:44 -04:00

113 lines
3.0 KiB
Plaintext

/obj/machinery/vending/hydroseeds
name = "\improper MegaSeed Servitor"
desc = "When you need seeds fast!"
product_slogans = "THIS'S WHERE TH' SEEDS LIVE! GIT YOU SOME!;Hands down the best seed selection on the station!;Also certain mushroom varieties available, more for experts! Get certified today!"
product_ads = "We like plants!;Grow some crops!;Grow, baby, growww!;Aw h'yeah son!"
icon_state = "seeds"
panel_type = "panel2"
light_mask = "seeds-light-mask"
product_categories = list(
list(
"name" = "Fruits",
"icon" = "apple-whole",
"products" = list (
/obj/item/seeds/apple = 3,
/obj/item/seeds/banana = 3,
/obj/item/seeds/chili/bell_pepper = 3,
/obj/item/seeds/berry = 3,
/obj/item/seeds/cherry = 3,
/obj/item/seeds/chili = 3,
/obj/item/seeds/cocoapod = 3,
/obj/item/seeds/eggplant = 3,
/obj/item/seeds/grape = 3,
/obj/item/seeds/lanternfruit = 3,
/obj/item/seeds/lemon = 3,
/obj/item/seeds/lime = 3,
/obj/item/seeds/olive = 3,
/obj/item/seeds/orange = 3,
/obj/item/seeds/pineapple = 3,
/obj/item/seeds/plum = 3,
/obj/item/seeds/pumpkin = 3,
/obj/item/seeds/toechtauese = 3,
/obj/item/seeds/tomato = 3,
/obj/item/seeds/watermelon = 3,
),
),
list(
"name" = "Vegetables",
"icon" = "carrot",
"products" = list(
/obj/item/seeds/cabbage = 3,
/obj/item/seeds/carrot = 3,
/obj/item/seeds/corn = 3,
/obj/item/seeds/cucumber = 3,
/obj/item/seeds/garlic = 3,
/obj/item/seeds/greenbean = 3,
/obj/item/seeds/herbs = 3,
/obj/item/seeds/onion = 3,
/obj/item/seeds/peanut = 3,
/obj/item/seeds/peas = 3,
/obj/item/seeds/potato = 3,
/obj/item/seeds/soya = 3,
/obj/item/seeds/sugarcane = 3,
/obj/item/seeds/whitebeet = 3,
),
),
list(
"name" = "Flowers",
"icon" = "leaf",
"products" = list(
/obj/item/seeds/aloe = 3,
/obj/item/seeds/ambrosia = 3,
/obj/item/seeds/poppy = 3,
/obj/item/seeds/rose = 3,
/obj/item/seeds/sunflower = 3,
),
),
list(
"name" = "Miscellaneous",
"icon" = "question",
"products" = list(
/obj/item/seeds/chanter = 3,
/obj/item/seeds/coffee = 3,
/obj/item/seeds/cotton = 3,
/obj/item/seeds/grass = 3,
/obj/item/seeds/korta_nut = 3,
/obj/item/seeds/wheat/rice = 3,
/obj/item/seeds/tea = 3,
/obj/item/seeds/tobacco = 3,
/obj/item/seeds/tower = 3,
/obj/item/seeds/wheat = 3,
),
),
)
contraband = list(
/obj/item/seeds/amanita = 2,
/obj/item/seeds/glowshroom = 2,
/obj/item/seeds/liberty = 2,
/obj/item/seeds/nettle = 2,
/obj/item/seeds/plump = 2,
/obj/item/seeds/reishi = 2,
/obj/item/seeds/cannabis = 3,
/obj/item/seeds/starthistle = 2,
/obj/item/seeds/random = 2,
)
premium = list(
/obj/item/reagent_containers/spray/waterflower = 1,
)
refill_canister = /obj/item/vending_refill/hydroseeds
default_price = PAYCHECK_LOWER
extra_price = PAYCHECK_CREW
payment_department = ACCOUNT_SRV
allow_custom = TRUE
/obj/item/vending_refill/hydroseeds
machine_name = "MegaSeed Servitor"
icon_state = "refill_plant"