Commit Graph

145 Commits

Author SHA1 Message Date
Marty-D
b3a20bffcb
Fix build 2019-12-10 16:54:55 -05:00
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
The Immortal
c7bc102c5a Max happiness in gen 8 is 160 2019-12-05 03:01:59 +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
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
5d97111f34 Initialise the m property on Pokemon earlier (#6097) 2019-11-30 10:16:18 +13:00
Spandan Punwatkar
0e8ee00acb Add Eternamax forme for Eternatus (#6081) 2019-11-28 12:24:47 -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
621d55646a Don't change Ability for temporary forme changes
Fixes #6025
2019-11-20 20:23:05 +13:00
HoeenHero
b65826b94e Gigantamax support 2019-11-17 08:00:22 -05:00
HoeenHero
62218ef416 Dynamax is only useable in gen 8 2019-11-15 21:44:44 -05:00
HoeenHero
9ecbcabee9
Dynamaxing (#5946) 2019-11-15 21:33:10 -05:00
HoeenHero
5144fc32d7 Add Gen 8 Abilities 2019-11-15 22:01:54 +13:00
urkerab
61faff236a Transform should copy the target's current weight (#5878) 2019-10-13 05:37:10 +11:00
Kirk Scheibelhut
691cf76de7 Fix EBC for external staleness via consumed Leppa 2019-10-05 15:41:18 -07: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
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
Kirk Scheibelhut
be19918c49 Fix incorrect ability message from Gen 1 Transform (#5518) 2019-06-02 17:05:41 -05:00
Kirk Scheibelhut
db66195c26 Remove additional toID calls (#5503) 2019-05-23 18:11:26 +01: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
Kirk Scheibelhut
49403556d1 getEffectByID (#5475) 2019-05-06 13:05:12 +09:30
Kirk Scheibelhut
10c744f733 Introduce an ID type to sim (#5468) 2019-05-04 13:13:12 +12:00
Kirk Scheibelhut
df3d9b91ef Battle toJSON/fromJSON (#5427) 2019-04-30 14:48:27 +12:00
Kirk Scheibelhut
7e4929a39f Change protocol for '|split' message type (#5331) (#5332) 2019-04-22 09:20:47 +09:30
Marty-D
9428d274cc Gen III: Improve Truant implementation 2019-04-17 16:36:25 -04:00
Marty-D
9b28525f4e Gen III: Correct Truant mechanics 2019-04-15 17:15:51 -04:00
urkerab
0133ba9bd6 Make Pokemon.moves a read only array (#5433) 2019-04-14 23:57:42 +09:30
Guangcong Luo
4c47af28aa Refactor moveHitData
This is actually three refactors:

- swap around thing:slot for slot:thing in MoveHitData
- add Pokemon#getSlot
- remove the ActiveMove class; it's back to being an interface
2019-04-06 19:10:45 +08: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
Slayer95
694cd47e7b Fix target resolution (#5363) 2019-03-30 22:34:44 +08:00
Alexander B
57701a5f04 Refactor OMs to use "m" property of Pokemon (#4957) 2019-03-28 22:28:35 +08:00
Ivo Julca
2747ce61fb Sim: Split Pokemon#nearby(Allies|Foes) feature out of Pokemon#(allies|foes) 2019-03-26 23:18:19 -05:00
Kirk Scheibelhut
9f5a727ad1 Pull Field out of Battle (#5333) 2019-03-23 02:52:12 +09:00
MacChaeger
6ac8266696 Support 4 player battles (#5266) 2019-03-18 13:37:27 +09:00
Marty-D
39a8b4270e Fix Stealth Rock effectiveness during Delta Stream 2019-03-16 14:38:03 -04:00
Kirk Scheibelhut
0e1708bf9f Enable prefer-const and max 120 character lines for .ts files (#5292) 2019-03-16 07:14:04 +09:00
urkerab
2ea89698b0 Run effectiveness events even for string type (#5310) 2019-03-14 20:03:14 +09:00
Kirk Scheibelhut
e634d9a7b9 Cleanup Side & Dex after .ts refactor (#5273) 2019-03-09 10:14:11 -06:00
Kirk Scheibelhut
a8903d2563 Cleanup stat naming and types (storedStats, StatNameExceptHP) (#5274) 2019-03-09 09:53:11 -06:00
Kirk Scheibelhut
91993df916 Continue cleaning up sim/ after .ts refactor (#5267) 2019-03-08 07:29:04 -06:00
Marty-D
f108ec0fba Update Psych Up and Transform interactions with crit rate effects 2019-02-27 12:45:09 -05:00
MacChaeger
16d078265b Run onModifyTemplate on rulesets (#5207) 2019-02-26 19:23:27 -06:00
Kirk Scheibelhut
b09fd63377 Refactor sim/ to be native Typescript (#5210) 2019-02-26 11:03:30 -06:00