Commit Graph

224 Commits

Author SHA1 Message Date
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
Guangcong Luo
5d3cd8263c More updates to Endless Battle Clause
- Gen 1 PP overflow makes a Pokemon stale
- Staleness warnings now specify the staleness source
- Half-staleness also warns, if another pokemon is already stale

Warning on half-staleness helps remind people who seem to think
they've beaten Endless Battle Clause after 5-ish turns, when it
takes 10-20 turns for some staleness verdics, especially if
there's a lot of switching going on.
2015-07-24 03:33:28 -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
Marty-D
d7ead997a5 Fix Ditto Transformed into Ditto gaining Metal/Quick Powder boosts 2015-07-17 21:57:09 -04:00
Marty-D
c8a63d4e53 Merge pull request #2012 from ascriptmaster/move-fixes-3
Fix OHKO moves' interaction with accuracy-changing abilities/effects
2015-07-01 11:05:00 -04:00
Marty-D
75d94ab935 Correct Mail and Zoom Lens' descriptions 2015-06-30 21:47:49 -04: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
a179b5c37c Clarify description of mostly useless Berries
...and Rare Bone
2015-06-27 16:54:49 -04: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
0fc6807d3a Fix Pledge moves' interaction with Gems 2015-06-13 12:24:01 -04:00
Marty-D
4f006f817d Disambiguate Kee and Maranga descriptions 2015-06-11 23:25:34 -04:00
Marty-D
ec06537531 Fix Kee and Maranga Berries
Who would have thought?
Bonus: Fixes Kee Berry's interaction with Knock Off
2015-06-11 13:25:51 -04:00
Ivo Julca
26680768eb Properly handle failure of multitarget moves
- On failure, they will no longer trigger the `AfterMoveSecondarySelf` event. It was a common pattern to check for success on its handlers, so this removes some duplication.
- All failed moves will now run any set `MoveFail` single events.
- Life Orb will now harm the holder if a successful attack did 0 damage (e.g. False Swipe on a 1 HP target).
2015-06-09 19:31:11 -05:00
Ivo Julca
a231aa9690 Fix Life Orb harming the holder on multitarget moves' failure 2015-06-08 01:43:41 -05:00
Marty-D
ad00529215 Fix Life Orb
- All attacking moves except OHKO moves now take recoil correctly
(except Bide... TODO)
- Thief effects stealing a Life Orb now take recoil correctly
2015-06-07 15:49:38 -04: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
Guangcong Luo
383af9eea1 Merge pull request #1858 from ascriptmaster/move-fixes-2
Fix Rage Powder's interaction with Safety Goggles
2015-05-05 05:39:29 +00:00
Kevin Lau
d287e86b46 Do not consume healing berry if healing is blocked
Fixes behavior between healing berries and Berry Juice with Heal Block.
2015-05-04 21:17:08 -07: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
23a8ebd8eb Fix Rage Powder's interaction with Safety Goggles
Safety Goggles was causing Rage Powder to fail.
2015-05-04 00:22:01 -07:00
Guangcong Luo
54947b665f Merge pull request #1728 from ascriptmaster/move-fixes
Move refactor: moves/items that ignore immunity/effectiveness
2015-04-14 17:05:22 +00:00
Ivo Julca
e6332ff424 Properly do b0e7711 2015-04-11 20:19:52 -05:00
Kevin Lau
628b870b2f Move Refactor: Moves track the type effectiveness of the move
Set up moves to track the type effectiveness of the move for purposes of
'Hit' and 'ModifyDamage' events. This fixes various glitches resulting
from Pokemon with the 'IgnoreEffectiveness' flag set for some types, and
also is a slight optimization because it removes the need to run the
'Effectiveness' event one more time to check effectiveness in the moves.
2015-04-09 01:46:22 -07:00
The Immortal
d4a22bb1e6 Remove isContact property from moves
Use flags instead.
2015-04-03 16:59:53 +04:00
Kevin Lau
b0e7711685 Fix Leppa Berry protocol message
Apparently the move data that stores PP doesn't have a "name" property.
2015-04-01 23:09:02 -07:00
Guangcong Luo
d89a77ac87 Merge pull request #1639 from ascriptmaster/modifypokemon
Weight Refactor: Do not modify weight in ModifyPokemon
2015-03-21 22:38:43 -05:00
Marty-D
ed074532c6 Make sure the flags object always exists 2015-03-21 14:29:07 -04:00
Kevin Lau
b0c2dcde5f Weight Refactor: Do not modify weight in ModifyPokemon
Added a new event, ModifyWeight, to deal with weight changes from items,
abilities, and moves. Add a function getWeight to call the event and
return a Pokemon's current weight.
2015-03-18 18:44:01 -07:00
Kevin Lau
aaea0556f7 Fix Pickup to use correct behavior
Pickup was not retrieving items consumed by allies, was picking up items
from nonadjacent foes, and had a chance of failing to retrieve an item
from a foe if the other one had not used its item that turn. Pickup now
queries all eligible Pokemon before randomly choosing one of the items to
pick up, instead of choosing the target before checking whether it had an
item that could be retrieved.
2015-02-25 20:19:09 -08:00
Kevin Lau
3306b02b48 Fix Unburden/Symbiosis interaction with Natural Gift/Air Balloon/Fling
Switched Unburden's onUseItem handler to onAfterUseItem instead, and set
Natural Gift, Air Balloon and Fling to send AfterUseItem events when the
items are removed. Sending these events also has the side effect of fixing
some of the functionality with Symbiosis not giving items when these moves
consume their items.
2015-02-25 19:23:01 -08:00
Kevin Lau
e27e7de08a Fix Knock Off + Mail interaction
Change Mail's onTakeItem handler to allow Knock Off to remove it using
Battle#takeItem. This prevents Mail from being recycled and lets it
trigger Unburden.
2015-02-25 19:13:36 -08:00
Marty-D
78f5cacd63 Update item descriptions 2015-02-20 18:16:39 -05:00
The Immortal
608ee7af7e Fix Safety Goggles interaction with Effect Spore
This fixes the bug created in 46008ea0a6.
2015-02-09 01:08:22 +04:00
The Immortal
46008ea0a6 Add Safety Goggles message for powder moves 2015-02-08 16:26:05 +04:00
The Immortal
7f9cbf617d Release Custap Berry 2015-02-03 17:11:33 +04:00
Marty-D
245af9721e Fix Mental Herb
- Cures Heal Block in Gen 5 and 6
2015-01-20 20:20:04 -05:00
Ivo Julca
2b5e3bab10 Minor style fixes in data files 2015-01-12 00:11:48 -05:00
Guangcong Luo
80704c272d Merge pull request #1298 from Slayer95/disabled-maybe
Hide moves disabled by Imprison or NEXT's Telepathy
2014-12-10 03:57:30 -06:00
Marty-D
8c2b18c622 Fix forced switch mechanics.
- Red Card and Eject Button do not activate if the holder is being
forced out.
- Circle Throw, Dragon Tail, Roar, and Whirlwind cannot attempt to force
out a Pokemon with no inactive unfainted allies.
2014-12-06 11:53:26 -05:00
The Immortal
d2f5f01830 Soul Dew is released 2014-11-26 01:03:38 +04:00
The Immortal
bcf19608c9 Update Mega Rayquaza
Rayquaza does not have a mega stone; it can mega evolve with the move
Dragon Ascent.
2014-11-21 16:26:56 +04:00
ascriptmaster
c0d2b26a89 Primal Reversion occurs before ability messages activate
Moved primal reversion checks to the SwitchIn event.

