Skip to content

feat: Add all 50 Gen 1 TMs + tests to restore coverage above 80% - #11

Merged
MobyNL merged 4 commits into
mainfrom
copilot/add-new-mechanics
Mar 12, 2026
Merged

feat: Add all 50 Gen 1 TMs + tests to restore coverage above 80%#11
MobyNL merged 4 commits into
mainfrom
copilot/add-new-mechanics

Conversation

Copilot AI commented Mar 12, 2026

Copy link
Copy Markdown

Only 7 of the 50 Gen 1 TMs existed in ITEM_DATA, and the new TM entries exposed four source files below the 80% coverage gate.

New moves (move_data.py)

Four moves required by TMs were missing from the database:

Move Type Power TM
SUBMISSION Fighting 80 (recoil) TM17
BIDE Normal — (charge) TM34
DREAM EATER Psychic 100 TM42
TRI ATTACK Normal 80 TM49

Full TM catalogue (items.py)

Replaced the 7-entry stub with all 50 Gen 1 TMs (TM01TM50). Each entry has cat=CAT_TM (consumed on use) and a move key pointing to a validated name in MOVES.

"TM17 Submission": ItemData(
    desc="Teaches Submission (one-time use)", emoji="🤼", cat=CAT_TM, move="SUBMISSION"
),

Coverage fixes (4 files below 80%)

File Before After
hm_tm_system.py 72% 99%
ui/battle_mixin.py 76% 99%
ui/game_flow_mixin.py 76% 99%
ui/panel_mixin.py 65% 84%

Tests added across test_advanced_systems.py, test_battle_mixin.py, test_game_flow_mixin.py, and test_panel_mixin.py covering:

  • teach_move error/dict-normalisation paths; _field_surf/fly/cut/strength/flash branches
  • execute_faint_switch, _queue_move_learn, _resume_after_move_learn, evolution-pending/resume branches in BattleMixin
  • learn_move_choice flow, safe_exit with lock-file, prompt_for_quit, failed_save_quit paths in GameFlowMixin
  • show_faint_switch_panel, show_pokemon_switch_panel, show_pc_*_panel methods in PanelMixin
Original prompt

Let's start to implement these steps:
Priority 3: Advanced Systems ⭐
New mechanics

HM/TM System

Cut, Surf, Strength, Flash, Fly
Badge requirements for field use
TM teaches (one-time use moves)
Would unlock new areas & puzzles
Fishing Mechanic

Old Rod, Good Rod, Super Rod items
Water Pokemon encounters (Magikarp, Goldeen, Tentacool)
Simple implementation, adds variety
Item Improvements

More hold items
Rare Candy (instant level up)
Master Ball (100% catch rate)
Vitamins (stat boosters)

Created from VS Code.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: MobyNL <59473010+MobyNL@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new mechanics for HM/TM system and fishing feat: HM/TM system, fishing mechanic, Master Ball, and Route 21 Mar 12, 2026
…AM EATER, TRI ATTACK)

Co-authored-by: MobyNL <59473010+MobyNL@users.noreply.github.com>
Copilot AI changed the title feat: HM/TM system, fishing mechanic, Master Ball, and Route 21 feat: Full Gen 1 TM set (TM01–TM50) + 4 missing moves Mar 12, 2026
…n, panel_mixin

Add new pytest test classes to four test files:

- tests/game/test_advanced_systems.py
  TestTeachMoveExtra, TestUseHmFieldExtra, TestFieldSurfExtra,
  TestFieldFlyExtra, TestFieldCutExtra, TestFieldStrengthExtra,
  TestFieldFlashExtra — covers hm_tm_system.py 72% → 99%

- tests/battle/test_battle_mixin.py
  RealDisplayTerminal, TestRealBattleDisplayMethods,
  TestThrowDifferentBalls, FaintableTerminal, TestPotionPlayerFaint,
  TestEndOfTurnEffects, TestSwitchMenuStringEntry,
  TestExecuteSwitchFaintPath, TestExecuteFaintSwitch,
  TestQueueMoveLearnNew, TestResumeMoveLearnBranches,
  EvolutionExceptionTerminal, TestQueueEvolutionException,
  TestResumeAfterEvolutionTrainerNextEmpty
  — covers battle_mixin.py 76% → 99%

- tests/ui/test_game_flow_mixin.py
  ExtendedFlowTerminal, TestShowMainMenuCallsActionPanel,
  TestConfirmOverwriteDispatch, TestFaintSwitchDispatch,
  TestPcDispatchReturnsToCenter, TestLearnMoveChoiceDispatch,
  TestSafeExitWithLockFile, TestPromptForQuit,
  TestConfirmQuitFailedSave, TestSaveCurrentGameFlow, TestPerformSave
  — covers game_flow_mixin.py 76% → 99%

- tests/ui/test_panel_mixin.py
  TestShowFaintSwitchPanel, TestShowPokemonSwitchPanel,
  TestShowPcMainPanel, TestShowPcDepositPanel, TestShowPcWithdrawPanel
  — covers panel_mixin.py 65% → 84%

All 1701 tests pass. Ruff format + check clean. CodeQL: 0 alerts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI changed the title feat: Full Gen 1 TM set (TM01–TM50) + 4 missing moves feat: Add all 50 Gen 1 TMs + tests to restore coverage above 80% Mar 12, 2026
@MobyNL
MobyNL marked this pull request as ready for review March 12, 2026 13:49
@MobyNL
MobyNL merged commit 2f533d0 into main Mar 12, 2026
1 check passed
@MobyNL
MobyNL deleted the copilot/add-new-mechanics branch March 12, 2026 13:56
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.

2 participants