Renewable resources: tree growth + WildGrowth + Quarry on BigRockNode

Trees: 4 growth stages (Sapling→Young→Growing→Mature), only Mature
yields wood. WildGrowth ticker fires every in-game hour; rejection-
samples grass tiles and plants a sapling with ~30% probability (capped
at MAP_TREE_LIMIT=60). New `paint_plant_tree` designation lets the
player manually plant — ghost sapling registered as a build_site that
ConstructionProvider fulfils. Stage round-trips through save/load.
Initial seed mixes 4 saplings + 6 mature so growth is visible day 1.

Quarry: new BigRockNode entity (2×2 permanent stone outcrop, never
depletes). 3 nodes seeded far from cabin. New QuarryWorkbench
(extends Workbench, auto-FOREVER `quarry_stone` bill, recipe drops
1 stone per 300 work-ticks). New `paint_quarry` designation only
accepts BigRockNode tiles. CraftingProvider now supports recipes
with `ingredient_count == 0` — skips ingredient-fetch and goes
straight to walk+craft toils. Recipe gains `ingredient_count` field
(defaults 0). Save/load layering: big_rock_node spawns at priority 0
(same as rock/tree), quarry_workbench at priority 2 (after the node).

UI: Plant tree + Build quarry buttons added to Build drawer.
build_drawer_thumb gains `plant_tree` (sapling sprout in dirt) and
`paint_quarry` (stone block + chisel + cut-stone pile) shapes.
inspect_tooltip recognises BigRockNode + shows tree growth stage on
hover.

Delegation: gdscript-refactor (Sonnet ×2) for trees full impl +
quarry skeleton; quick-edit (Haiku) for CraftingProvider no-ingredient
plumbing + TopBar polish; integration handled on Opus.
This commit is contained in:
megaproxy 2026-05-16 16:36:16 +01:00
parent 296894ff7a
commit d98d2c2425
20 changed files with 716 additions and 38 deletions

View file

@ -180,10 +180,11 @@ func _build_designate_tab() -> Control:
var flow := _make_flow_grid()
box.add_child(flow)
_add_tool_btn(flow, Strings.t(&"tool.chop"), &"chop", func() -> void: _activate(&"chop", &"", Strings.t(&"tool.chop")))
_add_tool_btn(flow, Strings.t(&"tool.mine"), &"mine", func() -> void: _activate(&"mine", &"", Strings.t(&"tool.mine")))
_add_tool_btn(flow, Strings.t(&"tool.dig_grave"),&"dig_grave", func() -> void: _activate(&"dig_grave", &"", Strings.t(&"tool.dig_grave")))
_add_tool_btn(flow, Strings.t(&"tool.no_roof"), &"no_roof", func() -> void: _activate(&"no_roof", &"", Strings.t(&"tool.no_roof")))
_add_tool_btn(flow, Strings.t(&"tool.chop"), &"chop", func() -> void: _activate(&"chop", &"", Strings.t(&"tool.chop")))
_add_tool_btn(flow, Strings.t(&"tool.mine"), &"mine", func() -> void: _activate(&"mine", &"", Strings.t(&"tool.mine")))
_add_tool_btn(flow, Strings.t(&"tool.dig_grave"), &"dig_grave", func() -> void: _activate(&"dig_grave", &"", Strings.t(&"tool.dig_grave")))
_add_tool_btn(flow, Strings.t(&"tool.no_roof"), &"no_roof", func() -> void: _activate(&"no_roof", &"", Strings.t(&"tool.no_roof")))
_add_tool_btn(flow, Strings.t(&"tool.plant_tree"), &"plant_tree", func() -> void: _activate(&"plant_tree", &"", Strings.t(&"tool.plant_tree")))
return box
@ -237,6 +238,12 @@ func _build_build_tab() -> Control:
&"build_workbench_cremation_pyre",
func() -> void: _activate(&"build_workbench_cremation_pyre", &"", Strings.t(&"tool.workbench_cremation_pyre")))
# Quarry — must be painted on a stone outcrop (BigRockNode); world.gd
# rejects placements on plain ground.
_add_tool_btn(flow, Strings.t(&"tool.paint_quarry"),
&"paint_quarry",
func() -> void: _activate(&"paint_quarry", &"", Strings.t(&"tool.paint_quarry")))
return box

View file

