Skip to content

feat(farmingcontract): add Farming Contracts plugin#495

Open
runsonmypc wants to merge 3 commits into
chsami:developmentfrom
runsonmypc:feature/farming-contract
Open

feat(farmingcontract): add Farming Contracts plugin#495
runsonmypc wants to merge 3 commits into
chsami:developmentfrom
runsonmypc:feature/farming-contract

Conversation

@runsonmypc

Copy link
Copy Markdown
Contributor

Summary

Adds a Farming Contracts plugin that automates Jane's farming contracts in the Farming Guild end to end.

What it does

  • Gets a contract (with optional auto-downgrade when seeds for the assigned crop aren't available)
  • Banks the required tools, seeds, and compost
  • Plants and harvests across patch types (allotment, herb, flower, bush, cactus, tree, fruit tree)
  • Clears and replants trees by paying the guild gardeners
  • Turns in completed contracts and loops

Correctness details

  • Stackable items: uses itemQuantity rather than count for coins/seeds — count() returns the slot count (1 for a stack), which otherwise made the plugin think it had a single coin and loop back to banking.
  • Guild gardeners: the farming-guild gardeners (Rosie / Nikkie) expose Pay (tree patch) / Pay (Fruit tree) rather than a generic Pay; the plugin finds them by name + specific action so checked/old trees actually get cleared.
  • Checked trees: detects a check-healthed tree via the Chop down action and clears it through the gardener.
  • Auto-downgrade: guarded on a needsDowngrade flag to prevent an infinite re-downgrade loop.
  • Weed regrowth while planting: re-rakes weeds that regrow during composting and verifies a seed was actually consumed before reporting a successful plant.

Testing

Verified live via the agent server: contract pickup, tree clearing by paying Rosie, contract turn-in, and the re-rake/seed-consumption planting path.

Automates Jane's farming contracts end to end: gets (and optionally
downgrades) contracts, banks tools/seeds/compost, plants and harvests
across patch types, clears and replants trees by paying the guild
gardeners, and turns in completed contracts.

Correctness details worth noting:
- itemQuantity (not count) for stackable coins/seeds; count() returns the
  slot count, which caused false "1 coin" / banking loops
- pay guild gardeners Rosie/Nikkie by name + tree-specific action when no
  generic "Pay" NPC is present, so checked/old trees get cleared
- detect check-healthed trees via the "Chop down" action and clear them
- guard auto-downgrade on needsDowngrade to stop re-downgrade loops
- re-rake weeds that regrow during composting and confirm a seed was
  consumed before reporting a successful plant
Use the Guildmaster Jane chathead as the icon and card; wire up
iconUrl/cardUrl in the descriptor. Bump version 0.2.1 -> 0.2.2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant