refactor(packages): 0.R5 - a question no longer starts its state - 64 lazy starts ('if st.x == null { st.x = ... }' inside a getter) are the state's defaults, gear__ensure is gone, and ludic migrate state --tighten took mut off 208 package parameters: things_all, thing_find, gear_charge, gear_level, jobs_state and the rest read
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
54f5efb23f
commit
9862ec82e3
102 changed files with 320 additions and 351 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# routine.ludic - going somewhere to do something, doing it here, and deciding what is next: the
|
||||
# kind's own plan first, then a weighted draw among its steps for this hour, falling through to the
|
||||
# next step whose spot can be found, and standing a while when none can
|
||||
export function npc_go(npc_st: mut NpcState, p: NpcPerson, x: float, z: float, act: int, dur: float) -> void {
|
||||
export function npc_go(npc_st: NpcState, p: NpcPerson, x: float, z: float, act: int, dur: float) -> void {
|
||||
p.tx = x
|
||||
p.tz = z
|
||||
p.next_act = act
|
||||
|
|
@ -76,7 +76,7 @@ export function npc_plan(npc_st: mut NpcState, p: NpcPerson) -> void {
|
|||
|
||||
# a weighted draw among the steps whose hours hold now; a step whose spot cannot be found
|
||||
# gives way to the next one in the table, round to the start
|
||||
export function npc_steps(npc_st: mut NpcState, p: NpcPerson, steps: []NpcStep) -> bool {
|
||||
export function npc_steps(npc_st: NpcState, p: NpcPerson, steps: []NpcStep) -> bool {
|
||||
let h = NpcWorld.hour()
|
||||
var total = 0
|
||||
for i in 0 .. len(steps) { if np_in_hours(steps[i], h) { total += np_pos(steps[i].weight) } }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue