feat(packages): ludic.shop - prices by standing with the fountain guard, a weekly demand on its own dice, stock, buying and selling through purse and pack ports, a trade fact
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>
This commit is contained in:
parent
cc9cec922a
commit
12cfcb10ac
12 changed files with 663 additions and 28 deletions
|
|
@ -4,17 +4,17 @@ export port CraftPack {
|
|||
count: fn(int) -> int
|
||||
take: fn(int, int) -> bool
|
||||
add: fn(int, int) -> int
|
||||
room: fn(int) -> int = fn cr_no_limit
|
||||
leaves: fn(int) -> int = fn cr_leaves_nothing
|
||||
room: fn(int) -> int = fn craft_no_limit
|
||||
leaves: fn(int) -> int = fn craft_leaves_nothing
|
||||
}
|
||||
function cr_no_limit(it: int) -> int { return 2147483647 }
|
||||
function cr_leaves_nothing(it: int) -> int { return -1 }
|
||||
function craft_no_limit(it: int) -> int { return 2147483647 }
|
||||
function craft_leaves_nothing(it: int) -> int { return -1 }
|
||||
|
||||
# the stations. Unbound, there are none: only the hands are ready, and nothing can be started.
|
||||
# `start(station, recipe)` puts a timed recipe in; false gives the makings back.
|
||||
export port CraftStations {
|
||||
ready: fn(int) -> bool = fn cr_hands_only
|
||||
start: fn(int, int) -> bool = fn cr_no_start
|
||||
ready: fn(int) -> bool = fn craft_hands_only
|
||||
start: fn(int, int) -> bool = fn craft_no_start
|
||||
}
|
||||
function cr_hands_only(station: int) -> bool { return station == CRAFT_HANDS }
|
||||
function cr_no_start(station: int, recipe: int) -> bool { return false }
|
||||
function craft_hands_only(station: int) -> bool { return station == CRAFT_HANDS }
|
||||
function craft_no_start(station: int, recipe: int) -> bool { return false }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue