Commit Graph

770 Commits

Author SHA1 Message Date
Marty-D
192ad88ef9 Fix remaining boost orders
- Magnetic Flux, Shift Gear, Weak Armor
2015-07-25 11:40:36 -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
974ecec510 Fix Curse and V-create boost order 2015-07-24 12:54:28 -04:00
The Immortal
aee36ef6c0 Fix Shell Smash boost order 2015-07-24 19:53:23 +04:00
Kevin Lau
bbec40bff4 Fix Secret Power's short description 2015-07-24 05:22:29 -07: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
1199108fc0 Fix Spite message 2015-07-22 03:38:49 -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
Ivo Julca
40c4c91af6 Fix future move gem boost message 2015-07-19 12:21:14 -05:00
The Immortal
8fb1ffc716 Release Hyperspace moves 2015-07-18 14:28:01 +04:00
Marty-D
f1ae041707 Fix Endeavor showing two failure messages 2015-07-17 21:31:28 -04:00
Kevin Lau
7a5ff2166f Sky Drop always redirects to the correct target 2015-07-16 04:10:05 -07:00
Marty-D
51e9c3d922 Fix Taunt duration on targets switched in during the turn 2015-07-04 22:04:28 -04:00
Ivo Julca
6f9437684a Remove volatiles for Beat Up and Triple Kick after the moves are run 2015-07-02 20:25:17 -05:00
Guangcong Luo
9d79f72418 Merge pull request #1999 from ascriptmaster/move-fixes
Fix Quash interaction with self-switching moves
2015-07-02 07:34:06 +00: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
Kevin Lau
231c2c7443 Simple Beam and Worry Seed reveal the target's ability 2015-06-25 12:29:43 -07:00
Kevin Lau
57a6328bc9 Sky Drop prevents both the user and the target from being dragged out
onSource event handlers only trigger when the event has the Pokemon with
the effect as a source, and doesn't actually track when effectData.source
is used as the event target. This means an onAny event handler is needed
instead.
2015-06-23 11:49:59 -07:00
Kevin Lau
255edab861 Fix Quash interaction with self-switching moves
Give the move demoted by Quash a negative priority when rearranging it in
the queue so that it does not get re-sorted to its original position when
self switch moves run.
2015-06-23 00:52:46 -07:00
Kevin Lau
becc9e659b Update Thousand Arrows' short description 2015-06-21 15:09:00 -07:00
Kevin Lau
3674a03663 Fix Thousand Arrows' interaction with effectiveness commands
Treat Thousand Arrows' effectiveness as if it were the second hit on, but
add a warning to the relevant commands informing the user that the first
hit will have a different effectiveness.

