vending 
Vars | |
| 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 |
| 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 |
| 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 |
| 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. |
| products | List of products this machine sells |
| 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. |
Procs | |
| Initialize | Initialize the vending machine |
| 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 |
| 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 |
| restock | Refill a vending machine from a refill canister |
| tilt | Tilts the machine onto the atom passed in. |
| 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 |
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(
- "name" = "Category Name",
- "icon" = "UI Icon (Font Awesome)",
- "products" = list(/type/path = amount, ...), )
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:
- FALSE — if the machine was maploaded on a zlevel that doesn't pass the is_station_level check
- TRUE — all other cases
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:
- productlist - the list of products that need to be converted
- recordlist - the list containing /datum/data/vending_product datums
- categories - account list in the format of product_categories to source category from
- startempty - should we set vending_product record amount from the product list (so it's prefilled at roundstart)
- premium - Whether the ending products shall have premium or default prices
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:
- productlist - list of types -> amount
- recordlist - existing record datums
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:
- canister - the vending canister we are refilling from
tilt
Tilts the machine onto the atom passed in.
Arguments:
- target_atom - The thing the machine is falling on top of
- crit - if true, some special damage effects might happen.
- from_combat - If true, hold off on some of the additional damage and extra effects.
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"