Commit Graph

1253 Commits

Author SHA1 Message Date
HoeenHero
5c75f0463c Dont turn status moves into G-Max Moves 2019-11-30 16:55:20 -05: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
420Blazeitt
a10265cb0f Change the current Game Console (#6082) 2019-11-26 16:22:35 -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
TZubiri
68593cd168 Updated dark pranster immunity message for gen 8. (#6041) 2019-11-23 20:38:31 +04:00
Guangcong Luo
744b25935d Dynamax moves are immune to Encore etc 2019-11-21 11:59:13 +13:00
HoeenHero
10b8641465 Correct Max & GMax move targeting 2019-11-20 14:00:04 -05:00
HoeenHero
43b22a04fd Fix dynamax targeting in doubles 2019-11-20 08:55:25 -05:00
Guangcong Luo
0bb2e58efd Fix Dynamax move base power
Dynamax moves now have the correct base power, and now correctly only
deal 25% usual damage against Protect.
2019-11-17 06:32:17 +13:00
HoeenHero
7ac8663556 Add default BP for Gen 8 Max Moves 2019-11-16 09:53:53 -05:00
HoeenHero
fd46616a93 Max Move's categories should reflect the base move 2019-11-16 08:18:56 -05:00
HoeenHero
c7d31804de Fix issues with Max Guard priority 2019-11-15 23:46:43 -05:00
HoeenHero
9e5f325902 Restrict gen 8 legendaries from Dynamax 2019-11-15 22:39:46 -05:00
HoeenHero
9ecbcabee9
Dynamaxing (#5946) 2019-11-15 21:33:10 -05:00
Guangcong Luo
801af59b98 Fix remaining build errors
- Centiskorch was misspelled in formats-data, causing a crash in the
  egg validator

- A few validation errors were due to Gen 6 not inheriting from Gen 7,
  Gen 7 not having a scripts file, and Gen 8 having a gen of 7

- Intimidate (Gen 7) wasn't inheriting from Intimidate (Gen 8), giving
  it no name, causing a few validation errors

  (Technically not a build error, but I also added Keen Eye to the list
  of Intimidate immunities, as reported by SadisticMystic.)

- A lot of tests relied on Teleport always failing; these have been
  switched to Gen 7 or swapped Teleport for Celebrate

- Inverse Mod suddenly stopped working; its implementation was a huge
  hack and I can't figure out what went wrong, so I've switched it to
	using the same system the other mod tests use. It's still a huge
	hack, but I don't have the free time to fix it right now.
2019-11-16 06:08:48 +13: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
urkerab
4ab68a3440 Refactor Toxic from Poison types against semi-invulnerability (#5930) 2019-11-06 19:51:22 -05:00
urkerab
bae434e606 Add a single event for a move's own immunity to a specific target (#5904) 2019-10-24 11:00:28 +10:30
urkerab
5b9d0c8db6 Centralise invulnerability checks for No Guard and Lock-On (#5894) 2019-10-17 22:32:44 -04:00
urkerab
3bfec7bf2f Rename TryImmunity to Invulnerability (#5877)
It's a check for semi-invulnerability rather than any sort of immunity.
2019-10-16 20:12:12 -04:00
Guangcong Luo
92c0011b93 Fix HP Fighting Mega Latias validation 2019-10-15 21:00:40 +10:30
Guangcong Luo
e97bb7462a Fix healing move messages at full HP
Fixes #5885

Fixes #5746
2019-10-15 20:32:32 +10:30
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
Guangcong Luo
0fdaeea3db Fix spread move messages
In certain cases, a spread move that KOed an opponent would send an
incorrect message which could crash the client. This fixes that while
also simplifying the code.
2019-08-28 20:47:15 -05:00
Jacob McLemore
3af1c771c2 Fix Encore + Pledge moves interaction (#5641) 2019-08-01 20:31:38 -04:00
Danofares
5fb57e6cfc Don't show "It's a one-hit KO!" if move did not OHKO the target (#5637) 2019-07-21 08:29:30 -05:00
Guangcong Luo
3db1d9916c Deduplicate Template definition
It turns out Template is the only remotely-easy type to merge the class
and interface for.

The others all have a bunch of event methods which would need to be
redefined on the class.
2019-07-19 18:20:42 -05:00
Jacob McLemore
ed4b027b5b Update ts-ignore comment in Dancer codepath in scripts.js (#5619) 2019-07-16 20:52:17 -07:00
Jacob McLemore
7e4ebe44aa Make moves called by Dancer target properly (#5616) 2019-07-16 21:15:05 -04:00
Marty-D
f65fe2c049 Don't stop moves before the first hit while asleep
The point of this check was to end a multi-hit move if you fell asleep to Effect Spore in the middle of the move, not be applied to every move (i.e. Doom Desire and Future Sight).
2019-06-22 20:38:47 -04:00
Kirk Scheibelhut
db66195c26 Remove additional toID calls (#5503) 2019-05-23 18:11:26 +01:00
Guangcong Luo
01804f988e Fix spread hit animation
Properly fixes https://github.com/Zarel/Pokemon-Showdown-Client/pull/1267
2019-05-16 12:52:13 +04:00
Kirk Scheibelhut
3d24166cdf toId -> toID
Closes #5479
2019-05-12 17:53:01 -07:00
Kirk Scheibelhut
a0734bde6f Redo Endless Battle Clause with a new specification (#5472) 2019-05-07 11:18:06 +09:30
Marty-D
e93686b411 Gen IV: Fix Explosion/Selfdestruct interaction with no target 2019-04-08 17:16:51 -04:00
Marty-D
e5167babcf Fix Jump Kicks against no target 2019-04-08 17:15:05 -04:00
MacChaeger
d3f1161b62 Fix Weakness Policy and Clangorous Soulblaze in doubles (#5389) 2019-04-04 18:51:27 +08:00
Kirk Scheibelhut
272700f2b2 Fix crash from Gen 4 Custap Berry + Trump Card interaction (#5395)
Fixes #5393
2019-04-04 01:20:11 +08:00
Slayer95
6384964a10 Sim: Z Moves may only be disabled when all base moves are (#5387) 2019-03-30 18:14:53 -04:00
MacChaeger
b8aa1048e2 Don't display "But it failed!" on a success (#5386) 2019-03-30 15:38:48 -04:00
Kirk Scheibelhut
19bde75842 canZMove should not be set for disabled moves (#5384)
Fixes #5383
2019-03-31 00:24:56 +08:00
Slayer95
694cd47e7b Fix target resolution (#5363) 2019-03-30 22:34:44 +08:00
MacChaeger
5a4578420b Fix attacks failing if only their effect fails (#5373) 2019-03-29 22:48:15 +08:00
MacChaeger
905ed1e95c Fix multihit moves continuing after a KO (#5360) 2019-03-28 19:02:37 +08:00
Ivo Julca
ac4b94876b Sim: Refactor to use Battle#getAllPokemon() and Battle#getAllActive() 2019-03-26 23:18:19 -05:00
MacChaeger
6adc779a19 Fix doubled recoil (#5358) 2019-03-27 11:15:57 +08:00
MacChaeger
9a7ce3dedf Put side conditions on p1 and p2 in multi battles (#5341) 2019-03-27 11:00:36 +08:00
MacChaeger
860900ac57 Fix AfterDamage event running on secondary effects (#5350) 2019-03-26 15:29:46 +09:00