Repository navigation
Multi-turn move mechanics, and stat changes landing on the right Pokémon - #5
Merged
Merged
Conversation
Joseph's feedback after playing the sim: moves that charge or spread their effect over several turns were missing, and stat drops weren't always landing on the right Pokémon. Multi-turn mechanics, all with hand-derived tests: - two-turn charge moves, with semi-invulnerability (Fly, Dig, Dive, Phantom Force), the moves that reach through it, Solar Beam's sun skip and bad weather penalty, charge-turn boosts, and Power Herb - recharge moves, rampage locks and the confusion they end in - confusion itself, plus momentum moves (Rollout, Fury Cutter) - partial trapping and the switch block it applies; Mean Look - Leech Seed, Wish, Future Sight, Perish Song, Yawn - Taunt, Encore, Disable - Reflect / Light Screen / Aurora Veil, Tailwind, Trick Room - Protect (with escalating failure odds) and Substitute - Fake Out, Focus Punch, Roost's grounding, and the switch-out moves Every counter now ticks in one documented place, endOfTurn. Stat-change fixes: - the self/target test read PokeAPI's meta category as "damage+raise", but the baked data spells it "damage-raise", so every self-boosting damaging move was buffing the OPPONENT instead. Power-Up Punch raised the foe's Attack; Meteor Mash, Flame Charge, Charge Beam and Ancient Power did the same - a move's own stat change now happens even when the hit knocks the target out, so a Draco Meteor that KOs still leaves the user at -2 Sp. Atk - moves with no meta block at all (Make It Rain, Armor Cannon, Headlong Rush) applied no stat change whatsoever; they now drop the user correctly Also corrected along the way: status moves no longer bounce off type immunities, so Encore, Yawn and Perish Song work on a Ghost and Confuse Ray works on a Normal type. Electric and Poison status moves still respect it. A simultaneous double faint now names one winner consistently. 156 tests pass, 63 of them new. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017SGWh8kJjQsy4QB9pigonf
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.
From Joseph's feedback after playing the sim: moves that charge or spread their effect over several turns were missing, and stat drops weren't always going to the right Pokémon.
1. Anything that takes more than one turn
All of it curated, modeled and tested — nothing guessed at:
Every counter now ticks in one documented place (
endOfTurn), in a fixed order — a Pokémon on 4 HP with a burn and a Wish incoming lives or dies on it.2. Stat changes on the right Pokémon
Three real bugs, all in the same place:
"damage+raise", but the baked data spells it"damage-raise". So every self-boosting damaging move was buffing the opponent — Power-Up Punch raised the foe's Attack, and so did Meteor Mash, Metal Claw, Flame Charge, Charge Beam, Ancient Power, Steel Wing, Diamond Storm and Fiery Dance.Verified against the real baked dex: Draco Meteor/Overheat drop the user's Sp. Atk, Close Combat/Armor Cannon drop the user's defences, Power-Up Punch raises the user's Attack, and Snarl/Mystical Fire/Eerie Impulse drop the target's Sp. Atk.
Also corrected
Status moves no longer bounce off type immunities — Encore, Yawn and Perish Song work on a Ghost, Confuse Ray works on a Normal type. That gate is for attacks; only Electric and Poison status moves respect it. And a simultaneous double faint (very reachable now Perish Song exists) names one winner consistently instead of leaving
state.winnerdisagreeing with the event log.Checks
npm run test:run— 156 pass, 63 of them new, every expected value derived by hand from the formulas before the code was run.npm run build— clean.battle.jsandtypeChart.jsare untouched.ROADMAP.mdrecords what's still deliberately not modeled — contact-triggered items and abilities (which is why Spiky Shield and King's Shield block but don't punish), terrain, and the switch-out timing simplification.🤖 Generated with Claude Code
https://claude.ai/code/session_017SGWh8kJjQsy4QB9pigonf
Generated by Claude Code