Commit Graph

34 Commits

Author SHA1 Message Date
Quinton Lee
55fa6c630e Rulesets: standardize types and names (#2838)
Rules that affect validation are now typed ValidatorRule and rule
names are no longer affected by Tools.getFormat input.
2016-10-12 14:24:53 -05:00
Marty-D
e5aa26028b Gen I, Stadium: Correct drain/recoil after breaking a sub
- Also apply the fix from fc86e0ef0a to
Stadium
2016-05-06 20:43:47 -04:00
Guangcong Luo
cc7ccd2efe Stop unnecessarily calling update()
pokemon.update() used to be called after pretty much everything, but
now that we've refactored pretty much everything out of it, it's no
longer necessary for most of the situations we call it for.

It currently only updates pokemon.speed, so I've renamed it updateSpeed
for clarity.

We now only update pokemon.speed on switch-in, right before the
residual event, and at the beginning of every turn. This gives
something like a 30% speed-up.
2016-02-17 01:07:22 -06:00
Guangcong Luo
2ec179dcae Fix Stadium Substitute detection
No longer leaves an unused variable, and is now better commented.
2016-02-16 01:08:55 -05:00
Konrad Borowski
81f602b8d8 Always use trailing comma for multiline objects 2016-01-01 00:20:07 +01:00
Konrad Borowski
79a5b23f25 Modify data and mods files to follow style rules 2016-01-01 00:18:00 +01:00
Konrad Borowski
133595c70f Fix style issues in mods hidden by ESLint before 2015-12-10 23:14:32 +01:00
Guangcong Luo
3c6909c414 Stop suppressing eslint warning for targetHadSub
This warning is legitimate.
2015-11-07 23:17:40 -06:00
Ivo Julca
7dddb66253 Migrate build system to ESLint
JSHint's ES6 support is shaky, and its development has stalled as of late.
Since ESLint can do by itself both JSHint and JSCS' jobs, this commit replaces them.
Gulp and its related dependencies are also hereby removed.
2015-11-07 21:36:49 -05:00
Ivo Julca
90973d5c0c Style fixes
- Cut down excessive spacing
- Add braces to missing conditionals
2015-11-07 17:08:09 -05:00
Juanma Serrano
c4ac8d6e2f Use strict mode and let and const instead of var
This commit also fixes some duplicated variable declarations.
2015-11-06 21:56:52 -05:00
Ivo Julca
85d92a58f4 Rename validateSet|Team and changeSet: prefix with "on" 2015-08-20 17:24:26 -05:00
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
Guernouille
7addf845ff Full paralysis chance is 63/256
http://datacrystal.romhacking.net/wiki/Pok%C3%A9mon_Stadium:ROM_map#Full_Paralysis_check
2015-07-08 18:29:10 +02:00
Marty-D
29e56b1043 Fix confusion timing after rampage moves
- Gen 1, 2, 5, and 6 cause confusion immediately after the move on the
last turn
- Gen 3 and 4 cause confusion at the end of the turn on the last turn
2015-06-04 09:55:30 -04:00
Juanma Serrano
0f99628d00 Stadium: Apply proper stat modifying mechanics
As gen 1, Stadium has its own stat modifying mechanics.
It's basically an extension of gen 1's, only it changes the approach and runs a recalculation on all changes only for the proper Pokémon.
2015-05-13 10:31:39 +02:00
Juanma Serrano
21b1ee7107 Stadium: Update Standard Clauses 2015-05-12 09:50:56 +02:00
Juanma Serrano
125144e07e Gen 1: Fix self-destructing moves on immunity
Forgot to mention this change for c53d022e4b
2015-05-05 10:48:56 +02:00
Marty-D
c53d022e4b Fix OHKO moves
- Fix Gen 1/Stadium's accuracy and immunity order
- Fix OHKO moves ignoring Phantom Force
- Add OHKO messages
2015-04-30 13:06:45 -04:00
Kevin Lau
b6808d4476 Fix ignoreImmunity crashes in earlier gens
Unlike battle-engine.js, old gens did not check if move.ignoreImmunity was
undefined/false in their getDamage functions, causing crashes when numbers
were passed in to the function.
2015-04-14 15:22:06 -07:00
Kevin Lau
2e56120ad9 Move refactor: affectedByImmunities -> ignoreImmunity
While move.affectedByImmunities was always a Boolean value to denote if
the move was affected by immunities, move.ignoreImmunity can be a Boolean
value if it ignores or is affected by all type immunities, but also can
act as an object such that !!move.ignoreImmunity[type] means it ignores
immunities of that type.
2015-04-08 00:17:12 -07:00
Guernouille
e1a6f6ce94 Acid, Aurora Beam, Bubble and Bubblebeam fix
http://datacrystal.romhacking.net/wiki/Pokémon_Stadium:ROM_map#Acid.2C_Aurora_Beam.2C_Bubble.2C_Bubblebeam.2C_Psychic
Acid, Aurora Beam, Bubble and Bubblebeam have a 33.2% chance to lower the target's stat one level. My apologies for the previous commit.
2015-03-29 13:43:38 +02:00
Juanma Serrano
e8cd499d58 Merge pull request #1651 from Guernouille/patch-2
Acid, Aurora Beam, Bubblebeam Effect chances
2015-03-24 10:22:53 +01:00
Marty-D
ed074532c6 Make sure the flags object always exists 2015-03-21 14:29:07 -04:00
Guernouille
0f751807fa Acid, Aurora Beam, Bubblebeam Effect chances
In Stadium, Effect chance for Acid is 51/256, Effect chance for Aurora Beam is 77/256, and Effect chance for Bubblebeam is 77/256.
2015-03-20 06:45:01 +01:00
Juanma Serrano
d9c367ff65 Fix more Travis Build Errors
Add a spaces after tests.
2015-01-15 09:31:36 +01:00
Joimer
ceda7c5d16 Stadium: Fix Substitute 2015-01-14 21:42:01 +01:00
Joimer
279c1e44a8 Stadium: Re-add Exact HP Mod 2015-01-14 21:39:20 +01:00
Joimer
ded842ef57 Stadium has Team Preview 2015-01-14 21:36:10 +01:00
Juanma Serrano
6b672a1b37 Stadium: Exact HP is always shown for both sides 2015-01-14 17:37:45 +01:00
Juanma Serrano
30614d0c6c Gen 1: Fix Substitute interaction with partial trapping 2015-01-14 13:44:34 +01:00
Juanma Serrano
c72606276b Delete last minute error tab 2015-01-09 10:01:11 +01:00
Juanma Serrano
defedeb162 Implement Stadium format
This commit implements at its full the Stadium format.
Stadium is a half-generation between Gen 1 and Gen 2, widely regarded as a Gen 1 game without the major gen 1 bugs.

The main changes of this game are:
Sleep lasts between 1 and 3 turns.
Hyper Beam does recharge after a faint.
Critical hits happen way less.
Substitute now blocks all status ailments and draining.
It allows tradebacks.
Partial trapping moves miss and stop their duration upon target switch.
Focus Energy actually works.
Stat calculations are done properly, burn and para drop are lost if you lose status.
2015-01-09 09:48:50 +01:00