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
|
|
@ -1,9 +1,9 @@
|
|||
# verbs.ludic - can it be made, taking and giving back its makings, and making it
|
||||
var cr_facts: Queue<Crafted> = null
|
||||
var craft_fact_q: Queue<Crafted> = null
|
||||
|
||||
export function craft_facts() -> Queue<Crafted> {
|
||||
if cr_facts == null { cr_facts = queue_new("crafting.crafted") }
|
||||
return cr_facts
|
||||
if craft_fact_q == null { craft_fact_q = queue_new("crafting.crafted") }
|
||||
return craft_fact_q
|
||||
}
|
||||
|
||||
# every making is in the pack
|
||||
|
|
@ -46,7 +46,7 @@ export function craft_refund(i: int) -> void {
|
|||
}
|
||||
}
|
||||
|
||||
function cr_fact(i: int, queued: bool) -> void {
|
||||
function craft_fact_push(i: int, queued: bool) -> void {
|
||||
let r = CraftRecipes[i]
|
||||
let c = new Crafted
|
||||
c.recipe = i
|
||||
|
|
@ -68,10 +68,10 @@ export function craft_make(i: int) -> bool {
|
|||
craft_refund(i)
|
||||
return false
|
||||
}
|
||||
cr_fact(i, true)
|
||||
craft_fact_push(i, true)
|
||||
return true
|
||||
}
|
||||
CraftPack.add(r.out, r.n)
|
||||
cr_fact(i, false)
|
||||
craft_fact_push(i, false)
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue