Items (base price, sell fraction) and vendors (stock, buys, refuses) are the game's data handed over at boot; standing, the day, a shortage and "buys beyond its list" are the ShopWorld port; money is ShopPurse and the pack ShopPack. The week's wanted and glutted items come from an Rng seeded by the week, never the world's. The balance invariants - a shop is not a fountain, friction falls and never inverts, raw keeps its order - are the package's tests (nine). ludic.crafting: its private names carry the package's prefix too (a private name is still one global namespace with the game's - ludic.shop's `sp_seed` met the game's). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
375 B
Text
13 lines
375 B
Text
# system.ludic - the shop as a system: a reset and nothing saved (the week's demand follows from
|
|
# the day, and nobody is at a counter across a save)
|
|
export function shop_reset() -> void {
|
|
shop_at = -1
|
|
shop_demand_reset()
|
|
q_clear(shop_trades())
|
|
}
|
|
|
|
export function shop_system() -> System {
|
|
let s = system_new("shop", PH_COMMIT)
|
|
s.reset = fn shop_reset
|
|
return s
|
|
}
|