Repository navigation
Conversation
Move GiftRng::program's reset, calibrate and attempt loop into a GiftRngAttempts class whose run() returns the outcome, so another program (AutoStory) can run Gift RNG with its own options and displays. GiftRng::program builds it from its options and keeps its behaviour. The per-target base stats move into gift_rng_species(), tested along with the shiny outcome. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
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.
Base:
main; independent of #183 and AutoStory. The diff shows only this change.Moves Gift RNG's reset, calibrate and attempt loop out of
GiftRng::programinto aGiftRngAttemptsclass, so AutoStory can later run Gift RNG for the Magikarp salesman inside its own program, as #183 did for Starter RNG.GiftRngAttempts::run()returns aGiftRngResult(outcome + target Pokemon). Settings, displays, notifications and stats are passed in asGiftRngTarget/Settings/Displays/Notifications/Stats, shaped like FRLG: make Starter RNG's attempts and SID Helper's steps callable #183's Starter structs, with the sameon_reset,identify_shinyandmax_resetshooks (plusmax_rare_candies, read per attempt as before).GiftRng::programis now a thin wrapper. Presses, timings, logs, stats names and notifications are unchanged; "5 failed searches" still throws from the program, as FRLG: make Starter RNG's attempts and SID Helper's steps callable #183 does.identify_shiny(off in Gift RNG) reads a shiny gift's summary and tells whether it hit the target;gift_shiny_outcome()is that check. Names are Gift-specific so they don't clash with FRLG: make Starter RNG's attempts and SID Helper's steps callable #183'sidentify_shinywhen both land.gift_rng_species(), onereturnper case, to fit the 50-line function limit; the values are the same and the tests pin each one.finished,reset_game,check_shiny_giftandrun_attempt. Locals became members (m_calibrations,m_target.seed,m_settings.language, ...), so most of it is moved with renames; about 75 of the 253 removed lines show as moved. Compare withgit diff --color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change main...frlg/gift-rng-callable-steps.Testing
PokemonFRLG::GiftRngAttemptssuite: species values per target, and shiny outcome on/off target.-Wmissing-designated-field-initializers; code health: 0 failures. Mac, Windows Clang and Ubuntu CI dispatched on the branch.🤖 Generated with Claude Code
https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E