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

@ -1184,7 +1184,7 @@ func _draw() -> void:
var ci_center := Vector2(7.0, -12.0)
var ci_scale := 0.55
draw_set_transform(ci_center, 0.0, Vector2(ci_scale, ci_scale))
if not Item.draw_item_shape(self, carried_item.item_type):
if not Item.draw_item_shape(self, carried_item.item_type, carried_item.subtype):
var ci_hue := float(carried_item.item_type.hash() % 360) / 360.0
var ci_color := Color.from_hsv(ci_hue, 0.6, 0.85)
draw_rect(Rect2(-6, -6, 12, 12), ci_color)