feat(packages): ludic.gear - kinds of kit with tiers bought flat through a purse port once the standing is there, the kind's item following, per-tier values and mults, stack limits, the hand and charges that burn by the game hour, facts for a tier bought and a charge run out, a save section by key
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
79ed7a335b
commit
cc930a114f
11 changed files with 569 additions and 0 deletions
37
packages/ludic.gear/state.ludic
Normal file
37
packages/ludic.gear/state.ludic
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# state.ludic - the level of each kind, the hand, each charge's units and whether it runs, the facts
|
||||
var gear__lv: []int = null
|
||||
var gear__hand: int = -1
|
||||
var gear__left: []float = null
|
||||
var gear__on: []bool = null
|
||||
var gear__q: Queue<GearFact> = null
|
||||
|
||||
function gear__ensure() -> void {
|
||||
if gear__lv != null { return }
|
||||
gear__lv = new []int
|
||||
for k in 0 .. GEAR_COUNT { push(gear__lv, GearKinds[k].start) }
|
||||
gear__left = new []float
|
||||
gear__on = new []bool
|
||||
for c in 0 .. CHARGE_COUNT {
|
||||
push(gear__left, GearCharges[c].full)
|
||||
push(gear__on, false)
|
||||
}
|
||||
}
|
||||
|
||||
export function gear_facts() -> Queue<GearFact> {
|
||||
if gear__q == null { gear__q = queue_new("gear.facts") }
|
||||
return gear__q
|
||||
}
|
||||
|
||||
function gear__fact(what: int, k: int, c: int, cost: int) -> void {
|
||||
let f = new GearFact
|
||||
f.what = what
|
||||
f.cost = cost
|
||||
f.kind = k
|
||||
f.charge = c
|
||||
if k >= 0 {
|
||||
f.level = gear__lv[k]
|
||||
f.item = GearKinds[k].item
|
||||
}
|
||||
if c >= 0 { f.item = GearCharges[c].item }
|
||||
q_push(gear_facts(), f)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue