Repository navigation
Many more abilities and items, and searchable pickers for both - #10
Merged
Merged
Conversation
Joseph pointed out that most Pokémon had an ability the sim had never heard of, and that there were only eleven items to pick from. Verified: 25 of the 312 ability slugs in the dex were modeled, and ITEMS was a hand-written list of 11 with no dataset behind it at all. Closes #9. The blocker on the biggest group was move flags. PokéAPI's /move endpoint has no flags block, so the sim had no way to know whether a move made contact — which is why ROADMAP listed Static, Flame Body, Rough Skin, Rocky Helmet and the Spiky Shield / King's Shield riders as all blocked together. Those flags are published elsewhere, so they get baked the same way the dex is: `npm run refresh-flags` writes src/data/move-flags.json once, offline, and data/index.js attaches them to every move object. Nothing new is fetched at runtime. ABILITIES goes from 25 to ~130 and ITEMS from 11 to ~75, under the standing rule: modeled and hand-tested, or not offered. Abilities that genuinely do nothing one-on-one (Pickup, Run Away, Telepathy) are listed with noop: true and grouped as such, which is honest rather than a stub. Mechanics worth flagging for the next person in here: - seenAbility(attacker, defender) is how anything reads the DEFENDER's ability, so Mold Breaker can switch it off. The abilities that punish a move AFTER it lands read foe.ability directly, because Mold Breaker doesn't stop those. - The end-of-turn order gained weather healing/chip, Shed Skin, Hydration and the two orbs. It is still written out in one place and still load-bearing. - Substitute is checked against the ORIGINAL sign of a stat change, then Contrary flips it, then the guard abilities look at what's left. The item and ability pickers now use the same search-at-the-top dropdown as Pokémon and moves, grouped, with each entry's description shown next to it and searchable — typing "burn" finds the Flame Orb. sim.test.js gains 133 tests, every expected number derived by hand. move-flags.test.js guards against a bake that quietly writes an empty file, which would switch Static off without anything else failing.
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.
Closes #9.
Joseph pointed out that not all abilities or items were available. He was right, and by a wide margin.
What was actually wrong
The blocker, and how it got cleared
The single biggest group of missing abilities was contact-triggered — Static, Flame Body, Rough Skin, Iron Barbs, Poison Point, Effect Spore, Tough Claws — plus Rocky Helmet and the punish riders on Spiky Shield, King's Shield and Baneful Bunker.
ROADMAP.mdhad them all filed under one blocker: PokéAPI's/moveendpoint carries no flags block, so the sim had no way to know whether a move touched.Those flags are published elsewhere, so they now get baked the same way the dex does.
npm run refresh-flagsrunsscripts/build-move-flags.mjsonce, offline, and writessrc/data/move-flags.json;data/index.jsattaches them to every move object. Nothing new is fetched at runtime. Ten flags are baked — contact, punch, bite, sound, powder, bullet, pulse, slicing, wind, heal — and each one has an ability or item reading it.What's in now
ABILITIES25 → ~130,ITEMS11 → ~75, under the standing rule: modeled and hand-tested, or not offered.Abilities, by group: weather (Swift Swim, Chlorophyll, Sand Rush, Slush Rush, Sand Veil, Snow Cloak, Sand Force, Solar Power, Rain Dish, Ice Body, Dry Skin, Leaf Guard, Hydration, Air Lock, Cloud Nine); damage (Sheer Force, Tinted Lens, Iron Fist, Strong Jaw, Tough Claws, Sharpness, Mega Launcher, Punk Rock, Reckless, Rock Head, Analytic, Sniper, Super Luck, Serene Grace, Skill Link, Hustle, Compound Eyes, No Guard, Scrappy, Infiltrator, Mold Breaker, Unaware, Defeatist); defence (Fur Coat, Ice Scales, Solid Rock, Filter, Multiscale, Heatproof, Water Bubble, Fluffy, Marvel Scale, Shell Armor, Shield Dust, Wonder Guard); immunities (Lightning Rod, Storm Drain, Motor Drive, Sap Sipper, Earth Eater, Well-Baked Body, Soundproof, Bulletproof, Overcoat); status (Immunity, Limber, Insomnia, Water Veil, Magma Armor, Oblivious, Natural Cure, Shed Skin, Early Bird, Poison Heal, Quick Feet, Unburden); contact (Static, Flame Body, Poison Point, Effect Spore, Rough Skin, Iron Barbs, Aftermath, Gooey, Cursed Body, Poison Touch, Stench); reactions (Moxie, Beast Boost, Defiant, Competitive, Weak Armor, Steadfast, Anger Point, Justified, Rattled, Stamina, Berserk, Download); stat guards (Clear Body, Hyper Cutter, Big Pecks, Keen Eye, Contrary, Simple); turn order (Prankster, Gale Wings, Triage, Stall, Pressure, Unnerve).
Items: all eighteen type-boosting items, all eighteen type-resist berries, plus Muscle Band, Wise Glasses, Scope Lens, Razor Claw, King's Rock, Metronome, Big Root, Rocky Helmet, Heavy-Duty Boots, Bright Powder, Safety Goggles, Weakness Policy, White Herb, Mental Herb, Flame Orb, Toxic Orb, Light Clay, Quick Claw, Black Sludge, Lum Berry, Oran Berry, Shell Bell and the four weather rocks.
Abilities that genuinely do nothing in a one-on-one battle — Pickup, Run Away, Telepathy, the doubles-only ones — are listed with
noop: trueand grouped as "No effect one-on-one". That's an honest entry, not a stub: it's the difference between a Pokémon whose ability does nothing and one whose ability the sim never heard of.Mechanics worth a second look in review
seenAbility(attacker, defender)is how anything reads the defender's ability, so Mold Breaker can switch it off. The abilities that punish a move after it lands — Static, Rough Skin, Aftermath — deliberately readfoe.abilitydirectly, because Mold Breaker doesn't stop those.endOfTurnand still load-bearing.The pickers
Item and ability dropdowns now use the same search-at-the-top component as Pokémon and moves, grouped, with each entry's description shown beside its name and searchable — typing "burn" finds the Flame Orb. The closed button shows the short name and clips; the open list wraps.
Tests
npm run test:runandnpm run buildboth green. 310 tests, up from 177 — 133 new ones insim.test.js, every expected number derived by hand from the formulas, plusmove-flags.test.jsguarding against a bake that quietly writes an empty file (which would switch Static off without anything else failing).Changelog entry added, credited to Joseph. ROADMAP's "still not modeled" list rewritten to say what's actually left.
Generated by Claude Code