This fixes the crash in /effectiveness and /coverage when Thousand Arrows
is used.
2015-06-21 15:06:27 -07:00
Kevin Lau
04954e965e Use Battle#boost in Belly Drum's Hit handler
This allows for a clean, non-hardcoded interaction with Contrary.
2015-06-18 15:07:11 -07:00
Kevin Lau
242fc01e9b Revert "Belly Drum's boost is inverted by Contrary"
This reverts commit 7e50b02a7a.
2015-06-18 15:01:03 -07:00
Kevin Lau
7e50b02a7a Belly Drum's boost is inverted by Contrary 2015-06-18 14:24:08 -07:00
Kevin Lau
7c8fff4977 Fix Mold Breaker Knock Off with Sticky Hold
Knock Off's function call for target.takeItem was written in such a way
that Sticky Hold could not actively notice and trigger its TakeItem event.
This fixes the function to have the handler called properly.
2015-06-17 15:39:33 -07: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
Guangcong Luo
cf112d1d3c Merge pull request #1945 from Slayer95/jscs-rules
Implement custom JSCS rules to enforce code style
2015-06-13 06:18:24 +00:00
Marty-D
3a8bad7811 Correct message for sub blocking Status moves 2015-06-12 17:43:33 -04:00
Ivo Julca
f18eef39ca Fix Travis build 2015-06-12 03:41:22 -05:00
Marty-D
cbd28a5c7a Show correct message on powder immunity 2015-06-09 17:20:54 -04:00
Kevin Lau
f8d3cb884f Sleep Talk cannot call Belch 2015-06-06 15:34:52 -07:00
Kevin Lau
48a9a91cdf Fix Smack Down and Thousand Arrows' interaction with Fly/Bounce
They were forcing the Pokemon to attempt to use Fly/Bounce again.
2015-06-06 00:47:11 -07:00
Kevin Lau
c74e1b7991 Slightly tweak Misty Terrain
It would have halved damage from Dragon moves against semi-invulnerable
Pokemon if No Guard or Lock On was involved.
2015-06-04 10:10:55 -07: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
Kevin Lau
038d4e91fe Belch cannot be selected if the Pokemon has not eaten a berry
https://www.youtube.com/watch?v=paMtFIVWRkQ&t=6m33s
2015-06-03 20:04:13 -07:00
Guangcong Luo
5be489504d Fix Razor Wind in Doubles 2015-05-29 00:02:33 -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
Guangcong Luo
590ebf9730 Merge pull request #1898 from ascriptmaster/tests
Un-hardcode Rock Head in favor of an onDamage handler
2015-05-26 01:25:06 +00:00
Marty-D
c40fdef413 Remove Yawn tag when the effect ends 2015-05-23 14:48:13 -04:00
Kevin Lau
61996d3f6e Battle refactor: New function isGrounded(), bug fixes
Added BattlePokemon#isGrounded to check for the grounded-ness of a
Pokemon. Also BattlePokemon#isSemiInvulnerable for whether a Pokemon is
in the first turn of a two-turn move that makes them semi-invulnerable.

Fixed Terrain bugs involving Pokemon in a semi-invulnerable state.

Changed OHKO move check to use BattlePokemon#isSemiInvulnerable, fixing a
graphical bug that would display an immunity message when a Pokemon
attempted an OHKO move on a higher-leveled Pokemon that was being held by
the effect of Sky Drop.

Fixed Misty Terrain bug that was causing Rest and the effect of Yawn to
put Pokemon to sleep.

Fixed Misty Terrain bug that was causing Yawn to fail.

Fixed Electric Terrain bug that was causing Yawn to succeed.
2015-05-21 16:54:44 -07:00
Kevin Lau
17724c59f0 Un-hardcode Rock Head in favor of an onDamage handler
Instead of having a hardcode in scripts.js that people needed to
reference, it seemed more intuitive to take advantage of the Damage
event instead, and have Rock Head negate damage within the event.

Fixed a bug in Gen-NEXT Rock Head exhibiting the same behavior that
was causing the original Rock Head + Mummy glitch.
2015-05-21 13:52:02 -07:00
Kevin Lau
12be51b262 Battle refactor: New functions ignoringItem() and ignoringAbility()
BattlePokemon#ignoringItem and BattlePokemon#ignoringAbility are
hardcodedto return true for any situation where pokemon.ignore['Item']
or pokemon.ignore['Ability'] respectively would have been true.
2015-05-18 19:17:41 -07:00
SolarisFox
29b961ff69 Style fix: indexOf() comparisons 2015-05-18 15:55:57 -07:00
Marty-D
5d0beee8ac Fix partial trapping end messages 2015-05-18 15:08:52 -04:00
Marty-D
724ae5e0ea Add Endure activation message 2015-05-17 12:58:23 -04:00
Marty-D
420e3458e7 Fix Aromatherapy's interaction with Sap Sipper 2015-05-16 19:47:37 -04:00
Kevin Lau
54f9383a2c Fix Imprison bugs
Imprison was not blocking moves the turn it was used.
2015-05-14 14:18:41 -07:00
Marty-D
e9057cff4d Fix Perish Song tagging Soundproof Pokemon 2015-05-13 09:40:30 -04:00