Commit Graph

19 Commits

Author SHA1 Message Date
Guangcong Luo
c8c03ad92d Update Endless Battle Clause
The full description is in the comments of the Endless Battle
Clause entry in rulesets.js.

This update fixes a lot of the issues with yesterday's version.

Also included: A minor refactor of deductPP, which did not need
a success variable.
2015-07-22 03:41:43 -04:00
Guangcong Luo
9bf3517f2e Implement New Endless Battle Clause
The new Endless Battle Clause attempts to ban endless battles by
detecting situations in which a battle could become endless.

This approach bans endless battles without banning Leppacycling.

The exact formulation is:

A Pokémon is considered cornered if:

- it has no available moves other than Struggle
- OR a stale Pokémon used Assist Whirlwind on it
- OR it has been hit by a Struggle from a stale Pokémon on the turn
  it switched in

(at the beginning of a turn, if you have available moves other than
Struggle, you are no longer cornered)

A Pokémon is considered stale if:

- it has gained a Leppa berry through any means besides starting
  with one (including but not limited to Harvest, Recycle, Pickup,
  Symbiosis, Bestow, Thief, Switcheroo, and Magician)
- OR it has been targeted with Fling Leppa Berry
- OR it is cornered and begins a turn with more HP than it the last
  turn it began
- OR it is cornered and begins a turn with as much HP as the last
  turn it began, and was not fully paralyzed, loafing around from
  Truant, or immobilized from Attract
- OR it uses Transform/Imposter against a stale Pokémon

(a Pokémon that becomes stale stays stale for the rest of the match)

If all active Pokémon are stale, the player whose team originally
started with a Leppa Berry loses. If both or neither team started
with a Leppa Berry, the team that had the first stale Pokémon wins.
2015-07-21 06:38:22 -04:00
Marty-D
815f9d8689 Remove thawsUser move property 2015-04-03 15:39:46 -04:00
Marty-D
3742d84f34 Fix thaw mechanics in all gens
- Gen 5-6: Thaw check is skipped when using a self-thaw move
- Gen 3-4: Thaw check happens before a move is used
- Gen 2: Self-thawing does not happen if the move misses
2015-04-03 09:42:08 -04:00
Marty-D
3533a15976 Make sure some Abilities are properly suppressed 2015-03-19 13:43:41 -04:00
The Immortal
272407a19a Fix BeforeMove priorities in old gens
Same order as current gen: ab1e90e478
2015-01-14 18:37:01 +04:00
Ivo Julca
1d95bfbda5 Fix remaining instances of Klutz being ineffective 2014-12-04 23:19:58 -05:00
Slayer95
cc0c856231 Gen 2-4: Users of Mean Look, etc. can Baton Pass the effect 2014-07-15 02:52:37 -05:00
小太
5c8fc7b982 Space after function for anonymous functions 2014-04-22 01:58:16 +10:00
小太
6fb3bc332a Spaces around operators and === instead of == 2014-04-22 01:56:11 +10:00
V4Victini
3176b0f6c2 Trapped status is passable in Gen 4 2014-01-21 10:49:01 -05:00
Guangcong Luo
cca66ef1fe Fix some doubles incompatibilities
Specifically, pokemon.id should never be passed to battle.add()
2013-06-16 03:18:32 -07: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
Marty-D
2515c59e9e Gen IV: Fix Early Bird. 2012-12-02 11:39:28 -05:00
Marty-D
2c6fb63efa Gen IV: Sleep is indeed 1-4 turns.
- tested in HGSS, Emerald, and Stadium 2 so far; same duration for all
2012-12-01 16:27:44 -05:00
Marty-D
d186ef1df4 Partial-trapping duration for Gen IV. 2012-08-29 22:44:06 -03:00
TheImmortal
236dabf074 Gen 4 Sleep mechanics 2012-07-26 20:51:08 +04:00
Marty-D
f70931bf12 Gen IV Magic Guard users can't be fully paralyzed. 2012-07-24 21:25:59 -04:00