Files
Bubberstation/code/modules/vending/cytopro.dm
T
RoxyandGitHub 87ebbba36a Refactor custom vending machine brand selection (#92205)
## About The Pull Request

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

## Why It's Good For The Game

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

## Changelog
🆑
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 01:11:24 +10:00

37 lines
1.3 KiB
Plaintext

/obj/machinery/vending/cytopro
name = "\improper CytoPro"
desc = "For all your cytology needs!"
product_slogans = "Cloning? Don't be ridiculous.;Don't be uncultured, get some cells growing!;Who needs farms when we got vats?"
product_ads = "Grow your own little creatures!;Biology, at your fingertips!"
icon_state = "cytopro"
icon_deny = "cytopro-deny"
panel_type = "panel2"
light_mask = "cytopro-light-mask"
products = list(
/obj/item/storage/bag/xeno = 5,
/obj/item/reagent_containers/condiment/protein = 10,
/obj/item/storage/box/swab = 3,
/obj/item/storage/box/petridish = 3,
/obj/item/storage/box/monkeycubes = 3,
/obj/item/biopsy_tool = 3,
/obj/item/clothing/under/rank/rnd/scientist = 5,
/obj/item/clothing/suit/toggle/labcoat/science = 5,
/obj/item/clothing/suit/bio_suit/scientist = 3,
/obj/item/clothing/head/bio_hood/scientist = 3,
/obj/item/reagent_containers/dropper = 5,
/obj/item/reagent_containers/syringe = 5,
/obj/item/petri_dish/random = 6,
)
contraband = list(
/obj/item/knife/kitchen = 3,
)
refill_canister = /obj/item/vending_refill/cytopro
default_price = PAYCHECK_CREW * 1
extra_price = PAYCHECK_COMMAND * 0.5
payment_department = ACCOUNT_SCI
allow_custom = TRUE
/obj/item/vending_refill/cytopro
machine_name = "CytoPro"
icon_state = "refill_plant"