Commit Graph

754 Commits

Author SHA1 Message Date
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
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
Marty-D
022dc59767 Remove Attract tag when unneeded 2015-05-12 11:05:20 -04:00
Marty-D
a570a29eac Fix Foresight and Miracle Eye interaction 2015-05-11 11:41:52 -04:00
Marty-D
f9bc7594ce Gen II: Stalling moves fail behind a substitute 2015-05-09 12:30:55 -04:00
Marty-D
af280660bb Gen II: Fix Dig and Fly
- Fissure can hit Dig and Whirlwind can hit Fly
- Use BasePower instead of ModifyDamage for doubled power moves
- Also correct current-gen Fly to modify damage instead of base power
2015-05-07 11:09:35 -04:00
Guangcong Luo
4f708b1240 Merge pull request #1849 from ascriptmaster/move-fixes
Refactor disabling moves, other miscellaneous bug fixes
2015-05-05 05:36:06 +00:00
Kevin Lau
0ec4ff912a Battle Engine Refactor: Add a DisableMove event
The intention for this event is to remove the move disabling code away
from ModifyPokemon and to an event that can be run a fewer number of
times. Since the disabledMoves index is used to gray-out moves that cannot
be used, and not for any other purpose, there is no need for the related
code to be run at the ModifyPokemon timing, instead working better as a
once per turn event.
2015-05-04 21:17:00 -07:00
Kevin Lau
8f33492d8b Fix Gravity's interaction with Fly and Bounce
Without removing the 'twoturnmove' volatile, it was forcing Pokemon to
re-select Fly if Gravity was used while the Pokemon was in midair.
2015-05-04 21:16:56 -07:00
Marty-D
6356f1ab33 Fix Rock Head against substitutes 2015-05-03 13:26:20 -04:00
Marty-D
1974360fa8 Fix Feint properly
- Multiple protection effects could be active for the same target
2015-04-29 18:13:09 -04:00
Marty-D
9d0f83ba76 Fix Feint
- All forms of protection can be broken by allies in Gen 6
2015-04-29 17:28:46 -04:00
Marty-D
4570f3b6df Add Lock-On/Mind Reader message 2015-04-28 19:56:55 -04:00
Ivo Julca
00f6c0faf7 Style fixes 2015-04-26 00:26:13 -05:00
Guangcong Luo
e71a287775 Properly show message when status is blocked by Sub 2015-04-25 22:05:42 -05:00
Guangcong Luo
4db053befe Revert "Show fail message when status is blocked by Sub"
This was implemented exactly the wrong way and showed fail messages
in a lot of situations they shouldn't show up, such as when
Close Combat's Def/SpD drops didn't happen.

This reverts commit 1edc40f936.
2015-04-25 21:58:09 -05:00
The Immortal
1edc40f936 Show fail message when status is blocked by Sub 2015-04-17 03:31:30 +04:00
The Immortal
339233c3b0 Fix Me First and Mirror Move against Substitute
Also changed `target` to `pokemon` for Nature Power because it makes
more sense as it targets `self`.
2015-04-17 02:31:15 +04:00