@ -332,6 +332,46 @@ func _draw() -> void:
draw_line(Vector2(c.x, c.y + 6), Vector2(c.x, c.y - 6), arrow, 2.0)
draw_line(Vector2(c.x, c.y - 6), Vector2(c.x - 4, c.y - 2), arrow, 2.0)
draw_line(Vector2(c.x, c.y - 6), Vector2(c.x + 4, c.y - 2), arrow, 2.0)
&"paint_quarry":
# Stone block on wood frame + small pile of cut stones beside.
var frame := Color(0.42, 0.26, 0.12)
var frame_top := Color(0.55, 0.36, 0.18)
var stone := Color(0.65, 0.63, 0.60)
var stone_hi := Color(0.82, 0.80, 0.76)
var stone_dark := Color(0.32, 0.30, 0.28)
var chisel_steel := Color(0.78, 0.80, 0.85)
# Wood frame base.
draw_rect(Rect2(c.x - 14, c.y + 6, 28, 8), frame)
draw_rect(Rect2(c.x - 14, c.y + 3, 28, 3), frame_top)
# Large stone block on top.
draw_rect(Rect2(c.x - 10, c.y - 8, 14, 11), stone)
draw_rect(Rect2(c.x - 10, c.y - 8, 14, 3), stone_hi)
# Chisel marks (3 short dark lines on the stone face).
draw_line(Vector2(c.x - 6, c.y - 3), Vector2(c.x - 4, c.y - 3), stone_dark, 1.0)
draw_line(Vector2(c.x - 2, c.y - 3), Vector2(c.x, c.y - 3), stone_dark, 1.0)
draw_line(Vector2(c.x + 2, c.y - 3), Vector2(c.x - 0, c.y - 3), stone_dark, 1.0)
# Pile of cut stones beside the block.
draw_rect(Rect2(c.x + 6, c.y, 4, 3), stone)
draw_rect(Rect2(c.x + 8, c.y - 3, 3, 3), stone_hi)
# Chisel tool on top of block.
draw_rect(Rect2(c.x - 4, c.y - 12, 2, 4), chisel_steel)
draw_rect(Rect2(c.x - 5, c.y - 13, 4, 2), frame_top)
&"plant_tree":
# Green sapling sprout rising from dirt — signals manual tree planting.
var dirt := Color(0.45, 0.32, 0.18)
var dirt_hi := Color(0.62, 0.46, 0.28)
var stem := Color(0.35, 0.22, 0.10)
var leaf_a := Color(0.30, 0.65, 0.20)
var leaf_b := Color(0.25, 0.55, 0.18)
# Dirt base rectangle.
draw_rect(Rect2(c.x - 14, c.y + 2, 28, 14), dirt)
draw_line(Vector2(c.x - 14, c.y + 5), Vector2(c.x + 14, c.y + 5), dirt_hi, 1.0)
# Stem.
draw_line(Vector2(c.x, c.y + 2), Vector2(c.x, c.y - 8), stem, 2.0)
# Three leaf dots at top of stem.
draw_circle(Vector2(c.x, c.y - 10), 4.0, leaf_a)
draw_circle(Vector2(c.x - 5, c.y - 6), 3.0, leaf_b)
draw_circle(Vector2(c.x + 5, c.y - 5), 3.0, leaf_b)
_:
# Unknown tool — small grey placeholder.
draw_rect(Rect2(c.x - 12, c.y - 12, 24, 24), Color(0.50, 0.50, 0.50))

View file

@ -0,0 +1 @@
uid://w802akkpbc6l

View file

@ -264,12 +264,36 @@ func _describe_wolf(w) -> String:
func _describe_tree(t) -> String:
# Growth stage label.
var stage: int = int(t.get("growth_stage")) if "growth_stage" in t else 3
var stage_key_map: Array[StringName] = [
&"tree.stage.sapling",
&"tree.stage.young",
&"tree.stage.growing",
&"tree.stage.mature",
]
var stage_label: String = Strings.t(stage_key_map[clamp(stage, 0, 3)])
# Pending-plant ghost indicator.
var pending: bool = bool(t.get("pending_plant")) if "pending_plant" in t else false
if pending:
return "[b]%s[/b]\n[color=#aaa]awaiting pawn[/color]" % stage_label
# Growth progress for sub-mature trees.
var is_mature: bool = (stage >= 3)
if not is_mature:
var progress: int = int(t.get("growth_progress")) if "growth_progress" in t else 0
var stage_ticks: int = int(t.get("STAGE_TICKS")) if "STAGE_TICKS" in t else 1
var pct_grow: int = int(100.0 * float(progress) / float(max(stage_ticks, 1)))
return "[b]%s[/b]\nGrowing %d%%" % [stage_label, pct_grow]
# Mature tree — show chop progress if any.
var pct: int = int(100.0 * float(t.chop_progress) / float(t.CHOP_TICKS))
var designated: bool = bool(t.get("chop_designated"))
var tag := " · [color=#fc6]marked[/color]" if designated else ""
if pct > 0:
return "[b]Tree[/b]\nChop %d%%%s" % [pct, tag]
return "[b]Tree[/b]%s" % tag
return "[b]%s[/b]\nChop %d%%%s" % [stage_label, pct, tag]
return "[b]%s[/b]%s" % [stage_label, tag]
func _describe_rock(r) -> String:

View file

@ -0,0 +1 @@
uid://c26o807ldrrrx