Commit Graph

404 Commits

Author SHA1 Message Date
The Immortal
d1538cfe8a Fix ability activation for primals
Abilities activate if it isn’t Drizzle on Kyogre and Drought on Groudon.
2015-12-29 01:20:07 +04:00
Guangcong Luo
2e7af97262 Fix Primal activation order 2015-12-28 12:16:32 -05:00
Kevin Lau
567b070cda Refactor trapping mechanics out of ModifyPokemon event
Trapping is now checked within Battle#nextTurn as a new TrapPokemon event.
All relevant abilities/items/moves have been adjusted to use it.
2015-12-21 14:56:22 -08:00
Marty-D
23bc05ea61 Add Stance Change animation 2015-12-07 16:48:37 -05:00
Guangcong Luo
2afd1ba636 Fix Mummy message 2015-12-05 02:06:12 -05:00
Guangcong Luo
7536a37dc5 Standardize ability-boost messages
Stat boosts/unboosts caused by abilities now send:

|-ability|POKEMON|ABILITY|boost
|-boost|etc
|-boost|etc
|-unboost|etc

Before, they were pretty inconsistent.
2015-12-05 02:04:01 -05:00
Marty-D
4d2eda1968 Fix Serene Grace's interaction with Secret Power 2015-11-26 11:45:04 -05:00
The Immortal
06fe3f1681 Revert 629f6f381a
Interacts badly with Arena Trap.
2015-11-18 22:22:34 +04:00
The Immortal
629f6f381a Add Levitate activation 2015-11-18 20:10:42 +04:00
Marty-D
81116929d4 Fix Intimidate message on substitutes 2015-11-17 11:06:28 -05:00
Marty-D
a8822423e8 Fix Gooey activation 2015-11-15 21:05:07 -05:00
Ivo Julca
8619ba2022 Turn on strict mode globally for real 2015-11-08 15:38:15 -05:00
Ivo Julca
38eb5d373d Lint: fix variable name collisions in data 2015-11-06 22:31:36 -05:00
Marty-D
5c5d442a40 Fix Dry Skin and Solar Power damage display 2015-10-21 16:28:44 -04:00
Marty-D
3d3938723e Improve support for Ability activation 2015-10-21 09:37:57 -04:00
Marty-D
48e4bc46f3 Apply more accurate modifiers in damage calculations 2015-10-18 21:03:37 -04:00
The Immortal
e2ef6ec36a Random Battle: Modify levels and Ability ratings
- Set Pokemon whose Ability is banned from UU at UU level
- Change weather Ability ratings, primarily to make sure Politoed
always gets Drizzle
2015-10-02 20:29:19 +04:00
Kevin Lau
002ea198f7 Add a source parameter to BattlePokemon#transformInto
This allows it to send a proper [from] tag to the client.
2015-09-14 17:08:27 -07:00
Kevin Lau
489fe131ce Add -ability tag to Imposter activation 2015-09-14 13:25:27 -07:00
Kevin Lau
79732b414e Shield Dust does not block self-boosting secondaries
Refactor TrySecondaryHit to become ModifySecondaries instead to allow for
proper behavior.
2015-09-03 03:10:16 -07:00
Marty-D
1b2e3d415a Fix Zen Mode removal upon fainting 2015-08-20 16:09:16 -04:00
Marty-D
1962a39f33 Merge pull request #2113 from ascriptmaster/move-fixes
Fix Zen Mode interaction with Skill Swap
2015-08-19 16:12:49 -04:00
Marty-D
cf77e666fa Fix race conditions with added flinch effects
- Sheer Force removes secondary effects before King's Rock/Razor Fang
adds the flinch effect to moves, which Serene Grace can then double
2015-08-15 00:09:41 -04:00
Kevin Lau
d629cf2da3 Fix Zen Mode interaction with Skill Swap
If two Zen Mode Pokemon Skill Swap each other, Zen Mode will end.
2015-08-14 18:02:36 -07:00
Marty-D
4743527d93 Fix Forewarn messages 2015-08-11 20:48:43 -04:00
The Immortal
7cd225b266 Update Mummy to use -activate 2015-08-10 06:38:02 +04:00
Kevin Lau
17a3129286 Update messages for Anticipation and Forewarn
Anticipation now activates as an -ability tag.

