Skip to content

PokemonFRLG: S12, Fuchsia Gym, Koga and the Warden (12.01, 12.02) on the 11.03 stack - #431

Draft
dayfine wants to merge 45 commits into
frlg/stage11-safarifrom
frlg/stage12-fuchsia-gym
Draft

dayfine wants to merge 45 commits into
frlg/stage11-safarifrom
frlg/stage12-fuchsia-gym

Conversation

@dayfine

@dayfine dayfine commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Depends on #426 (base frlg/stage11-safari; the diff shows only this change).

Segment 12 on the 11.03 stack: Fuchsia Gym, Koga, and the GOLD TEETH to the Warden for HM04 Strength, in PokeGuy's order (1:14:38 to 1:18:39). This carries #414's rows over from frlg/stage8-rocktunnel (without the player-girl merge on that branch), so #414 can close as superseded.

  • 12.01 now starts where 11.03's Fly lands, below Fuchsia's Center facing south, walks in to the nurse, heals and teaches HM03 Surf over Water Gun. Then it goes to the walls in the Center's northwest corner before walking out, so a nurse pose a tile off still leaves by the mat. It ends west of Koga, saved there for Koga's retry.
  • 12.02: Koga, then the Warden. The last step to the Warden is now a tap from the house's west wall, so the walk before the A press ends on its tile. The row ends at Fuchsia's nurse; Strength is not taught, as PokeGuy waits until Victory Road.
  • The chain test and the whole-story sim lose PokemonFRLG: S12, Fuchsia Gym and Koga (12.01, 12.02) #414's exception for 12.01's start. Segment 12 gets its own golden header and its own header for registering its tests.
  • Still a deviation from PokeGuy, as in PokemonFRLG: S12, Fuchsia Gym and Koga (12.01, 12.02) #414: Juggler Kayden (Hypno Lv38) is fought. Every way north crosses his east line, and no leg there ends on a wall; PokeGuy got past while Kayden faced south.

Testing

  • Headless SerialProgramsTests --filter PokemonFRLG: the route golden, chain, routes-run, trainer-line count, plan-items and A-press checks pass. So do the whole-story sim, the Fuchsia Gym sims and every fault sweep on 12.01 and 12.02. The only failures are the image/resource FileExceptions and OverworldSpin's lift test, none in files this PR touches.
  • Not run on a console.

🤖 Generated with Claude Code

https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

dayfine and others added 6 commits November 12, 2026 10:14
The change of #414 (frlg/stage12-koga, without the player-girl merge it
carries from frlg/stage8-rocktunnel), brought over as one patch on top of
11.03. 12.01 now starts where 11.03's Fly lands, below Fuchsia's Center
facing south, and walks in to the nurse; the chain test and the whole-story
sim lose their exception for it. The segment 12 golden gets its own header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…Warden; S12 golden

The scene end pose sweep moved the Center script's end a tile off the
nurse, and 12.01's walk out then missed the mat: legs to the Center's west
and north walls first. 12.02's open leg east onto the tile below the Warden
wasn't found again before the A press: a tap from the house's west wall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
PokemonFRLG_AutoStoryRows_Tests.h stays as 11.03 left it (header_symbols
at its limit of 8).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Kayden (FACE_DOWN_AND_RIGHT) turns south or east every 32 to 80 frames.
The sim models that (SimScript::trainer_turns), and a new STEP variant,
trainer_pass, waits for a turn away and crosses the line on it, fighting
the trainer as a fallback if seen. 12.01 uses it in place of the fight.
The console has no sprite of the trainer to read yet, so there it crosses
unwatched with the fallback. Koga at full HP: 88.0% (vs 70.1% recorded).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…les; 12.02 sim after Koga

- trainer_pass gets a STEP row, so its args lint; the console pass moves to
  AutoStoryTrainerPass.{h,cpp}, the sim's trainer sight and timer turns to
  OverworldSimTrainers.cpp and OverworldSimTrainerTurns.h (trainer_facing()
  is a friend, not a public method).
- The line check counts a pass's end as its last tile; Kayden leaves the
  fought list (38 trainers).
- The gym sim marks every gym trainer beaten after Koga, as the game does
  (set_gym_trainers 5), so 12.02's way out doesn't meet an unbeaten Kayden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
The player facing reader's matching now takes a frame position
(match_facing_at()), and a trainer facing reader uses it with pokefirered's
rocker.png standing frames in npc_blue.pal's colours, kept in the source
until Packages carries the sheet. trainer_pass reads the step's "sprite"
(12.01: "rocker") while waiting for the turn away; without frames, or with
no turn seen in 20 s, it crosses blind, logged. Unit test on synthetic gym
frames rendered from the sprite (red with the offset ignored).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine and others added 5 commits November 12, 2026 10:56
…-12)

Removes trainer_pass, the trainer facing reader, the player reader's
match_facing_at() refactor and the sim's timer-turn trainers, back to
52ede51's code. Keeps the gym sim's rule that Koga's win beats every
gym trainer (set_gym_trainers 5). 12.01's notes record the decision and
Koga's full-HP win rate (88.0%) next to the recorded 70.1%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
The lead's HP between battles is tracked from the last measured battle HP
bar plus the Potions and Super Potions used since. heal_to_full after
Kayden's and Kirk's fights uses bag items until no HP is missing;
check_full_hp west of Koga fails loudly if HP is missing or unmeasured.
12.01 counts Potions and Super Potions at the start and the Fuchsia Mart
buys Super Potions only for what the bag lacks to heal 122 HP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…eal from Navigation

