Commit Graph

585 Commits

Author SHA1 Message Date
Guangcong Luo
b236500fea Fix Struggle/Dynamax interaction
Struggle is now coded as a locked move, meaning you can't use Z-moves,
mega, or dynamax if you're forced to Struggle.

In addition, Dynamax undisables all moves for its duration.

Fixes #6088
2019-12-11 03:41:38 +09:00
Guangcong Luo
b9fb3e3a0a Refactor test formats
`Dex.installFormat` has been deprecated and removed. Formats are now
directly created and cached by our unit test framework. This should
lead to fewer weird bugs.
2019-12-11 03:41:36 +09:00
420Blazeitt
143ea606fd Fix type-changing moves & abilities while Dynamaxed (#6080) 2019-12-11 03:10:38 +09:00
Kris Johnson
89002124b3 Change inheritsLearnsetFrom to inheritsFrom and fix Necrozma-Ultra's inheritance (#6168) 2019-12-10 08:03:49 +04:00
The Immortal
cb01db1eab Fix Body Press mechanics
It should be affected by abilities and items that modify attack, not defense.
2019-12-10 01:34:22 +04:00
The Immortal
3572be0be8 Update forme validation for gen 8 2019-12-07 17:05:49 +04:00
The Immortal
f1530288e5 Move Keldeo-R validation to Obtainable rule
Keldeo-R is not a battle forme and is possible to hack without Secret Sword, unlike most other formes. It should be restricted by the rule that prevents hacks and not the rule that validates battle formes. This is mostly relevant for Hackmons.
2019-12-05 22:36:20 +04:00
The Immortal
4266000df4 Update forme validation
- In gen 8, Silvally is able to enter battles in different types if it doesn't have RKS System (i.e. it doesn't require a Memory).
- In gen 8, formes that transform in battle are no longer able to start in that forme (relevant to BH).
2019-12-05 07:29:15 +04:00
The Immortal
c7bc102c5a Max happiness in gen 8 is 160 2019-12-05 03:01:59 +04:00
Guangcong Luo
eb614e627f Fix switch order
Fixes #6135
2019-12-04 13:36:39 +09:00
Guangcong Luo
fe0d044d2b Fix tests to run on Gen 8 instead of Gen 7 2019-12-04 13:36:37 +09:00
HoeenHero
fe6ee1339f Sort battle actions by order instead of priority (#6143)
This fixes the issues with priority moves in gen 8.
2019-12-04 12:56:50 +09: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
The Immortal
a133a5b28b Fix 4b324e536
This reverts the other changes that were related to that commit.
2019-12-02 18:13:08 +04:00
Kris Johnson
953531cb6f Add inheritsLearnsetFrom property (#6133) 2019-12-02 21:15:48 +09:00
Guangcong Luo
d550bb64d8 Support past-gen-only tracking in minPastGen
This adds new properties `isUnreleased: 'Past'` and
`unreleasedHidden: 'Past'`, which mark a Pokémon or Hidden Ability as
released in past gens, but not in the current gen. This allows them
to be banned in present-gen-only formats, but not in past-gen-transfer
formats.
2019-12-01 20:24:52 +13:00
Guangcong Luo
d5b4b7964e Fix mega evolution priority move interaction 2019-12-01 20:08:25 +13:00
Guangcong Luo
2c95b17e98 Improve debugging support
We have a new command:

`./pokemon-showdown simulate-battle --replay`

which will extract the omniscient log from an input log.

Remember: debugging is as easy as running `simulate-battle` and pasting
an input log. `--replay` will just make the output easier to read.
2019-12-01 19:38:51 +13:00
YaBoiJD
546065a10d Update National Dex Mechanics (#6108)
Pokemon that are holding an Item that enables Mega Evolution, Primal Revision, or the use of a Z-Move cannot Dynamax. A Rayquaza that can Mega Evolve also cannot Dynamax.

Also fixes an alias loop with the national dex format/ruleset.
2019-11-30 14:50:09 -05:00
urkerab
2e85e8afe1 Only in Gen 7 can level-up moves be relearned at any level (#6114) 2019-11-30 04:20:25 +04:00
urkerab
5d97111f34 Initialise the m property on Pokemon earlier (#6097) 2019-11-30 10:16:18 +13:00
HoeenHero
7957e74b75
Dynamic speed updates for Gen 8 (#6100)
In Generation 8, a Pokemon's speed updates dynamically. Meaning that it can move sooner than expected if its speed is modified by something such as tailwind or swift swim. This is different from past generations where the Pokemon's updated speed would only take effect the next turn.
2019-11-28 17:08:58 -05:00
Spandan Punwatkar
0e8ee00acb Add Eternamax forme for Eternatus (#6081) 2019-11-28 12:24:47 -05:00
Spandan Punwatkar
b6b66de896 Update Repo Links (#6102) 2019-11-28 12:47:38 +04:00
Guangcong Luo
c26d6c313b
SIM-PROTOCOL: Document -block 2019-11-28 10:42:54 +13:00
Spandan Punwatkar
599a6e39fc Add some Gen 8 aliases (#6069) 2019-11-27 18:57:17 +13:00
The Immortal
6018270cbc Dex: Identify Galar Darmanitan as gen 8 2019-11-26 23:38:11 +04:00
HoeenHero
b2625ed70c Remove formeLetters
We don't use these at all currently and they are starting
to overlap. As discussed at the start of Gen 8 development
were removing them now.
2019-11-26 13:26:17 -05:00
HoeenHero
44a7fa0946 Make Dynamax checks more dynamic
Specifically we now check the battle.canDynamax method when
notifying a player about their pokemon's eligibility to dynamax.

This enforces the fact that pokemon that are transformed into
dynamax ineligible pokemon cannot dynamax themselves.

As a result of this change the pokemon.canDynamax flag is unnessecary
and has been refactored to a side.canDynamax flag. All pokemon specific
dynamax checks should use the battle.canDynamax method.
2019-11-26 13:05:38 -05: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
Guangcong Luo
a9e1ec8487 Implement a default zMovePower
Like gmaxPower, Z-move powers mostly follow a formula, which can be
applied to newer moves.

(In the future, we can save some bytes by not listing the powers.)
2019-11-25 15:26:36 +13:00
subash955
bee1be1f45 Validator: Ignore Nature restrictions in Gen 8 (#6048) 2019-11-22 12:47:26 +13:00
whales
9e454e3ea6 Mark double iron bash as gen 7 (#6042) 2019-11-21 13:47:08 +04:00
Guangcong Luo
65b17bc669 Properly fix Speed after Dynamaxing 2019-11-21 11:59:12 +13:00
Kris Johnson
8370c488ce Fix the evolution method of new Pokemon (#5982) 2019-11-20 21:44:16 +13:00
Guangcong Luo
18dab87d6b Fix Dynamax move targeting in Doubles 2019-11-20 21:28:51 +13:00
Guangcong Luo
621d55646a Don't change Ability for temporary forme changes
Fixes #6025
2019-11-20 20:23:05 +13:00
Guangcong Luo
b02e91f393 Lose Choice Scarf Speed on first turn of Dynamax
Fixes #6008
2019-11-20 19:53:32 +13:00
Christopher Monsanto
b90475a257 Don't allow Darmanitan-Zen-Galar in previous gens (#6022) 2019-11-20 04:56:00 +04:00
The Immortal
426c013cae Add Gmax events 2019-11-20 03:04:16 +04:00
420Blazeitt
9ed1dec6bf Fix Max Move effects not activating against substitute (#5997) 2019-11-19 17:17:52 +13:00
The Immortal
e7cece5282 Add minSourceGen field to Formats 2019-11-19 03:12:22 +04:00
HoeenHero
d864c798e2 Fix Giantamax 2019-11-18 07:44:29 -05:00
The Immortal
7a3cd9d078 Restrict SwSh metagames to Galar learnsets 2019-11-18 00:22:36 +04:00
Guangcong Luo
6de97db219 TypeScript event handler types 2019-11-18 07:02:32 +13:00
Guangcong Luo
2601450517 Fix Ice Face 2019-11-18 06:23:24 +13:00
Russell Jones
b2e9336c32 Fix Gmax powers (#5985) 2019-11-17 20:14:10 +04:00
HoeenHero
b65826b94e Gigantamax support 2019-11-17 08:00:22 -05:00
Guangcong Luo
4fc49bc7f9 Fix Body Press
Fixes #5975

Fixes #5979
2019-11-17 18:47:16 +13:00
Guangcong Luo
2b55bde8af Output Dynamax to inputlogs 2019-11-17 13:10:43 +13:00