sow no longer needs grain + add crop zone paint tools

Bug: pawns weren't replanting. _find_sow required a TYPE_GRAIN item
as seed, but Millstone's flour bill (FOREVER) consumed all grain
before sow could claim it. With CookingProvider now priority 6, grain
contention is fatal — TILLED crops sit forever.

Fix: removed the grain requirement. Sow is now Rimworld-style — the
designation triggers work; no input is consumed. _find_sow returns a
2-toil job (walk → interact). Crop.on_sow_tick just flips stage to
SOWN.

Feature: 4 new paint tools in BuildDrawer's new "Farm" section column
— TOOL_PAINT_CROP_WHEAT/POTATO/CORN/STRAWBERRY. Painting a grass
tile spawns a TILLED Crop entity that pawns then sow. World rejects
non-grass tiles, occupied tiles, and non-walkable terrain. 9 new
string keys, kind-specific thumbnail draws (gold/tan/yellow/red).

MCP verified: 12 forced-TILLED crops fully cycled TILLED → SOWN →
growth → READY within ~3000 ticks. Paint tool spawned wheat crop at
(35, 30); wall tile at (44, 23) correctly rejected.

Followup smell: cancelling a designation on a player-painted crop
will queue_free even if grown — Crop has no can_complete. Future
guard could skip crops past TILLED.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-05-16 21:29:00 +01:00
parent 87a7beb22b
commit c6c88acc47
6 changed files with 107 additions and 54 deletions

View file

@ -44,6 +44,12 @@ const TOOL_PAINT_STOCKPILE: StringName = &"paint_stockpile"
const TOOL_PLANT_TREE: StringName = &"plant_tree"
# Quarry — must paint on a BigRockNode tile; spawns a QuarryWorkbench ghost.
const TOOL_PAINT_QUARRY: StringName = &"paint_quarry"
# Crop zone paint (one tool per kind) — spawns a Crop entity at Stage.TILLED
# so PlantProvider will assign a sow job with no seed cost.
const TOOL_PAINT_CROP_WHEAT: StringName = &"paint_crop_wheat"
const TOOL_PAINT_CROP_POTATO: StringName = &"paint_crop_potato"
const TOOL_PAINT_CROP_CORN: StringName = &"paint_crop_corn"
const TOOL_PAINT_CROP_STRAWBERRY: StringName = &"paint_crop_strawberry"
# ── tool → material override ─────────────────────────────────────────────────
# For build_wall and build_floor the tool is shared but the material differs.
@ -79,6 +85,10 @@ const _ATLAS_BY_TOOL: Dictionary = {
&"paint_stockpile": Vector2i(0, 0),
&"plant_tree": Vector2i(0, 0), # grass ghost — tinted green
&"paint_quarry": Vector2i(2, 0), # stone-grey ghost
&"paint_crop_wheat": Vector2i(1, 0), # dirt-brown ghost (tilled soil)
&"paint_crop_potato": Vector2i(1, 0),
&"paint_crop_corn": Vector2i(1, 0),
&"paint_crop_strawberry": Vector2i(1, 0),
}
# Placeholder source ID — mirrors World.PLACEHOLDER_SOURCE_ID.
@ -128,6 +138,8 @@ func set_active_tool(tool: StringName) -> void:
TOOL_PAINT_STOCKPILE,
TOOL_PLANT_TREE,
TOOL_PAINT_QUARRY,
TOOL_PAINT_CROP_WHEAT, TOOL_PAINT_CROP_POTATO,
TOOL_PAINT_CROP_CORN, TOOL_PAINT_CROP_STRAWBERRY,
],
"Designation.set_active_tool: unknown tool '%s'" % tool
)