Commit Graph

165 Commits

Author SHA1 Message Date
Ivo Julca
a0601bdb73 Add MoveAborted event, to be run when move execution stops on BeforeMove 2016-11-25 15:23:52 -05:00
Guangcong Luo
71249f48fe Make Gen 3 inherit from Gen 4
Due to a quirk of history (namely, programmers having a poor
understanding of the mod inheritance system), Gen 3 inherited from
Gen 5 for a long time, resulting in a lot of duplicate code.

This commit changes up the inheritance system and removes some
duplicate code (specifically, statuses.js and moves.js besides
Metronome and Mirror Move which need more investigation), the rest is
reserved for a future commit.
2016-11-14 09:18:30 -07:00
Marty-D
aac63d3e26 Fix various issues with Bide
Corrects all of the following
Gen 2: lasts 2-3 turns
Gen 3: can't hit Ghosts
Gen 4: can hit Ghosts, stops immediately when the user falls asleep or
becomes frozen
Gens 2-6: Stops immediately when the user is prevented from moving
2016-10-06 21:33:30 -04:00
Marty-D
25ff3aaadc Gen III: Update move descriptions 2016-09-28 16:18:58 -04:00
Marty-D
bc652d4f62 Fix Struggle recoil timing
Fixes #2780
Also fixes a damage rounding issue.
2016-09-24 20:39:45 -04:00
Guangcong Luo
792866e74a Fix Gen 3 Surf
It was previously hitting all adjacent Pokémon instead of just foes.

