ludic.fire: a camp fire's fuel, lit and out, the rain on it, and its reach
Minutes of fuel that burn down in game time, twice as fast in the rain with nothing over the ring, and the hours it held under cover. Lighting and feeding are decided (fire_decide), costed in wood (fire_cost) and applied (fire_apply) apart, so a machine that does not own the world can ask the one that does. Warmth and cooking by distance are queries. FIRE_LIT, FIRE_WENT_OUT and FIRE_LOW_FUEL are facts; the rain, the tarp, the ban and who owns the world come through the FireWorld port. Its own save section. Uses ludic_base only; 8 tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
cf42214974
commit
0af0ef681f
9 changed files with 402 additions and 0 deletions
16
packages/ludic.fire/queries.ludic
Normal file
16
packages/ludic.fire/queries.ludic
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# queries.ludic - what the world asks the fire
|
||||
export function fire_lit() -> bool { return fr_lit }
|
||||
|
||||
# game minutes of fuel left
|
||||
export function fire_fuel() -> float { return fr_fuel }
|
||||
|
||||
export function fire_low() -> bool { return fr_lit and fr_fuel < fr_low_minutes }
|
||||
|
||||
# game hours today it has burned in the rain with something over it
|
||||
export function fire_rain_hours() -> float { return fr_rain_h }
|
||||
|
||||
# does it warm a body `dist` metres from it?
|
||||
export function fire_warms(dist: float) -> bool { return fr_lit and dist < fr_warm_radius }
|
||||
|
||||
# will it cook for someone `dist` metres from it? (a station that stands on it asks only fire_lit)
|
||||
export function fire_cooks(dist: float) -> bool { return fr_lit and dist < fr_cook_radius }
|
||||
Loading…
Add table
Add a link
Reference in a new issue