feat(packages): ludic.jobs - written jobs gated by standing and story, boards of posts rolled by the day on their own dice, progress counted from events and read back from state, handing in, rewards through a port, facts, a save section per scope
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e146c7a337
commit
411206e45a
14 changed files with 984 additions and 0 deletions
36
packages/ludic.jobs/lists.ludic
Normal file
36
packages/ludic.jobs/lists.ludic
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# lists.ludic - the written jobs as a screen lists them: a vendor's, the taken, the ones to show
|
||||
# a vendor's offers and the ones it can take back, in a group (-1 every vendor)
|
||||
export function jobs_at(group: int, vendor: int) -> []int {
|
||||
let out = new []int
|
||||
for i in 0 .. JOB_COUNT {
|
||||
let d = Jobs[i]
|
||||
if d.group != group or (vendor >= 0 and d.vendor != vendor) { continue }
|
||||
let s = jobs_state(i)
|
||||
if s == JOBS_DONE or (s == JOBS_OFFERED and not jobs_offered(i)) { continue }
|
||||
push(out, i)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
# every job of a group taken at some point, done ones too
|
||||
export function jobs_taken(group: int) -> []int {
|
||||
let out = new []int
|
||||
for i in 0 .. JOB_COUNT { if Jobs[i].group == group and jobs_state(i) != JOBS_OFFERED { push(out, i) } }
|
||||
return out
|
||||
}
|
||||
|
||||
# the first `most` of a group under way
|
||||
export function jobs_shown(group: int, most: int) -> []int {
|
||||
let out = new []int
|
||||
for i in 0 .. JOB_COUNT {
|
||||
if len(out) >= most { break }
|
||||
if Jobs[i].group == group and jobs_under_way(i) { push(out, i) }
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
# the first under way and not yet met, or -1
|
||||
export function jobs_first_open(group: int) -> int {
|
||||
for i in 0 .. JOB_COUNT { if Jobs[i].group == group and jobs_state(i) == JOBS_ACTIVE { return i } }
|
||||
return -1
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue