Commit Graph

210 Commits

Author SHA1 Message Date
Joimer
28dfac8474 Implement Grass Pelt 2013-10-21 11:52:31 +02:00
Guangcong Luo
cef8fddebd Fix bug in previous commit 2013-10-19 20:20:42 -07:00
Guangcong Luo
213d1c6cc2 Protean will change mixed types to pure types 2013-10-19 20:18:56 -07:00
Guangcong Luo
d595c5ae15 Properly activate abilities after Transform 2013-10-19 18:45:57 -07:00
The Immortal
3efeae3a92 Add new ability Grass Pelt 2013-10-18 17:14:12 +04:00
Joimer
ba1bfdedb5 Implement Flower Veil 2013-10-18 10:19:57 +02:00
The Immortal
e3017dbe17 Implement Competitive 2013-10-18 00:17:14 +04:00
The Immortal
c1a3f9a614 Correct name is Pixilate 2013-10-18 00:09:41 +04:00
Guangcong Luo
b2826cab56 Revert Intimidate change, it was wrong 2013-10-17 12:52:15 -07:00
Guangcong Luo
0c9ce5055d Implement gen 6 Keen Eye 2013-10-17 12:44:19 -07:00
Guangcong Luo
f6e330791e Implement gen 6 Intimidate 2013-10-17 12:44:04 -07:00
The Immortal
4064776c7f Fix mistakes 2013-10-17 20:10:39 +04:00
Joimer
e67383064b Implement Gooey 2013-10-17 15:45:41 +02:00
Guangcong Luo
0c2bc56618 Fix Stance Change
Stance Change only changes to Shield Forme for King's Shield
2013-10-16 13:15:31 -07:00
Guangcong Luo
4235ecfb17 Fix ES4-compatibility 2013-10-16 15:04:42 -05:00
Joimer
4a5846efc9 Implement Sweet Veil 2013-10-16 18:29:49 +02:00
Joimer
29b7709506 Implement Aura Break 2013-10-16 17:28:11 +02:00
Joimer
225aefd0d1 Gen 6: Overcoat now protects from powder moves 2013-10-16 10:42:59 +02:00
Joimer
be36ed748c Gen 6: Oblivious now makes Pokémon immune to Taunt 2013-10-16 10:38:46 +02:00
Joimer
8a13baec34 Update Gale Wings short desc.
Updated the short description so it fits with latest Smogon research.
2013-10-16 10:36:12 +02:00
Juanma Serrano
ca55cc1515 Add comma to previous commit
Pressed backspace and enter at the same time.
2013-10-16 10:21:51 +02:00
Juanma Serrano
2105f29b3e Gen 6: Implement Gale Wings 2013-10-16 10:21:09 +02:00
The Immortal
3b3f317832 Protean changes type before the move is used 2013-10-14 23:06:03 +04:00
The Immortal
0ea428201f Implement Protean 2013-10-12 11:33:23 +04:00
Guangcong Luo
e81071d213 Fix crash due to typo in Pixelite 2013-10-11 20:07:37 -07:00
Guangcong Luo
7d4ec59950 Properly remove perm-weather from gen 6 2013-10-11 18:47:49 -07:00
Guangcong Luo
cf259c776a Implement Stance Change 2013-10-11 14:18:08 -07:00
V4Victini
4e663da55e Use this.chainModify for base power modifiers
This also fixes Technician
2013-10-11 15:09:47 -04:00
V4Victini
224a0f10e2 Merge remote-tracking branch 'upstream/master' into modifiers 2013-10-11 14:17:25 -04:00
V4Victini
fb33b72e87 Use this.chainModify for stat modifiers
Also apply Sandstorm and Hustle boosts directly to the stat.
2013-10-11 14:05:51 -04:00
Guangcong Luo
c33abee343 Fix Fairy Aura description 2013-10-11 10:43:42 -07:00
V4Victini
d5c84dc134 Use this.chainModify for final modifiers 2013-10-11 13:25:14 -04:00
The Immortal
d23bb245ac Add new Gen 6 Abilities 2013-10-11 20:07:33 +04:00
V4Victini
5aa2458847 Fix Technician 2013-10-06 16:08:23 -04:00
V4Victini
7f880e1170 Chain Heatproof 2013-10-06 14:42:08 -04:00
V4Victini
5353430e43 Chain Analytic and Sand Force 2013-10-06 14:38:50 -04:00
V4Victini
01201d9a70 Fix typo in Sheer Force 2013-10-06 14:15:03 -04:00
V4Victini
9635ea7d56 Chain base power modifiers in proper order
8: User Ability
7: Target Ability
6:  User Item
5: Target Item
4: Move Modifers
3: Other User Modifiers (Helping Hand, Charge)
2: Other Target Modifiers
1: Field Modifiers (Water Sport, Mud Sport)
2013-10-05 19:12:10 -04:00
V4Victini
8a119fefeb Chain base power modifiers
onBasePower events now affect the base power modifier as opposed to the
base power directly. Also some moves had their base power changes moved
from basePowerCallback to onBasePower. These moves affect the modifier
and not the base power.

Note: The effects of weather and burn are still incorrectly applied as
base power modifiers
2013-10-05 18:56:32 -04:00
V4Victini
fb4dd5e385 Merge remote-tracking branch 'upstream/master' into damage 2013-10-05 15:55:26 -04:00
V4Victini
bed7316a14 Chain stat modifiers in the proper order
10: Figure out a way to apply these directly to the stat later
...
6: Target Ability
5: User Ability
4: Target's Ally Abilities
3: User's Ally Abilities
2: Target's Item
1: User's Item

To be honest it's mostly for posterity's sake as well as to match the
soon-to-be-corrected base power modifiers. At the moment all stat
modifiers are either *1.5 or *2 which have the same result no matter
which order you chain them in. However a mod or ability/item in the
future could add a value that isn't as clean.
2013-10-05 01:14:11 -04:00
V4Victini
c89670e9e6 Fix Trace Message
Say that Trace has copied the ability before having the copied ability
take effect
2013-10-04 18:45:37 -04:00
V4Victini
1c2a9a76c0 Chain Final Modifiers 2013-09-27 23:30:55 -04:00
Guangcong Luo
0dba0d50cb Workaround fix for Mold Breaker Unaware 2013-09-14 16:50:42 -07:00
V4Victini
d64d7bfdb7 Fix Thick Fat 2013-09-12 23:01:46 -04:00
V4Victini
78edf360f2 Re-add getStat function 2013-09-11 19:50:00 -04:00
V4Victini
0ef4a02b0c Run ModifyDef/SpD events properly
and remove Chlorophyll's debug message
2013-09-11 04:10:14 -04:00
V4Victini
c50d30f11f Overhaul the stat system and implement chaining
onModifyStat events now alter the returning modifier instead of
affecting the stat directly
2013-09-11 03:17:13 -04:00
V4Victini
5751090870 Use proper modifiers for Sheer Force, Sand Force, and Analytic
0x14CD instead of 0x14CC (1.3)
2013-09-08 15:18:14 -04:00
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
Marty-D
8cf4bf27bc Prevent certain Abilities from working with self-target moves. 2012-12-30 10:47:42 -05:00