Merge task #20: lettuce and corn fields on the south soil, map 60 x 80

Lettuce (x -6..4) and corn (x 24..34, both z 20..30) sit on the bare
SW/SE soil with cabbage and corn-stalk prefabs and matching crop
tokens; playable map extends south to z 35; SouthFields moved off the
map; per-field thief rects. test_targets conflict resolved in favour of
#21 (dropped animals no longer run for the edge).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-06 13:19:10 -04:00
commit 11d19d874a
10 changed files with 676 additions and 508 deletions

View file

@ -131,12 +131,12 @@ func _ready() -> void:
shed_stock.setup(campaign, shed_zone, player) # every pile prop in place for the navigation
nav.build(get_parent(), zones.playable.grow(5.0), config.nav_cell_size, config.enemy_radius + config.nav_inflate_margin)
shed_stock.refresh()
# #13: three CROP_FIELD zones now (the original field, lettuce/cabbage, corn); field_rect is
# their bounding box (ThiefBehavior.area_for: "close enough, go straight" once inside it).
var crop_zones := zones.zones_of(FarmZone.Kind.CROP_FIELD)
var field_rect := crop_zones[0].rect()
for i in range(1, crop_zones.size()):
field_rect = field_rect.merge(crop_zones[i].rect())
# #13: three CROP_FIELD zones (the original field, lettuce/cabbage, corn). #20: each keeps its
# own rectangle (ThiefBehavior.area_for: "close enough, go straight" once inside the target's
# field); their bounding box would span most of the map now that the later fields lie south.
var field_rects: Array[Rect2] = []
for z in zones.zones_of(FarmZone.Kind.CROP_FIELD):
field_rects.append(z.rect())
# Goals are the crop rows themselves (not the whole zone), so a fence around the crops
# encloses every goal and thieves have to break in. Likewise the inside of the pen.
var crop_goals := PackedInt32Array()
@ -167,7 +167,7 @@ func _ready() -> void:
animals = AnimalSystem.new()
animals.name = "Animals"
add_child(animals)
behavior.setup(config, nav, loot, crop_field, escape_field, field_rect)
behavior.setup(config, nav, loot, crop_field, escape_field, field_rects)
behavior.pen_rect = pen_zone.rect()
behavior.shed_rect = shed_zone.rect()
behavior.farm_rect = zones.playable