Home
API: chem

Function: metabolise()

lifecycle-kit

lifecycle-kit


lifecycle-kit / chem / metabolise

Function: metabolise()

metabolise(state, food, activity, backbone?): MetabolicState

Defined in: chem/metabolism.ts:147

Convert intake into tissue.

A tissue is only built if the food supplied its inputs AND the pet's activity called for it, so feeding protein to a sedentary pet banks lipid rather than building muscle. Scarcer tissues build more slowly, which is how phosphorus scarcity becomes something the player feels.

backbone defaults to carbon, so every existing caller (and every pre-existing test) is unaffected. A caller that knows the creature's world — currentBackbone() in the pet game — passes it through, and the demand AND build-speed discount both then read from the same world chemistry rather than assuming carbon regardless of which backbone actually won.

Parameters

state

MetabolicState

food

FoodProfile

activity

ActivityDemand

backbone?

Backbone = "C"

Returns

MetabolicState