The Mart detour went round the city (about 150 tiles there, 110 back):
planned routes never hop a ledge, and the Cut tree (24, 22) is the only gap
between row 23 and the Mart's road. Hop the ledge (28, 32) and cut the tree
both ways. AutoStory's blind heal_at_center is replaced by upstream's
heal_at_pokecenter, which waits for the nurse's dialog and retries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 12, 2026
dayfine and others added 2 commits November 12, 2026 13:53
Comment on each AutoStory helper that overlaps a PokemonFRLG_Navigation or
StartMenuNavigation helper: which one, how ours differs or that it wraps it,
and that the two could be unified if needed. Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
… test loop over const char*

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine and others added 2 commits November 12, 2026 15:57
A TEACH step may list the moves to keep: the one known move outside the
list is forgotten, and none or several outside it is an error that logs
the moveset. 12.01's Surf named Water Gun, which console B's Blastoise
(Bite, Water Pulse, Bubble, Dig) doesn't know. The 04.06, 05.02-05.04,
06.02 and 12.01 teach steps now carry keep lists; 10.01's Fly keeps its
ordered forget/or_forget, which a keep list can't express.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
… floor

read_money() reads nothing yet, so a Mart step with no floor buys nothing
(console failure 2026-11-12 16:13). 3762 = 10.01's floor 19862 less its
15600 of X items and the Safari Zone's 500, prize money not counted.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine and others added 8 commits November 12, 2026 16:32
The Fuchsia Mart's ULTRA BALL row read as PARLYZ HEAL, the nearest name in a
dictionary without Ultra Ball, and 12.01 bought nothing (console B,
2026-11-12). The Bag-layout name box reads the Mart's rows correctly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
The step's cover_hp 122 bought one Super Potion with 6 Potions in the bag.
PokeGuy's bag at Koga holds 5 (PokemonSimulation docs/battles/
pokeguy-conditions.md, ### koga), so the step takes a new "fill_to"
argument: it buys what the bag lacks of the first line's item to hold that
many. The budget is raised to 3,500 (5 x 700); the floor stays 3,762.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…er rival

Koga ended console B's run in 6 turns with no Antidote and no X item used:
a trainer battle only used its step's use_items. A step now names a
"policy" (solo-recovery or goal-based-setup), the doc's setup goals and the
foes' threat rows; the pure BattlePolicy module chooses a cure, a heal, or
an X item / Guard Spec before the lead attacks, tracks the stages and Mist,
and counts the foes left for X Speed. 12.02 koga and 10.03 rival_tower carry
them; Lavender buys 1 Antidote and 1 Parlyz Heal and Cerulean 3 Awakenings,
PokeGuy's bag at Koga.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…er the file limit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…tions at 85/128 poisoned)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…hits is not made

At 85/128 poisoned against a hit of 100 the policy spent four Potions in a row
(20 HP against 42 lost a turn) and never attacked; a heal now has to gain
ground over the foe's mean hit, else the policy attacks (the doc's C rule 5).
The heal's log line says what setup it waits on, or that none is pending.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine and others added 6 commits November 12, 2026 18:18
12.02 counts the Items pocket first; unless it holds 5 Super Potions and a
cure for poison, it walks out of the gym by 12.01's legs backwards, buys the
shortfall at the Mart (Super Potions to 5, one Full Heal: the Mart sells no
Antidote) and walks back to west of Koga. New GAME action bag_check sets a
flag for skip_if; fill_to counts any item the story counts; a Mart step with
a skip_if is no longer once per save.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…er the line limit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 13, 2026
dayfine and others added 16 commits November 12, 2026 18:42
The money can't be read, so a Mart step buys its listed quantity (or with
fill_to the bag's shortfall); the NOT_ENOUGH_MONEY dialog is the only money
check. Remove the budget and floor args, read_money(), cover_hp and the test
that required a floor; add a test that flags a Mart step after a battle or a
long walk in its checkpoint (07.01 and 12.01 are listed, not reordered).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Koga 12.02 (console B 2026-11-12) chose Dig for 8 turns against Koffing:
the matchup ranked by type only, and Koffing's Levitate makes Ground do
nothing. attack_slot_against() now scores a move as expected damage: 0
against a foe immune through its single ability (Levitate, Flash Fire,
Volt Absorb, Water Absorb), 1.5x for the attacker's own type, halved for
a two-turn move (Dig, Fly, ...). Ties still go to the plan's order.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…ap cures

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…l Restore only when it heals half of max HP

12.02 now challenges Koga from its save. The policy cures status with
Antidote or Full Heal, and uses a Full Restore only when it also heals
at least half of max HP.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…ower; the plan's order breaks ties)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…rows, pinned by a test

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…ames 19.04

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
…2.02b

A boss battle is its own checkpoint (user, 2026-11-12). 12.02 starts west of Koga and ends there after the SOULBADGE and TM06 text; the new 12.02b starts at the same tile and goes to the Warden, takes HM04 and heals at Fuchsia's Center. Ids are not renumbered; the golden, run-plan, count and gym tests follow.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
The run plans, the 12.02 text and the golden already name 12.02b; the file
was missing, so the table had 52 checkpoints and the count test expects 53.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss

# Conflicts:
#	.github/workflows/cpp-ci-serial-programs-base.yml
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