Files
Bubberstation/code/modules/vending/engivend.dm
Roxy 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

40 lines
1.3 KiB
Plaintext

/obj/machinery/vending/engivend
name = "\improper Engi-Vend"
desc = "Spare tool vending. What? Did you expect some witty description?"
icon_state = "engivend"
icon_deny = "engivend-deny"
panel_type = "panel10"
products = list(
/obj/item/clothing/glasses/meson/engine = 2,
/obj/item/clothing/glasses/welding = 3,
/obj/item/multitool = 4,
/obj/item/grenade/chem_grenade/smart_metal_foam = 10,
/obj/item/geiger_counter = 5,
/obj/item/stock_parts/power_store/cell/high = 10,
/obj/item/stock_parts/power_store/battery/high = 10,
/obj/item/electronics/airlock = 10,
/obj/item/electronics/apc = 10,
/obj/item/electronics/airalarm = 10,
/obj/item/electronics/firealarm = 10,
/obj/item/electronics/firelock = 10,
/obj/item/stack/sticky_tape/duct = 10,
)
contraband = list(
/obj/item/stock_parts/power_store/cell/potato = 3,
)
premium = list(
/obj/item/storage/belt/utility = 3,
/obj/item/construction/rcd/loaded = 2,
/obj/item/storage/box/smart_metal_foam = 1,
)
refill_canister = /obj/item/vending_refill/engivend
default_price = PAYCHECK_CREW
extra_price = PAYCHECK_COMMAND * 1.5
payment_department = ACCOUNT_ENG
light_mask = "engivend-light-mask"
allow_custom = TRUE
/obj/item/vending_refill/engivend
machine_name = "Engi-Vend"
icon_state = "refill_engi"