Task #21: animals roam the whole farm, never lost on their own

Loose animals now roam the whole playable map, day and night. Each walk
goes to a goal 4-8 m away that is walkable, in a clear straight line,
at least 2 m inside FarmZones.playable (passed into AnimalSystem.setup),
and neither inside the pen nor across it. Every morning a loose animal
is back at its loose spot (no save change).

Animals no longer escape on their own:
- _stray and LootSystem.animal_escaped are gone.
- A new LootSystem.animal_loose makes an animal LOOSE where it stands
  and unpens it. It covers a carrier killed or scared (drop), a broken
  follow leash, and an animal getting out of an open pen (animal_strays,
  which still records animals_strayed).
- An animal dropped inside the pen is home again.
- An animal let out of an open pen walks out along the escape field,
  then roams. If the pen shuts first, it stays home.
- return_dropped still pens followers at dawn's end, but leaves loose
  animals loose.
- The only loss paths left are a carrier leaving the farm
  (thief escape, or removal with reason LEFT).

Loose spots at x = -12 move inward to (6|9|12, 0.5). The toast,
review-panel, dropped-animal toast, RULES.md and header text no longer
promise animals wander off or run for the edge.

test_targets: _loose_start has a 90 s day + 90 s night roam run (every
animal >4 m, never off the map or into the pen, none lost), a morning
reset to the spots, a killed carrier leaving the animal loose, and an
unopposed thief carrying one off. _animal_theft, _leading, _breach and
_make_loose follow the new rules. AWAY moves off the map so roaming
animals can't start following the parked scarecrow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-06 13:07:13 -04:00
parent 26b735d3e6
commit aaf5a81b4e
8 changed files with 379 additions and 226 deletions

View file

@ -11,7 +11,7 @@ const SLOTS := 5
## Loot events per category (LootSystem.Category): the text ("%s" is the item's noun) and color.
const MESSAGES := {
&"stolen": [["A crop was snatched!", "A %s was grabbed!", "Aliens took %s from the shed!"], Color(1.0, 0.6, 0.15)],
&"dropped": [["The alien dropped the crop. Grab it!", "The alien dropped the %s. Catch it before it runs off!",
&"dropped": [["The alien dropped the crop. Grab it!", "The alien dropped the %s. Lead it back to the pen!",
"The alien dropped %s. Grab it!"], Color(1.0, 0.9, 0.3)],
&"recovered": [["Crop recovered", "The %s is back in the pen", "%s back in the shed"], Color(0.5, 1.0, 0.45)],
&"returned": [["A dropped crop went back to its plot", "The %s went back to the pen", "%s went back to the shed"],