Commit Graph

18 Commits

Author SHA1 Message Date
Cathy J. Fitzpatrick
871ed33d78 Fix move choice validation properly
The previous implementation of move choice validation allowed various
checks to be bypassed with crafted /move commands. For example, it was
possible to use arbitrary moves while in the invincibiltiy phase of
two-turn moves:

  http://pokemonshowdown.com/replay/dev-customgamenoteampreview-205

This commit fixes the validation mecahnics.

Compared to the last attempt at this, this commit also properly
handles Hidden Power.
2013-06-10 20:05:38 -06:00
Cathy J. Fitzpatrick
e4b5c92a27 Revert "Fix move choice validation" for now
This reverts commit 59ae64f840.
2013-06-10 19:56:35 -06:00
Cathy J. Fitzpatrick
59ae64f840 Fix move choice validation
The previous implementation of move choice validation allowed various
checks to be bypassed with crafted /move commands. For example, it was
possible to use arbitrary moves while in the invincibiltiy phase of
two-turn moves:

  http://pokemonshowdown.com/replay/dev-customgamenoteampreview-205

This commit fixes the validation mecahnics.
2013-06-10 16:19:37 -06:00
Marty-D
743c85127c Fix Transform.
- Gen 5: User cannot Transform if it or the target is already
Transformed.
- Gens 2-4: User cannot Transform if the target is already Transformed.
- Gen 1: User can Transform in both situations.
2013-06-10 11:52:25 -04:00
Guangcong Luo
f762f34385 Suppress a crash when a user leaves during a switch 2013-06-06 18:41:23 -05:00
Guangcong Luo
f527634692 Suppress an error for a weird race condition 2013-06-03 18:39:05 -05:00
Cathy J. Fitzpatrick
ee0cf88f7c Revert "Correct turn order mechanics"
This reverts commit c21674c835.
2013-06-02 15:15:54 -06:00
Cathy J. Fitzpatrick
c21674c835 Correct turn order mechanics
1) For the purpose of action sorting, a Pokemon's effective speed is
   `speed & 8191`.

2) Trick Room works by replacing a Pokemon's speed by `0x2710 - speed`.
2013-06-02 15:12:59 -06:00
Guangcong Luo
fee174e2a8 Multiline eval
">> " and ">>> " now accept multiple lines. In addition, ">> "
does not broadcast by default.

Their functionality are also available by !eval (which does
broadcast) and !evalbattle, although those are single-line.

While /eval doesn't broadcast, /evalbattle still does because
it's unnecessarily difficult to make simulator processes send
things privately.
2013-05-31 00:10:24 -07:00
Guangcong Luo
af80d6f3d5 Fix singleEvent relayVars 2013-05-29 03:31:47 -07:00
Guangcong Luo
26b527e261 Support NEXT base power modding 2013-05-29 03:06:13 -07:00
Guangcong Luo
9c54ddf05b Fix crash when a battle detects a crash
(Yo dawg, we heard you like... etc)
2013-05-29 02:47:36 -07:00
Guangcong Luo
32312a8468 Fix crash in sendUpdates 2013-05-29 02:20:47 -07:00
Cathy J. Fitzpatrick
3bfb0a46c2 Fix crashes in battles 2013-05-28 19:59:04 -06:00
Guangcong Luo
37ff5a4130 Nicer crash messages 2013-05-28 03:43:52 -07:00
Guangcong Luo
d5ca89b557 Better error handling for battle crashes 2013-05-28 03:18:55 -07:00
Guangcong Luo
84fa2443ec Update crash messages to new protocol 2013-05-28 03:18:55 -07:00
Guangcong Luo
238a709f3b Rename battles.js to battle-engine.js 2013-05-24 20:50:30 -07:00