feat(vagrant): v0.19.0 — role-based Stone-Age recipes (match by form/material/weight/affordance, not item id); rock/stick get form roles
This commit is contained in:
3
init.lua
3
init.lua
@@ -181,6 +181,7 @@ composition.define_template{
|
||||
description = "A heavy stone. Could be useful for crafting.",
|
||||
weight = 2.5, -- kg (real units)
|
||||
volume = 0.001, -- L (real units)
|
||||
form = "lump", -- role: a knappable/poundable stone
|
||||
-- Material composition (composition-model.md §4 — 0-1 platonic;
|
||||
-- 1.0 = pure stone). Phase E (property-driven recipes) reads this.
|
||||
["composition.stone"] = 1.0,
|
||||
@@ -204,6 +205,7 @@ composition.define_template{
|
||||
description = "A wooden stick. Useful for crafting tool handles.",
|
||||
weight = 0.3, -- kg
|
||||
volume = 0.0005, -- L
|
||||
form = "shaft", -- role: a light rigid shaft (handle)
|
||||
["composition.wood"] = 1.0,
|
||||
sprite_atlas = "",
|
||||
sprite_uv = {x = 0, y = 0, w = 1, h = 1},
|
||||
@@ -642,6 +644,7 @@ function M.init(ctx)
|
||||
position = { x = 0, y = 0 },
|
||||
}
|
||||
if a.scale then props.sprite_scale = a.scale * (d.scale or 1) end
|
||||
if d.form then props.form = d.form end -- role tag: shaft / cord / fiber / lump / blade / …
|
||||
for m, v in pairs(d.material or {}) do props["composition." .. m] = v end
|
||||
for k, v in pairs(d.affordance or {}) do props["affordance." .. k] = v end
|
||||
composition.define_template{ id = d.id, properties = props, tags = { "renderable", "item" } }
|
||||
|
||||
Reference in New Issue
Block a user