Commit Graph

388 Commits

Author SHA1 Message Date
Kevin Lau
81be17cd3c Fix Wonder Guard's interaction with Iron Ball/Thousand Arrows 2015-04-11 00:43:56 -07: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
Kevin Lau
2e56120ad9 Move refactor: affectedByImmunities -> ignoreImmunity
While move.affectedByImmunities was always a Boolean value to denote if
the move was affected by immunities, move.ignoreImmunity can be a Boolean
value if it ignores or is affected by all type immunities, but also can
act as an object such that !!move.ignoreImmunity[type] means it ignores
immunities of that type.
2015-04-08 00:17:12 -07:00
Marty-D
1a6e62ef7b Fix Pickpocket 2015-04-05 10:55:02 -04:00
The Immortal
7e9c1030ec Remove notSubBlocked move property
Use the authentic flag instead. Also combined the Infiltrator properties
into one.
2015-04-04 01:22:21 +04:00
Marty-D
a698ed2315 Ensure Toxic Spikes does not activate Synchronize 2015-04-03 12:19:11 -04:00
The Immortal
d4a22bb1e6 Remove isContact property from moves
Use flags instead.
2015-04-03 16:59:53 +04:00
Kevin Lau
4ca5d7a676 Send -end message when Flash Fire volatile disappears
Relevant for when the Pokemon with an active Flash Fire boost has its
ability changed or suppressed.
2015-03-31 16:18:07 -07:00
Kevin Lau
ca2aade9ec Change Slow Start to listen to End events 2015-03-31 11:51:25 -07:00
The Immortal
571c7653a4 Improve ability ratings 2015-03-29 16:01:00 +04:00
The Immortal
5949294b78 Use hasItem in Arena Trap 2015-03-29 04:00:51 +04:00
Kevin Lau
18b3a99423 Arena Trap Typo Fix 2015-03-28 03:02:02 -07:00
Kevin Lau
ab80397192 Refactor Unaware to use ModifyBoost
Cleans up the code quite a bit because it no longer needs the hardcoding
option that it was having.
2015-03-26 20:06:47 -07:00
The Immortal
3de23cb90a Use the reflectable flag for Magic Bounce/Coat 2015-03-24 02:42:04 +04: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
351c13aa98 Merge pull request #1655 from ascriptmaster/move-fixes
Flash Fire boost disappears when the ability is removed
2015-03-21 14:51:23 -04:00
Marty-D
ed074532c6 Make sure the flags object always exists 2015-03-21 14:29:07 -04:00
Kevin Lau
c60de125bd Flash Fire boost disappears when the ability is removed
Added onEnd event to Flash Fire (and Unburden) to check for when the
ability disappears.
2015-03-20 15:55:16 -07:00
The Immortal
d81fdd4549 Remove isSoundBased property 2015-03-20 02:13:38 +04:00
The Immortal
ca31b6edc5 Remove isPunchAttack property 2015-03-20 01:51:55 +04:00
Marty-D
3533a15976 Make sure some Abilities are properly suppressed 2015-03-19 13:43:41 -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
The Immortal
4c3a2fde72 Update a few ability ratings 2015-03-13 12:16:57 +04:00
The Immortal
74419b6668 Lower Ice Body rating 2015-03-12 22:50:56 +04:00
Kevin Lau
40df9b9a49 Remove depreciated EndAbility event
The 'EndAbility' event was initially introduced for the implementation of
new weathers in ORAS, like Desolate Land, but has since been depreciated
in favor of an 'End' singleEvent.
2015-03-10 00:19:19 -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
Marty-D
9b43953f6a Update Ability descriptions 2015-02-19 18:55:06 -05:00
Kevin Lau
89deb35644 Fix Tough Claws
It gives a 30% boost, not 33%.
2015-02-18 20:56:05 -08:00
The Immortal
cd6ed5993f Reduce Flare Boost rating
Drifblim almost never runs it. And even in formats that allow any
ability, it isn't even used half as much as Guts. Lack of a Special
Facade is probably why.
2015-02-15 22:27:12 +04:00
Kevin Lau
4884ec66ba Weather Refactor: Regular weathers don't activate w/ Primal Weather set
Moved all checks for primal weather into setWeather() instead of
hard-coding the check into every effect attempting to change the weather.

