Commit Graph

136 Commits

Author SHA1 Message Date
Marty-D
8bbeabb1a9 Correct Magic Coat in Gen IV and V.
- Magic Coat can only bounce one move per turn in Gen 4, while in Gen 5
it stays active until the end of the turn.
2013-01-22 15:46:50 -05:00
Marty-D
7490af2692 Fix Swallow healing. 2013-01-21 17:57:12 -05:00
TheImmortal
215cd108ee Fix Relic Song transforming Meloetta twice
- It incorrectly transforms twice in doubles due to being a spread hit
2013-01-22 00:45:29 +04:00
Guangcong Luo
7fa7f24a39 Refactor how stats are calculated
They're now read on-the-fly instead of being recalculated and cached
every update.
2013-01-21 11:49:22 -08:00
Cathy J. Fitzpatrick
6b16dd6139 Fix redirection of randomNormal target moves.
Previously, Follow Me (and anything else that redirects moves, such as
various abilities) was unable to redirect the target of a
'randomNormal' target move, because validTargetLoc() always returned
false for a 'randomNormal' type move; this reflects the fact that the
client is not allowed to specify the target for such a move, because it
is chosen randomly. However, the internal game logic does need to be
able to specify a target for 'randomNormal' moves.

This commit adds a new parameter to validTargetLoc that specifies whether
the proposed target was chosen by the client or by the internal game logic.
If the proposed target was chosen by the internal game logic, then the same
targeting rules apply as in the case of a "normal" target move.

Note that it is necessary to add this new parameter, rather than just making
'randomNormal' behave the same as 'normal', because without the userSelected
check, a user could send a crafted choice string to the server specifying a
target for a 'randomNormal' move, and the server would respect the choice.
This implementation correctly prevents the client from specifying the target
of a 'randomNormal' move.
2013-01-21 00:04:21 -07:00
Marty-D
9e89524d8f Update several move descriptions. 2013-01-18 18:48:22 -05:00
Cathy Fitzpatrick
8f6313a705 This commit makes several changes to Protect and related moves in both
Gen 4 and Gen 5:

1) In Gen 4, the chance of protecting succeeding does not fall below
   1/8, which has now been corrected in this commit. Previously, the
   chance of success in Gen 4 was allowed to drop all the way to
   1/(2**32) as in Gen 5.

   Please see upokecenter for the correct mechanics:
     http://upokecenter.dreamhosters.com/dex/?lang=en&move=182

   For Protect and friends, Smogon currently says that the chance of
   success does not fall below 50%, which is inconsistent both with the
   current Pokemon Showdown! behaviour and with upokecenter. It is
   pretty much certain that upokecenter is accurate here, since it is
   based directly on the in-game data. This commit implements the
   upokecenter mechanics.

2) This commit also consolidates some duplicate code with Protect and
   friends by moving the miss chance logic to an event of the 'stall'
   volatile called onStallMove. This allows me to remove some duplicate
   code from moves.js.

3) Currently, some but not all of Protect and friends have a flag
   called stallingMove set to true. This flag does not appear to be used
   for anything. However, for consistency, I have set it to true for all
   the "stall moves", as opposed to just a subset of them.
