refactor(packages): 0.R5 - the shop's week is rolled by its tick and asking reads it; needs start filled and vehicles start with their list; character, physics, vehicles and nativeecho's lazy starts are defaults; --tighten over all four

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-27 13:25:57 +03:00
parent 67d8079c47
commit 87259f989d
31 changed files with 104 additions and 111 deletions

View file

@ -51,21 +51,24 @@ export property NeedFact {
need: int = 0
}
# where a body starts: warm, fed well enough, watered, rested
function nd_start() -> []float {
let l = floats(NEED_COUNT)
l[NEED_WARMTH] = 100.0
l[NEED_FOOD] = 70.0
l[NEED_WATER] = 85.0
l[NEED_ENERGY] = 100.0
return l
}
export state NeedsState {
nd_level: []float = null
nd_level: []float = nd_start()
nd_legs: float = 0.0 # seconds left before a collapse, 0 = none
nd_last: int = 0 # the need the countdown is for
nd_collapses: int = 0
nd_facts: Queue<NeedFact> = nd_facts__new()
}
function nd_lv(needs_st: mut NeedsState) -> []float {
if needs_st.nd_level == null {
needs_st.nd_level = floats(NEED_COUNT)
nd_fill(needs_st)
}
return needs_st.nd_level
}
function nd_lv(needs_st: NeedsState) -> []float { return needs_st.nd_level }
function nd_fill(needs_st: mut NeedsState) -> void {
needs_st.nd_level[NEED_WARMTH] = 100.0