Yogstation 13 - Modules - TypesVar Details - Proc Details

vending machines

Captalism in the year 2525, everything in a vending machine, even love

Vars

activeIs the machine active (No sales pitches if off)!
age_restrictionsWhether our age check is currently functional
alertradioused for narcing on underages
billBills we accept?
canload_access_listID's that can load this vending machine wtih refills
chef_priceCustom item price
coinCoins that we accept?
contrabandList of products this machine sells when you hack it
crit_chanceThe chance, in percent, of this vendor performing a critical hit on anything it crushes via [tilt].
default_priceDefault price of items if not overridden
extended_inventorycan we access the hidden inventory?
extra_priceDefault price of premium items if not overridden
forcecritIf set to a critical define in crushing.dm, anything this vendor crushes will always be hit with that effect.
icon_denyIcon to flash when user is denied a vend
icon_vendIcon when vending an item to the user
input_display_headerDisplay header on the input view
last_replyLast world tick we sent a vent reply
last_shopperLast mob to shop with us
last_sloganLast world tick we sent a slogan message out
light_maskName of lighting mask for the vending machine
loaded_itemshow many items have been inserted in a vendor
num_shardsNumber of glass shards the vendor creates and tries to embed into an atom it tilted onto
onstationIs this item on station or not
panel_typeIcon for the maintenance panel overlay
pinned_mobsList of mobs stuck under the vendor
premiumList of premium products this machine sells
product_adsString of small ad messages in the vending screen - random chance
product_slogansString of slogans separated by semicolons, optional
productsList of products this machine sells
purchase_message_cooldownNext world time to send a purchase message
scan_idAre we checking the users ID
seconds_electrifiedWorld ticks the machine is electified for
shoot_inventoryWhen this is TRUE, we fire items at customers! We're broken!
shoot_inventory_chanceHow likely this is to happen (prob 100)
slogan_delayHow many ticks until we can send another
small_adsSmall ad messages in the vending screen - random chance of popping up whenever you open it
squish_damageDamage this vendor does when tilting onto an atom
tiltableWhether this vendor can be tilted over or not
tiltedWhether the vendor is tilted or not
tilted_rotationIf tilted, this variable should always be the rotation that was applied when we were tilted. Stored for the purposes of unapplying it.
vend_readyAre we ready to vend?? Is it time??
vend_replyMessage sent post vend (Thank you for shopping!)
vending_machine_inputCustom item stock

Procs

InitializeInitialize the vending machine
build_inventoryBuild the inventory of the vending machine from it's product and record lists
canLoadItemAre we able to load the item passed in
charge_userCharge the user during a vend Returns false if the user could not buy this item
compartmentLoadAccessCheckIs the passed in user allowed to load this vending machines compartments
finish_vendFinish a vend by consuming power, playing animations & playing sounds
pre_throwA callback called before an item is tossed out
refill_inventoryRefill our inventory from the passed in product list into the record list
restockRefill a vending machine from a refill canister
shockShock the passed in user
speakSpeak the given message verbally
thank_userThank the user for the purchase
throw_itemThrow an item from our internal inventory out in front of us
unbuild_inventoryGiven a record list, go through and and return a list of type -> amount
update_canisterSet up a refill canister that matches this machines products

Var Details

active

Is the machine active (No sales pitches if off)!

age_restrictions

Whether our age check is currently functional

alertradio

used for narcing on underages

bill

Bills we accept?

canload_access_list

ID's that can load this vending machine wtih refills

chef_price

Custom item price

coin

Coins that we accept?

contraband

List of products this machine sells when you hack it

form should be list(/type/path = amount, /type/path2 = amount2)

crit_chance

The chance, in percent, of this vendor performing a critical hit on anything it crushes via [tilt].

default_price

Default price of items if not overridden

extended_inventory

can we access the hidden inventory?

extra_price

Default price of premium items if not overridden

forcecrit

If set to a critical define in crushing.dm, anything this vendor crushes will always be hit with that effect.

icon_deny

Icon to flash when user is denied a vend

icon_vend

Icon when vending an item to the user

input_display_header

Display header on the input view

last_reply

Last world tick we sent a vent reply

last_shopper

Last mob to shop with us

last_slogan

Last world tick we sent a slogan message out

light_mask

Name of lighting mask for the vending machine

loaded_items

how many items have been inserted in a vendor

num_shards

Number of glass shards the vendor creates and tries to embed into an atom it tilted onto

onstation

Is this item on station or not

if it doesn't originate from off-station during mapload, everything is free

panel_type

Icon for the maintenance panel overlay

pinned_mobs

List of mobs stuck under the vendor

premium

List of premium products this machine sells

form should be list(/type/path, /type/path2) as there is only ever one in stock

product_ads

String of small ad messages in the vending screen - random chance

product_slogans

String of slogans separated by semicolons, optional

products

List of products this machine sells

form should be list(/type/path = amount, /type/path2 = amount2)

purchase_message_cooldown

Next world time to send a purchase message

scan_id

Are we checking the users ID

seconds_electrified

World ticks the machine is electified for

shoot_inventory

When this is TRUE, we fire items at customers! We're broken!

shoot_inventory_chance

How likely this is to happen (prob 100)

slogan_delay

How many ticks until we can send another

small_ads

Small ad messages in the vending screen - random chance of popping up whenever you open it

squish_damage

Damage this vendor does when tilting onto an atom

tiltable

Whether this vendor can be tilted over or not

tilted

Whether the vendor is tilted or not

tilted_rotation

If tilted, this variable should always be the rotation that was applied when we were tilted. Stored for the purposes of unapplying it.

vend_ready

Are we ready to vend?? Is it time??

vend_reply

Message sent post vend (Thank you for shopping!)

vending_machine_input

Custom item stock

Proc Details

Initialize

Initialize the vending machine

Builds the vending machine inventory, sets up slogans and other such misc work

This also sets the onstation var to:

build_inventory

Build the inventory of the vending machine from it's product and record lists

This builds up a full set of /datum/data/vending_products from the product list of the vending machine type Arguments:

canLoadItem

Are we able to load the item passed in

Arguments:

charge_user

Charge the user during a vend Returns false if the user could not buy this item

compartmentLoadAccessCheck

Is the passed in user allowed to load this vending machines compartments

Arguments:

finish_vend

Finish a vend by consuming power, playing animations & playing sounds

pre_throw

A callback called before an item is tossed out

Override this if you need to do any special case handling

Arguments:

refill_inventory

Refill our inventory from the passed in product list into the record list

Arguments:

restock

Refill a vending machine from a refill canister

This takes the products from the refill canister and then fills the products,contraband and premium product categories

Arguments:

shock

Shock the passed in user

This checks we have power and that the passed in prob is passed, then generates some sparks and calls electrocute_mob on the user

Arguments:

speak

Speak the given message verbally

Checks if the machine is powered and the message exists

Arguments:

thank_user

Thank the user for the purchase

throw_item

Throw an item from our internal inventory out in front of us

This is called when we are hacked, it selects a random product from the records that has an amount > 0 This item is then created and tossed out in front of us with a visible message

unbuild_inventory

Given a record list, go through and and return a list of type -> amount

update_canister

Set up a refill canister that matches this machines products

This is used when the machine is deconstructed, so the items aren't "lost"