Also to prevent hardcoding, the check now runs on the event system, and
the primal weathers themselves deny regular weathers from being set.
2015-02-12 14:39:50 -08:00
Slayer95
1cbdf09b7d Merge pull request #1514 from ascriptmaster/move-fixes
Fix Anger Point's Interaction with Mold Breaker
2015-02-08 17:14:32 -05:00
The Immortal
afbb72228e Change Sticky Hold's rating
It is much more useful this generation because of Knock Off's high
usage.
2015-02-09 01:51:54 +04:00
Kevin Lau
f5c12a60a1 Fix Anger Point's Interaction with Mold Breaker
Moved Anger Point's check for critical from onCritical to onAfterDamage.
This not only allows it to avoid being suppressed by Mold Breaker, it
also results in the Anger Point message being displayed in the correct
order with respect to the other messages.
2015-02-08 13:16:18 -08:00
Guangcong Luo
956566f856 Merge pull request #1502 from Joimer/UnawareFix
Fix Unaware in Doubles and refactor stat ignoring abilities
2015-02-05 11:59:21 -06:00
Juanma Serrano
64b2246260 Fix Unaware in Doubles and refactor stat ignoring abilities
Unaware currently doesn't work because the ModifyMove event is fired on the move before each target is caculated in doubles and triples.
This means that the ModifyMove event should be fired for each target and the move not modified unless it fits the attacker-target.
It's easier and less expensive to use an ability property to check on attacker/target than to fire events.
This fixes Unaware in doubles/triples.
It takes account interaction with Mold Breaker, Gastro Acid, and other ability supressers.
2015-02-05 10:38:17 +01:00
The Immortal
de123dceb8 Change Arena Trap rating
Lowered it from 5 to 4 but 4.5 is more representative of it and equal to
Magnet Pull's rating.
2015-02-01 22:09:32 +04:00
The Immortal
1efd11466f Modify ability ratings
Old abilities were not updated in gen 6, and some of the initial ratings
for new abilities were inaccurate.
2015-02-01 15:53:33 +04:00
ascriptmaster
5f65d41475 Fix Ability Activation Order for type changes
Fixed ability interactions with Hidden Power, Judgment, and other moves
that change their types.

-ate Abilities don't trigger with Natural Gift.

Normalize > move's type change > -ate Ability > Ion Deluge/Electrify

For Gen 4, the order is: move's type change > Normalize
2015-01-16 14:45:51 -08:00
Marty-D
efa28607b8 Fix Fur Coat
Thought this was fixed a long time ago:

2014-01-12
15:16:23: <Marty> V4, if Fur Coat halves Psyshock damage, it must be
Huge Power for Defense, yes?
15:17:13: <V4> Ya
15:17:32: <Marty> cool

2014-01-19
17:31:20: <CDXCIV> Marty did you ever try that thing with Fur Coat?
17:32:24: <Marty> the Psyshock thing? yeah I tried it before asking you
17:32:46: <Marty> it's double Defense

For shame, V4 :(
2015-01-15 18:58:17 -05:00
The Immortal
ab1e90e478 Update BeforeMove priorities 2015-01-14 03:33:00 +04:00
Juanma Serrano
25ca98d012 Fix -ate moves boosting moves through Sleep Talk
The -ate boost only applies to moves which have a direct Normal-type.
It still changes its type, though.
2015-01-13 18:23:24 +01:00
Ivo Julca
2b5e3bab10 Minor style fixes in data files 2015-01-12 00:11:48 -05:00
The Immortal
44df32904f Fix abilities crashing with confusion damage 2014-12-19 00:29:43 +04:00
Marty-D
b7070b6325 Refactor bite, bullet, and pulse moves 2014-12-17 11:29:26 -05:00
Guangcong Luo
151b7ea61a Merge pull request #1334 from ascriptmaster/primal
Ability refactor - Abilities now receive End events properly
2014-12-03 16:43:29 -06:00
ascriptmaster
e79e64e3fc Ability Refactor: Abilities now listen for End events
Added functionality for setAbility to send End events to abilities.

Fixed bug with Mold Breaker negating all Battle#singleEvent ability calls,
even those that don't involve damage calculation.

Fixed Skill Swap to now use End and Start events in the right order:
send the End events, then change the abilities, then send Start events.
If the same ability is swapped, don't send End events (the game simply
re-activates the abilities in question)

Moved SwitchOut/Faint events from weather to ability so the weather
can interact properly with Cloud Nine or Air Lock.

Primal weathers persist if a Pokemon with the relevant ability is
on-field, even if the originator switches out.
2014-12-03 12:22:21 -08:00
Ivo Julca
01de2eadf9 Magician's handler is now purely a global event
Reverts 3b5d455
2014-12-02 20:25:02 -05:00
ascriptmaster
29905009af Fix Scrappy's interaction with Ion Deluge/Electrify
Give Scrappy a negative priority on its onModifyMove action because it was
causing Normal/Fighting moves affected by Electrify to hit Ground types.
2014-11-26 11:04:10 -08: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
Marty-D
0a31dab7e8 Fix Secret Power. 2014-11-09 20:40:31 -05:00
V4Victini
5c805a028e Correct Cheek Pouch mechanics
Didn't know this was still set to 25%...
2014-11-06 23:48:23 -05:00
ascriptmaster
ef50dea521 Aromatherapy triggers Sap Sipper 2014-11-01 17:10:38 -07:00
Ivo Julca
641651e19d Send 'trapped' flag in requests for pokémon that are known trapped
- Implement BattlePokemon#isLastActive to do the check for whether this is the last non-fainted active pokémon in a team.
- BattlePokemon#tryTrap now accepts an argument that, if true, will hide the fact that a pokémon is trapped.
- This should revert an small (annoying) change in the UI for locked moves introduced as a secondary effect in 8afc588e4.
- NEXT: Shadow Tag shouldn't activate the 'maybeTrapped' flag after the suspected Shadow Tagger has made a move.
2014-10-30 00:34:34 -05:00
ascriptmaster
859cebf490 Implement Harsh Sun, Heavy Rain, Strong Winds
Abilities might not be 100% accurate to the gameplay yet.
2014-10-27 16:10:26 -07:00
Ivo Julca
727579ff89 Revamp effectiveness calculation
- Implement BattlePokemon#runEffectiveness, accounting for battle events.
- Refactor Tools#getEffectiveness accordingly.
- Remove Inverse mod. It's now implemented using the global event 'Effectiveness', and with a few changes in the base data for hazards and Arena Trap.
- NEXT: Fix Filter and Solid Rock not accounting for the special effects of Freeze Dry and Flying Press.
2014-10-27 03:46:32 -05:00
ascriptmaster
44845f0cb9 Removed placeholder messages for Castform/Cherrim transformation
Added [msg] handler for client to check for and display the message.
2014-10-21 13:32:21 -07:00
The Immortal
f0824ef1cc Add new abilities 2014-10-20 01:41:32 +04:00
The Immortal
db24264fae Change Lightningrod to Lightning Rod
It has been changed in ORAS.
2014-10-16 15:15:15 +04:00
Ivo Julca
eff6f2c793 Trapping abilities affect adjacent foes only 2014-10-12 16:25:16 -05:00
Guangcong Luo
1abb45cd18 Use -ability for Cloud Nine and Air Lock messages 2014-10-01 05:27:15 -04:00
Guangcong Luo
2f93240bfb Merge pull request #1231 from Pikachuun/master
Future Moves Bug Fix (Issue 567)
2014-09-30 13:37:52 -07:00
Pikachuun
a7e9079726 Future moves bug fix
Future moves fail to activate if the opponent has Wonder Guard, and
deals damage if it activated beforehand to a Wonder Guard Pokemon that
is not weak to them. This commit fixes both of those issues. However,
future moves still hit through wonder guard in generation 5, so that
is untouched.
2014-09-30 08:32:32 -04:00
小太
fe37f3b6a7 Apply jscs to the data files as well 2014-09-30 18:34:16 +10:00
小太
5027be79fb Add jscs as a style checker, and add some extra jshint options 2014-09-29 18:38:01 +10:00
The Immortal
562de6102a Fix Anger Point desc 2014-09-09 18:10:44 +04:00
QxC4eva
465b4bce22 Switch around shortDesc entries longer than desc, grammar fixes 2014-08-29 18:42:21 +10:00
The Immortal
bdc319cba6 Fix Inflitrator descs 2014-08-28 18:03:59 +04:00
Guangcong Luo
71d24fbcd7 Fix Trace
The previous implementation of Trace is difficult to understand
and has a lot of weird bugs. I'm mostly sure this is what it
was intended to do.
2014-08-11 15:05:20 -04:00
Guangcong Luo
af2026436a More style fixes and Gulpfile updates
JSHint is now a fair bit stricter, and is now correctly checking
files in `mods/`.

The code has been fixed to match the new stricter standards.

