SS1984 - Modules - TypesVar Details - Proc Details

vending

Vars

activeNo sales pitches if off
ads_listList of ads to display in UI. Built from slogan_list upon Iniitialize()
aggressiveIf the vendor should tip on anyone who walks by. Mainly used for brand intelligence
all_possible_critsAll possible crits that could be applied. We only need to build this up once
all_products_freeIf this is set to TRUE, all products sold by the vending machine are free (cost nothing). If unset, this will get automatically set to TRUE during init if the machine originates from off-station during mapload. Defaults to null, set it to TRUE or FALSE explicitly on a per-machine basis if you want to force it to be a certain value.
broken_lightmask_overlaySpecial lightmask for broken overlay. If vendor is BROKEN, but not dePOWERED we will see this, instead of lightmask_overlay.
broken_overlayDamage overlay applied if vendor is damaged enough.
contrabandList of products this machine sells when you hack it
credits_containedHow many credits does this vending machine have? 20% of all sales go to this pool, and are given freely when the machine is restocked, or successfully tilted. Lost on deconstruction.
crit_damage_factorFactor of extra damage to deal when triggering a crit
currently_vendingItem currently being bought
default_premium_priceDefault price of premium items if not overridden
default_priceDefault price of items if not overridden
deny_lightmaskSpecial lightmask that will override default lightmask_overlay, while machine is denying its wares.
deny_overlayOverlay applied when machine is denying its wares.
deny_overlay_timeAmount of time until denying sequence is reseted.
extended_inventorycan we access the hidden inventory?
flick_sequenceFlags used to correctly manipulate with vend/deny sequences.
flickeringblocks further flickering while true
force_no_power_icon_statedo I look unpowered, even when powered?
hit_warning_cooldown_lengthHow long to wait before resetting the warning cooldown
inserted_itemthe actual item inserted
item_slotboolean, whether this vending machine can accept people inserting items into it, used for coffee vendors
last_hit_timeCooldown for warning cooldowns
last_sloganWhen did we last pitch?
lightmask_overlayLightmask used when vendor is working properly.
num_shardsnumber of shards to apply when a crit embeds
onstationIs this item on station or not
onstation_overrideDO NOT APPLY THIS GLOBALLY. For mapping var edits only. A variable to change on a per instance basis that allows the instance to avoid having onstation set for them during mapload. Setting this to TRUE means that the vending machine is treated as if it were still onstation if it spawns off-station during mapload. Useful to specify an off-station machine that will be affected by machine-brand intelligence for whatever reason.
panel_overlayOverlay of vendor maintenance panel.
possible_critsPossible crit effects from this vending machine tipping.
premiumList of premium products this machine sells
product_categoriesList of products this machine sells, categorized. Can only be used as an alternative to products, not alongside it. Be aware that categories will be inherited by children object, and will override it's products list if children's categories aren't set to null.
productsList of products this machine sells
refill_canisterThe type of refill canisters used by this machine.
scan_idIf true, enforce access checks on customers. Disabled by messing with wires.
screen_overlayOverlay of a vendor screen, will not apply of stat is NOPOWER.
seconds_electrifiedAllows people to access a vendor that's normally access restricted. Shocks people like an airlock
self_knockover_factorFactor of extra damage to deal when you knock it over onto yourself
shoot_chanceHow often are we firing the items? (prob(...))
shoot_inventoryFire items at customers! We're broken!
shoot_speedHow hard are we firing the items?
shut_upIf true, prevent saying sales pitches
skip_non_primary_icon_updatesIf TRUE machine will only react to BROKEN/NOPOWER stat, when updating overlays.
slogan_delayHow long until we can pitch again?
slogan_listList of ads the vendor will say time to time.
squish_damageAmount of damage to deal when tipped
tiltableIf this vending machine can be tipped or not
tiltedIf this vendor is currently tipped
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_delayHow long vendor takes to vend one item.
vend_lightmaskSpecial lightmask that will override default lightmask_overlay, while machine is vending goods.
vend_overlayOverlay applied when machine is vending goods.
vend_overlay_timeAmount of time until vending sequence is reseted.
vend_readyIf off, vendor is busy and unusable until current action finishes
vend_reply"Спас+ибо за пок+упку!" type phrases, which are said when someone buys something.

