Commit Graph

405 Commits

Author SHA1 Message Date
Guangcong Luo
55cbc52bba Fix bugs with secondary/ability order
Fixes #6346

The `AfterDamage` event has been replaced with `DamagingHit`, which
which happens for damaging moves after secondaries.

The `AfterHit` event has also been moved after `DamagingHit`, to make
sure Knock Off still procs after Rocky Helmet.

`AfterHit` is no longer a valid event on `secondary` and `self` blocks,
because it's meaningless in those blocks, anyway. All `self.onAfterHit`
and `secondary.onAfterHit` handlers have been moved to `onHit`, which
should have the same timing in practice.
2020-02-08 08:07:39 -08:00
The Immortal
e67a55d7ad Macho Brace is available in Sw/Sh 2020-02-07 14:21:36 +04:00
Kris Johnson
d3e266cddd
Fix crash with TRs (#6330) 2020-02-03 00:25:49 -08:00
Kris Johnson
05efe2e011
Add TRs (#6317) 2020-02-02 23:19:45 -08:00
The Immortal
68e0bcb75f Refactor single-use items
This adds a `boosts` property to items that runs in `useItem`.
This allows it to be added to `datasearch` or similar plugins.
The item activation messages are now as accurate as in-game.
The Gem activation message is also consolidated in `useItem`.
2020-01-28 13:21:23 +04:00
The Immortal
8f7df1e5c4 Set Genesect drives as past items 2020-01-18 14:17:12 +04:00
Kris Johnson
d20a46d4c7 Update item sprite numbers (#6276) 2020-01-13 09:23:09 -05:00
Kris Johnson
a97360a966 Slowpoke-Galar can use Eviolite (#6274) 2020-01-10 02:50:12 +04:00
The Immortal
6b2fb44abb Set unavailable fossils as "Past" items 2020-01-07 04:17:29 +04:00
Jacob Ellis Duncan
766dcbc3b4 Update item descriptions (#6211) 2020-01-06 12:00:20 -05:00
The Immortal
1b7c47b6f4 Fix HP healing berries 2020-01-04 02:54:50 +04:00
urkerab
3db3f29a72 Fix fractional priority for Full Incense and Lagging Tail (#6230) 2019-12-30 10:08:22 +09:00
urkerab
7152b42daf Calculate fractional priority once per turn (#6224) 2019-12-27 12:42:34 +09:00
Guangcong Luo
223e2af9fa Fix Custap Berry, Quick Claw, Stuff Cheeks
- Prevent Custap Berry and Quick Claw from activating on switches

- Stuff Cheeks now bypasses Unnerve and Magic Room
2019-12-25 09:42:39 +09:00
Guangcong Luo
a062a6c96e Fix Custap Berry 2019-12-12 18:23:52 +09:00
Guangcong Luo
d91bad3365 Fix Quick Claw 2019-12-12 17:09:17 +09:00
Guangcong Luo
3b86164a77 Fix Quick Claw 2019-12-11 18:12:54 +09:00
Marty-D
1b3e577753 Ensure the Room Service holder is the source of the stat change
This matters for Clear Body, etc.
2019-12-11 02:29:48 +04:00
Guangcong Luo
9b943fb62f Fix Dynamax stat handling
We now track `baseMaxhp`, the pre-Dynamax max HP. We also have a new
function `getUndynamaxedHP` for use by moves that use it (famously,
Endeavor).

- `baseStoredStats` is unused outside of the mouseover stats display.
  I updated its implementation to reflect this.

- Power Construct doesn't have a defined behavior during Dynamax. I
  ended up implementing an approximation of what it should probably do.

- Endeavor, Pain Split, Super Fang, and Nature's Madness now work on
  undynamaxed HP.

- Moves that deal or heal percentage damage now do it based on
  undynamaxed max HP, other than G-Max Finale.

Fixes #6131

Fixes #6087
2019-12-04 09:25:46 +09:00
Kris Johnson
1fe47eabdd Add Utility Umbrella (#6120) 2019-12-01 01:24:25 +13:00
HoeenHero
c0c9bca26b Mark various berries as unreleased in Gen 8 2019-11-26 12:55:49 -05:00
supermii2
cf10a81985 Fix Ice Stone description (#6075)
Description reflects that it can evolve Galarian Darumaka into Galarian Darmanitan
2019-11-26 20:50:25 +13:00
Guangcong Luo
5364c63e23 Introduce item.itemUser
`item.itemUser` replaces `item.zMoveUser`, and is a new field
representing a list of possible users of an item, for items that are
restricted to specific species.

`item.zMoveUser` is a base forme for items that affect every forme, and
a forme name otherwise (forme name is currently only used for
`forcedForme` uses).

Arceus is a weird case. Both generic Z crystals and Plates, while
having unique effects on Arceus, also have effects on other Pokémon.
For this reason, Arceus isn't listed as an `itemUser` of either of
these item types - use-cases that want this should also check
`item.forcedForme`.

This is mostly intended to be useful to move-searching and custom
rules (like NatDex, which will only allow past-gen items associated
with removed species).
2019-11-25 15:26:36 +13:00
PartMan
d9cd828c0a Add Stick / Rename Vice Grip (#6046) 2019-11-24 12:00:42 +13:00
The Immortal
bb370216e0 Set Gems to Past items 2019-11-20 23:23:05 +04:00
The Immortal
ee5103dbf1 Set Blue/Red Orbs to Past items 2019-11-19 21:47:43 +04:00
Guangcong Luo
6de97db219 TypeScript event handler types 2019-11-18 07:02:32 +13:00
Guangcong Luo
cc84d1c4f1 Fix some Z crystals being allowed 2019-11-17 07:26:10 +13:00
Guangcong Luo
5b6771091d Choice items don't boost stats during Dynamax 2019-11-17 07:26:09 +13:00
Guangcong Luo
04799f5c1e Restrict Z-crystals and mega stones to Gen 7 2019-11-16 20:00:53 +13:00
420Blazeitt
84dc57aafe Add Fossils (#5953) 2019-11-16 06:31:47 +04:00
The Immortal
1a90dc71db Fix Rusted Shield/Sword 2019-11-16 01:52:32 +04:00
urkerab
e7aee8d9cc Some fixes to Gen 7 formats data 2019-11-15 22:02:24 +13:00
420Blazeitt
723e256aec Add Gen 8 Items 2019-11-15 22:02:15 +13:00
Guangcong Luo
7a023746ba
Refactor battle.dex out of battle (#5851)
In most other similar systems, like TeamValidator, we use `thing.dex` instead of having it extend `ModdedDex`. Battle has always extended `ModdedDex`, though. This changes Battle to match the others.

This should fix an issue with `Battle.data` not being cached.

This also frees up Battle to extend ObjectReadWriteStream<string> in a future update.
2019-10-06 07:38:08 +11:00
urkerab
948257cce7 Change weight units to hectograms (#5765) 2019-10-03 14:00:16 +10:00
Kirk Scheibelhut
57dd3b527f Add isPokeball field to Items data (#5644) 2019-07-22 16:20:09 -05:00
Kirk Scheibelhut
a0734bde6f Redo Endless Battle Clause with a new specification (#5472) 2019-05-07 11:18:06 +09:30
Marty-D
75b92ab1dd
Fix Eject Button interaction with U-turn/Volt Switch 2019-04-23 16:50:05 -04:00
Marty-D
80619d62a5
Prevent multiple Eject Button activations from a single attack 2019-04-19 11:38:36 -04:00
Kirk Scheibelhut
0efd71dfef Move Data.ActiveMove methods to Pokemon (#5416)
See #5415 for context - having these methods is unsafe and leads
to crashes because not all ActiveMoves are created through the
Data.ActiveMove constructor. Instead of Pokemon, these could
alternatively be static methods on ActiveMove (or the ActiveMove
class could be completely abolished and reverted back to an
interface), but #5415 will deal with ActiveMove long term, this just
fixes the crashes.
2019-04-06 13:14:50 +08:00
MacChaeger
d3f1161b62 Fix Weakness Policy and Clangorous Soulblaze in doubles (#5389) 2019-04-04 18:51:27 +08:00
Slayer95
628f32e8fb Stricter type definitions for dex data (#5375)
BattleStatuses switched to PureEffectData
2019-03-30 22:31:04 +08:00
Kirk Scheibelhut
9f5a727ad1 Pull Field out of Battle (#5333) 2019-03-23 02:52:12 +09:00
Kirk Scheibelhut
03b2c92cb1 Make isNonstandard specify reason for non-standardness (#5330) 2019-03-22 01:49:22 +09:00
Kirk Scheibelhut
4be90a0a28 Cleanup sim/battle.ts (#5325) 2019-03-22 01:25:12 +09:00
Marty-D
17b3c037e1 Add Bottle Caps 2019-02-16 23:29:01 -05:00
HoeenHero
9c9004cacf Fix "Fix terrain seed activation timing (#5163)"
Shouldn't of reverted this so quickly. Credit to the code goes to @MacChaeger
2019-02-16 20:31:07 -05:00
HoeenHero
f8a1612906
Revert "Fix terrain seed activation timing (#5163)" (#5173)
This reverts commit 250955ee68.
2019-02-16 19:46:53 -05:00
MacChaeger
250955ee68 Fix terrain seed activation timing (#5163) 2019-02-16 19:30:00 -05:00