2013-01-15 22:33:54 -07:00
Guangcong Luo
d7b28b40ad Fix sometimes incorrect Leech Seed message in doubles 2013-01-14 21:58:10 -08:00
Guangcong Luo
3b69429f3f Fix crash with Beat Up
(it would crash if, in doubles, a Pokemon in slot 2 that was statused
used Beat Up)
2013-01-14 19:18:59 -08:00
Guangcong Luo
4811087267 Screens are less effective in doubles 2013-01-12 15:22:01 -08:00
Guangcong Luo
acbeada910 Fix Magic Guard 2013-01-11 22:51:22 -08:00
Marty-D
ddbd2d37c4 Fix multi-hit moves. 2013-01-08 20:23:21 -05:00
Marty-D
42ef0bb533 Fix Wide Guard. 2013-01-08 15:56:56 -05:00
Guangcong Luo
1a9a836ad9 Fix Rollout and Ice Ball not locking when called 2013-01-05 14:33:59 -08:00
Guangcong Luo
d6aab03fb6 Encore no longer forces retarget in doubles 2013-01-05 13:56:39 -08:00
Marty-D
b0d685be1a Imprison's effect can't be Baton Passed. 2013-01-04 18:53:47 -05:00
Guangcong Luo
cdd3af07c1 Implement Safeguard preventing confusion 2013-01-02 07:59:38 -08:00
Marty-D
c101694d84 Fix Electro Ball's Base Power in Trick Room. 2013-01-01 22:07:41 -05:00
Marty-D
c64d65182d Fix Helping Hand and Sky Drop.
- Helping Hand should work on an ally using two-turn moves.
- Sky Drop should fail on an ally.
2013-01-01 11:37:05 -05:00
Marty-D
2f6abbb384 Make Soundproof block Perish Song again. 2012-12-30 13:26:45 -05:00
Marty-D
7f25f19554 Make sure Status moves can activate certain Abilities behind Subs. 2012-12-29 00:07:33 -05:00
V4Victini
54dd6ff01b Fix GK/LK
Should be >= as opposed to >
2012-12-28 12:01:27 -05:00
Marty-D
c195611628 Fix the 1/3 recoil moves. 2012-12-22 15:27:31 -05:00
Marty-D
703a95fd3a Fix Outrage + Protect. 2012-12-19 20:33:48 -05:00
Guangcong Luo
f30c801ffd Corrections to two-turn moves' accuracy modification 2012-12-17 06:26:28 -08:00
Guangcong Luo
7dbe93dcf2 Implement Snatch 2012-12-14 14:44:55 -08:00
Guangcong Luo
8d5f2884ca Fix Baton Pass circumventing Natural Cure and Regenerator 2012-12-14 06:57:13 -08:00
Guangcong Luo
2db3d66f80 Implement Quash 2012-12-14 02:57:18 -08:00
Guangcong Luo
5922f301c7 Implement Power Split and Guard Split 2012-12-14 02:42:24 -08:00
Guangcong Luo
e68507d627 Implement Follow Me 2012-12-13 16:37:10 -08:00
Guangcong Luo
06ca4132e1 Follow Me only lasts one turn 2012-12-13 05:11:10 -08:00
Guangcong Luo
c5553925d5 Implement Helping Hand 2012-12-12 15:52:05 -08:00
Guangcong Luo
7625846be7 Proper implementation of Follow Me, Lightningrod et al. 2012-12-12 11:55:30 -08:00
Guangcong Luo
722ec91767 Implement Follow Me/Rage Powder 2012-12-12 11:23:38 -08:00
Guangcong Luo
4edd2ddfac Fix the order of selfdestruct, drain, and recoil when used by moves 2012-12-12 10:06:56 -08:00
Guangcong Luo
b614cd6c1d Fix Protect+Outrage crash 2012-12-12 08:19:48 -08:00
Guangcong Luo
ee06de6ce1 Implement Wide Guard 2012-12-12 08:19:47 -08:00
Guangcong Luo
ba510dea75 Doubles! now in beta
- most remaining Doubles issues have been fixed in this commit
2012-12-12 06:52:12 -08:00
Guangcong Luo
8cc7bb5979 New allyTeam targeting for Heal Bell/Aromatherapy 2012-12-07 13:11:51 -08:00
Marty-D
d4d6885a2b New targets for Doubles+. 2012-12-06 19:34:44 -05:00
Marty-D
e91ec51e58 Wonder Room works properly. 2012-11-30 18:28:58 -05:00
Guangcong Luo
2a08c9a2cc Fix some remaining Curse issues
Curse should now KO the user where necessary and fail against Cursed mons again
2012-11-15 19:32:34 -08:00
Marty-D
0302e93226 Add forgotten parts to some move descriptions. 2012-11-14 15:45:30 -05:00
Guangcong Luo
d06be3b172 Slight fix to Curse:
- should fail if not enough HP
2012-11-12 23:32:19 -08:00
Guangcong Luo
dc89148d12 Fix Venoshock to work with toxic poison 2012-11-12 23:23:21 -08:00
Guangcong Luo
828e1e3465 Fix a few more move message bugs 2012-11-10 14:08:42 -08:00
Guangcong Luo
36eb0d27a1 Fix the Perish Song Soundproof visual issue 2012-11-10 11:18:37 -08:00
Guangcong Luo
57e0fbe552 Another ton of placeholder messages
(should be nearly everything in moves.js, besides the perish song immunity)
2012-11-10 02:01:20 -08:00
Guangcong Luo
84e711697c Implement a ton of placeholder messages 2012-11-10 01:24:33 -08:00
Guangcong Luo
5e542b0ae7 Fix Gravity's end animation PEROPERLY 2012-11-10 01:12:58 -08:00