Files
Bubberstation/code/modules/vending/games.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

123 lines
3.9 KiB
Plaintext

/obj/machinery/vending/games
name = "\improper Good Clean Fun"
desc = "Vends things that the Captain and Head of Personnel are probably not going to appreciate you fiddling with instead of your job..."
product_ads = "Escape to a fantasy world!;Fuel your gambling addiction!;Ruin your friendships!;Roll for initiative!;Elves and dwarves!;Paranoid computers!;Totally not satanic!;Fun times forever!"
icon_state = "games"
panel_type = "panel4"
product_categories = list(
list(
"name" = "Cards",
"icon" = "diamond",
"products" = list(
/obj/item/toy/cards/deck = 5,
/obj/item/toy/cards/deck/blank = 3,
/obj/item/toy/cards/deck/blank/black = 3,
/obj/item/toy/cards/deck/cas = 3,
/obj/item/toy/cards/deck/cas/black = 3,
/obj/item/toy/cards/deck/kotahi = 3,
/obj/item/toy/cards/deck/tarot = 3,
/obj/item/toy/cards/deck/wizoff = 3,
),
),
list(
"name" = "Toys",
"icon" = "hat-wizard",
"products" = list(
/obj/item/toy/captainsaid = 1,
/obj/item/toy/intento = 3,
/obj/item/storage/box/tail_pin = 1,
),
),
list(
"name" = "Art",
"icon" = "palette",
"products" = list(
/obj/item/storage/crayons = 2,
/obj/item/chisel = 3,
/obj/item/paint_palette = 3,
/obj/item/canvas/nineteen_nineteen = 5,
/obj/item/canvas/twentythree_nineteen = 5,
/obj/item/canvas/twentythree_twentythree = 5,
/obj/item/canvas/twentyfour_twentyfour = 5,
/obj/item/canvas/thirtysix_twentyfour = 3,
/obj/item/canvas/fortyfive_twentyseven = 3,
/obj/item/wallframe/painting/large = 5,
/obj/item/stack/pipe_cleaner_coil/random = 10,
),
),
list(
"name" = "Fishing",
"icon" = "fish",
"products" = list(
/obj/item/storage/toolbox/fishing = 2,
/obj/item/storage/box/fishing_hooks = 2,
/obj/item/storage/box/fishing_lines = 2,
/obj/item/storage/box/fishing_lures = 2,
/obj/item/book/manual/fish_catalog = 5,
/obj/item/reagent_containers/cup/fish_feed = 4,
/obj/item/storage/box/aquarium_props = 4,
/obj/item/fish_analyzer = 2,
/obj/item/storage/bag/fishing = 2,
/obj/item/fishing_rod/telescopic = 1,
/obj/item/fish_tank = 1,
),
),
list(
"name" = "Skillchips",
"icon" = "floppy-disk",
"products" = list(
/obj/item/skillchip/appraiser = 2,
/obj/item/skillchip/basketweaving = 2,
/obj/item/skillchip/bonsai = 2,
/obj/item/skillchip/intj = 2,
/obj/item/skillchip/light_remover = 2,
/obj/item/skillchip/master_angler = 2,
/obj/item/skillchip/sabrage = 2,
/obj/item/skillchip/useless_adapter = 5,
/obj/item/skillchip/wine_taster = 2,
/obj/item/skillchip/big_pointer = 2,
),
),
list(
"name" = "Other",
"icon" = "star",
"products" = list(
/obj/item/camera = 3,
/obj/item/camera_film = 5,
/obj/item/cardpack/resin = 20, //Both card packs have had their count raised to 20 from 10 until card persistence is implemented.
/obj/item/cardpack/series_one = 20,
/obj/item/dyespray = 3,
/obj/item/hourglass = 2,
/obj/item/instrument/piano_synth/headphones = 4,
/obj/item/razor = 3,
/obj/item/storage/card_binder = 10,
/obj/item/storage/dice = 10,
),
),
)
contraband = list(
/obj/item/dice/fudge = 9,
/obj/item/clothing/shoes/wheelys/skishoes = 4,
/obj/item/instrument/musicalmoth = 1,
/obj/item/gun/ballistic/revolver/russian = 1, //the most dangerous game
/obj/item/skillchip/acrobatics = 1,
)
premium = list(
/obj/item/disk/holodisk = 5,
/obj/item/rcl = 2,
/obj/item/airlock_painter = 1,
/obj/item/clothing/shoes/wheelys/rollerskates= 3,
/obj/item/melee/skateboard/pro = 3,
/obj/item/melee/skateboard/hoverboard = 1,
)
refill_canister = /obj/item/vending_refill/games
default_price = PAYCHECK_CREW
extra_price = PAYCHECK_COMMAND * 1.25
payment_department = ACCOUNT_SRV
light_mask = "games-light-mask"
allow_custom = TRUE
/obj/item/vending_refill/games
machine_name = "\improper Good Clean Fun"
icon_state = "refill_games"