Commit Graph

530 Commits

Author SHA1 Message Date
Ivo Julca
8d03df9141 Forbid multiple mega and z-moves on the decider level
- This fixes potential issues in Doubles created by the new turn order mechanics.
- Note that this implementation doesn't impact OMs such as Mix and Mega -at least in Singles.
2016-11-18 20:18:57 -05:00
Ivo Julca
bf04094f08 Update BattlePokemon#formeChange to use Tools#spreadModify 2016-11-18 19:26:54 -05:00
Guangcong Luo
4abd4dac39 Remove Z-Move button from locked moves 2016-11-18 17:19:16 -05:00
Guangcong Luo
847373001d Fix Gen 7 Hidden Power 2016-11-18 13:18:20 -05:00
Ivo Julca
ccccd1afa0 Implement Arceus' type-change immunities into Silvally
Tentative, based on http://www.smogon.com/forums/threads/3586701/page-37#post-7089082
2016-11-18 11:47:08 -05:00
Guangcong Luo
5981e2a78b Stub gen 7 Hidden Power implementation 2016-11-18 03:52:42 -05:00
Guangcong Luo
224cf25e46 Fix bugs in Z-moves 2016-11-18 01:46:56 -06:00
Guangcong Luo
8f7d189838 Implement Z-moves 2016-11-18 02:44:29 -05:00
Guangcong Luo
acfeb39e7e Stub Z-move implementation
This is only the |request| half.
2016-11-17 23:41:11 -05:00
Ivo Julca
a1405e9c43 Gen 7: Turn order is decided by the ability and stats of the mega forme 2016-11-17 21:00:48 -05:00
Ivo Julca
32412e5524 Refactor EV/IV/Nature stat modifiers to Tools#spreadModify 2016-11-17 21:00:05 -05:00
Marty-D
1d9feb363e Implement remaining Z-Moves
- Implement their tentative interaction with protection moves
- Make them unsketchable
2016-11-17 11:06:13 -06:00
Marty-D
5da62651ce Implement more new stuff and remove some TODOs 2016-11-17 11:06:13 -06:00
Marty-D
52184167b7 Implement new moves 2016-11-17 11:06:12 -06:00
Marty-D
83acbc578d Add preliminary Gen 7 changes 2016-11-17 11:06:12 -06:00
Guangcong Luo
c37ee8ccc7 Fix replay reporting 2016-11-06 01:58:40 -07:00
Guangcong Luo
7d8d47c97c Refactor BattleEngine
Battle is now an ES6 class... mostly... it's complicated.

Battle's inheritance system has always been a mess. I tried to redo it
in a sensible way but it caused nondeterministic test failures. Not
even kidding; different things would fail each time I ran tests, even
without code changes. I'll investigate closer later, but this refactor
makes it use ES6 classes with only a small amount of hacking, which is
good enough. It is, at the very least, simpler than the previous mess.

