Append the following to the rule Food Trucks:
Each Truck has a publicly tracked Theme (a flavour-text string) that reflects the Truck’s aesthetic, personality, or branding (e.g. “Neon retro diner”, “Wildly entertaining”, or “Locally sourced eco-friendly eats”). A Truck may change its own Theme as a Prep Action.
Each Truck has a publicly tracked list of Decorations, where each Decoration has a Name (a flavour-text string).
Create a new rule titled The Vending Machine:
The Vending Machine is maintained by the Yard and has the following publicly tracked properties:
* Dollars, which defaults to $0
* A list of up to five Items, where each Item has:
* A Name (a flavour-text string)
* A Price (a Dollar amount), which defaults to $1
* An Age (an integer, defaulting to 0), representing the number of Trading Days the Item has been availableThe Yard may generate an Item by performing the following steps:
* Choose a text string using the Yard’s own creative judgment. The Yard is encouraged to create Items that would appeal to one, many, or all Trucks based on their Themes.
* Set the Item’s Price to $1.
* Set the Item’s Age to 0.The Yard may add an Item to the Vending Machine at any time, but only if it contains fewer than five Items.
Once per Trading Day, a Truck may take a Virtual Action called Queue. The Truck must specify which Item it intends to purchase and the Yard privately tracks the Trucks that have Queued.At the end of each Trading Day (after the Serve Phase), the Yard must perform Vend and Restock for each Item in the Vending Machine.
Vend and Restock is an action performed for an Item in the Vending Machine that is comprised of the following conditions and associated atomic actions:
If one or more Trucks Queued for this Item during the current Trading Day, choose one of those Trucks at random. This Truck becomes the Lucky Truck. Perform the following numbered steps as an atomic action, in order
1. Deduct the Item’s Price from the Lucky Truck’s Dollars.
2. Add the Item’s Price to the Vending Machine’s Dollars.
3. Remove the Item from the Vending Machine and add its Name to the Lucky Truck’s Decorations list.Otherwise if the Item is still in the Vending Machine perform the following numbered steps as an atomic action, in order:
1. Increment its Age by 1
2. If its Age is now 1, set its Price to $0.
3. If its Age is now 2, remove it from the Vending Machine.
Given that naming Trucks seemed to be fun I wanted to take Truck customization a little bit further and add some extra fun as well.
eternalservererror:
I incorrectly remembered the editing rule as being able to edit the post either 30 minutes before the editing window or before another Truck has commented or voting on it. I made several edits over the period of an hour since I saw neither of those two things.