Commit Graph

94 Commits

Author SHA1 Message Date
Cathy J. Fitzpatrick
31fac973e0 Correct trapping mechanics
This doesn't yet handle modded formats that don't validate ability
selection in the ordinary manner. Those formats will continue to work
essentially in the same manner as before, rather than with the correct
mechanics.
2013-04-10 21:19:35 -06:00
Cathy J. Fitzpatrick
cbfc3e5e16 Working implementation of sending exact damage for own pokemon
This isn't as elegant as I might like, but it does appear to work.
2013-04-09 03:46:45 -06:00
Guangcong Luo
d888a75bbe Fix Forewarn message 2013-04-06 15:49:24 -07:00
Guangcong Luo
b7500a375a Make sure ability immunities go last
Specifically, abilities like Lightningrod should activate their
absorption effects after Protect, Magic Bounce, or anything like
that.
2013-04-06 15:22:32 -07:00
Guangcong Luo
2b1a5540ac Fix SR for new move hit system
Specifically, the TryFieldHit event no longer exists.

Instead, Magic Bounce has separate event handlers for TryHit and
TryHitSide.

This also fixes it so Magic Coat/Bounce happen before ability
absoption (like Water Absorb).
2013-04-06 14:35:31 -07:00
Guangcong Luo
7aa1ed7ae3 Order the TryHit event correctly
(This isn't perfect yet; Magic Coat/Bounce uses a different event,
which we'll need to correct later.)
2013-04-06 12:57:16 -07:00
Guangcong Luo
fe2da359e9 Refactor when accuracy is calculated
Accuracy is now checked after immunities and certain other effects,
rather than before.
2013-04-06 12:55:38 -07:00
Guangcong Luo
d91896a106 Fix Rebound
It previously was using an outdated algorithm to determine whether
a move is bounceable.
2013-04-05 16:04:29 -07:00
Cathy J. Fitzpatrick
db8d988d47 Fix some bugs from the HP refactor 2013-03-29 04:31:53 -06:00
The Immortal
0ee5661e1f Randbats changes 2013-03-26 00:51:59 +04:00
Marty-D
84ef730ab8 Fix Wonder Guard.
- Moves that are 'evaded' can no longer be critical hits.
- Gems are no longer used up if a move is 'evaded'.
- The issue with Struggle being 'evaded' while the Wonder Guard user has
a Substitute is fixed.
2013-03-22 15:05:38 -04:00
The Immortal
bcea04020c Modify ratings 2013-03-19 00:39:47 +04:00
Guangcong Luo
8ebe9bd3f3 typechange refactor
Type changes have been moved out of ModifyPokemon, and now are only
updated manually such as at clearVolatile or during forme changes.

This fixes interaction between: Transform, forme changes,
Conversion, Conversion2, Soak, Camouflage, Reflect Type, and
Color Change.

We're now one more step closer to getting rid of the ModifyPokemon
event.

Type changes in gen3 and gen4 will need to be redone for the new
typechange system.
2013-03-06 10:21:30 -08:00
Guangcong Luo
d54f129342 Template/stats refactor:
- Stats are now cached and recalculated every clearVolatile (switchout)
- Power Trick, Power Split, Guard Split, Transform, forme changes now
  modify the cached stat value
- This eliminates the need for pokemon.baseSet, so it's been removed
- pokemon.transformInto has been split into transformInto and formeChange
- pokemon.baseBoosts have also been eliminated, boost changes are now
  calculated on-the-fly like stats themselves
- Overall, stat changes should be a lot more like the cartridge games now
- We're also one step closer to finally getting rid of the ModifyPokemon
  event
2013-03-06 09:53:34 -08:00
Guangcong Luo
ce0ffe654e movedThisTurn overhaul:
- now named 'moveThisTurn' and contains the moveid
- this fixes the Outrage issue
2013-03-05 11:27:49 -08:00
Marty-D
f86b52689a Fix Choice locking and Magic Room.
- Choice items now lock into a new move properly after losing the
original locked move (due to Mimic/Sketch/Transform)
- Choice items now continue locking into the original locked move (if
there was one) after Embargo, Klutz, or Magic Room's effects end
- General fixes to the priority of ignoring items
- Magic Room is now usable again
2013-02-22 19:12:29 -05:00
Guangcong Luo
abd320cc6e Illusion fix:
- A previous change to Illusion + Mold Breaker interaction broke some UI
  for tracking Illusion status.
- This changes Illusion again, to have its clearing be hardcoded... which
  isn't a big deal, because most of the rest is hardcoded anyway.
- This also fixes a minor animation bug so Illusion clears before taking
  damage, not after
2013-02-13 14:38:52 -08:00
Marty-D
47f678bb50 Add messages for Suction Cups and Ingrain. 2013-02-11 17:22:53 -05:00
Marty-D
01f304a6dc Fix Mold Breaker's interaction with Illusion. 2013-02-07 09:54:15 -05:00
Guangcong Luo
ed7b505a0b Fix Cute Charm's random roll
(it was previously guaranteed to activate while testing)
2013-01-28 17:48:00 -08:00
Guangcong Luo
b6113490ad Implement Friend Guard 2013-01-28 10:50:12 -08:00
Guangcong Luo
e69e7dde30 Implement Destiny Knot
(This involved refactoring a lot of the Attract implementation)
2013-01-28 10:43:46 -08:00
TheImmortal
cbb65b6583 Add isAdjacent function
Used to check if two allies are adjacent and have not fainted
2013-01-25 21:07:39 +04:00
TheImmortal
310eb90ac1 Implement Minus & Plus abilities 2013-01-25 02:04:17 +04:00
TheImmortal
7a3a328fd3 Fix mistake in previous commit 2013-01-24 21:30:10 +04:00
TheImmortal
55167c2c51 Implement Healer 2013-01-24 20:11:58 +04:00
Guangcong Luo
b49b86a1ab Fix a bunch of bugs in the stats refactor 2013-01-21 15:24:16 -08:00
TheImmortal
2e650d448a Flare Boost & Toxic Boost are BP modifiers 2013-01-22 01:04:35 +04:00
Guangcong Luo
7fa7f24a39 Refactor how stats are calculated
They're now read on-the-fly instead of being recalculated and cached
every update.
2013-01-21 11:49:22 -08:00
TheImmortal
94a4b0946b Prevent CAP abilities in Hackmons/BH 2013-01-17 22:19:04 +04:00
Guangcong Luo
fb4f4e5f9d Slow Start goes away when the ability changes 2013-01-14 19:18:59 -08:00
Guangcong Luo
acbeada910 Fix Magic Guard 2013-01-11 22:51:22 -08:00
TheImmortal
8878dbd9e2 Make Magic Guard block (Hi) Jump Kick recoil
This is a temporary fix
2013-01-07 12:39:20 +04:00
Marty-D
8cf4bf27bc Prevent certain Abilities from working with self-target moves. 2012-12-30 10:47:42 -05:00
Bill Meltsner
7520c2342d Fix issue where Prankster would sometimes ignore Lagging Tail 2012-12-29 12:32:10 -06:00
Marty-D
ecbc9bfd62 Fix certain Abilities activating behind Protect. 2012-12-29 00:04:13 -05:00
Bill Meltsner
0296f36912 Actually, this is better 2012-12-23 12:29:17 -06:00
Bill Meltsner
cbdbdcf1be Fix Solid Rock and Filter affecting both Pokemon on a side in Doubles. 2012-12-23 12:18:10 -06:00
Guangcong Luo
94ab0f9d91 Make evasion abilities work correctly in doubles 2012-12-16 16:57:10 -08:00
Guangcong Luo
8a15fbe5cd Implement Damp 2012-12-14 14:44:55 -08:00
Guangcong Luo
721b4c894b Correct implementation of Telepathy 2012-12-13 14:28:48 -08:00
Guangcong Luo
51e8a2cc2d Implement Telepathy 2012-12-13 14:12:09 -08:00
Marty-D
7759e934c0 Fix Defiant for Doubles. 2012-12-13 16:38:18 -05:00
Guangcong Luo
9f91d5c0f1 Correct Imposter targeting in doubles/triples 2012-12-12 15:51:53 -08:00
Guangcong Luo
7625846be7 Proper implementation of Follow Me, Lightningrod et al. 2012-12-12 11:55:30 -08:00
Guangcong Luo
4edd2ddfac Fix the order of selfdestruct, drain, and recoil when used by moves 2012-12-12 10:06:56 -08:00
TheImmortal
f2f000f989 Modify ability ratings 2012-12-07 20:29:51 +04:00
Guangcong Luo
a29c373699 Fix Illusion, it should now be mechanically correct 2012-12-06 15:37:56 -08:00
TheImmortal
99f6a51c43 Reduce Rivalry rating 2012-11-23 22:22:02 +04:00
Marty-D
68fc3c1e06 Make sure Leech Seed can't activate Cursed Body. 2012-11-13 19:59:33 -05:00