Commit Graph

111 Commits

Author SHA1 Message Date
Joimer
be2d3686f7 Fix Storm Drain accuracy check for Water-type moves
Water-type moves should not fail against Storm Draim Pokémon.

Test, Gastrodon + Qwilfish, turn 2 switching the first to Escavalier:
Storm drain is making Hydro Pump accuracy true
Storm drain is making Hydro Pump accuracy true
Storm drain is making Hydro Pump accuracy true
Storm drain is making Hydro Pump accuracy true
Accuracy for Recover: true
Accuracy for Recover: true
Accuracy for Hydro Pump: 80
Accuracy for Hydro Pump: 80
2013-08-09 11:07:12 +02:00
Joimer
fe0e94fd87 Fix Flash Fire accuracy check with Fire-type moves
No Fire-type move should fail against Flash Fire Pokémon.

Test on two turns:
Flash fire is making Will-O-Wisp accuracy to true.
Flash fire is making Will-O-Wisp accuracy to true.
Accuracy for Earth Power: 100
Accuracy for Earth Power: 100
Accuracy for Will-O-Wisp: 75
Accuracy for Will-O-Wisp: 75
Accuracy for Substitute: true
Accuracy for Substitute: true
2013-08-09 11:00:55 +02:00
V4Victini
90694f4e8b Use proper event for several effects
These effects should take place last in damage calculation during the
ModifyDamage event.
2013-07-09 22:51:15 -04:00
Marty-D
5e0acfb56b Correct previous commit. 2013-06-19 21:28:50 -04:00
Marty-D
78b4cffc02 Make sure Shed Skin doesn't try curing 'fnt'. 2013-06-17 14:49:43 -04:00
Guangcong Luo
cca66ef1fe Fix some doubles incompatibilities
Specifically, pokemon.id should never be passed to battle.add()
2013-06-16 03:18:32 -07:00
Marty-D
743c85127c Fix Transform.
- Gen 5: User cannot Transform if it or the target is already
Transformed.
- Gens 2-4: User cannot Transform if the target is already Transformed.
- Gen 1: User can Transform in both situations.
2013-06-10 11:52:25 -04:00
Bill Meltsner
aab4a0eb35 Fix abilities which block stat decreases, for real this time.
Now, those abilities will not report their activation if the stat drop would have been caused by a secondary effect.
They will also only report their activation once, even if multiple stats would have been lowered.
2013-06-01 22:34:21 -07:00
Bill Meltsner
f9cc37ff64 Clear Body should not display an activation message. 2013-06-01 19:17:35 -06:00
Marty-D
419496ba58 Fix Pressure.
- It should not affect moves made by allies.
2013-05-27 23:51:45 -04:00
Cathy J. Fitzpatrick
3a8662102f Fix Flower Gift boosting Pokemon other than Cherrim 2013-05-22 06:31:21 -06:00
Guangcong Luo
de7277c768 New research suggests all formes are possible in Hackmons
Specifically, formes that normally require a specific condition,
such as Darmanitan-Z and Arceus-Fire, are now available in Hackmons.

The previous confusion stemmed from that Arceus-Fire is actually
Normal-type, and the Arceus forme is handled separately from
Multitype and plates, which is what actually gives it the Fire
typing.
2013-05-16 21:22:52 -07:00
Guangcong Luo
d35be5d57a Fix Truant/flinch interaction 2013-05-09 21:17:43 -07:00
Marty-D
bed84d61f5 Add some more immunity messages. 2013-05-05 21:09:08 -04:00
Marty-D
a62cd46c88 Add a few helpful immunity messages. 2013-05-05 19:10:26 -04:00
Marty-D
7ff0c7531c Fix Heal Block.
- Healing moves are now prevented and disabled correctly.
2013-04-30 21:24:35 -04:00
Guangcong Luo
f63a35f2da Fix Harvest message 2013-04-26 20:16:33 -07:00
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