JSHint has now caught its second actual bug: Gen 5 Pinap Berry
was Ice instead of Grass.
2014-08-10 20:43:53 -04:00
Ivo Julca
1b783b7111 Effect Spore checks for Powder immunity 2014-08-10 16:56:28 -05:00
V4Victini
0ccd5a5722 Try to activate Trace on every active foe. 2014-08-10 10:41:30 -04:00
Ivo Julca
c2082b6b87 Fix Protean activating on Struggle 2014-08-04 02:05:27 -05:00
Guangcong Luo
5b6e6038ac Merge pull request #1079 from Slayer95/protean
Fix more bugs with Protean
2014-07-12 22:31:57 -05:00
Slayer95
684a2a4418 Fix more bugs with Protean
- Fix an issue introduced in 6539521adc, where Protean didn't activate if the target was immune to the move.
- Protean should not activate if the user fails a Detect/Protect, or the move is Fling or Natural Gift and the user has no item.
- Protean should not activate on the first turn of a Pledge Combo. Aditionally, fix Flash Fire/Storm Drain, etc being activated by the first move in the combo.
- Introduce event 'PrepareHit', which is ran after any move target is resolved but before immunity is checked.
2014-07-12 21:42:02 -05:00
Guangcong Luo
e176899492 Merge pull request #1074 from Slayer95/aura
Fix aurae of the same type stacking together
2014-07-10 22:30:09 -05:00
Slayer95
79b37b5603 Fix aurae of the same type stacking together
Dark Aura, Fairy Aura
2014-07-10 22:24:42 -05:00
Slayer95
6539521adc Fix Protean activation timing
- The message for the move usage is now sent before Protean's activation.
- Protean is affected by Electrify and Ion Deluge.
- Protean activates after the move target is resolved.
2014-07-10 15:02:19 -05:00
Slayer95
375cf4a70d Fix Klutz causing Mega Stones to be ignored 2014-06-24 13:11:44 -05:00
Slayer95
dd44cf3e2a Mummy reveals the ability the affected pokemon had 2014-06-23 17:52:27 -05:00
Slayer95
a1f955e7b0 Fix Protean Arceus
It could only attack with Normal-type moves
2014-06-23 16:24:54 -05:00
Slayer95
a6287a0bbc Fix Shield Dust for multitarget moves 2014-06-21 21:26:41 -05:00
V4Victini
fc8902409a Fix bug introduced in 529281272a 2014-06-21 01:39:36 -04:00
V4Victini
529281272a RNG: Shield Dust
Shield Dust does not even permit rolls for secondary effects. This will
correct its interaction with the RNG.
2014-06-20 21:59:30 -04:00
The Immortal
04caa0879e Prevent status moves from activating Magician 2014-06-16 13:24:48 +04:00
Slayer95
6a48ce030d Tweaks for adjacency check methods 2014-06-12 02:02:37 -05:00
Slayer95
612ef3956d Intimidate affects adjacent foes only 2014-06-10 17:44:45 -05:00
Guangcong Luo
9d884372b0 Properly fix faint order for Iron Barbs etc 2014-06-09 06:37:14 -04:00
The Immortal
e89eb3b0fd Revert "Fix faint order for Iron Barbs etc"
This reverts commit e94940cd5f.
2014-06-09 13:43:35 +04:00
Guangcong Luo
e94940cd5f Fix faint order for Iron Barbs etc 2014-06-09 04:16:35 -04:00
Slayer95
dfbdce129c Actually fix Mold Breaker+Slow Start
It wasn't fully done in c6dc05d66d
2014-05-26 15:21:15 -05:00
Guangcong Luo
913a1b64ab Fix Compound Eyes 2014-05-24 17:27:39 -04:00
The Immortal
895c546b05 Fix Aroma Veil 2014-05-20 13:35:04 +04:00
Slayer95
c6dc05d66d Fix Slow Start/Unburden being ended by Mold Breaker
Temporal fix.
2014-05-10 16:56:02 -05:00
Slayer95
3811adca7c Fix description of Mold Breaker-like abilities
Active abilities are nullified regardless of who is attacked.
The description doesn´t agree with current PS behavior though.
2014-05-03 18:41:21 -05:00
The Immortal
6948516973 Update XY ability nums 2014-05-02 13:27:31 +04:00
小太
5c8fc7b982 Space after function for anonymous functions 2014-04-22 01:58:16 +10:00
小太
6fb3bc332a Spaces around operators and === instead of == 2014-04-22 01:56:11 +10:00