Skip to main content

Module life

Module life 

Source
Expand description

The lives of citizens and their homes: needs, age, death, health, happiness, disease, homes, partners and births. See Citizens, docs/CITIZEN-NEEDS-AND-HOUSEHOLDS.md and docs/CITIZEN-LIFE.md.

The citizen description is kept as a table by offset, so the port reads the same values as the original.

Deviations: the entity references the original keeps (home, partner, guardian, dependents) are citizen and entity indices; the dependents’ ring is a vector in ring order. Disease spread visits the citizens within the radius in registration order where the original asks its spatial index.

Original: CitizenComponent (vtable 0x1401689a0), ResidenceComponent (vtable 0x14016a6a0); disease spread FUN_140117940.

Modules§

reason
The causes of death and the life events, as the event log’s types.
service
Which service an attendance search is for (D/).

Structs§

Home
ResidenceComponent: the family slots and the fire.
LifeEvent
An event the citizens’ update asks the log for.
LifeRules
The CitizenDescription values, by offset.
People
Everything one citizen’s update touches.

Functions§

eat
Citizen message 2: eat from storage until the citizen is no longer hungry: one unit of food per point of hunger. Each kind of food is remembered (for variety) and counts as used.
stored
The units of a category in storage that nobody has reserved: food (bit 5) or firewood (bit 6).
update_home
A residence’s update. The fire burns down; with residents, while it is colder than the house’s warmth, one unit of firewood keeps it burning for seconds. The food and firewood status icons clear when there is some. The ClearStorage work comes first (crate::town::Sim::residence_clear_storage). The firewood burned counts as used in the stock manager.
warm_at
Citizen message 0: warm up at home if it is warm.