-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
abilities.js
4177 lines (4150 loc) · 140 KB
/
abilities.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Ratings and how they work:
-2: Extremely detrimental
The sort of ability that relegates Pokemon with Uber-level BSTs into NU.
ex. Slow Start, Truant
-1: Detrimental
An ability that does more harm than good.
ex. Defeatist, Normalize
0: Useless
An ability with no net effect during a singles battle.
ex. Healer, Illuminate
1: Ineffective
An ability that has a minimal effect. Should not be chosen over any other ability.
ex. Damp, Shell Armor
2: Situationally useful
An ability that can be useful in certain situations.
ex. Clear Body, Static
3: Useful
An ability that is generally useful.
ex. Infiltrator, Sturdy
4: Very useful
One of the most popular abilities. The difference between 3 and 4 can be ambiguous.
ex. Protean, Regenerator
5: Essential
The sort of ability that defines metagames.
ex. Desolate Land, Shadow Tag
*/
'use strict';
/**@type {{[k: string]: AbilityData}} */
let BattleAbilities = {
"noability": {
shortDesc: "Does nothing.",
id: "noability",
isNonstandard: "Past",
name: "No Ability",
rating: 0.1,
num: 0,
},
"adaptability": {
desc: "This Pokemon's moves that match one of its types have a same-type attack bonus (STAB) of 2 instead of 1.5.",
shortDesc: "This Pokemon's same-type attack bonus (STAB) is 2 instead of 1.5.",
onModifyMove(move) {
move.stab = 2;
},
id: "adaptability",
name: "Adaptability",
rating: 4,
num: 91,
},
"aftermath": {
desc: "If this Pokemon is knocked out with a contact move, that move's user loses 1/4 of its maximum HP, rounded down. If any active Pokemon has the Damp Ability, this effect is prevented.",
shortDesc: "If this Pokemon is KOed with a contact move, that move's user loses 1/4 its max HP.",
id: "aftermath",
name: "Aftermath",
onAfterDamageOrder: 1,
onAfterDamage(damage, target, source, move) {
if (source && source !== target && move && move.flags['contact'] && !target.hp) {
this.damage(source.maxhp / 4, source, target);
}
},
rating: 2.5,
num: 106,
},
"aerilate": {
desc: "This Pokemon's Normal-type moves become Flying-type moves and have their power multiplied by 1.2. This effect comes after other effects that change a move's type, but before Ion Deluge and Electrify's effects.",
shortDesc: "This Pokemon's Normal-type moves become Flying type and have 1.2x power.",
onModifyMovePriority: -1,
onModifyMove(move, pokemon) {
if (move.type === 'Normal' && !['judgment', 'multiattack', 'naturalgift', 'revelationdance', 'technoblast', 'weatherball'].includes(move.id) && !(move.isZ && move.category !== 'Status')) {
move.type = 'Flying';
move.aerilateBoosted = true;
}
},
onBasePowerPriority: 8,
onBasePower(basePower, pokemon, target, move) {
if (move.aerilateBoosted) return this.chainModify([0x1333, 0x1000]);
},
id: "aerilate",
name: "Aerilate",
rating: 4,
num: 185,
},
"airlock": {
shortDesc: "While this Pokemon is active, the effects of weather conditions are disabled.",
onStart(pokemon) {
this.add('-ability', pokemon, 'Air Lock');
},
suppressWeather: true,
id: "airlock",
name: "Air Lock",
rating: 2.5,
num: 76,
},
"analytic": {
desc: "The power of this Pokemon's move is multiplied by 1.3 if it is the last to move in a turn. Does not affect Doom Desire and Future Sight.",
shortDesc: "This Pokemon's attacks have 1.3x power if it is the last to move in a turn.",
onBasePowerPriority: 8,
onBasePower(basePower, pokemon) {
let boosted = true;
for (const target of this.getAllActive()) {
if (target === pokemon) continue;
if (this.willMove(target)) {
boosted = false;
break;
}
}
if (boosted) {
this.debug('Analytic boost');
return this.chainModify([0x14CD, 0x1000]);
}
},
id: "analytic",
name: "Analytic",
rating: 2.5,
num: 148,
},
"angerpoint": {
desc: "If this Pokemon, but not its substitute, is struck by a critical hit, its Attack is raised by 12 stages.",
shortDesc: "If this Pokemon (not its substitute) takes a critical hit, its Attack is raised 12 stages.",
onHit(target, source, move) {
if (!target.hp) return;
if (move && move.effectType === 'Move' && target.getMoveHitData(move).crit) {
target.setBoost({atk: 6});
this.add('-setboost', target, 'atk', 12, '[from] ability: Anger Point');
}
},
id: "angerpoint",
name: "Anger Point",
rating: 2,
num: 83,
},
"anticipation": {
desc: "On switch-in, this Pokemon is alerted if any opposing Pokemon has an attack that is super effective on this Pokemon, or an OHKO move. Counter, Metal Burst, and Mirror Coat count as attacking moves of their respective types, Hidden Power counts as its determined type, and Judgment, Multi-Attack, Natural Gift, Revelation Dance, Techno Blast, and Weather Ball are considered Normal-type moves.",
shortDesc: "On switch-in, this Pokemon shudders if any foe has a supereffective or OHKO move.",
onStart(pokemon) {
for (const target of pokemon.side.foe.active) {
if (!target || target.fainted) continue;
for (const moveSlot of target.moveSlots) {
const move = this.getMove(moveSlot.move);
const moveType = move.id === 'hiddenpower' ? target.hpType : move.type;
if (move.category !== 'Status' && (this.getImmunity(moveType, pokemon) && this.getEffectiveness(moveType, pokemon) > 0 || move.ohko)) {
this.add('-ability', pokemon, 'Anticipation');
return;
}
}
}
},
id: "anticipation",
name: "Anticipation",
rating: 1,
num: 107,
},
"arenatrap": {
desc: "Prevents adjacent opposing Pokemon from choosing to switch out unless they are immune to trapping or are airborne.",
shortDesc: "Prevents adjacent foes from choosing to switch unless they are airborne.",
onFoeTrapPokemon(pokemon) {
if (!this.isAdjacent(pokemon, this.effectData.target)) return;
if (pokemon.isGrounded()) {
pokemon.tryTrap(true);
}
},
onFoeMaybeTrapPokemon(pokemon, source) {
if (!source) source = this.effectData.target;
if (!source || !this.isAdjacent(pokemon, source)) return;
if (pokemon.isGrounded(!pokemon.knownType)) { // Negate immunity if the type is unknown
pokemon.maybeTrapped = true;
}
},
id: "arenatrap",
name: "Arena Trap",
rating: 4.5,
num: 71,
},
"aromaveil": {
desc: "This Pokemon and its allies cannot be affected by Attract, Disable, Encore, Heal Block, Taunt, or Torment.",
shortDesc: "Protects user/allies from Attract, Disable, Encore, Heal Block, Taunt, and Torment.",
onAllyTryAddVolatile(status, target, source, effect) {
if (['attract', 'disable', 'encore', 'healblock', 'taunt', 'torment'].includes(status.id)) {
if (effect.effectType === 'Move') {
this.add('-activate', this.effectData.target, 'ability: Aroma Veil', '[of] ' + target);
}
return null;
}
},
id: "aromaveil",
name: "Aroma Veil",
rating: 1.5,
num: 165,
},
"aurabreak": {
desc: "While this Pokemon is active, the effects of the Dark Aura and Fairy Aura Abilities are reversed, multiplying the power of Dark- and Fairy-type moves, respectively, by 3/4 instead of 1.33.",
shortDesc: "While this Pokemon is active, the Dark Aura and Fairy Aura power modifier is 0.75x.",
onStart(pokemon) {
this.add('-ability', pokemon, 'Aura Break');
},
onAnyTryPrimaryHit(target, source, move) {
if (target === source || move.category === 'Status') return;
move.hasAuraBreak = true;
},
id: "aurabreak",
name: "Aura Break",
rating: 1.5,
num: 188,
},
"baddreams": {
desc: "Causes adjacent opposing Pokemon to lose 1/8 of their maximum HP, rounded down, at the end of each turn if they are asleep.",
shortDesc: "Causes sleeping adjacent foes to lose 1/8 of their max HP at the end of each turn.",
onResidualOrder: 26,
onResidualSubOrder: 1,
onResidual(pokemon) {
if (!pokemon.hp) return;
for (const target of pokemon.side.foe.active) {
if (!target || !target.hp) continue;
if (target.status === 'slp' || target.hasAbility('comatose')) {
this.damage(target.maxhp / 8, target, pokemon);
}
}
},
id: "baddreams",
name: "Bad Dreams",
rating: 2,
num: 123,
},
"battery": {
shortDesc: "This Pokemon's allies have the power of their special attacks multiplied by 1.3.",
onAllyBasePowerPriority: 8,
onAllyBasePower(basePower, attacker, defender, move) {
if (attacker !== this.effectData.target && move.category === 'Special') {
this.debug('Battery boost');
return this.chainModify([0x14CD, 0x1000]);
}
},
id: "battery",
name: "Battery",
rating: 0,
num: 217,
},
"battlearmor": {
shortDesc: "This Pokemon cannot be struck by a critical hit.",
onCriticalHit: false,
id: "battlearmor",
name: "Battle Armor",
rating: 1,
num: 4,
},
"battlebond": {
desc: "If this Pokemon is a Greninja, it transforms into Ash-Greninja after knocking out a Pokemon. As Ash-Greninja, its Water Shuriken has 20 base power and always hits 3 times.",
shortDesc: "After KOing a Pokemon: becomes Ash-Greninja, Water Shuriken: 20 power, hits 3x.",
onSourceFaint(target, source, effect) {
if (effect && effect.effectType === 'Move' && source.template.speciesid === 'greninja' && source.hp && !source.transformed && source.side.foe.pokemonLeft) {
this.add('-activate', source, 'ability: Battle Bond');
source.formeChange('Greninja-Ash', this.effect, true);
}
},
onModifyMovePriority: -1,
onModifyMove(move, attacker) {
if (move.id === 'watershuriken' && attacker.template.species === 'Greninja-Ash') {
move.multihit = 3;
}
},
id: "battlebond",
name: "Battle Bond",
rating: 3,
num: 210,
},
"beastboost": {
desc: "This Pokemon's highest stat is raised by 1 stage if it attacks and knocks out another Pokemon.",
shortDesc: "This Pokemon's highest stat is raised by 1 if it attacks and KOes another Pokemon.",
onSourceFaint(target, source, effect) {
if (effect && effect.effectType === 'Move') {
let statName = 'atk';
let bestStat = 0;
/** @type {StatNameExceptHP} */
let s;
for (s in source.storedStats) {
if (source.storedStats[s] > bestStat) {
statName = s;
bestStat = source.storedStats[s];
}
}
this.boost({[statName]: 1}, source);
}
},
id: "beastboost",
name: "Beast Boost",
rating: 3.5,
num: 224,
},
"berserk": {
desc: "When this Pokemon has more than 1/2 its maximum HP and takes damage from an attack bringing it to 1/2 or less of its maximum HP, its Special Attack is raised by 1 stage. This effect applies after all hits from a multi-hit move; Sheer Force prevents it from activating if the move has a secondary effect.",
shortDesc: "This Pokemon's Sp. Atk is raised by 1 when it reaches 1/2 or less of its max HP.",
onAfterMoveSecondary(target, source, move) {
if (!source || source === target || !target.hp || !move.totalDamage) return;
const lastAttackedBy = target.getLastAttackedBy();
if (!lastAttackedBy) return;
const damage = move.multihit ? move.totalDamage : lastAttackedBy.damage;
if (target.hp <= target.maxhp / 2 && target.hp + damage > target.maxhp / 2) {
this.boost({spa: 1});
}
},
id: "berserk",
name: "Berserk",
rating: 2.5,
num: 201,
},
"bigpecks": {
shortDesc: "Prevents other Pokemon from lowering this Pokemon's Defense stat stage.",
onBoost(boost, target, source, effect) {
if (source && target === source) return;
if (boost.def && boost.def < 0) {
delete boost.def;
if (!effect.secondaries) this.add("-fail", target, "unboost", "Defense", "[from] ability: Big Pecks", "[of] " + target);
}
},
id: "bigpecks",
name: "Big Pecks",
rating: 0.5,
num: 145,
},
"blaze": {
desc: "When this Pokemon has 1/3 or less of its maximum HP, rounded down, its attacking stat is multiplied by 1.5 while using a Fire-type attack.",
shortDesc: "At 1/3 or less of its max HP, this Pokemon's attacking stat is 1.5x with Fire attacks.",
onModifyAtkPriority: 5,
onModifyAtk(atk, attacker, defender, move) {
if (move.type === 'Fire' && attacker.hp <= attacker.maxhp / 3) {
this.debug('Blaze boost');
return this.chainModify(1.5);
}
},
onModifySpAPriority: 5,
onModifySpA(atk, attacker, defender, move) {
if (move.type === 'Fire' && attacker.hp <= attacker.maxhp / 3) {
this.debug('Blaze boost');
return this.chainModify(1.5);
}
},
id: "blaze",
name: "Blaze",
rating: 2.5,
num: 66,
},
"bulletproof": {
desc: "This Pokemon is immune to ballistic moves. Ballistic moves include Bullet Seed, Octazooka, Barrage, Rock Wrecker, Zap Cannon, Acid Spray, Aura Sphere, Focus Blast, and all moves with Ball or Bomb in their name.",
shortDesc: "Makes user immune to ballistic moves (Shadow Ball, Sludge Bomb, Focus Blast, etc).",
onTryHit(pokemon, target, move) {
if (move.flags['bullet']) {
this.add('-immune', pokemon, '[from] ability: Bulletproof');
return null;
}
},
id: "bulletproof",
name: "Bulletproof",
rating: 3.5,
num: 171,
},
"cheekpouch": {
desc: "If this Pokemon eats a Berry, it restores 1/3 of its maximum HP, rounded down, in addition to the Berry's effect.",
shortDesc: "If this Pokemon eats a Berry, it restores 1/3 of its max HP after the Berry's effect.",
onEatItem(item, pokemon) {
this.heal(pokemon.maxhp / 3);
},
id: "cheekpouch",
name: "Cheek Pouch",
rating: 2,
num: 167,
},
"chlorophyll": {
shortDesc: "If Sunny Day is active, this Pokemon's Speed is doubled.",
onModifySpe(spe) {
if (this.field.isWeather(['sunnyday', 'desolateland'])) {
return this.chainModify(2);
}
},
id: "chlorophyll",
name: "Chlorophyll",
rating: 3,
num: 34,
},
"clearbody": {
shortDesc: "Prevents other Pokemon from lowering this Pokemon's stat stages.",
onBoost(boost, target, source, effect) {
if (source && target === source) return;
let showMsg = false;
for (let i in boost) {
// @ts-ignore
if (boost[i] < 0) {
// @ts-ignore
delete boost[i];
showMsg = true;
}
}
if (showMsg && !effect.secondaries) this.add("-fail", target, "unboost", "[from] ability: Clear Body", "[of] " + target);
},
id: "clearbody",
name: "Clear Body",
rating: 2,
num: 29,
},
"cloudnine": {
shortDesc: "While this Pokemon is active, the effects of weather conditions are disabled.",
onStart(pokemon) {
this.add('-ability', pokemon, 'Cloud Nine');
},
suppressWeather: true,
id: "cloudnine",
name: "Cloud Nine",
rating: 2.5,
num: 13,
},
"colorchange": {
desc: "This Pokemon's type changes to match the type of the last move that hit it, unless that type is already one of its types. This effect applies after all hits from a multi-hit move; Sheer Force prevents it from activating if the move has a secondary effect.",
shortDesc: "This Pokemon's type changes to the type of a move it's hit by, unless it has the type.",
onAfterMoveSecondary(target, source, move) {
if (!target.hp) return;
let type = move.type;
if (target.isActive && move.effectType === 'Move' && move.category !== 'Status' && type !== '???' && !target.hasType(type)) {
if (!target.setType(type)) return false;
this.add('-start', target, 'typechange', type, '[from] ability: Color Change');
if (target.side.active.length === 2 && target.position === 1) {
// Curse Glitch
const action = this.willMove(target);
if (action && action.move.id === 'curse') {
action.targetLoc = -1;
}
}
}
},
id: "colorchange",
name: "Color Change",
rating: 1,
num: 16,
},
"comatose": {
desc: "This Pokemon cannot be statused, and is considered to be asleep. Moongeist Beam, Sunsteel Strike, and the Mold Breaker, Teravolt, and Turboblaze Abilities cannot ignore this Ability.",
shortDesc: "This Pokemon cannot be statused, and is considered to be asleep.",
onStart(pokemon) {
this.add('-ability', pokemon, 'Comatose');
},
onSetStatus(status, target, source, effect) {
if (!effect || !effect.status) return false;
this.add('-immune', target, '[from] ability: Comatose');
return false;
},
// Permanent sleep "status" implemented in the relevant sleep-checking effects
isUnbreakable: true,
id: "comatose",
name: "Comatose",
rating: 3,
num: 213,
},
"competitive": {
desc: "This Pokemon's Special Attack is raised by 2 stages for each of its stat stages that is lowered by an opposing Pokemon.",
shortDesc: "This Pokemon's Sp. Atk is raised by 2 for each of its stats that is lowered by a foe.",
onAfterEachBoost(boost, target, source) {
if (!source || target.side === source.side) {
return;
}
let statsLowered = false;
for (let i in boost) {
// @ts-ignore
if (boost[i] < 0) {
statsLowered = true;
}
}
if (statsLowered) {
this.boost({spa: 2}, target, target, null, true);
}
},
id: "competitive",
name: "Competitive",
rating: 2.5,
num: 172,
},
"compoundeyes": {
shortDesc: "This Pokemon's moves have their accuracy multiplied by 1.3.",
onSourceModifyAccuracy(accuracy) {
if (typeof accuracy !== 'number') return;
this.debug('compoundeyes - enhancing accuracy');
return accuracy * 1.3;
},
id: "compoundeyes",
name: "Compound Eyes",
rating: 3.5,
num: 14,
},
"contrary": {
shortDesc: "If this Pokemon has a stat stage raised it is lowered instead, and vice versa.",
onBoost(boost, target, source, effect) {
if (effect && effect.id === 'zpower') return;
for (let i in boost) {
// @ts-ignore
boost[i] *= -1;
}
},
id: "contrary",
name: "Contrary",
rating: 4,
num: 126,
},
"corrosion": {
shortDesc: "This Pokemon can poison or badly poison other Pokemon regardless of their typing.",
// Implemented in sim/pokemon.js:Pokemon#setStatus
id: "corrosion",
name: "Corrosion",
rating: 2.5,
num: 212,
},
"cursedbody": {
desc: "If this Pokemon is hit by an attack, there is a 30% chance that move gets disabled unless one of the attacker's moves is already disabled.",
shortDesc: "If this Pokemon is hit by an attack, there is a 30% chance that move gets disabled.",
onAfterDamage(damage, target, source, move) {
if (!source || source.volatiles['disable']) return;
if (source !== target && move && move.effectType === 'Move' && !move.isFutureMove) {
if (this.randomChance(3, 10)) {
source.addVolatile('disable', this.effectData.target);
}
}
},
id: "cursedbody",
name: "Cursed Body",
rating: 2,
num: 130,
},
"cutecharm": {
desc: "There is a 30% chance a Pokemon making contact with this Pokemon will become infatuated if it is of the opposite gender.",
shortDesc: "30% chance of infatuating Pokemon of the opposite gender if they make contact.",
onAfterDamage(damage, target, source, move) {
if (move && move.flags['contact']) {
if (this.randomChance(3, 10)) {
source.addVolatile('attract', this.effectData.target);
}
}
},
id: "cutecharm",
name: "Cute Charm",
rating: 1,
num: 56,
},
"damp": {
desc: "While this Pokemon is active, Explosion, Mind Blown, Self-Destruct, and the Aftermath Ability are prevented from having an effect.",
shortDesc: "Prevents Explosion/Mind Blown/Self-Destruct/Aftermath while this Pokemon is active.",
id: "damp",
onAnyTryMove(target, source, effect) {
if (['explosion', 'mindblown', 'selfdestruct'].includes(effect.id)) {
this.attrLastMove('[still]');
this.add('cant', this.effectData.target, 'ability: Damp', effect, '[of] ' + target);
return false;
}
},
onAnyDamage(damage, target, source, effect) {
if (effect && effect.id === 'aftermath') {
return false;
}
},
name: "Damp",
rating: 1,
num: 6,
},
"dancer": {
desc: "After another Pokemon uses a dance move, this Pokemon uses the same move. Moves used by this Ability cannot be copied again.",
shortDesc: "After another Pokemon uses a dance move, this Pokemon uses the same move.",
id: "dancer",
name: "Dancer",
// implemented in runMove in scripts.js
rating: 2.5,
num: 216,
},
"darkaura": {
desc: "While this Pokemon is active, the power of Dark-type moves used by active Pokemon is multiplied by 1.33.",
shortDesc: "While this Pokemon is active, a Dark move used by any Pokemon has 1.33x power.",
onStart(pokemon) {
this.add('-ability', pokemon, 'Dark Aura');
},
onAnyBasePower(basePower, source, target, move) {
if (target === source || move.category === 'Status' || move.type !== 'Dark') return;
if (!move.auraBooster) move.auraBooster = this.effectData.target;
if (move.auraBooster !== this.effectData.target) return;
return this.chainModify([move.hasAuraBreak ? 0x0C00 : 0x1547, 0x1000]);
},
isUnbreakable: true,
id: "darkaura",
name: "Dark Aura",
rating: 3,
num: 186,
},
"dazzling": {
desc: "While this Pokemon is active, priority moves from opposing Pokemon targeted at allies are prevented from having an effect.",
shortDesc: "While this Pokemon is active, allies are protected from opposing priority moves.",
onFoeTryMove(target, source, effect) {
if ((source.side === this.effectData.target.side || effect.id === 'perishsong') && effect.priority > 0.1 && effect.target !== 'foeSide') {
this.attrLastMove('[still]');
this.add('cant', this.effectData.target, 'ability: Dazzling', effect, '[of] ' + target);
return false;
}
},
id: "dazzling",
name: "Dazzling",
rating: 2.5,
num: 219,
},
"defeatist": {
desc: "While this Pokemon has 1/2 or less of its maximum HP, its Attack and Special Attack are halved.",
shortDesc: "While this Pokemon has 1/2 or less of its max HP, its Attack and Sp. Atk are halved.",
onModifyAtkPriority: 5,
onModifyAtk(atk, pokemon) {
if (pokemon.hp <= pokemon.maxhp / 2) {
return this.chainModify(0.5);
}
},
onModifySpAPriority: 5,
onModifySpA(atk, pokemon) {
if (pokemon.hp <= pokemon.maxhp / 2) {
return this.chainModify(0.5);
}
},
id: "defeatist",
name: "Defeatist",
rating: -1,
num: 129,
},
"defiant": {
desc: "This Pokemon's Attack is raised by 2 stages for each of its stat stages that is lowered by an opposing Pokemon.",
shortDesc: "This Pokemon's Attack is raised by 2 for each of its stats that is lowered by a foe.",
onAfterEachBoost(boost, target, source) {
if (!source || target.side === source.side) {
return;
}
let statsLowered = false;
for (let i in boost) {
// @ts-ignore
if (boost[i] < 0) {
statsLowered = true;
}
}
if (statsLowered) {
this.boost({atk: 2}, target, target, null, true);
}
},
id: "defiant",
name: "Defiant",
rating: 2.5,
num: 128,
},
"deltastream": {
desc: "On switch-in, the weather becomes strong winds that remove the weaknesses of the Flying type from Flying-type Pokemon. This weather remains in effect until this Ability is no longer active for any Pokemon, or the weather is changed by Desolate Land or Primordial Sea.",
shortDesc: "On switch-in, strong winds begin until this Ability is not active in battle.",
onStart(source) {
this.field.setWeather('deltastream');
},
onAnySetWeather(target, source, weather) {
if (this.field.getWeather().id === 'deltastream' && !['desolateland', 'primordialsea', 'deltastream'].includes(weather.id)) return false;
},
onEnd(pokemon) {
if (this.field.weatherData.source !== pokemon) return;
for (const target of this.getAllActive()) {
if (target === pokemon) continue;
if (target.hasAbility('deltastream')) {
this.field.weatherData.source = target;
return;
}
}
this.field.clearWeather();
},
id: "deltastream",
name: "Delta Stream",
rating: 5,
num: 191,
},
"desolateland": {
desc: "On switch-in, the weather becomes extremely harsh sunlight that prevents damaging Water-type moves from executing, in addition to all the effects of Sunny Day. This weather remains in effect until this Ability is no longer active for any Pokemon, or the weather is changed by Delta Stream or Primordial Sea.",
shortDesc: "On switch-in, extremely harsh sunlight begins until this Ability is not active in battle.",
onStart(source) {
this.field.setWeather('desolateland');
},
onAnySetWeather(target, source, weather) {
if (this.field.getWeather().id === 'desolateland' && !['desolateland', 'primordialsea', 'deltastream'].includes(weather.id)) return false;
},
onEnd(pokemon) {
if (this.field.weatherData.source !== pokemon) return;
for (const target of this.getAllActive()) {
if (target === pokemon) continue;
if (target.hasAbility('desolateland')) {
this.field.weatherData.source = target;
return;
}
}
this.field.clearWeather();
},
id: "desolateland",
name: "Desolate Land",
rating: 5,
num: 190,
},
"disguise": {
desc: "If this Pokemon is a Mimikyu, the first hit it takes in battle deals 0 neutral damage. Its disguise is then broken and it changes to Busted Form. Confusion damage also breaks the disguise.",
shortDesc: "If this Pokemon is a Mimikyu, the first hit it takes in battle deals 0 neutral damage.",
onDamagePriority: 1,
onDamage(damage, target, source, effect) {
if (effect && effect.effectType === 'Move' && ['mimikyu', 'mimikyutotem'].includes(target.template.speciesid) && !target.transformed) {
this.add('-activate', target, 'ability: Disguise');
this.effectData.busted = true;
return 0;
}
},
onEffectiveness(typeMod, target, type, move) {
if (!target) return;
if (!['mimikyu', 'mimikyutotem'].includes(target.template.speciesid) || target.transformed || (target.volatiles['substitute'] && !(move.flags['authentic'] || move.infiltrates))) return;
if (!target.runImmunity(move.type)) return;
return 0;
},
onUpdate(pokemon) {
if (['mimikyu', 'mimikyutotem'].includes(pokemon.template.speciesid) && this.effectData.busted) {
let templateid = pokemon.template.speciesid === 'mimikyutotem' ? 'Mimikyu-Busted-Totem' : 'Mimikyu-Busted';
pokemon.formeChange(templateid, this.effect, true);
}
},
id: "disguise",
name: "Disguise",
rating: 4,
num: 209,
},
"download": {
desc: "On switch-in, this Pokemon's Attack or Special Attack is raised by 1 stage based on the weaker combined defensive stat of all opposing Pokemon. Attack is raised if their Defense is lower, and Special Attack is raised if their Special Defense is the same or lower.",
shortDesc: "On switch-in, Attack or Sp. Atk is raised 1 stage based on the foes' weaker Defense.",
onStart(pokemon) {
let totaldef = 0;
let totalspd = 0;
for (const target of pokemon.side.foe.active) {
if (!target || target.fainted) continue;
totaldef += target.getStat('def', false, true);
totalspd += target.getStat('spd', false, true);
}
if (totaldef && totaldef >= totalspd) {
this.boost({spa: 1});
} else if (totalspd) {
this.boost({atk: 1});
}
},
id: "download",
name: "Download",
rating: 3.5,
num: 88,
},
"drizzle": {
shortDesc: "On switch-in, this Pokemon summons Rain Dance.",
onStart(source) {
for (const action of this.queue) {
if (action.choice === 'runPrimal' && action.pokemon === source && source.template.speciesid === 'kyogre') return;
if (action.choice !== 'runSwitch' && action.choice !== 'runPrimal') break;
}
this.field.setWeather('raindance');
},
id: "drizzle",
name: "Drizzle",
rating: 4.5,
num: 2,
},
"drought": {
shortDesc: "On switch-in, this Pokemon summons Sunny Day.",
onStart(source) {
for (const action of this.queue) {
if (action.choice === 'runPrimal' && action.pokemon === source && source.template.speciesid === 'groudon') return;
if (action.choice !== 'runSwitch' && action.choice !== 'runPrimal') break;
}
this.field.setWeather('sunnyday');
},
id: "drought",
name: "Drought",
rating: 4.5,
num: 70,
},
"dryskin": {
desc: "This Pokemon is immune to Water-type moves and restores 1/4 of its maximum HP, rounded down, when hit by a Water-type move. The power of Fire-type moves is multiplied by 1.25 when used on this Pokemon. At the end of each turn, this Pokemon restores 1/8 of its maximum HP, rounded down, if the weather is Rain Dance, and loses 1/8 of its maximum HP, rounded down, if the weather is Sunny Day.",
shortDesc: "This Pokemon is healed 1/4 by Water, 1/8 by Rain; is hurt 1.25x by Fire, 1/8 by Sun.",
onTryHit(target, source, move) {
if (target !== source && move.type === 'Water') {
if (!this.heal(target.maxhp / 4)) {
this.add('-immune', target, '[from] ability: Dry Skin');
}
return null;
}
},
onFoeBasePowerPriority: 7,
onFoeBasePower(basePower, attacker, defender, move) {
if (this.effectData.target !== defender) return;
if (move.type === 'Fire') {
return this.chainModify(1.25);
}
},
onWeather(target, source, effect) {
if (effect.id === 'raindance' || effect.id === 'primordialsea') {
this.heal(target.maxhp / 8);
} else if (effect.id === 'sunnyday' || effect.id === 'desolateland') {
this.damage(target.maxhp / 8, target, target);
}
},
id: "dryskin",
name: "Dry Skin",
rating: 3,
num: 87,
},
"earlybird": {
shortDesc: "This Pokemon's sleep counter drops by 2 instead of 1.",
id: "earlybird",
name: "Early Bird",
// Implemented in statuses.js
rating: 2,
num: 48,
},
"effectspore": {
desc: "30% chance a Pokemon making contact with this Pokemon will be poisoned, paralyzed, or fall asleep.",
shortDesc: "30% chance of poison/paralysis/sleep on others making contact with this Pokemon.",
onAfterDamage(damage, target, source, move) {
if (move && move.flags['contact'] && !source.status && source.runStatusImmunity('powder')) {
let r = this.random(100);
if (r < 11) {
source.setStatus('slp', target);
} else if (r < 21) {
source.setStatus('par', target);
} else if (r < 30) {
source.setStatus('psn', target);
}
}
},
id: "effectspore",
name: "Effect Spore",
rating: 2,
num: 27,
},
"electricsurge": {
shortDesc: "On switch-in, this Pokemon summons Electric Terrain.",
onStart(source) {
this.field.setTerrain('electricterrain');
},
id: "electricsurge",
name: "Electric Surge",
rating: 4,
num: 226,
},
"emergencyexit": {
desc: "When this Pokemon has more than 1/2 its maximum HP and takes damage bringing it to 1/2 or less of its maximum HP, it immediately switches out to a chosen ally. This effect applies after all hits from a multi-hit move; Sheer Force prevents it from activating if the move has a secondary effect. This effect applies to both direct and indirect damage, except Curse and Substitute on use, Belly Drum, Pain Split, and confusion damage.",
shortDesc: "This Pokemon switches out when it reaches 1/2 or less of its maximum HP.",
onAfterMoveSecondary(target, source, move) {
if (!source || source === target || !target.hp || !move.totalDamage) return;
const lastAttackedBy = target.getLastAttackedBy();
if (!lastAttackedBy) return;
const damage = move.multihit ? move.totalDamage : lastAttackedBy.damage;
if (target.hp <= target.maxhp / 2 && target.hp + damage > target.maxhp / 2) {
if (!this.canSwitch(target.side) || target.forceSwitchFlag || target.switchFlag) return;
target.switchFlag = true;
source.switchFlag = false;
this.add('-activate', target, 'ability: Emergency Exit');
}
},
onAfterDamage(damage, target, source, effect) {
if (!target.hp || effect.effectType === 'Move') return;
if (target.hp <= target.maxhp / 2 && target.hp + damage > target.maxhp / 2) {
if (!this.canSwitch(target.side) || target.forceSwitchFlag || target.switchFlag) return;
target.switchFlag = true;
this.add('-activate', target, 'ability: Emergency Exit');
}
},
id: "emergencyexit",
name: "Emergency Exit",
rating: 1.5,
num: 194,
},
"fairyaura": {
desc: "While this Pokemon is active, the power of Fairy-type moves used by active Pokemon is multiplied by 1.33.",
shortDesc: "While this Pokemon is active, a Fairy move used by any Pokemon has 1.33x power.",
onStart(pokemon) {
this.add('-ability', pokemon, 'Fairy Aura');
},
onAnyBasePower(basePower, source, target, move) {
if (target === source || move.category === 'Status' || move.type !== 'Fairy') return;
if (!move.auraBooster) move.auraBooster = this.effectData.target;
if (move.auraBooster !== this.effectData.target) return;
return this.chainModify([move.hasAuraBreak ? 0x0C00 : 0x1547, 0x1000]);
},
isUnbreakable: true,
id: "fairyaura",
name: "Fairy Aura",
rating: 3,
num: 187,
},
"filter": {
shortDesc: "This Pokemon receives 3/4 damage from supereffective attacks.",
onSourceModifyDamage(damage, source, target, move) {
if (target.getMoveHitData(move).typeMod > 0) {
this.debug('Filter neutralize');
return this.chainModify(0.75);
}
},
id: "filter",
name: "Filter",
rating: 3,
num: 111,
},
"flamebody": {
shortDesc: "30% chance a Pokemon making contact with this Pokemon will be burned.",
onAfterDamage(damage, target, source, move) {
if (move && move.flags['contact']) {
if (this.randomChance(3, 10)) {
source.trySetStatus('brn', target);
}
}
},
id: "flamebody",
name: "Flame Body",
rating: 2,
num: 49,
},
"flareboost": {
desc: "While this Pokemon is burned, the power of its special attacks is multiplied by 1.5.",
shortDesc: "While this Pokemon is burned, its special attacks have 1.5x power.",
onBasePowerPriority: 8,
onBasePower(basePower, attacker, defender, move) {
if (attacker.status === 'brn' && move.category === 'Special') {
return this.chainModify(1.5);
}
},
id: "flareboost",
name: "Flare Boost",
rating: 2.5,
num: 138,
},
"flashfire": {
desc: "This Pokemon is immune to Fire-type moves. The first time it is hit by a Fire-type move, its attacking stat is multiplied by 1.5 while using a Fire-type attack as long as it remains active and has this Ability. If this Pokemon is frozen, it cannot be defrosted by Fire-type attacks.",
shortDesc: "This Pokemon's Fire attacks do 1.5x damage if hit by one Fire move; Fire immunity.",
onTryHit(target, source, move) {
if (target !== source && move.type === 'Fire') {
move.accuracy = true;
if (!target.addVolatile('flashfire')) {
this.add('-immune', target, '[from] ability: Flash Fire');
}
return null;
}
},
onEnd(pokemon) {
pokemon.removeVolatile('flashfire');
},
effect: {
noCopy: true, // doesn't get copied by Baton Pass
onStart(target) {
this.add('-start', target, 'ability: Flash Fire');
},
onModifyAtkPriority: 5,
onModifyAtk(atk, attacker, defender, move) {
if (move.type === 'Fire') {
this.debug('Flash Fire boost');
return this.chainModify(1.5);
}
},
onModifySpAPriority: 5,
onModifySpA(atk, attacker, defender, move) {
if (move.type === 'Fire') {
this.debug('Flash Fire boost');
return this.chainModify(1.5);
}
},
onEnd(target) {
this.add('-end', target, 'ability: Flash Fire', '[silent]');
},
},
id: "flashfire",
name: "Flash Fire",
rating: 3,
num: 18,
},
"flowergift": {
desc: "If this Pokemon is a Cherrim and Sunny Day is active, it changes to Sunshine Form and the Attack and Special Defense of it and its allies are multiplied by 1.5.",
shortDesc: "If user is Cherrim and Sunny Day is active, it and allies' Attack and Sp. Def are 1.5x.",
onStart(pokemon) {
delete this.effectData.forme;
},
onUpdate(pokemon) {
if (!pokemon.isActive || pokemon.baseTemplate.baseSpecies !== 'Cherrim' || pokemon.transformed) return;
if (this.field.isWeather(['sunnyday', 'desolateland'])) {
if (pokemon.template.speciesid !== 'cherrimsunshine') {
pokemon.formeChange('Cherrim-Sunshine', this.effect, false, '[msg]');
}
} else {
if (pokemon.template.speciesid === 'cherrimsunshine') {
pokemon.formeChange('Cherrim', this.effect, false, '[msg]');
}
}
},