crafting v0.5.0 + composition v0.4.0: Quality & Condition (Phase J)
lib-core.composition v0.4.0: un-defer quality/condition as inert numeric properties (loud-error removed); composition stores them without semantics. lib-core.crafting v0.5.0: quality-block (multi-contributor product-quality formula: skill-band with min=requires-floor + named ingredient/tool qualities), optional slot name, tool wear_per_use (condition decrement + wear report). affordance stays boolean. Additive to v0.4.0. vagrant-skeleton v0.22.0: branch quality-band RNG at spawn; stone_hammer condition=1.0; knap+axe quality-blocks; hammer wears out. Headless-verified 20/20. Design: meta/docs/design/2026-08-03-crafting-quality-condition-design.md. Docs synced: crafting-model.md, composition-model.md, libraries.md, READMEs.
This commit is contained in:
22
init.lua
22
init.lua
@@ -28,12 +28,17 @@
|
||||
-- entity was created from, or nil if the entity is not
|
||||
-- composition-managed. Loud-Error if entity is nil.
|
||||
--
|
||||
-- v0.4.0 additions (Phase J — Quality / Condition):
|
||||
-- - `quality` / `condition` are now accepted as ordinary inert numeric
|
||||
-- properties (no longer a loud-error). composition stores them and knows
|
||||
-- NO semantics — no clamp, no default, no decay, no RNG. Producers own the
|
||||
-- meaning (crafting quality-formula, wear-decrement, module acquisition
|
||||
-- roll). See design/2026-08-03-crafting-quality-condition-design.md.
|
||||
--
|
||||
-- DEFERRED (loud-error if attempted):
|
||||
-- - slots → Phase D Trigger (Composite Items with Sub-Items)
|
||||
-- - container constraint fields (weight_max, volume_max, grid,
|
||||
-- accepts_fluid, accepts_gas, restrictions) → Phase F/G Trigger
|
||||
-- - quality → Phase J Trigger (Damage / Wear)
|
||||
-- - condition → Phase J Trigger (Damage / Wear)
|
||||
-- - parent: → Template-Inheritance, no consumer yet
|
||||
-- - composite-property values (e.g. position = {x, y} as single
|
||||
-- property) — engine PROPERTY_TABLE doesn't exist; nested-tables
|
||||
@@ -202,12 +207,13 @@ function M.define_template(def)
|
||||
end
|
||||
end
|
||||
end
|
||||
if def.quality ~= nil or def.condition ~= nil then
|
||||
error(string.format(
|
||||
"composition.define_template '%s': 'quality' / 'condition' " ..
|
||||
"are Phase-J triggers (Damage / Wear); not supported in v0.2",
|
||||
def.id))
|
||||
end
|
||||
-- v0.4.0 (Phase J): `quality` / `condition` are no longer rejected. They are
|
||||
-- ordinary inert numeric properties — composition stores them and knows NO
|
||||
-- semantics (no clamp, no default, no decay, no RNG). Producers set them:
|
||||
-- crafting's quality-formula, a wear-decrement, or a module's acquisition
|
||||
-- roll. A template may declare them as plain properties (e.g. a tool with a
|
||||
-- default `condition = 1.0`); they flatten/declare like any other scalar.
|
||||
-- See design/2026-08-03-crafting-quality-condition-design.md §2.
|
||||
if def.parent ~= nil then
|
||||
error(string.format(
|
||||
"composition.define_template '%s': 'parent:' inheritance has " ..
|
||||
|
||||
Reference in New Issue
Block a user