Procs

InitializeInitialize the vending machine
RefreshPartsBetter would be to make constructable child
build_inventoriesBuilds all available inventories for the vendor - standard, contraband and premium Arguments: start_empty - bool to pass into build_inventory that determines whether a product entry starts with available stock or not
build_inventoryBuild the inventory of the vending machine from it's product and record lists
build_products_from_categoriesPopulates list of products with categorized products
choose_critSelect a random valid crit.
create_categories_fromReturns a list of data about the category Arguments: name - string for the name of the category icon - string for the fontawesome icon to use in the UI for the category products - list of products available in the category
deploy_creditsDrop credits when the vendor is attacked.
do_vendOverride this proc to add handling for what to do with the vended product when you have a inserted item and remember to include a parent call for this generic handling
freebieDispenses free items from the standard stock. Arguments: freebies - number of free items to vend
item_slot_checkOverride this proc to do per-machine checks on the inserted item, but remember to call the parent to handle these generic checks before your logic!
power_changeIntentionally leaving out a case for zero credits as it should be covered by the vending machine's stock being full, or covered by first case if items were returned.
refill_inventoryRefill our inventory from the passed in product list into the record list
restockRefill a vending machine from a refill canister
tiltTilts the machine onto the atom passed in.
unbuild_inventoryGiven a record list, go through and and return a list of type -> amount
unbuild_inventory_intoUnbuild product_records into categorized product lists to the machine's refill canister. Does not handle contraband/premium products, only standard stock and any other categories used by the vendor(see: ClothesMate). If a product has no category, puts it into standard stock category. Arguments: product_records - list of products of the vendor products - list of products of the refill canister product_categories - list of product categories of the refill canister
update_canisterSet up a refill canister that matches this machines products

Var Details

active

No sales pitches if off

ads_list

List of ads to display in UI. Built from slogan_list upon Iniitialize()

aggressive

If the vendor should tip on anyone who walks by. Mainly used for brand intelligence

all_possible_crits

All possible crits that could be applied. We only need to build this up once

all_products_free

If this is set to TRUE, all products sold by the vending machine are free (cost nothing). If unset, this will get automatically set to TRUE during init if the machine originates from off-station during mapload. Defaults to null, set it to TRUE or FALSE explicitly on a per-machine basis if you want to force it to be a certain value.

broken_lightmask_overlay

Special lightmask for broken overlay. If vendor is BROKEN, but not dePOWERED we will see this, instead of lightmask_overlay.

broken_overlay

Damage overlay applied if vendor is damaged enough.

contraband

List of products this machine sells when you hack it

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

credits_contained

How many credits does this vending machine have? 20% of all sales go to this pool, and are given freely when the machine is restocked, or successfully tilted. Lost on deconstruction.

crit_damage_factor

Factor of extra damage to deal when triggering a crit

currently_vending

Item currently being bought

default_premium_price

Default price of premium items if not overridden

default_price

Default price of items if not overridden

deny_lightmask

Special lightmask that will override default lightmask_overlay, while machine is denying its wares.

deny_overlay

Overlay applied when machine is denying its wares.

deny_overlay_time

Amount of time until denying sequence is reseted.

extended_inventory

can we access the hidden inventory?

flick_sequence

Flags used to correctly manipulate with vend/deny sequences.

flickering

blocks further flickering while true

force_no_power_icon_state

do I look unpowered, even when powered?

hit_warning_cooldown_length

How long to wait before resetting the warning cooldown

inserted_item

the actual item inserted

item_slot

boolean, whether this vending machine can accept people inserting items into it, used for coffee vendors

last_hit_time

Cooldown for warning cooldowns

last_slogan

When did we last pitch?

