* Megas for All: Minor Ability polish
* Attribute Arena Rock to the proper source
* Don't always animate delayed moves when the user is KOed
* Add visual indicator of which Pokémon currently has Gravitational Pull
* Damage the correct Pokémon with Stealth Rock and G-Max Steelsurge through Gravitational Pull
* Megas for All: Minor Ability polish
* Don't animate delayed moves through Long Whip unless the user is active - it gets very weird if it tries when the user is absent, because most of the animations bring back the user and then it just hangs out indefinitely behind the other Pokémon and... it's very funny but also not correct
* Megas for All: Slate 30 and balance/bugfixes
Adding all four new Abilities from Slate 30 (Pool Floaties, Red Licorice, Stygian Shades and Long Whip), but also fixing issues with various other Abilities, including minor balance changes to Savage, Heavenly Techniques, Body of Water and Forgery, and bugfixes to Forgery (again), Seismic Scream and Settle.
* Megas for All: Slate 30 ability (Long Whip)
This is so convoluted, but it has to be able to stack with itself as many as five times over, so I hope this is okay. Let me know if there's a way to streamline this! (and same for Settle, for that matter)
* Megas for All: Slate 30
* Megas for All: Add slate 30 stones
* Megas for All: Update Court Change
* Megas for All: Add slate 30 Mega Evolutions
* Megas for All: Slate 30 and balance changes
Forgery can no longer fake a Z-Crystal, so the entire section dedicated to making that work is no longer necessary. However, there's a new form of non-groundedness that needs to be added (the new 'poolfloaties' volatile), and I also modified the damage section slightly because Settle and Body of Water have some weird interactions, and this was the best way I could find to handle them with perfect accuracy. (For reference, Settle is meant to use the user's physical Attack stat without actually becoming a physical move for any other intents or purposes, while Body of Water is now about halfway to the Body Press effect but keeps the user's offensive stat changes rather than its defensive ones.)
* Megas for All: Add two new move modifiers
* Megas for All: Add missing trailing comma
* Megas for All: Improve Red Licorice ability
* Update abilities.ts
Okay I do think this was at least part of the problem so I'm gonna address that first
* Update scripts.ts
* Megas for All: Fix Cinccino and Falinks
Just fixing two minor errors that came up since the last time I touched this patch
* Update data/mods/megasforall/abilities.ts
Co-authored-by: Annika <annika0uwu@gmail.com>
* Megas for All: Define bladeMoves only once
(okay I was so tired when I worked on this code and I'm actually very embarrassed to see that there are three of these in quick succession and I only changed two of them ._.
so uh! clearly Annika's suggestion not to define it three separate times in the first place is the right call XP)
* Update data/mods/megasforall/abilities.ts
Co-authored-by: Annika <annika0uwu@gmail.com>
* Update scripts.ts
* Megas for All: Abilities for slate 31 and bugfixes
* Revise some shortDescs so they can fit better
* Accommodate for Illusion in some messages (previously, they gave away the Pokémon's real name)
* Revise Forgery (again) - it can no longer copy Mega Stones, and it no longer wears off when the user is hit
* Improve the functionality of Clairvoyance (for consistency with Future Sight and other delayed moves)
* Preserve type change indicators for SOS and Stance Change (established convention is for every Mega in the mod to have these regardless of whether it has changed type, but they disappear when changing form)
* Make sure Sticky Gel doesn't ignite more than once at a time (has been happening)
* Add an activation message to Stygian Shades to reduce confusion
* Overhaul Long Whip (now compatible with the varying base powers of Triple Axel and Triple Kick; now decides accuracy at the start and guarantees that every subsequent hit will land; now persists after the source faints and behaves more similarly to other delayed moves)
* Add new Abilities from slate 31, the very over-the-top complicated Gravitational Pull and the refreshingly simple Chakra Lock
* Megas for All: Improve functionality of Long Whip
* Megas for All: Slate 31
* Megas for All: Slate 31 stones
* Megas for All: Slate 31 compatibility
Modify all entry hazards to account for Gravitational Pull and Triple Axel and Triple Kick to account for Long Whip
* Megas for All: Add slate 31 forms
Add Mega Torterra, Mega Infernape and Mega Empoleon and revise Mega Zoroark's stats
* Megas for All: Slate 31 moves and balance changes
* Megas for All: Minor Ability corrections
* Megas for All: longWhipBoost
* Update moves.ts
* Megas for All: Fix Long Whip
* Megas for All: Fix Alchemist
SHOOT sorry I skipped over this
Meant to do it in the same commit
That was just a copying error
* Apply suggestions from code review
Aaaaa thank you so much! ;u;
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Megas for All: Condense Long Whip conditions
WOW this saves so much space I never knew you could do that
* Update conditions.ts
Co-authored-by: Annika <annika0uwu@gmail.com>
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Megas for All: Fix three abilities
This changes Blackmail primarily just to be more realistic, but there are also more important bugfixes to Forgery and Masquerade.
The previous version of Masquerade would activate the acquired Ability twice if, as in the case of Intimidate, it was supposed to activate on entry. This is because the Ability was replaced while the Pokémon was still starting, so it activated once when it was acquired (as it would by Skill Swap) and again as the Pokémon was still "entering." This fix makes it so such Abilities only activate once; it's also much neater and easier to edit than the messy version I had before.
The previous version of Forgery had problems whenever the Pokémon's item was consumed at the same time it was hit with a move; it would replace its item with Zoroarkite, then consume the Zoroarkite and be itemless, which in turn left it unable to activate the Ability.
I fixed this by making it acquire the item later on (after it would be consumed), and I also made the Ability itself check for a specific species instead of a specific item at the start, so it should still function in case Zoroarkite is ever not properly replaced (though it's also way more consistent at that now than before).
Let me know if there's anything else I should change about these! After testing, I think they work a lot better now than before, though. C:
* Megas for All: fix Unaware
The custom Ability Body of Water can give the effect of Body Press to special moves, so Unaware needs to ignore an attacker's Special Defense boosts when being attacked.
* Update data/mods/megasforall/abilities.ts
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Update data/mods/megasforall/abilities.ts
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Update abilities.ts
* Megas for All: Add slate 29 abilities
* Megas for All: Add slate 29 stones
* Megas for All: Add slate 29 forms
(That's a lot of fish)
* Megas for All: Add slate 29 moves
and keep Alolan Dugtrio incompatible with Dugtrionite
* Megas for All: Shorten overlong line
* Apply suggestions from code review
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Correct variable name after code review
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Update formats.ts
Ban Dragonitite in Megas for All in line with latest update
* Update abilities.ts
Megas for All: add slate 28 Abilities (Everlasting Winter, Forgery, Clairvoyance and Sleight of Hand)
* Update items.ts
Megas for All: add slate 28 Mega Stones (Ninetalesite, Zoroarkite and Delphoxite)
* Update pokedex.ts
Megas for All: add slate 29 Mega Evolutions (Ninetales-Alola, Zoroark, Delphox); buff Thievul; add battleOnly for Mega Evolutions with multiple base forms (this was causing issues before)
* Update scripts.ts
Megas for All: add new moves to Thievul, Delphox; add form requirement for Mega Ninetales; add compatibility with Mega Zoroark to Mega Evolution and Z-Move scripts
* Update items.ts
Megas for All: rename Delphoxite -> Delphite
* Update pokedex.ts
Megas for All: rename Delphoxite -> Delphite
* Update abilities.ts
Megas for All: correct line length and trailing spaces
* Update items.ts
Megas for All: correcting species string (caught by npm test)
* Update abilities.ts
* Update scripts.ts
* Update abilities.ts
Megas for All: improve Everlasting Winter
(It feels remiss of me not to specify this - Ninetales gets Rain Dance itself, so it would be awkward if it was that easy to overwrite Everlasting Hail even if no one would do it in a serious environment)
I just tested and can confirm this fix works more properly!
* Update data/mods/megasforall/abilities.ts
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Update data/mods/megasforall/abilities.ts
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
* Update data/mods/megasforall/items.ts
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
Co-authored-by: Kris Johnson <11083252+KrisXV@users.noreply.github.com>
This is required to add support for Stadium in unit tests. A lot of the
codebase assumes that all mods start with "gen" followed by a number,
but I don't want to touch the others at the moment.
Patch notes (2/13/21):
-Prevent Virizion with 1 attack by preventing Coaching from generating with any other setup move.
-Prevent First Impression from generating with any setup move, for Sirfetch'd.
-Reject Protect if Belly Drum is in the movepool but hasn't been rolled, in an attempt to prevent Belly Drum-less Eiscue.
-Fix post-refactor bug causing heavy-duty boots to generate where it shouldn't
-Glastrier: Icicle Crash over Avalanche
-Keldeo: Muddy Water over Hydro Pump and Scald, added Air Slash.
-Regieleki: Electroweb over Eerie Impulse
-Various level balancing. Pokemon above 56.00% win rate nerfed. Pokemon below 46.00% win rate buffed. Highlights: Moltres-Galar, Regidrago, Calyrex-Shadow, Zacian-C down again, Maractus, Toxapex, Shuckle, etc. up. See pull request for full list of level changes.
Gen 7 Random Doubles: Remove Protect from Typhlosion to prevent Choice Scarf Protect.
This PR
- Brings all Random Battles code up to the standard 120-charaacter line length limit
- Improves readability for all Random Battles code
- Refactors current-gen Random Battles team generation to be more modular and readable
Documentation thanks to @ACakeWearingAHat!
- Various movepool improvements
- Prevent Toxic with setup or Trick Room
- Prevent Rain Dance with RestTalk
- Force Seed Flare and Horn Leech
- Reject Keen Eye
- Reject Intimidate so Shed Skin is rolled
- Fix Toxic/Flame Orb selection
- Improve Leftovers and Life Orb selection
- Various movepool adjustments
- Prevent Substitute + Circle Throw (Poliwrath)
- Improve Protect rejection
- Prevent Water Spout outside of Choice sets (Kyogre)
- Prevent Ice Punch with RestTalk (optimizes Throh and Muk)
- Make RestTalk Throh have Guts
- Make Gardevoir have Trace
- Fix Tinted Lens rejection (Venomoth)
- Improve Gem selection with Unburden
- Increase the bulk cut-off for Focus Sash
- Allow Sturdy leads to roll Custap Berry (Golem)
This was a minor mistake when I was writing this thing up. Since Desync Clause isn't something you replicate in RBY, it is more accurate to describe it as a Mod, in line with the ADV Switch thing.
* Split up dex-data over individual files
This commit introduces:
- `dex-abilities.ts`
- `dex-conditions.ts`
- `dex-formats.ts`
- `dex-items.ts`
- `dex-moves.ts`
- `dex-species.ts`
These files centralize definitions from `dex-data` and `global-types`.
* Inherit ItemData from Item etc
Previously, Condition inherited from ConditionData. Now, ConditionData
inherits from Condition. The advantage of the new approach is that now,
Condition and DataCondition no longer need to be separate types, and
there should be much less duplication of type definitions in general.
This has also been done for
- ItemData/Item/DataItem
- AbilityData/Ability/DataAbility
- FormatData/Format/DataFormat
Species and DataSpecies was already merged, but this also reverses
their inheritance (saving a lot of duplicated definitions in the
process!)
The only one left is MoveData, which is just super complicated and
will need its own commit.
Specifically, if you target your ally and your ally uses Ally Switch
(causing you to target yourself), certain moves (including Thunder,
Hurricane, and SSA) crash. This has been fixed.
* Lint arrow-body-style
* Lint prefer-object-spread
Object spread is faster _and_ more readable.
This also fixes a few unnecessary object clones.
* Enable no-parameter-properties
This isn't currently used, but this makes clear that it shouldn't be.
* Refactor more Promises to async/await
* Remove unnecessary code from getDataMoveHTML etc
* Lint prefer-string-starts-ends-with
* Stop using no-undef
According to the typescript-eslint FAQ, this is redundant with
TypeScript, and they're not wrong. This will save us from needing to
specify globals in two different places which will be nice.
This removes Harden from Kakuna and Dragon Rage from Magikarp.
Harden is incompatible with Poison Sting and String Shot, as Kakuna doesn't learn it upon evolving like Metapod.
https://www.smogon.com/forums/threads/random-battles.3526564/post-8577809
Magikarp only gets Dragon Rage via a Japanese event, and since international RBY mechanics are used, it's impossible for this to be used.
As far as I know, these are the only incompatibilities.
We're skipping two major typescript-eslint versions, so there are a
bunch of changes here, including:
- it's catching a lot of things it didn't catch in the past, for
reasons unclear to me
- no-unused-vars has to be explicitly disabled in global-types now
- a lot of `ts-ignore`s were never necessary and have been fixed
- Crashlogger can now handle being thrown things that aren't errors.
This has never been a problem in the past, but to satisfy TypeScript
we might as well not die in a fire on the off chance someone tries to
`throw null` or something.
(The name FormatsData is inconsistent with how we name other things;
especially since it's supposed to be data for a single format. It was
probably originally a typo. -Zarel)
This adds some new `data/text/` files, which are the new home for
item/move/ability descriptions, as well as in-game messages, in one
place for ease of translation.
`BattlePokedex` is now `Pokedex`, `BattleItems` is now `Items`, etc.
I also renamed `Movedex` to `Moves` and `Statuses` to `Conditions`.
`TypeChart` isn't `Types` yet, because unlike the others, it's not
indexed by ID. That should probably be fixed one day.
It's a judgment call that doesn't belong among the other factual
information in `moves.ts`.
The information is still around; in the client's `battle-dex-search.ts`
in `BattleMoveSearch#moveIsNotUseless`. But now it's all in one place.
fb18721e82
This mostly serves to provide cleaner and more consistent field
naming. maxMove currently doesn't have boosts or effects to group
together but who knows what will be thrown at us via DLC, and being
symmetrical with zMoves is a nice.
- `Modded[Effect]Data` are now correctly defined: they must either have
`inherit: true` and be partial, or not have `inherit: true` and be a
complete `[Effect]Data` entry
- `id` is no longer allowed; instead, it's calculated directly from
`toID(name)`. The one exception, Hidden Power, gets a `realMove`
property to track this (it's still used to set `.id`, though;
TODO: really fix it properly).
- `num` is still required in `data/pokedex.ts` (dex number),
`data/moves.ts` (move index number, for Metronome), and
`data/items.ts` (minisprite sprite-sheet location). It's still not
required for mod-only items and moves.
- `num` is no longer allowed for PureEffects (in `statuses.ts`) where
it's always been meaningless.
- `color` and `heightm`, being completely flavor, are still not
required for `pokedex.ts` in mods. They're still required in the base
pokedex.
The whole `checkBattleForme` system, introduced in 4410843e5a
and currently used in Gen 6 and 7, seems to have always been bugged.
As TI mentions in #5970, we already use `getPokemonPool` for alternate
forme handling.
I've replaced it with a roll for cosmetic formes.
As confirmed by SadisticMystic, base power cannot be above 255, so
this move data is clearly incorrect and results in downstream users
of the data files such as the Smogon or PS dex or the tooltips
displaying misleading information.
The server now uses the same approach as the client of treating
cosmetic formes as real formes, as documented in `FORMES.md`.
This eliminates the need for the `.forme` and `.speciesid` properties
of `Pokemon`.
`pokemon.id` has also been removed: useful, since it turns out half
of its uses were bugs that should have used `pokemon.species.id`.
BasicEffect always had a `status` property to support the pattern of
testing it to see if it's a move that sets status directly.
This is just a situation that TypeScript is bad at.
Another possibility would be to set `status: undefined` on PureEffect,
Ability, Item, and Species, but I think that's also ugly. Casting to
Move is probably the best approach, so that's what we do now.
For historical reasons, move property definitions have been very blurry
across `EffectData`. Fortunately, recent refactors have made it
possible to put them all where they're supposed to be.
The data/.ts refactor left a few .js files in, which weren't deleted
between 13 and 3 days ago:
c85f5bccb0
Because of this, the corresponding `.ts` files were considered new,
rather than renamed, and changes to the `.js` files got deleted rather
than merged.
Fortunately, this only affected `moves.js`, which has now been manually
re-merged with the changes.
Bar Fight is supposed to act like Fake Out and only work on turn 1. This line added in this PR was missing from the runMove function, so Bar Fight and Fake Out were usable past turn 1.
Renames:
- .status -> .effect
- .statusData -> .state
- .thing -> .effectHolder
`thing` was always a really weird "I don't know what to call this"
variable name, but it's been renamed `effectHolder`, which should be
much clearer. `status` -> `effect` is I think the last remnant of old
PS code which called all effects "statuses". `statusData` -> `state`,
on the other hand, is the very first step in an initiative to calling
less things "data".
Pokemon that are not available in-game are now consolidated into `isNonstandard`. 'Past' indicates that the Pokemon no longer works in the current generation. 'Unobtainable' indicates that the Pokemon works but can only be obtained through hacking.
Moves that are not available in-game are now consolidated into `isNonstandard`. 'Past' indicates that the item no longer works in the current generation. 'Unobtainable' indicates that the item works but can only be obtained through hacking.
Items that are not available in-game are now consolidated into `isNonstandard`. 'Past' indicates that the item no longer works in the current generation. 'Unobtainable' indicates that the item works but can only be obtained through hacking.
Credit to @lusamine for testing many of these items in Sw/Sh.
dragIn and switchIn being two separate functions is a weird historical
quirk that leads to inconsistencies in implementation.
The only reason they need to be separated is a Mold Breaker quirk:
1da65efb12
(This is now done with an `if` statement.)
This should fix a lot of Roar/Whirlwind mechanics issues from `dragIn`
being on outdated mechanics compared to `switchIn`.
`activeTurns` was previously a horrible hack, used for "first full turn
only" effects like Speed Boost as well as "first move action" effects
like Fake Out.
In addition to being a huge hazard for API users such as OMs, this also
means weird bugs such as Speed Boost not working if you get hit by
Sky Drop on your first turn.
This commit fixes them by splitting these counters into two - an
`activeTurns` counter for Speed Boost, and an `activeMoveActions`
counter for Fake Out.