BattleEngine.Battle.construct has been renamed BattleEngine.construct.
2016-10-22 23:11:26 -05:00
Guangcong Luo
47adaf0bde Minor refactor
Chat is now being included in battle processes, because Chat.escapeHTML
is convenient to have and because the recent Chat refactor makes it
relatively lightweight to include (it doesn't load chat commands
unless you call Chat.parse)
2016-10-21 15:47:06 -05:00
Ben Davies
54d0ff203a Performance: replace direct references to arguments with rest parametres (#2818)
Replacing direct references to the arguments object of functions with rest
parametres prevents the function from being deoptimized while still allowing
use of arbitrary arguments. This may also fix some minor memory leaks related
to mishandling the arguments object.
2016-10-04 16:29:14 -07:00
Marty-D
c1430d7c3e Fix information leak with Transform 2016-10-02 09:36:49 -04:00
The Immortal
ed4d8de047 Fix build fail 2016-10-01 19:02:16 +04:00
Guangcong Luo
2157c2d31b Fix crash in battles
escapeHTML is no longer available in battles, so we have to make our
own.

This is very hacky and will be replaced with a better solution.
2016-10-01 07:27:24 -04:00
Marty-D
f5881ee572 Generalize hardcoded list in BattlePokemon#setAbility
Resolves #2790
2016-09-30 20:09:14 -04:00
QuiteQuiet
893cd1a0b5 Send -endability from BattlePokemon#setAbility (#2797) 2016-09-30 12:45:43 -07:00
Bär Halberkamp
37a79be36a Refactor BattlePokemon and BattleSide to use ES6 classes (#2792) 2016-09-28 20:57:13 -07:00
Marty-D
cd9fd01d18 Fix weather-starting mechanics
Permanent weather from Abilities overrides current weather unless it's already permanent.
2016-09-17 10:27:48 -04:00
Taylor Everding
1a1f64fe95 Remove .js extension from requires (#2725) 2016-08-30 00:04:40 -05:00
Marty-D
d76a79f9d2 Fix Wonder Room 2016-08-22 17:11:39 -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
urkerab
d5b985adc5 Make Illusion wear off properly after Ability-ending effects (#2638) 2016-08-11 18:47:58 -04:00
Marty-D
bb0b3e064e Fix Unnerve activation
Fixes #872
2016-08-06 17:54:21 -04:00
Marty-D
06567f8d95 Fix redirection issues with two-turn moves 2016-08-06 14:59:57 -04:00
Ivo Julca
060563495c Notify cancel of battle decisions 2016-08-05 02:19:57 -05:00
Taylor Everding
f6a7c4bd30 Move IPC from battle-engine.js to simulator.js (#2666) 2016-08-04 00:35:59 -05:00
Marty-D
13197e86b7 Fix possible crash on the final turn in Triples 2016-07-22 16:48:24 -04:00
Marty-D
0271c09ce4 Fix Yawn's interaction with other effects 2016-07-20 14:10:35 -04:00
Marty-D
afd549fa17 Fix automatic centering in Triples 2016-07-20 11:27:46 -04:00
Marty-D
86417a7df9 Fix Ability boosting when maxed out 2016-07-09 12:17:38 -04:00
Marty-D
a99bd01cf3 Refactor boosting
- Boosts now show the correct boosting message (i.e. using Swords Dance
at +5 Attack will show the +1 message instead of +2).
- Boosts now show the appropriate maxed out message when a stat cannot
be raised/lowered further, instead of simply failing or failing
silently, unless the boost is an additional effect.
2016-07-06 11:28:06 -04:00
Ivo Julca
6cf6b9d3ea Cancel: Fix revoking decisions
The battle processes are unexpectedly being sent `undo`
details when the cancel command is used.
2016-06-28 00:22:03 -05:00
Marty-D
3acbe0a357 Fix Transform interaction with certain Abilities
- Multitype and Stance Change can be overwritten by Transforming
- The above two and Illusion can be obtained by Transforming
- Fix Stance Change and Zen Mode while Transformed
2016-06-23 17:07:12 -04:00
Ivo Julca
dcd97ce62b Fix spreading of typing information 2016-06-20 12:27:24 -05:00
Ivo Julca
ec572891a5 Fix typing information leak 2016-06-20 11:38:06 -05:00
Ivo Julca
e3c6cbe4b9 Implement partial decisions synchronization 2016-06-20 10:55:26 -05:00
Ivo Julca
59c667337b Refactor Team Preview to support per-Pokémon decisions 2016-06-20 10:49:21 -05:00
Ivo Julca
543bbf5ccc Refactor switching to support per-Pokémon decisions
- Implements `skip` choice, which acts as a placeholder in the player
choices. This is relevant to double-KOs, since in-game you are allowed
to specify switch-ins in any order.
2016-06-19 23:45:57 -05:00
Ivo Julca
8cc635923d Restrict 9b73eae to Doubles/Triples 2016-06-19 08:40:56 -05:00
Ivo Julca
50fcd02b6d Tighten move validation
The target location is checked on chooseMove(), rather than
after the decision has entered the queue.
2016-06-19 07:53:58 -05:00
Ivo Julca
3b1749eccf Add basic support for per-Pokémon decisions
- Basically, support is added only for `move` requests here, and
behind a flag (`battle.supportsPartialDecision`).
- Switching is mostly supported, except for the multiple-KOs case.
- Team Preview needs a rework in order to enable this feature.
2016-06-17 12:26:56 -05:00
Ivo Julca
cc73c34cfa Fix possible out of bounds access in chooseMove()
Making V8 happy
2016-06-17 12:08:39 -05:00