Commit Graph

387 Commits

Author SHA1 Message Date
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
Konrad Borowski
a97b879e2d Prevent using Leppa Berry from triggering Endless Battle (#5158)
Previously, using Leppa Berry by itself caused Endless Battle Clause
to consider Pokemon to be stale. However, it is reasonable to use
Leppa Berry without an intent to cause an endless battle - for
instance to increase the PP of a move with a low PP.
2019-02-15 17:43:19 -06:00
Guangcong Luo
b498bb222c Require object literal method shorthand 2019-02-11 18:14:09 -06:00
Russell Jones
e4923a08d5 Use more accurate multiplier for Big Root (#5120) 2019-01-25 10:39:58 -05:00
Marty-D
5d06968819 Release Custap, Enigma, Jaboca, Micle, and Rowap Berries 2019-01-08 08:25:57 -05:00
Alexander B
eecde00ed3 Fix Leppa Berry (#5025) 2018-12-14 01:12:41 -06:00
Guangcong Luo
877c9feeeb Fix onEffectiveness event signature
I fixed `onAfterSubDamage` in the previous commit, but this one I left
for later.
2018-12-08 22:52:59 -06:00
Guangcong Luo
c752b327ca Fix no-target charge moves 2018-11-27 23:25:29 -06:00
Guangcong Luo
37a5cf25cc Fix Power Herb animation 2018-11-19 17:20:55 -06:00
Quinton Lee
94016f6218 Update Typescript to 3.1 (#4879) 2018-10-05 04:02:54 -05:00
Guangcong Luo
2c15a1663a
BrightPowder -> Bright Powder
Fixes https://github.com/Zarel/Pokemon-Showdown-Client/issues/1142
2018-09-01 04:09:35 -05:00
Marty-D
21cf8fbab0 Descriptions: Change "Ability [name]" to "[name] Ability" 2018-08-25 12:56:23 -04:00
Marty-D
ac71237de1 Gen II-III: Fix Berry usage timing 2018-08-21 16:36:23 -04:00
MacChaeger
82c792f82c Update to TypeScript 3.0.1 (#4710) 2018-08-07 03:27:28 +09:00
MacChaeger
08ba5bc831 Make formeChange handle relevant messages and ability changes (#4654) 2018-05-23 19:55:05 -04:00
Marty-D
8a6ef0d792 Implement Metronome item slightly less incorrectly
This is still wrong because spamming a Fire attack in Primordial Sea
should not boost damage, but then you run into the problem of boosting
multiple times against multiple targets.
TODO: fix this
2018-05-14 09:50:27 -04:00
Marty-D
d110807efd
Fix Mystery Berry message 2018-05-14 13:31:48 +00:00
Marty-D
f79a889e84
Fix crash in Mystery Berry 2018-05-14 13:24:57 +00:00
Marty-D
2d40904573 Fix some item sprites 2018-04-25 08:50:55 -04:00