Task #12: animals start loose; herd into the player-built pen
Adds LootSystem.Status.LOOSE: animals now start scattered at GameConfig. animal_loose_spots outside the pen rect and graze in place (AnimalSystem, anchored to their own spot instead of the pen) instead of starting HOME or escaping down the field. A thief can still claim and carry a loose animal off (same DROPPED/escape rules as before); the scarecrow's existing follow-trail recovery now also picks up a loose animal directly, and entering the pen makes it HOME as before. FarmState gains penned_animals (which ids are currently penned), set whenever an animal becomes HOME (led in, or auto-returned at the dawn grace) and cleared when it's lost. LootSystem.sync_from_state() uses it each morning/retry/load to restore penned animals HOME and leave the rest LOOSE, instead of resetting the whole herd into the pen. Bumped FarmState. VERSION to 5 with a migration step that pens every surviving animal for older saves (which always kept them in the pen). test_targets.gd's existing pen-mechanics suite (containment, straying, leading in) now pens every animal up front to keep covering that behavior; a new _loose_start check covers the loose start itself: animals spawn loose and scattered, graze in place, a thief can still claim and steal a loose one, leading one in with the follow-trail mechanic pens it, and a morning resync keeps the penned one home and the rest loose. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
186c9c44cb
commit
13efe6603f
7 changed files with 252 additions and 41 deletions
|
|
@ -74,6 +74,9 @@ func _rejects(r: GameTestRunner, good: Dictionary) -> void:
|
|||
"an unknown night event": func(d: Dictionary) -> void: d["night_events"] = {"cows_tipped": 1},
|
||||
"a lost animal id beyond the total": func(d: Dictionary) -> void: d["lost_animals"] = [d["animals_total"] + 1],
|
||||
"an animal lost twice": func(d: Dictionary) -> void: d["lost_animals"] = [2, 2],
|
||||
"a penned animal id beyond the total": func(d: Dictionary) -> void: d["penned_animals"] = [d["animals_total"] + 1],
|
||||
"an animal penned twice": func(d: Dictionary) -> void: d["penned_animals"] = [1, 1],
|
||||
"a penned animal that's also lost": func(d: Dictionary) -> void: d["penned_animals"] = [2], # 2 is already lost in `good`
|
||||
"negative supplies in play": func(d: Dictionary) -> void: d["supplies_total"] = -1,
|
||||
"HP above max": func(d: Dictionary) -> void: d["scarecrow_hp"] = d["scarecrow_max_hp"] + 1,
|
||||
"night 0": func(d: Dictionary) -> void: d["night"] = 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue