Distinct icons for wheat / corn / potato / strawberry harvests

Wheat + corn both produce TYPE_GRAIN; potato + strawberry both produce
TYPE_VEGETABLE. Until now they rendered identically (yellow stalks for
both grains, green-leafed root for both vegetables) since shape was
driven by item_type alone.

Added an Item.subtype field that carries the origin crop_kind through
harvest. draw_item_shape dispatches on subtype FIRST then falls back
to item_type — so storage filters (which match on item_type) still
treat wheat+corn as one Grain category and potato+strawberry as one
Vegetable category, but the visuals are now distinct.

New procedural shapes:
- wheat: 3 yellow stalks with grain-heads (same as existing grain)
- corn: yellow cob with kernel dots wrapped in green husk leaves
- potato: 2 brown overlapping lumps with sprout-eye dots
- strawberry: red heart-shape body with green calyx + yellow seeds

Crop.on_harvest_tick assigns subtype = crop_kind on spawn.
SaveSystem._spawn_item now round-trips subtype through saves.
Pawn carry indicator + Item._draw both pass subtype to draw_item_shape.
This commit is contained in:
megaproxy 2026-05-16 15:52:31 +01:00
parent c7f97e2c7a
commit 413054157a
4 changed files with 97 additions and 3 deletions

View file

@ -407,6 +407,8 @@ func _spawn_item(world_scene: Node, d: Dictionary) -> void:
Vector2i(int(d.get("tile_x", 0)), int(d.get("tile_y", 0)))
)
ent.quality = int(d.get("quality", 1)) as Item.Quality
ent.subtype = StringName(d.get("subtype", ""))
ent.queue_redraw()
func _spawn_wall(world_scene: Node, d: Dictionary) -> void: