Daedalus Dock - Modules - TypesVar Details - Proc Details

vending

Vars

__typeinfo_path
activeIs the machine active (No sales pitches if off)!
age_restrictionsWhether our age check is currently functional
canload_access_listID's that can load this vending machine wtih refills
contained_cashMoney inside us.
contrabandList of products this machine sells when you hack it
default_priceDefault price of items if not overridden
discount_accessAccess that gets the non-premium content for free
extended_inventorycan we access the hidden inventory?
extra_priceDefault price ADDED to the default price of premium items if they don't have one set.
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_shopperThe ref of the last 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
onstationIs this item on station or not
onstation_overrideA variable to change on a per instance basis on the map that allows the instance to force cost and ID requirements
panel_typeIcon for the maintenance panel overlay
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) per second
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
vend_readyAre we ready to vend?? Is it time??
vend_replyMessage sent post vend (Thank you for shopping!)

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
can_user_vendChecks if the user can purchase an item from this machine.
compartmentLoadAccessCheckIs the passed in user allowed to load this vending machines compartments
complete_vendComplete the vend.
dispense_cashDispense all contained cash to the user.
dispense_itemDispense the item to the user.
give_or_drop_dispensed_itemIt's in the name.
on_cash_movedCalled when contained_cash moves.
pay_for_vendPay for the fuckin' item. Returns -1 if the item was unable to be purchased. Otherwise, returns the amount of money spent.
pre_throwA callback called before an item is tossed out
refill_inventoryRefill our inventory from the passed in product list into the record list
reset_pricesReassign the prices of the vending machine using the multiplier argument
restockRefill a vending machine from a refill canister
sanitize_vendSanitizes the input of vend().
shockShock the passed in user
speakSpeak the given message verbally
thank_shopperThank our patron.
throw_impactCrush the mob that the vending machine got thrown at
throw_itemThrow an item from our internal inventory out in front of us
tiltTilts ontop of the atom supplied, if crit is true some extra shit can happen. Returns TRUE if it dealt damage to something.
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
vendThe core vend proc used by normal vendors.
vend_delay_animationAnimation/effects to play while doing a delayed vend. Returns the duration of the animation in deciseconds.

Var Details

__typeinfo_path

vending machines

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

active

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

age_restrictions

Whether our age check is currently functional

canload_access_list

ID's that can load this vending machine wtih refills

contained_cash

Money inside us.

contraband

List of products this machine sells when you hack it

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

default_price

Default price of items if not overridden

discount_access

Access that gets the non-premium content for free

extended_inventory

can we access the hidden inventory?

extra_price

Default price ADDED to the default price of premium items if they don't have one set.

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

The ref of the 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

onstation

Is this item on station or not

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

onstation_override

A variable to change on a per instance basis on the map that allows the instance to force cost and ID requirements

panel_type

Icon for the maintenance panel overlay

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) per second

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

vend_ready

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

vend_reply

Message sent post vend (Thank you for shopping!)

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:

can_user_vend

Checks if the user can purchase an item from this machine.

compartmentLoadAccessCheck

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

Arguments:

complete_vend

Complete the vend.

dispense_cash

Dispense all contained cash to the user.

dispense_item

Dispense the item to the user.

give_or_drop_dispensed_item

It's in the name.

on_cash_moved

Called when contained_cash moves.

pay_for_vend

Pay for the fuckin' item. Returns -1 if the item was unable to be purchased. Otherwise, returns the amount of money spent.

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:

reset_prices

Reassign the prices of the vending machine using the multiplier argument

This rebuilds both /datum/data/vending_products lists for premium and standard products based on their most relevant pricing values. 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:

sanitize_vend

Sanitizes the input of vend().

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_shopper

Thank our patron.

throw_impact

Crush the mob that the vending machine got thrown at

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

tilt

Tilts ontop of the atom supplied, if crit is true some extra shit can happen. Returns TRUE if it dealt damage to something.

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"

vend

The core vend proc used by normal vendors.

vend_delay_animation

Animation/effects to play while doing a delayed vend. Returns the duration of the animation in deciseconds.