Moved the SwitchIn event to properly account for turn order.
2014-11-20 21:06:02 -08:00
The Immortal
579319bc9b Release ORAS megas/primals
The ORAS formats are no longer needed.
2014-11-20 13:52:21 +04:00
Marty-D
e0eff117f3 Add missing item sprites. 2014-11-19 20:40:34 -05:00
The Immortal
8eac7f2e9a Update ORAS mega stones 2014-11-19 13:37:38 +04:00
Guangcong Luo
4bc18009d9 Merge pull request #1315 from ascriptmaster/move-messages
Updated most moves, items and abilities to not use -message tags
2014-11-19 13:51:31 +08:00
ascriptmaster
54fd6f41d3 Updated most moves, items and abilities to not use -message tags
Some gen 1 moves like Dig/Fly, gen 4's Custap Berry, and everything in
NEXT is untouched for now.
2014-11-17 11:25:56 -08:00
Marty-D
fdc3d9f570 Fix several item mechanics.
- Griseous Orb, Plates, Drives, and Mega Stones can no longer be removed
from or given to their respective species by any means
- Mold Breaker and friends can no longer remove a Plate from an Arceus
- The Fling base power for these related items is now defined in Tools,
like Berries
- Sticky Hold works correctly with Bestow, Fling, Knock Off, Switcheroo,
and Trick
2014-11-13 15:51:28 -05:00