wip(0.S3): the packages migrated by ludic migrate state packages - every package test green

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 14:02:21 +03:00
parent 1e8b5b0523
commit 07505e7ef2
294 changed files with 14996 additions and 14675 deletions

View file

@ -10,12 +10,18 @@ export port FireWorld {
function fr_yes() -> bool { return true }
function fr_no() -> bool { return false }
var fr_light_wood: int = 3 # logs to light one
var fr_light_minutes: float = 120.0 # game minutes of fuel a new fire has
var fr_log_minutes: float = 60.0 # game minutes a log adds
var fr_low_minutes: float = 15.0 # under this, the fire is burning low
var fr_warm_radius: float = 3.6 # metres it warms a body
var fr_cook_radius: float = 3.5 # metres it cooks from
export state FireState {
fr_light_wood: int = 3 # logs to light one
fr_light_minutes: float = 120.0 # game minutes of fuel a new fire has
fr_log_minutes: float = 60.0 # game minutes a log adds
fr_low_minutes: float = 15.0 # under this, the fire is burning low
fr_warm_radius: float = 3.6 # metres it warms a body
fr_cook_radius: float = 3.5 # metres it cooks from
fr_lit: bool = false
fr_fuel: float = 0.0 # game minutes left
fr_rain_h: float = 0.0 # game hours today it burned in the rain under cover
fr_facts: Queue<FireFact> = null
}
# what lighting or feeding would come to, as the world stands
export const FIRE_NO_WOOD: int = 0 # not enough to light one
@ -35,34 +41,30 @@ export property FireFact {
fuel: float = 0.0
}
var fr_lit: bool = false
var fr_fuel: float = 0.0 # game minutes left
var fr_rain_h: float = 0.0 # game hours today it burned in the rain under cover
var fr_facts: Queue<FireFact> = null
# the facts, oldest first; the game drains them into its notices
export function fire_facts() -> Queue<FireFact> {
if fr_facts == null { fr_facts = queue_new("fire.facts") }
return fr_facts
export function fire_facts(base_st: mut BaseState, fire_st: mut FireState) -> Queue<FireFact> {
if fire_st.fr_facts == null { fire_st.fr_facts = queue_new(base_st, "fire.facts") }
return fire_st.fr_facts
}
function fr_fact(what: int) -> void {
function fr_fact(base_st: mut BaseState, fire_st: mut FireState, what: int) -> void {
let f = new FireFact
f.what = what
f.fuel = fr_fuel
q_push(fire_facts(), f)
f.fuel = fire_st.fr_fuel
q_push(base_st, fire_facts(base_st, fire_st), f)
}
# a game's numbers: logs to light, minutes a new fire and a log are worth, when it is low
export function fire_config(light_wood: int, light_minutes: float, log_minutes: float, low_minutes: float) -> void {
fr_light_wood = light_wood
fr_light_minutes = light_minutes
fr_log_minutes = log_minutes
fr_low_minutes = low_minutes
export function fire_config(fire_st: mut FireState, light_wood: int, light_minutes: float, log_minutes: float, low_minutes: float) -> void {
fire_st.fr_light_wood = light_wood
fire_st.fr_light_minutes = light_minutes
fire_st.fr_log_minutes = log_minutes
fire_st.fr_low_minutes = low_minutes
}
# how far it warms a body and how far it cooks from, in metres
export function fire_config_reach(warm: float, cook: float) -> void {
fr_warm_radius = warm
fr_cook_radius = cook
export function fire_config_reach(fire_st: mut FireState, warm: float, cook: float) -> void {
fire_st.fr_warm_radius = warm
fire_st.fr_cook_radius = cook
}