ludic/packages/ludic.fire
Orkuncakilkaya 71735b10a2 feat(base): 0.R4 - a queue keeps its own count, so every package verb takes only its own state; ludic migrate state --prune
ludic.base's Queue<T> carries a QueueTag (its name and pending count): queue_new(name), q_push(q, v),
q_drain(q), q_clear(q) take no BaseState, and core_undrained(tags) names the given queues still holding
facts. A reducer on a package's state can now call that package's verbs (wallet_earn(wallet_st, n)).

ludic migrate state --prune (ludicc --migrate-prune) takes out each state parameter a function no
longer uses, nor anything it calls, and the argument that fills it - including an argument for a
parameter the callee has dropped, which is taken out before the call is checked, so a generic's T is
told by the argument that says it. A reducer keeps its state. --dry-run now counts the edits it would
make. Every package was moved with it: 608 base_st parameters and their arguments, 1889 edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 04:19:56 +03:00
..
tests feat(base): 0.R4 - a queue keeps its own count, so every package verb takes only its own state; ludic migrate state --prune 2026-09-26 04:19:56 +03:00
decide.ludic feat(base): 0.R4 - a queue keeps its own count, so every package verb takes only its own state; ludic migrate state --prune 2026-09-26 04:19:56 +03:00
index.ludic ludic.fire: a camp fire's fuel, lit and out, the rain on it, and its reach 2026-09-25 06:08:53 +03:00
package.ludic ludic.fire: a camp fire's fuel, lit and out, the rain on it, and its reach 2026-09-25 06:08:53 +03:00
queries.ludic wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run 2026-09-25 15:31:34 +03:00
README.md ludic.fire: a camp fire's fuel, lit and out, the rain on it, and its reach 2026-09-25 06:08:53 +03:00
state.ludic feat(base): 0.R4 - a queue keeps its own count, so every package verb takes only its own state; ludic migrate state --prune 2026-09-26 04:19:56 +03:00
system.ludic feat(base): 0.R4 - a queue keeps its own count, so every package verb takes only its own state; ludic migrate state --prune 2026-09-26 04:19:56 +03:00
verbs.ludic feat(base): 0.R4 - a queue keeps its own count, so every package verb takes only its own state; ludic migrate state --prune 2026-09-26 04:19:56 +03:00

ludic.fire

A camp fire: minutes of fuel that burn down in game time, twice as fast in the rain with nothing over the ring, the hours it held under cover, the warmth it gives at a distance and whether it will cook. Uses ludic.base and nothing else.

import "ludic.fire"

The package never draws the fire, never says a line and never touches a pack: lighting and feeding are three steps so a machine that does not own the world can ask the one that does - fire_decide(wood) says what it would come to, fire_cost(how) what it costs in wood, and fire_apply(how) does it (only on the owner). The game takes the wood and says the line.

The port

export port FireWorld {            # every member has a default, so any may be left out
  owns_world: fn() -> bool         # does this machine burn it? (unbound: yes)
  is_wet: fn() -> bool             # rain or snow is falling on the ring (unbound: no)
  sheltered: fn() -> bool          # something is over the ring (unbound: no)
  allowed: fn() -> bool            # no fire ban (unbound: yes)
}

API

fire_config(light_wood, light_minutes, log_minutes, low_minutes), fire_config_reach(warm, cook) the numbers (3 logs, 120 minutes, 60 a log, low under 15; warms within 3.6 m, cooks within 3.5 m)
fire_decide(wood) -> int, fire_cost(how) -> int, fire_apply(how), fire_light_wood() FIRE_NO_WOOD, FIRE_NO_LOG, FIRE_BANNED, FIRE_SOAKED, FIRE_LIGHT, FIRE_FEED
fire_lit(), fire_fuel(), fire_low(), fire_rain_hours() the fire (fuel in game minutes)
fire_warms(dist), fire_cooks(dist) lit, and a body that close is warmed / can cook on it
fire_run(gh) gh game hours of burning (the system's tick)
fire_out(), fire_set_burning(fuel), fire_set_rain_hours(h) quietly out, or burning, or the rain hours outright (the night, staging, tests)
fire_told(lit, fuel, say) what the owner says the fire is; going out is a fact when say
fire_morning(), fire_reset() the rain hours start again; a new trip
fire_facts() -> Queue<FireFact> { what, fuel }: FIRE_LIT, FIRE_WENT_OUT, FIRE_LOW_FUEL
fire_system() -> System "fire", PH_SIMULATE: reset, tick, and its save section (fire_save, fire_load: lit, fuel, the rain hours)

Tests

ludic test packages/ludic.fire