Commit Graph

55 Commits

Author SHA1 Message Date
Kris Johnson
d50c8c249b
Add Gen 9 (#8997) 2022-11-17 20:46:29 -05:00
Guangcong Luo
ed454ef76a
Refactor scripts to battle-actions (#8138)
This introduces a new class, BattleActions, available as `battle.actions`,
moving all functions from `data/scripts.ts` to `sim/battle-actions.ts`.

This makes it so that "go to definition" will now work correctly for
functions previously in scripts; we no longer need UnimplementedError,
and there's now a clean conceptual separation between `battle` and
`battle-actions` (whereas the previous distinction between `battle` and
`scripts` was basically nonexistent).

This will be a difficult migration if you maintain a fork with custom
scripted mods. I'm sorry! Migration instructions are here:

https://github.com/smogon/pokemon-showdown/pull/8138
2021-03-28 12:01:38 -07:00
Marty-D
b26b8f6da7 Fix G-Max One Blow / Rapid Flow interaction with protection 2021-03-20 18:04:55 -04:00
Annika
c2e97aaaed
Use optional chaining in more places (#8063) 2021-02-22 11:42:05 -08:00
Leonard Craft III
013dd54d33
Gen IV: Fix Struggle's interaction with Shedinja (#8048) 2021-02-17 09:44:10 -05:00
Marty-D
b7d8802dd6 Correct move data
Fixes #7886
2021-01-08 13:52:48 -05:00
Adam Tran
2c65de1a16
Fix various Future Sight / Doom Desire issues (#7884) 2021-01-07 19:20:30 -05:00
urkerab
80d652d59b Sturdy should trigger before Focus Sash but after False Swipe 2021-01-05 16:58:03 +00:00
urkerab
4192201d60 Pressure should deduct additional PP from Z-moves and Max moves 2021-01-05 13:17:27 +00:00
MacChaeger
bb8aca0905
Fix move-disabling mechanics for Dynamaxed Pokemon (#7853) 2020-12-30 18:08:53 -05:00
Adam Tran
d6e05d0a98
Fix Metal Burst interaction with called moves (#7835) 2020-12-30 14:36:06 -05:00
Adam Tran
674eb1449f
Fix Conversion 2 interaction with called moves (#7813) 2020-12-30 11:50:04 -05:00
The Immortal
fda0ee61f4 Gen 7/6: Implement Toxic accuracy mechanics 2020-12-22 15:50:05 +04:00
urkerab
74ae95a91c
Update accuracy calculation for latest Gen 7 research (#7806) 2020-12-15 18:37:24 -05:00
urkerab
6daa05781b
Protean should affect the victim of Snatch rather than the user (#7768) 2020-12-07 09:43:55 +04:00
Leonard Craft III
12da66fb21
Correct Protean interactions & Gravity-blocked Status Z-Moves (#7729) 2020-11-30 16:30:51 -05:00
MacChaeger
3dfa1bdd91
Fix Emergency Exit/Wimp Out false positives (#7719) 2020-11-24 05:42:55 -08:00
Marty-D
d20e85863a
Fix typo in 6d793f5c37 2020-11-18 09:34:03 -05:00
urkerab
6d793f5c37
Fix Magic Bounce and Rebound protocol messages (#5045) 2020-11-18 04:02:30 -08:00
Leonard Craft III
12c6321c90
Correct multi-hit distribution and confusion odds (#7706) 2020-11-17 19:50:41 -08:00
urkerab
ec8cd25d59
Properly update Diamond Storm boosts for Gen 7 (#7638) 2020-11-12 10:27:18 -05:00
Guangcong Luo
9b5217ab70
Split up dex-data into more files (#7634)
* 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.
2020-11-05 05:00:13 -08:00
Kris Johnson
e5c2616531 Let Rayquaza Mega Evolve in National Dex formats 2020-10-22 22:37:11 -06:00
The Immortal
0901f23ecf Prevent Mega Rayquaza in gen 8 2020-10-23 08:11:16 +04:00
Guangcong Luo
9d87616176
Add more style linting rules (#7537)
* 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.
2020-10-19 02:42:28 -07:00
The Immortal
f893ba8b39 Revert "Fix exploit with Slowbro-Galar and Slowbronite"
This reverts commit 65de865040.
2020-09-24 03:08:52 +04:00
Kris Johnson
65de865040 Fix exploit with Slowbro-Galar and Slowbronite 2020-09-23 17:02:25 -06:00
urkerab
5d714fbb56
Replace @ts-ignore with type assertions or other less unsafe constructs (#7390) 2020-09-19 02:07:48 -07:00
urkerab
90a94bc343
Improve spread damage return value check (#7363) 2020-09-14 17:04:08 -07:00
Kris Johnson
8656d633ac
Format volatiles consistently (#7314) 2020-09-05 08:12:24 -07:00
Mia
deeed6c789
Remove sim/ and data/'s globals (#7091) 2020-08-07 06:44:15 -07:00
Annika
05a9f9a1e5
Minor code quality improvements based on LGTM (#7092) 2020-07-30 14:24:37 -07:00
Guangcong Luo
4d09f7acde Rename more instances of Effect to Condition 2020-07-26 11:26:23 -07:00
Guangcong Luo
2f805c93a2
Remove "Battle" prefix from data exports (#7039)
`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.
2020-07-24 12:42:26 -07:00
Kris Johnson
00b88b521d
Handle Gigantamaxing properly (#7001) 2020-07-23 13:27:42 -07:00
Marty-D
d1e91acb6f
Fix Protean interaction with Sucker Punch
and other assorted things
2020-07-22 12:33:18 -04:00
Kris Johnson
25af31372f
Fix /dt interaction with Galar starters' Gmax moves (#6994) 2020-07-12 23:37:59 -07:00
Jacob McLemore
30e420204a
Fix Fusion Bolt + Fusion Flare interaction when first move fails (#6991) 2020-07-10 16:29:53 -07:00
The Immortal
4769823d25 Revert part of 0e0ad1f3d8 2020-06-29 00:02:34 +04:00
Kris Johnson
0e0ad1f3d8
Fix some National Dex mechanics (#6914) 2020-06-24 15:23:05 -07:00
Marty-D
263380ae03
Fix Gen 8 starters' G-Max Move powers 2020-06-22 18:16:04 -04:00
Marty-D
baed323713
Pass determined priority to Max Moves 2020-06-19 10:39:08 -04:00
Kris Johnson
4156eef05d
Fix various Isle of Armor DLC moves (#6862) 2020-06-18 00:25:26 -07:00
Mia
6839a1f4db
Add a library for utility functions (#6817) 2020-06-09 22:06:43 -07:00
urkerab
32d84a1d1a
Correctly attribute target with full HP (#6807) 2020-06-06 05:11:27 -07:00
HoeenHero
148570ddb5 Fix Emergency Exit Bug
Fixes 0450e8cb65
2020-05-27 10:11:04 -04:00
fart
0450e8cb65
Fix Life Orb + Emergency Exit interaction (#6738) 2020-05-25 14:14:59 -07:00
The Immortal
d085c30856 Fix Struggle recoil under Dynamax 2020-05-13 22:47:24 +04:00
Kirk Scheibelhut
2af7040270
Group zMove and maxMove attributes (#6652)
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.
2020-05-04 20:21:27 -07:00
Guangcong Luo
e20a71206e Fix Struggle recoil rounding in Gen 4
Thanks to DaWoblefet for finding this mechanic.
2020-05-03 16:56:37 -07:00