Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.BattleAbilities = {
- "adaptability": {
- inherit: true,
- onModifyMove: function (move) {
- move.stab = 8/3;
- }
- },
- "aftermath": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (source && source !== target && move && move.isContact && !target.hp) {
- this.damage(source.maxhp / 2, source, target, null, true);
- }
- }
- },
- "aerilate": {
- inherit: true,
- effect: {
- duration: 1,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, pokemon, target, move) {
- return this.chainModify([0x199A, 0x1000]);
- }
- }
- },
- "analytic": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (!this.willMove(defender)) {
- this.debug('Analytic boost');
- return this.chainModify([0x199A, 0x1000]); // The Analytic modifier is slightly higher than the normal 1.3 (0x14CC)
- }
- }
- },
- "baddreams": {
- inherit: true,
- onResidual: function (pokemon) {
- if (!pokemon.hp) return;
- for (var i = 0; i < pokemon.side.foe.active.length; i++) {
- var target = pokemon.side.foe.active[i];
- if (!target || !target.hp) continue;
- if (target.status === 'slp') {
- this.damage(target.maxhp / 4, target);
- }
- }
- }
- },
- "blaze": {
- inherit: true,
- onModifyAtk: function (atk, attacker, defender, move) {
- if (move.type === 'Fire' && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Blaze boost');
- return this.chainModify(2);
- }
- },
- onModifySpA: function (atk, attacker, defender, move) {
- if (move.type === 'Fire' && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Blaze boost');
- return this.chainModify(2);
- }
- }
- },
- "cheekpouch": {
- inherit: true,
- onEatItem: function (item, pokemon) {
- this.heal(2 * pokemon.maxhp / 3);
- }
- },
- "chlorophyll": {
- inherit: true,
- onModifySpe: function (speMod) {
- if (this.isWeather(['sunnyday', 'desolateland'])) {
- return this.chain(speMod, 3);
- }
- }
- },
- "competitive": {
- inherit: true,
- onAfterEachBoost: function (boost, target, source) {
- if (!source || target.side === source.side) {
- return;
- }
- var statsLowered = false;
- for (var i in boost) {
- if (boost[i] < 0) {
- statsLowered = true;
- }
- }
- if (statsLowered) {
- this.boost({spa: 4});
- }
- }
- },
- "compoundeyes": {
- inherit: true,
- onSourceAccuracy: function (accuracy) {
- if (typeof accuracy !== 'number') return;
- this.debug('compoundeyes - enhancing accuracy');
- return accuracy * 1.6;
- }
- },
- "cursedbody": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (!source || source.volatiles['disable']) return;
- if (source !== target && move && move.effectType === 'Move') {
- if (this.random(10) < 6) {
- source.addVolatile('disable');
- }
- }
- }
- },
- "cutecharm": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (move && move.isContact) {
- if (this.random(10) < 6) {
- source.addVolatile('attract', target);
- }
- }
- }
- },
- "defeatist": {
- inherit: true,
- onModifyAtk: function (atk, pokemon) {
- if (pokemon.hp < pokemon.maxhp / 2) {
- return this.chainModify(1/3);
- }
- },
- onModifySpA: function (atk, pokemon) {
- if (pokemon.hp < pokemon.maxhp / 2) {
- return this.chainModify(1/3);
- }
- }
- },
- "defiant": {
- inherit: true,
- onAfterEachBoost: function (boost, target, source) {
- if (!source || target.side === source.side) {
- return;
- }
- var statsLowered = false;
- for (var i in boost) {
- if (boost[i] < 0) {
- statsLowered = true;
- }
- }
- if (statsLowered) {
- this.boost({atk: 4});
- }
- }
- },
- "download": {
- inherit: true,
- onStart: function (pokemon) {
- var foeactive = pokemon.side.foe.active;
- var totaldef = 0;
- var totalspd = 0;
- for (var i = 0; i < foeactive.length; i++) {
- if (!foeactive[i] || foeactive[i].fainted) continue;
- totaldef += foeactive[i].getStat('def', false, true);
- totalspd += foeactive[i].getStat('spd', false, true);
- }
- if (totaldef && totaldef >= totalspd) {
- this.boost({spa:2});
- } else if (totalspd) {
- this.boost({atk:2});
- }
- }
- },
- "dryskin": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === 'Water') {
- if (!this.heal(target.maxhp / 2)) {
- this.add('-immune', target, '[msg]');
- }
- return null;
- }
- },
- onFoeBasePower: function (basePower, attacker, defender, move) {
- if (this.effectData.target !== defender) return;
- if (move.type === 'Fire') {
- return this.chainModify(1.5);
- }
- },
- onWeather: function (target, source, effect) {
- if (effect.id === 'raindance' || effect.id === 'primordialsea') {
- this.heal(target.maxhp / 4);
- } else if (effect.id === 'sunnyday' || effect.id === 'desolateland') {
- this.damage(target.maxhp / 4);
- }
- }
- },
- "effectspore": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (move && move.isContact && !source.status && source.runImmunity('powder')) {
- var r = this.random(100);
- if (r < 21) {
- source.setStatus('slp', target);
- } else if (r < 41) {
- source.setStatus('par', target);
- } else if (r < 60) {
- source.setStatus('psn', target);
- }
- }
- }
- },
- "filter": {
- inherit: true,
- onSourceModifyDamage: function (damage, source, target, move) {
- if (target.runEffectiveness(move) > 0) {
- this.debug('Filter neutralize');
- return this.chainModify(0.5);
- }
- }
- },
- "flamebody": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (move && move.isContact) {
- if (this.random(10) < 6) {
- source.trySetStatus('brn', target, move);
- }
- }
- }
- },
- "flareboost": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (attacker.status === 'brn' && move.category === 'Special') {
- return this.chainModify(2);
- }
- }
- },
- "flashfire": {
- inherit: true,
- effect: {
- noCopy: true, // doesn't get copied by Baton Pass
- onStart: function (target) {
- this.add('-start', target, 'ability: Flash Fire');
- },
- onModifyAtkPriority: 5,
- onModifyAtk: function (atk, attacker, defender, move) {
- if (move.type === 'Fire') {
- this.debug('Flash Fire boost');
- return this.chainModify(2);
- }
- },
- onModifySpAPriority: 5,
- onModifySpA: function (atk, attacker, defender, move) {
- if (move.type === 'Fire') {
- this.debug('Flash Fire boost');
- return this.chainModify(2);
- }
- }
- }
- },
- "flowergift": {
- inherit: true,
- onAllyModifyAtk: function (atk) {
- if (this.effectData.target.template.speciesid !== 'cherrim') return;
- if (this.isWeather(['sunnyday', 'desolateland'])) {
- return this.chainModify(2);
- }
- },
- onAllyModifySpD: function (spd) {
- if (this.effectData.target.template.speciesid !== 'cherrim') return;
- if (this.isWeather(['sunnyday', 'desolateland'])) {
- return this.chainModify(2);
- }
- }
- },
- "forewarn": {
- inherit: true,
- onStart: function (pokemon) {
- var targets = pokemon.side.foe.active;
- var warnMoves0 = [];
- var warnMoves1 = [];
- var warnBp0 = 1;
- var warnBp1 = 1;
- for (var i = 0; i < targets.length; i++) {
- if (targets[i].fainted) continue;
- for (var j = 0; j < targets[i].moveset.length; j++) {
- var move = this.getMove(targets[i].moveset[j].move);
- var bp = move.basePower;
- if (move.ohko) bp = 160;
- if (move.id === 'counter' || move.id === 'metalburst' || move.id === 'mirrorcoat') bp = 120;
- if (!bp && move.category !== 'Status') bp = 80;
- if (bp > warnBp0) {
- warnMoves1 = warnMoves0;
- warnMoves0 = [[move, targets[i]]];
- warnBp1 = warnBp0;
- warnBp0 = bp;
- } else if (bp === warnBp0) {
- warnMoves0.push([move, targets[i]]);
- } else if (bp === warnBp1) {
- warnMoves1.push([move, targets[i]]);
- }
- }
- }
- if (!warnMoves0.length) return;
- var warnMove0 = warnMoves0[this.random(warnMoves0.length)];
- this.add('-activate', pokemon, 'ability: Forewarn', warnMove0[0], warnMove0[1]);
- if (!warnMoves1.length) return;
- var warnMove1 = warnMoves1[this.random(warnMoves1.length)];
- this.add('-activate', pokemon, 'ability: Forewarn', warnMove1[0], warnMove0[1]);
- }
- },
- "friendguard": {
- inherit: true,
- onAnyModifyDamage: function (damage, source, target, move) {
- if (target !== this.effectData.target && target.side === this.effectData.target.side) {
- this.debug('Friend Guard weaken');
- return this.chainModify(0.5);
- }
- }
- },
- "furcoat": {
- inherit: true,
- onModifyDef: function (def) {
- return this.chainModify(3);
- }
- },
- "galewings": {
- inherit: true,
- onModifyPriority: function (priority, pokemon, target, move) {
- if (move && move.type === 'Flying') return priority + 2;
- }
- },
- "gooey": {
- inherit: true,
- onAfterDamage: function (damage, target, source, effect) {
- if (effect && effect.isContact) this.boost({spe: -2}, source, target);
- }
- },
- "grasspelt": {
- inherit: true,
- onModifyDef: function (pokemon) {
- if (this.isTerrain('grassyterrain')) return this.chainModify(2);
- }
- },
- "guts": {
- inherit: true,
- onModifyAtk: function (atk, pokemon) {
- if (pokemon.status) {
- return this.chainModify(2);
- }
- }
- },
- "harvest": {
- inherit: true,
- onResidual: function (pokemon) {
- if (pokemon.hp && !pokemon.item && this.getItem(pokemon.lastItem).isBerry) {
- pokemon.setItem(pokemon.lastItem);
- this.add('-item', pokemon, pokemon.getItem(), '[from] ability: Harvest');
- }
- }
- },
- "healer": {
- inherit: true,
- onResidual: function (pokemon) {
- var allyActive = pokemon.side.active;
- if (allyActive.length === 1) {
- return;
- }
- for (var i = 0; i < allyActive.length; i++) {
- if (allyActive[i] && this.isAdjacent(pokemon, allyActive[i]) && allyActive[i].status && this.random(10) < 6) {
- allyActive[i].cureStatus();
- }
- }
- }
- },
- "heatproof": {
- inherit: true,
- onSourceBasePower: function (basePower, attacker, defender, move) {
- if (move.type === 'Fire') {
- return this.chainModify(1/3);
- }
- },
- onDamage: function (damage, target, source, effect) {
- if (effect && effect.id === 'brn') {
- return damage / 3;
- }
- },
- },
- "heavymetal": {
- inherit: true,
- onModifyPokemon: function (pokemon) {
- pokemon.weightkg *= 3;
- }
- },
- "hugepower": {
- inherit: true,
- onModifyAtk: function (atk) {
- return this.chainModify(3);
- }
- },
- "hustle": {
- inherit: true,
- onModifyAtk: function (atk) {
- return this.modify(atk, 2);
- },
- onModifyMove: function (move) {
- if (move.category === 'Physical' && typeof move.accuracy === 'number') {
- move.accuracy *= 0.6;
- }
- }
- },
- "icebody": {
- inherit: true,
- onWeather: function (target, source, effect) {
- if (effect.id === 'hail') {
- this.heal(target.maxhp / 8);
- }
- }
- },
- "intimidate": {
- inherit: true,
- onStart: function (pokemon) {
- var foeactive = pokemon.side.foe.active;
- for (var i = 0; i < foeactive.length; i++) {
- if (!foeactive[i] || !this.isAdjacent(foeactive[i], pokemon)) continue;
- if (foeactive[i].volatiles['substitute']) {
- // does it give a message?
- this.add('-activate', foeactive[i], 'Substitute', 'ability: Intimidate', '[of] ' + pokemon);
- } else {
- this.add('-ability', pokemon, 'Intimidate', '[of] ' + foeactive[i]);
- this.boost({atk: -2}, foeactive[i], pokemon);
- }
- }
- }
- },
- "ironbarbs": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (source && source !== target && move && move.isContact) {
- this.damage(source.maxhp / 4, source, target, null, true);
- }
- }
- },
- "ironfist": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.isPunchAttack) {
- this.debug('Iron Fist boost');
- return this.chainModify(1.4);
- }
- }
- },
- "justified": {
- inherit: true,
- onAfterDamage: function (damage, target, source, effect) {
- if (effect && effect.type === 'Dark') {
- this.boost({atk:2});
- }
- }
- },
- "lightmetal": {
- inherit: true,
- onModifyPokemon: function (pokemon) {
- pokemon.weightkg /= 3;
- }
- },
- "lightningrod": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === 'Electric') {
- if (!this.boost({spa:2})) {
- this.add('-immune', target, '[msg]');
- }
- return null;
- }
- }
- },
- "liquidooze": {
- inherit: true,
- onSourceTryHeal: function (damage, target, source, effect) {
- this.debug("Heal is occurring: " + target + " <- " + source + " :: " + effect.id);
- var canOoze = {drain: 1, leechseed: 1};
- if (canOoze[effect.id]) {
- this.damage(damage * 2, null, null, null, true);
- return 0;
- }
- }
- },
- "marvelscale": {
- inherit: true,
- onModifyDef: function (def, pokemon) {
- if (pokemon.status) {
- return this.chainModify(2);
- }
- }
- },
- "megalauncher": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.flags && move.flags['pulse']) {
- return this.chainModify(2);
- }
- }
- },
- "minus": {
- inherit: true,
- onModifySpA: function (spa, pokemon) {
- var allyActive = pokemon.side.active;
- if (allyActive.length === 1) {
- return;
- }
- for (var i = 0; i < allyActive.length; i++) {
- if (allyActive[i] && allyActive[i].position !== pokemon.position && !allyActive[i].fainted && allyActive[i].hasAbility(['minus', 'plus'])) {
- return this.chainModify(2);
- }
- }
- }
- },
- "moody": {
- inherit: true,
- onResidual: function (pokemon) {
- var stats = [], i = '';
- var boost = {};
- for (var i in pokemon.boosts) {
- if (pokemon.boosts[i] < 6) {
- stats.push(i);
- }
- }
- if (stats.length) {
- i = stats[this.random(stats.length)];
- boost[i] = 4;
- }
- stats = [];
- for (var j in pokemon.boosts) {
- if (pokemon.boosts[j] > -6 && j !== i) {
- stats.push(j);
- }
- }
- if (stats.length) {
- i = stats[this.random(stats.length)];
- boost[i] = -2;
- }
- this.boost(boost);
- }
- },
- "motordrive": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === 'Electric') {
- if (!this.boost({spe:2})) {
- this.add('-immune', target, '[msg]');
- }
- return null;
- }
- }
- },
- "moxie": {
- inherit: true,
- onSourceFaint: function (target, source, effect) {
- if (effect && effect.effectType === 'Move') {
- this.boost({atk:2}, source);
- }
- }
- },
- "multiscale": {
- inherit: true,
- onSourceModifyDamage: function (damage, source, target, move) {
- if (target.hp >= target.maxhp) {
- this.debug('Multiscale weaken');
- return this.chainModify(1/3);
- }
- }
- },
- "overgrow": {
- inherit: true,
- onModifyAtk: function (atk, attacker, defender, move) {
- if (move.type === 'Grass' && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Overgrow boost');
- return this.chainModify(2);
- }
- },
- onModifySpA: function (atk, attacker, defender, move) {
- if (move.type === 'Grass' && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Overgrow boost');
- return this.chainModify(2);
- }
- }
- },
- "parentalbond": {
- inherit: true,
- onModifyMove: function (move, pokemon, target) {
- if (move.category !== 'Status' && !move.selfdestruct && !move.multihit && ((target.side && target.side.active.length < 2) || move.target in {any:1, normal:1, randomNormal:1})) {
- move.multihit = 3;
- pokemon.addVolatile('parentalbond');
- }
- },
- effect: {
- duration: 1,
- onBasePowerPriority: 8,
- onBasePower: function (basePower) {
- if (this.effectData.hit > 0) {
- return this.chainModify(Math.pow(.5, this.effectData.hit));
- } else {
- this.effectData.hit++;
- }
- }
- }
- },
- "pixilate": {
- inherit: true,
- effect: {
- duration: 1,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, pokemon, target, move) {
- return this.chainModify([0x199A, 0x1000]);
- }
- }
- },
- "plus": {
- inherit: true,
- onModifySpA: function (spa, pokemon) {
- var allyActive = pokemon.side.active;
- if (allyActive.length === 1) {
- return;
- }
- for (var i = 0; i < allyActive.length; i++) {
- if (allyActive[i] && allyActive[i].position !== pokemon.position && !allyActive[i].fainted && allyActive[i].hasAbility(['minus', 'plus'])) {
- return this.chainModify(2);
- }
- }
- }
- },
- "poisonheal": {
- inherit: true,
- onDamage: function (damage, target, source, effect) {
- if (effect.id === 'psn' || effect.id === 'tox') {
- this.heal(target.maxhp / 4);
- return false;
- }
- }
- },
- "poisonpoint": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (move && move.isContact) {
- if (this.random(10) < 6) {
- source.trySetStatus('psn', target, move);
- }
- }
- }
- },
- "poisontouch": {
- inherit: true,
- onModifyMove: function (move) {
- if (!move || !move.isContact) return;
- if (!move.secondaries) {
- move.secondaries = [];
- }
- move.secondaries.push({
- chance: 60,
- status: 'psn'
- });
- }
- },
- "prankster": {
- inherit: true,
- onModifyPriority: function (priority, pokemon, target, move) {
- if (move && move.category === 'Status') {
- return priority + 2;
- }
- }
- },
- "pressure": {
- inherit: true,
- onSourceDeductPP: function (pp, target, source) {
- if (target.side === source.side) return;
- return pp + 2;
- }
- },
- "purepower": {
- inherit: true,
- onModifyAtk: function (atk) {
- return this.chainModify(3);
- }
- },
- "quickfeet": {
- inherit: true,
- onModifySpe: function (speMod, pokemon) {
- if (pokemon.status) {
- return this.chain(speMod, 2);
- }
- }
- },
- "raindish": {
- inherit: true,
- onWeather: function (target, source, effect) {
- if (effect.id === 'raindance' || effect.id === 'primordialsea') {
- this.heal(target.maxhp / 8);
- }
- }
- },
- "rattled": {
- inherit: true,
- onAfterDamage: function (damage, target, source, effect) {
- if (effect && (effect.type === 'Dark' || effect.type === 'Bug' || effect.type === 'Ghost')) {
- this.boost({spe:2});
- }
- }
- },
- "reckless": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.recoil || move.hasCustomRecoil) {
- this.debug('Reckless boost');
- return this.chainModify(1.4);
- }
- }
- },
- "refrigerate": {
- inherit: true,
- effect: {
- duration: 1,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, pokemon, target, move) {
- return this.chainModify([0x199A, 0x1000]);
- }
- }
- },
- "regenerator": {
- inherit: true,
- onSwitchOut: function (pokemon) {
- pokemon.heal(2 * pokemon.maxhp / 3);
- }
- },
- "rivalry": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (attacker.gender && defender.gender) {
- if (attacker.gender === defender.gender) {
- this.debug('Rivalry boost');
- return this.chainModify(1.5);
- } else {
- this.debug('Rivalry weaken');
- return this.chainModify(0.5);
- }
- }
- }
- },
- "roughskin": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (source && source !== target && move && move.isContact) {
- this.damage(source.maxhp / 4, source, target, null, true);
- }
- }
- },
- "sandforce": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (this.isWeather('sandstorm')) {
- if (move.type === 'Rock' || move.type === 'Ground' || move.type === 'Steel') {
- this.debug('Sand Force boost');
- return this.chainModify([0x199A, 0x1000]); // The Sand Force modifier is slightly higher than the normal 1.3 (0x14CC)
- }
- }
- }
- },
- "sandrush": {
- inherit: true,
- onModifySpe: function (speMod, pokemon) {
- if (this.isWeather('sandstorm')) {
- return this.chain(speMod, 3);
- }
- }
- },
- "sandveil": {
- inherit: true,
- onAccuracy: function (accuracy) {
- if (typeof accuracy !== 'number') return;
- if (this.isWeather('sandstorm')) {
- this.debug('Sand Veil - decreasing accuracy');
- return 2 * accuracy / 3; //Technically, this is a 50% increase in evasion.
- }
- }
- },
- "sapsipper": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === 'Grass') {
- if (!this.boost({atk:2})) {
- this.add('-immune', target, '[msg]');
- }
- return null;
- }
- },
- onAllyTryHitSide: function (target, source, move) {
- if (target.side !== source.side) return;
- if (move.type === 'Grass') {
- this.boost({atk:2}, this.effectData.target);
- }
- }
- },
- "serenegrace": {
- inherit: true,
- onModifyMove: function (move) {
- if (move.secondaries && move.id !== 'secretpower') {
- this.debug('doubling secondary chance');
- for (var i = 0; i < move.secondaries.length; i++) {
- move.secondaries[i].chance *= 3;
- }
- }
- }
- },
- "shedskin": {
- inherit: true,
- onResidual: function (pokemon) {
- if (pokemon.hp && pokemon.status && this.random(3) < 2) {
- this.debug('shed skin');
- this.add('-activate', pokemon, 'ability: Shed Skin');
- pokemon.cureStatus();
- }
- }
- },
- "sheerforce": {
- inherit: true,
- effect: {
- duration: 1,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, pokemon, target, move) {
- return this.chainModify([0x199A, 0x1000]); // The Sheer Force modifier is slightly higher than the normal 1.3 (0x14CC)
- }
- }
- },
- "simple": {
- inherit: true,
- onBoost: function (boost) {
- for (var i in boost) {
- boost[i] *= 3;
- }
- }
- },
- "slowstart": {
- inherit: true,
- effect: {
- duration: 5, //Why is this still 5? If we were to make this 10, we'd have a quadrupling effect, not a doubling effect.
- onStart: function (target) {
- this.add('-start', target, 'Slow Start');
- },
- onModifyAtkPriority: 5,
- onModifyAtk: function (atk, pokemon) {
- if (pokemon.ignore['Ability'] === true || pokemon.ability !== 'slowstart') {
- pokemon.removeVolatile('slowstart');
- return;
- }
- return this.chainModify(0.25);
- },
- onModifySpe: function (speMod, pokemon) {
- if (pokemon.ignore['Ability'] === true || pokemon.ability !== 'slowstart') {
- pokemon.removeVolatile('slowstart');
- return;
- }
- return this.chain(speMod, 0.25);
- },
- onEnd: function (target) {
- this.add('-end', target, 'Slow Start');
- }
- }
- },
- "sniper": {
- inherit: true,
- onModifyDamage: function (damage, source, target, move) {
- if (move.crit) {
- this.debug('Sniper boost');
- return this.chainModify(2);
- }
- }
- },
- "snowcloak": {
- inherit: true,
- onAccuracy: function (accuracy) {
- if (typeof accuracy !== 'number') return;
- if (this.isWeather('hail')) {
- this.debug('Snow Cloak - decreasing accuracy');
- return 2 * accuracy / 3; //Technically, this is a 50% increase in evasion.
- }
- }
- },
- "solarpower": {
- inherit: true,
- onModifySpA: function (spa, pokemon) {
- if (this.isWeather(['sunnyday', 'desolateland'])) {
- return this.chainModify(2);
- }
- },
- onWeather: function (target, source, effect) {
- if (effect.id === 'sunnyday' || effect.id === 'desolateland') {
- this.damage(target.maxhp / 4);
- }
- }
- },
- "solidrock": {
- inherit: true,
- onSourceModifyDamage: function (damage, source, target, move) {
- if (target.runEffectiveness(move) > 0) {
- this.debug('Solid Rock neutralize');
- return this.chainModify(0.5);
- }
- }
- },
- "speedboost": {
- inherit: true,
- onResidual: function (pokemon) {
- if (pokemon.activeTurns) {
- this.boost({spe:2}); //gotta go fast
- }
- }
- },
- "stall": {
- inherit: true,
- onModifyPriority: function (priority) {
- return priority - 0.2; //Not that this makes a difference :^)
- }
- },
- "static": {
- inherit: true,
- onAfterDamage: function (damage, target, source, effect) {
- if (effect && effect.isContact) {
- if (this.random(10) < 6) {
- source.trySetStatus('par', target, effect);
- }
- }
- }
- },
- "steadfast": {
- inherit: true,
- onFlinch: function (pokemon) {
- this.boost({spe: 2});
- }
- },
- "stench": {
- inherit: true,
- onModifyMove: function (move) {
- if (move.category !== "Status") {
- this.debug('Adding Stench flinch');
- if (!move.secondaries) move.secondaries = [];
- for (var i = 0; i < move.secondaries.length; i++) {
- if (move.secondaries[i].volatileStatus === 'flinch') return;
- }
- move.secondaries.push({
- chance: 20,
- volatileStatus: 'flinch'
- });
- }
- }
- },
- "stormdrain": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === 'Water') {
- if (!this.boost({spa:2})) {
- this.add('-immune', target, '[msg]');
- }
- return null;
- }
- }
- },
- "strongjaw": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.flags && move.flags['bite']) {
- return this.chainModify(2);
- }
- }
- },
- "sturdy": {
- inherit: true,
- onDamage: function (damage, target, source, effect) {
- if (effect && effect.ohko) {
- this.add('-activate', target, 'Sturdy');
- return 0;
- }
- if (target.hp === target.maxhp && damage >= target.hp && effect && effect.effectType === 'Move') {
- this.add('-activate', target, 'Sturdy');
- if (target.hp === 1) return 0; //Just in case
- return target.hp - 2; //Does this even matter
- }
- }
- },
- "superluck": {
- inherit: true,
- onModifyMove: function (move) {
- (move.critRatio++)++;
- }
- },
- "swarm": {
- inherit: true,
- onModifyAtk: function (atk, attacker, defender, move) {
- if (move.type === 'Bug' && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Swarm boost');
- return this.chainModify(2);
- }
- },
- onModifySpA: function (atk, attacker, defender, move) {
- if (move.type === 'Bug' && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Swarm boost');
- return this.chainModify(2);
- }
- }
- },
- "swiftswim": {
- inherit: true,
- onModifySpe: function (speMod, pokemon) {
- if (this.isWeather(['raindance', 'primordialsea'])) {
- return this.chain(speMod, 3);
- }
- }
- },
- "tangledfeet": {
- inherit: true,
- onAccuracy: function (accuracy, target) {
- if (typeof accuracy !== 'number') return;
- if (target && target.volatiles['confusion']) {
- this.debug('Tangled Feet - decreasing accuracy');
- return accuracy / 3;
- }
- }
- },
- "technician": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (basePower <= 60) {
- this.debug('Technician boost');
- return this.chainModify(2);
- }
- }
- },
- "thickfat": {
- inherit: true,
- onSourceModifyAtk: function (atk, attacker, defender, move) {
- if (move.type === 'Ice' || move.type === 'Fire') {
- this.debug('Thick Fat weaken');
- return this.chainModify(1/3);
- }
- },
- onSourceModifySpA: function (atk, attacker, defender, move) {
- if (move.type === 'Ice' || move.type === 'Fire') {
- this.debug('Thick Fat weaken');
- return this.chainModify(1/3);
- }
- }
- },
- "tintedlens": {
- inherit: true,
- onModifyDamage: function (damage, source, target, move) {
- if (target.runEffectiveness(move) < 0) {
- this.debug('Tinted Lens boost');
- return this.chainModify(3);
- }
- }
- },
- "torrent": {
- inherit: true,
- onModifyAtk: function (atk, attacker, defender, move) {
- if (move.type === 'Water' && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Torrent boost');
- return this.chainModify(2);
- }
- },
- onModifySpA: function (atk, attacker, defender, move) {
- if (move.type === 'Water' && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Torrent boost');
- return this.chainModify(2);
- }
- }
- },
- "toxicboost": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if ((attacker.status === 'psn' || attacker.status === 'tox') && move.category === 'Physical') {
- return this.chainModify(2);
- }
- }
- },
- "toughclaws": {
- inherit: true,
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.isContact) {
- return this.chainModify(1.66);
- }
- }
- },
- "truant": {
- inherit: true,
- effect: {
- duration: 3
- }
- },
- "unburden": {
- inherit: true,
- effect: {
- onModifySpe: function (speMod, pokemon) {
- if (pokemon.ignore['Ability'] === true || pokemon.ability !== 'unburden') {
- pokemon.removeVolatile('unburden');
- return;
- }
- if (!pokemon.item) {
- return this.chain(speMod, 3);
- }
- }
- }
- },
- "victorystar": {
- inherit: true,
- onAllyModifyMove: function (move) {
- if (typeof move.accuracy === 'number') {
- move.accuracy *= 1.2;
- }
- }
- },
- "voltabsorb": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === 'Electric') {
- if (!this.heal(target.maxhp / 2)) {
- this.add('-immune', target, '[msg]');
- }
- return null;
- }
- }
- },
- "waterabsorb": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === 'Water') {
- if (!this.heal(target.maxhp / 2)) {
- this.add('-immune', target, '[msg]');
- }
- return null;
- }
- }
- },
- "weakarmor": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (move.category === 'Physical') {
- this.boost({spe:2, def:-2});
- }
- }
- },
- "wonderskin": {
- inherit: true,
- onAccuracy: function (accuracy, target, source, move) {
- if (move.category === 'Status' && typeof move.accuracy === 'number') {
- this.debug('Wonder Skin - setting accuracy to 100/3');
- return 100/3;
- }
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement