Repository navigation
Conversation
run_league_fight() tries a fight from its start save through a LeagueFightRunner: load, top up, check the entry contract (hard on items), fight, check the caps and reserves. Phase 1: min_pass_of tries, none saved, stop below min_pass; phase 2: up to reset_budget tries, save the first pass. The plan's contract.entry is read for the check. Tests run the loop on a fake runner whose fights are the fake engine's scripted battles.
A planned fight that resets on Roar or Whirlwind soft resets when the lead is dragged out, instead of switching it back; the planned policy soft resets on the plan's early reset (league_early_reset(), Bruno's after Onix #1) when the foe it names falls. The battle ends ROARED or EARLY_RESET and its step fails with league_roar_reset or league_early_reset: the try didn't pass and the game is at its save.
The battle no longer soft resets itself: a Roar or Whirlwind in a fight that resets on one, or the plan's early reset, ends the battle at once (TurnChoice::END_TRY) as ROARED or EARLY_RESET, and the League loop's next try reloads the fight's save. Keeps PokemonFRLG_AutoStoryBattle.cpp and BattleDecisions within code health's limits; the League loop header gets its missing comments.
Owner
Author
|
Superseded by #652 (frlg/lean), which continues from this branch's tip; the branch stays. |
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.
Depends on #638 (base
frlg/league-plan; the diff shows only this change).The League now runs fight by fight:
run_league_fight()loads each fight's start save, tops up, checks the plan's entry contract (contract.entry, now parsed; hard on item counts), fights, and checks the caps and reserves. Phase 1 runsmin_pass_oftries without saving and stops belowmin_pass; phase 2 tries up toreset_budgettimes and saves the first pass. The loop drives aLeagueFightRunnerseam. In the console battle, a Roar or Whirlwind in a fight that resets on one, or the plan's early reset (Bruno after Onix #1), now ends the battle at once asROARED/EARLY_RESET, and its step fails so the loop reloads the save. Tested with new fake-runner cases in the fake engine's test file (phases, over-cap win, Roar and early reset, a failed precondition, the one-heal branches and the Elixir before the Champion); CI runs them. Not in yet: the console runner, the per-fight story rows, and removingplan_league().