lightmask_overlay

Lightmask used when vendor is working properly.

num_shards

number of shards to apply when a crit embeds

onstation

Is this item on station or not

if it doesn't originate from off-station during mapload, all_products_free gets automatically set to TRUE if it was unset previously.

onstation_override

DO NOT APPLY THIS GLOBALLY. For mapping var edits only. A variable to change on a per instance basis that allows the instance to avoid having onstation set for them during mapload. Setting this to TRUE means that the vending machine is treated as if it were still onstation if it spawns off-station during mapload. Useful to specify an off-station machine that will be affected by machine-brand intelligence for whatever reason.

panel_overlay

Overlay of vendor maintenance panel.

possible_crits

Possible crit effects from this vending machine tipping.

premium

List of premium products this machine sells

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

product_categories

List of products this machine sells, categorized. Can only be used as an alternative to products, not alongside it. Be aware that categories will be inherited by children object, and will override it's products list if children's categories aren't set to null.

Form should be list(

products

List of products this machine sells

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

refill_canister

The type of refill canisters used by this machine.

scan_id

If true, enforce access checks on customers. Disabled by messing with wires.

screen_overlay

Overlay of a vendor screen, will not apply of stat is NOPOWER.

seconds_electrified

Allows people to access a vendor that's normally access restricted. Shocks people like an airlock

self_knockover_factor

Factor of extra damage to deal when you knock it over onto yourself

shoot_chance

How often are we firing the items? (prob(...))

shoot_inventory

Fire items at customers! We're broken!

shoot_speed

How hard are we firing the items?

shut_up

If true, prevent saying sales pitches

skip_non_primary_icon_updates

If TRUE machine will only react to BROKEN/NOPOWER stat, when updating overlays.

slogan_delay

How long until we can pitch again?

slogan_list

List of ads the vendor will say time to time.

squish_damage

Amount of damage to deal when tipped

tiltable

If this vending machine can be tipped or not

tilted

If this vendor is currently tipped

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_delay

How long vendor takes to vend one item.

vend_lightmask

Special lightmask that will override default lightmask_overlay, while machine is vending goods.

vend_overlay

Overlay applied when machine is vending goods.

vend_overlay_time

Amount of time until vending sequence is reseted.

vend_ready

If off, vendor is busy and unusable until current action finishes

vend_reply

"Спас+ибо за пок+упку!" type phrases, which are said when someone buys something.

Place "+" before stressed syllables for better Text-to-speech pronunciation.

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:

RefreshParts

Better would be to make constructable child

build_inventories

Builds all available inventories for the vendor - standard, contraband and premium Arguments: start_empty - bool to pass into build_inventory that determines whether a product entry starts with available stock or not

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_product from the product list of the vending machine type Arguments:

build_products_from_categories

Populates list of products with categorized products

choose_crit

Select a random valid crit.

create_categories_from

Returns a list of data about the category Arguments: name - string for the name of the category icon - string for the fontawesome icon to use in the UI for the category products - list of products available in the category

deploy_credits

Drop credits when the vendor is attacked.

do_vend

Override this proc to add handling for what to do with the vended product when you have a inserted item and remember to include a parent call for this generic handling

freebie

Dispenses free items from the standard stock. Arguments: freebies - number of free items to vend

item_slot_check

Override this proc to do per-machine checks on the inserted item, but remember to call the parent to handle these generic checks before your logic!

power_change

Intentionally leaving out a case for zero credits as it should be covered by the vending machine's stock being full, or covered by first case if items were returned.

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:

tilt

Tilts the machine onto the atom passed in.

Arguments:

unbuild_inventory

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

unbuild_inventory_into

Unbuild product_records into categorized product lists to the machine's refill canister. Does not handle contraband/premium products, only standard stock and any other categories used by the vendor(see: ClothesMate). If a product has no category, puts it into standard stock category. Arguments: product_records - list of products of the vendor products - list of products of the refill canister product_categories - list of product categories of the refill canister

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"