Commit Graph

27 Commits

Author SHA1 Message Date
Cathy J. Fitzpatrick
bd681a1193 Fix interaction between Safeguard and Confusion
Safeguard was failing to block Confusion because the Confusion
`onStart` function did not pass a `target` and `source` to `runEvent`
when invoking the `TryConfusion` event, and Safeguard's
`onTryConfusion` function requires that a `target` and `source` be
specified.
2013-02-04 17:25:05 -07:00
Marty-D
36dae6f2c2 Add messages for partial-trapping moves. 2013-01-27 20:19:56 -05: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 Fitzpatrick
03d9da0d5b Use this.effect for constant effect property. 2013-01-15 22:56:45 -07: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
acbeada910 Fix Magic Guard 2013-01-11 22:51:22 -08:00
Guangcong Luo
78ab5811e9 Fix calling+rampage moves
(things like Assist+Outrage)
2013-01-05 13:57:12 -08:00
Guangcong Luo
cdd3af07c1 Implement Safeguard preventing confusion 2013-01-02 07:59:38 -08:00
Guangcong Luo
7ed88a77a3 New seasonal ladder: Winter Wonderland 2012-12-14 14:44:55 -08:00
Marty-D
95a002fee5 Revert Outrage fix.
- Outrage is supposed to be able to confuse while asleep, as long as the duration would have ended the turn of attempted use anyway, much like Protect + Outrage. Also this breaks the game.
2012-12-05 10:35:50 -05:00
Guangcong Luo
df4939b84d Fix Outrage/etc confusing while asleep 2012-12-05 04:04:34 -08:00
Marty-D
487c34f02e Fix Early Bird. 2012-12-02 11:34:46 -05:00
Guangcong Luo
5d6544724b More doubles fixes:
- status is applied to the right pokemon
- active pokemon can't be switched in
- don't prompt a switch if there's nothing to switch to
2012-11-28 20:52:42 -08:00
Marty-D
a56f4128b3 Remove Outrage lock if the user falls asleep. 2012-10-19 17:17:05 -03:00
Bill Meltsner
9d92f920cc "Fix" burn to not halve the damage of fixed-damage moves.
A proper fix requires reworking how we handle fixed-damage moves in general. That'll probably come hand in hand with the revised damage formula.
2012-10-15 09:58:31 -07:00
Bill Meltsner
4ab7cd8059 Burns halve the damage done, not the attack of the user. 2012-10-14 17:14:00 -07:00
Marty-D
5c96fcf73a Fix the partial-trapping duration. 2012-08-29 22:41:33 -03:00
Marty-D
c051a7f06a Fix partial trapping moves.
Thanks, bmelts!
2012-08-23 00:40:18 -03:00
Guangcong Luo
26d9b2c971 Update some remaining code to the new LockMove system 2012-08-12 18:33:33 -07:00
Guangcong Luo
a0f10fe811 Two-turn move bugs: pretty much all fixed 2012-08-12 16:31:06 -07:00
TheImmortal
9c6aa5492c Add cureStatus 2012-07-26 20:48:42 +04:00
Bill Meltsner
ba4148cfc7 Fix two-turn moves (mostly).
Two-turn moves are now controlled by a volatile, twoturnmove, which determines whether a Pokemon executes the charge turn or the move turn of a two-turn move. This handles mechanics like Truant Pokemon being unable to use two-turn moves, as the execution turn is their truancy turn. It also handles various edge cases involving moves that call other moves (e.g. Metronome) and Encore.

These changes add a new event, onChargeMove, in which one can return false to "skip" the charging turn and execute the move in full immediately. For example, Solarbeam returns false in onChargeMove if the weather is sunny, and Power Herb returns false if the Pokemon uses its item successfully. (Actually, those are the only two examples at present.)

This implementation is complete except for one issue, an inversion of a previous problem: whereas before, moves like Assist calling two-turn moves would execute them immediately, now, only the charge turn will be executed, and the Pokemon will not be locked into the move. This is due to be fixed soon.
2012-07-18 21:27:43 -05:00
Guangcong Luo
125ede327f Gen next changes:
- several bugfixes and new features
- see GEN-NEXT.md for details
2012-07-06 16:50:20 -04:00
Bill Meltsner
9bbb0b8d56 Convert battles to use the new, cartridge-simulating RNG.
Non-battle randomness is still based off of Math.random().
2012-06-12 03:47:14 -05:00
Bill Meltsner
8f6b7e380c Change the "stall" volatile to work more like the in-game version.
This has the added benefit of not using Math.pow anymore.
2012-06-11 22:22:39 -05:00
Guangcong Luo
7009b3a4bb Revert bmelts's hasty porting of Id etc to Sugar.js extensions
- The reverted utility functions, toId/toUserid/sanitize/clampIntRange, were designed to handle unsanitized data gracefully
2012-06-08 15:44:49 -07:00
Guangcong Luo
e73c587e7d Move a bunch of files into data/
also take this opportunity to rename movedex.js -> moves.js
2012-06-08 14:25:45 -07:00