Closes #2761
2016-09-21 05:09:01 -07:00
The Immortal
59f4202309 Update gen 3 tier list to match Smogon 2016-09-02 01:51:09 +04:00
urkerab
5f8a608270 Quick Claw and Custap Berry should override Stall (#2709) 2016-08-23 10:35:41 -04:00
Marty-D
89ff8f5997 Gen III: Fix Sleep Talk when calling 0 PP moves
Sleep Talk may select a move with 0 PP but will fail to use it successfully.
2016-08-18 10:08:46 -04:00
urkerab
51fab2d10f Fix client-side activation of Aromatherapy and Heal Bell for all gens (#2699) 2016-08-17 22:35:35 -04:00
Marty-D
eb5eb2d234 Gen III: Berry Juice is unobtainable 2016-07-06 20:36:54 -04:00
Marty-D
f74bcee659 Update non-Baton Passable volatiles 2016-05-25 23:21:10 -04:00
urkerab
be0f9d3be2 Show ability activation when it causes an immunity (#2555)
- Also improve `trySetStatus` and `moveHit` implementations
2016-05-22 18:44:54 -04:00
Marty-D
a1d692d508 Update JEREMY event Pokemon 2016-05-15 17:37:47 -04:00
The Immortal
8eafd44b27 Gen 3 formats-data: Only inherit for Pokemon with events 2016-05-10 04:48:14 +04:00
The Immortal
7e33b0a855 Update Pokemon data
- Remove unneeded data
- Remove duplicate events
- Add possibly shiny gen 3 events
2016-05-08 21:27:28 +04:00
The Immortal
a6af8d0c54 Gen 3: Inherit formats-data 2016-05-08 17:04:57 +04:00
mizdra
f262d02c42 Fix recoil in Gen 3-4 (#2461)
* Fix the 1/3 recoil moves in Gen 3-4
* Fix rounding recoil in Gen 3-4
2016-04-18 16:26:54 -04:00
Kevin Lau
1c574c6c55 Critical Hit Ratio refactor: Use an event to modify crit ratios (#2501)
This allows for proper crit ratios when a Pokemon loses/gains an ability,
item, or other effect in the middle of a multi-hit attack.
2016-04-11 21:35:36 -04:00
Guangcong Luo
a4ef6a0680 Fix infinite loop in Gen 3-4 Beat Up 2016-03-16 09:44:46 -05:00
Guangcong Luo
97c21f150c Fix Gen 2-4 Beat Up
- No longer affected by weakness and resistance
- No longer affected by damage modifiers on attacker (Choice Band,
  Huge Power, etc)
- Gen 2-3 now uses Gen 4 Beat Up system
2016-02-16 01:08:54 -05:00
Marty-D
2465c1d5b2 Add more event IV restrictions 2016-01-30 20:10:49 -05:00
Kevin Lau
f9d3692555 ACTUALLY fix Focus Punch in old gens
Returned the wrong value
2016-01-29 22:10:18 -08:00
Kevin Lau
d75d0178ca Fix Focus Punch in old gens 2016-01-29 22:08:50 -08:00
Marty-D
f248d191d5 Add shiny Jirachi, Darkrai, and Shaymin events
- Darkrai and Shaymin could be caught in the wild in Gen 4.
- WISHMKR Jirachi has a very small chance to be shiny (but only 9
possible Natures).
2016-01-21 18:56:33 -05:00
Marty-D
e6d4a48885 Gen III, IV: Fix revealing Natural Cure on fainted Pokemon 2016-01-12 17:59:53 -05:00
Guangcong Luo
d49107cf3a Fix Natural Cure in gen 3-4 2016-01-12 13:29:06 -08:00
Guangcong Luo
69934732ef Merge pull request #2130 from ascriptmaster/move-fixes
Refactor move redirection
2016-01-05 04:06:58 +00:00
Konrad Borowski
81f602b8d8 Always use trailing comma for multiline objects 2016-01-01 00:20:07 +01:00
Konrad Borowski
79a5b23f25 Modify data and mods files to follow style rules 2016-01-01 00:18:00 +01:00
Marty-D
235e470553 Merge pull request #2339 from ascriptmaster/trapping
Trapping refactor
2015-12-28 12:10:52 -05:00
Kevin Lau
567b070cda Refactor trapping mechanics out of ModifyPokemon event
Trapping is now checked within Battle#nextTurn as a new TrapPokemon event.
All relevant abilities/items/moves have been adjusted to use it.
2015-12-21 14:56:22 -08:00
Marty-D
6d6d1724fd Make sure Doom Desire/Future Sight deal direct damage
No more Magic Guard being immune, bypassing Sturdy, etc.
2015-12-15 15:53:11 -05:00
The Immortal
fe33d2c4e5 Update past gen data
This utilizes the new `eventOnly` and `eventOnlyHidden` flags.
`unobtainableShiny` is not necessary for event only Pokemon.

This also includes various fixes such as duplicate events and missing
data entries.
2015-12-12 05:09:11 +04:00
Konrad Borowski
133595c70f Fix style issues in mods hidden by ESLint before 2015-12-10 23:14:32 +01:00
Ivo Julca
47918a6d92 Replace remaining instances of var by block bindings 2015-12-03 19:45:35 -05:00
Guangcong Luo
39281f6995 Fix many bugs in Doom Desire/Future Sight
- Doom Desire/Future Sight now calculate accuracy when hit, not when
  the move is used
- Doom Desire/Future Sight are now limit 1 per defender slot, not 1
  per attacker slot
- Doom Desire/Future Sight in gen 4 and earlier now have their damage
  calculated on use, rather than on hit
- Doom Desire/Future Sight in gen 4 and earlier now deal typeless
  damage, and are not subject to STAB, weakness, resistance, or
  immunity
- Doom Desire/Future Sight in gen 4 and earlier now can't critical
  hit
- Doom Desire is now Physical in gen 3
2015-12-02 00:38:30 -05:00
Marty-D
4d2eda1968 Fix Serene Grace's interaction with Secret Power 2015-11-26 11:45:04 -05:00
Ivo Julca
8619ba2022 Turn on strict mode globally for real 2015-11-08 15:38:15 -05:00
Juanma Serrano
c4ac8d6e2f Use strict mode and let and const instead of var
This commit also fixes some duplicated variable declarations.
2015-11-06 21:56:52 -05:00
Marty-D
0e26fbadaf Gen III: Fix Stockpile 2015-09-07 22:11:15 -04:00
Kevin Lau
cc1f581c90 Refactor move redirection
Implemented a new priorityEvent function that is set to abort when any
event handler returns a non-undefined result, unlike runEvent which waits
until all event handlers have run. Set RedirectTarget to use this event.

Changed ability/move priorities for RedirectTarget handlers to fit under
this new paradigm.

Added new Lightning Rod and Storm Drain tests to ensure proper behavior.
2015-08-26 20:22:28 -07:00
Marty-D
d7d9c7c067 Gen III: Fix Weather Ball damage categories 2015-08-10 21:10:22 -04:00
Marty-D
b77e3795b5 Gen III: Reset sleep's skippedTime counter properly 2015-07-19 12:21:04 -05:00
Marty-D
c85622391f Gen III: Fix sleep count interaction with Sleep Talk/Snore
- Basically, a counter separate from the sleep counter starts at 0, and
attempting to use Sleep Talk or Snore while asleep increments it by 1.
- If the Pokemon attempts to use any other move while asleep, this
counter is reset to 0.
- If the Pokemon switches out while asleep, the current value of the
counter is added to the sleep counter.
2015-07-07 20:30:39 -04:00
Marty-D
0739d7eea5 Gen III, IV: Fix Taunt 2015-07-05 13:40:30 -04:00
Ivo Julca
f18eef39ca Fix Travis build 2015-06-12 03:41:22 -05:00
Marty-D
29e56b1043 Fix confusion timing after rampage moves
- Gen 1, 2, 5, and 6 cause confusion immediately after the move on the
last turn
- Gen 3 and 4 cause confusion at the end of the turn on the last turn
2015-06-04 09:55:30 -04:00
Marty-D
aab6d24bb2 Correct a few "events" from Pokémon XD 2015-05-29 14:27:00 -04:00
Marty-D
4749def28b Add Johto starter prizes from Pokémon XD 2015-05-29 11:58:59 -04:00