Forewarn now uses an [of] tag to indicate the given Pokemon, and fixed
Gen 4 Forewarn to not broadcast the Pokemon.
2015-08-03 10:53:21 -07:00
Marty-D
5cb2cf0311 Merge pull request #2074 from ascriptmaster/move-fixes-3
Ice Ball and Rollout do not double BP when hitting multiple times/turn
2015-07-27 16:19:31 -04:00
Rhythms
8183ffe09e Fix Defeatist's interaction with HP
@Marty: please stop believing websites that aren't this one or UPC :/
The description for Defeatist is literally "While this Pokemon has 1/2
or less of its maximum HP, its Attack and Special Attack are halved."
I even looked in-game and it said it was half of lower, and even sites
we shouldn't trush say it's 1/2 or less of max HP.
2015-07-26 21:55:16 -06:00
Kevin Lau
7513362001 Parental Bond does not affect Ice Ball or Rollout
Also, if Ice Ball or Rollout are somehow made to hit more than 5 times
without resetting, subsequent hits should be 30 BP.
2015-07-26 19:58:40 -07:00
Marty-D
192ad88ef9 Fix remaining boost orders
- Magnetic Flux, Shift Gear, Weak Armor
2015-07-25 11:40:36 -04:00
Pikachuun
cf295251a1 Fix Flower Gift 2015-07-24 20:03:25 -04:00
Kevin Lau
0bbd3650b7 Normalize ModifySpe calculations with the other Modify-Stat events
The current implementation of ModifyAtk, ModifyDef, etc. is to pass the
actual stat into the event, have event handlers run battle.chainModify(),
ModifySpe passes in a modifier variable, calls battle.chain(), and then
ends with battle.modify() using the modifier variable. The way chainModify
is implemented within the event system also means that it chains together
modifiers in the same manner and finishes with battle.modify(), meaning
that there is no need for ModifySpe to use battle.chain() and
battle.modify() manually.

This also fixes the effect of BattlePokemon#getStat on stats other than
speed.
2015-07-24 12:19:42 -07:00
Marty-D
112aa72378 Fix Parental Bond with spread moves having only one target 2015-07-24 12:37:53 -04:00
The Immortal
ea546bf8e4 Change Sturdy to use -ability
Relevant:
https://github.com/Zarel/Pokemon-Showdown-Client/commit/a2e9ed70bfa78c26
bfef41d871116455519af04c
2015-07-24 14:23:38 +04:00
Marty-D
21a7fcc8bc Fix Parental Bond interaction with two-turn moves 2015-07-22 22:04:06 -04: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
The Immortal
aa0525f724 Fix Intimidate activation message 2015-07-21 00:06:08 +04:00
Marty-D
fc1268da2e Fix Telepathy's interaction with Bide 2015-07-17 15:52:19 -04:00
Kevin Lau
b0e1fd5789 Fix Pressure's interaction with multi-target moves and Follow Me
Implement new function getMoveTargets to list all move targets given a
user and a move. Refactor Battle system to remove redundancies with
checking move targets. Run the RedirectTarget in this function instead of
later after TryMove, since technically single-target moves changing
targets should occur before the move is attempted.

Refactor the DeductPP event to be a singleEvent that targets the Pokemon's
ability instead of a global event. Run this event on the move's targets as
calculated by BattlePokemon#getMoveTargets.
2015-07-17 01:47:55 -07:00
Kevin Lau
be03f23c78 Replace TryWeather event with battle.suppressingWeather 2015-07-06 17:00:41 -07:00
Kevin Lau
cbef63343a Fix OHKO moves' interaction with accuracy-changing abilities/effects
Add a new event ModifyAccuracy that affects all moves other than OHKO
moves and switched many event handlers that originally used the Accuracy
event to ModifyAccuracy instead.
2015-06-29 17:22:42 -07:00
Kevin Lau
fce231cc48 Various Item removal fixes
Knock Off no longer broadcasts the source so Arceus can knock off a Plate
from a non-Arceus, Genesect can knock off a Drive, etc. Updated Sticky
Hold to check for Knock Off specifically as a result.

TakeItem is no longer suppressed by Mold Breaker, fixing interaction with
Unburden. Updated Sticky Hold to check for Mold Breaker instead.

Items that prevent their own removal do not have that effect negated by
Klutz and other item-negating effects.

Thief and Covet can steal Mail.
2015-06-28 16:53:47 -07:00
Marty-D
d32b69f48d Fix Attract end messages 2015-06-25 12:29:30 -04:00
Kevin Lau
903853d91b Battle refactor: No longer reset negated immunity in pokemon.update()
Replace the pokemon.negateImmunity object with a new `NegateImmunity`
event that handles all the immunity negation.

Also deprecate 'IgnoreEffectiveness' in favor of having relevant moves
and items use `Effectiveness` event handlers instead.
2015-06-16 00:02:06 -07:00
Marty-D
081e288f57 Fix Pledge moves' interaction with redirection Abilities 2015-06-13 12:10:03 -04:00
The Immortal
3e3f2ad7cc Fix Color Change 2015-06-08 00:35:07 +04:00
Guangcong Luo
066b1d6828 Merge pull request #1865 from ascriptmaster/move-fixes
Battle refactor: No longer reset ignore in Battle#update
2015-05-27 01:11:34 +00:00
Guangcong Luo
b7aa629703 Merge pull request #1889 from ascriptmaster/move-fixes-2
Battle refactor: New function isGrounded(), bug fixes
2015-05-26 07:09:19 +00:00