Repository navigation
Conversation
BBQSoloFarmer::program() runs its quest rounds inline against the console, so the round logic (which quests count, when to stop, when to save) can only be exercised by running the farmer on a Switch. Move the round loop into run_bbq_rounds(), which takes the game actions it depends on as a BBQGameActions interface: read the quests, process them, do a quest, report a completed quest, and end the round (saving if due). BBQSoloFarmer implements these with the calls they replace, in the same order; the date fix, save/reset, stats and notification move together into end_round(). Startup, flying to the plaza and end-of-program handling stay in program(). The commented-out single-quest debug block declares its own egg counter now that the loop locals have moved. process_quest_list() only reads its quest list and egg count, so take them as const& and by value. Add PokemonSV::BBQFarmerRounds, a table of scenarios run against a simulated singleplayer quest panel: 3 blue quests, completed quests are replaced, impossible quests are skipped, and a panel with nothing doable is rerolled. Each scenario checks the number of completed quests and the exact action sequence: finishing the round that reaches the goal, a quest already gone, a failed quest, a panel with nothing doable, saving at exact multiples, and stopping when out of eggs. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
When nothing on the panel is doable the farmer rerolls it and reads it again. If nothing can ever become doable, the loop never ends. Check at start that the exclusions table leaves at least one doable blue quest, and give up with a UserSetupError after 30 reads in a row with nothing doable (wrong game language, or no BP left to reroll). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Contributor
Author
|
Closing for now to keep the upstream queue to PRs that are ready: this one waits on unmerged parent PRs. It continues on my fork as dayfine#5, and I'll reopen it here once its parents merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When nothing on the quest panel is doable, the BBQ Farmer rerolls the whole panel and reads it again. If nothing can ever become doable, it does this forever, spending BP on every reroll. This PR stops the program with a setup error in that case.
Change
run_bbq_rounds()throwsUserSetupErrorbefore reading the panel if the exclusions table skips or rerolls every blue quest the program can do (blue quests minusnot_possible_quests). A quest counts as doable when any table row for it says Run, which matches howprocess_quest_list()treats duplicate rows.UserSetupErrortelling the user to check the game language and their BP. If the language is wrong, every quest reads asUnableToDetect. If BP runs out, rerolls stop changing the panel.Why 30: with valid settings, a panel can have nothing doable and the next reroll fixes it. In a bad case where only 3 of the 31 blue quests are doable, a panel has nothing doable 73% of the time, so 30 such panels in a row happen with probability 0.008%. With the defaults (28 doable) the chance per panel is 0.02%.
Tests
There are 3 new
PokemonSV::BBQFarmerRoundsscenarios that run through the simulated quest panel from #1632. The panel can now be out of BP, meaning rerolls do nothing.All 9 farmer-round scenarios pass. Without this change, the first and third scenarios fail.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E