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

@ -109,6 +109,11 @@ func on_harvest_tick() -> void:
var it: Item = ITEM_SCENE.instantiate()
get_parent().add_child(it)
it.setup(item_type, 1, tile)
# Carry the crop_kind through as a visual subtype so wheat / corn /
# potato / strawberry each render distinctly, while item_type stays
# generic (TYPE_GRAIN / TYPE_VEGETABLE) for stockpile filter purposes.
it.subtype = crop_kind
it.queue_redraw()
stage = Stage.TILLED
stage_progress = 0
_refresh_sprite_region()