Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- exports.BattleAbilities = {
- //worth mentioning that -ates still list the normal type moves as the -ate type
- //I have confirmed that -ates work though
- //all weathers only use rock, water, ice, or fire
- "drizzle": {
- inherit: true,
- onStart: function (source) {
- switch(source.hpType) {
- case 'Fire':
- this.setWeather('sunnyday');
- break;
- case 'Ice':
- this.setWeather('hail');
- break;
- case 'Rock':
- this.setWeather('sandstorm');
- break;
- default:
- this.setWeather('raindance');
- break;
- }
- }
- },
- "drought": {
- inherit: true,
- onStart: function (source) {
- switch(source.hpType) {
- case 'Water':
- this.setWeather('raindance');
- break;
- case 'Ice':
- this.setWeather('hail');
- break;
- case 'Rock':
- this.setWeather('sandstorm');
- break;
- default:
- this.setWeather('sunnyday');
- break;
- }
- }
- },
- "sandstream": {
- inherit: true,
- onStart: function (source) {
- switch(source.hpType) {
- case 'Fire':
- this.setWeather('sunnyday');
- break;
- case 'Water':
- this.setWeather('raindance');
- break;
- case 'Ice':
- this.setWeather('hail');
- break;
- default:
- this.setWeather('sandstorm');
- break;
- }
- }
- },
- "snowwarning": {
- inherit: true,
- onStart: function (source) {
- switch(source.hpType) {
- case 'Fire':
- this.setWeather('sunnyday');
- break;
- case 'Water':
- this.setWeather('raindance');
- break;
- case 'Rock':
- this.setWeather('sandstorm');
- break;
- default:
- this.setWeather('hail');
- break;
- }
- }
- },
- "hydration": {
- inherit: true,
- onResidual: function (pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Fire':
- neededWeather = 'sunnyday';
- break;
- case 'Ice':
- neededWeather = 'hail';
- break;
- case 'Rock':
- neededWeather = 'sandstorm';
- break;
- default:
- neededWeather = 'raindance';
- break;
- }
- if (pokemon.status && this.isWeather(neededWeather)) {
- this.debug('hydration');
- this.add('-activate', pokemon, 'ability: Hydration');
- pokemon.cureStatus();
- }
- }
- },
- "leafguard": {
- inherit: true,
- onSetStatus: function (pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Water':
- neededWeather = 'raindance';
- break;
- case 'Ice':
- neededWeather = 'hail';
- break;
- case 'Rock':
- neededWeather = 'sandstorm';
- break;
- default:
- neededWeather = 'sunnyday';
- break;
- }
- if (this.isWeather(neededWeather)) {
- return false;
- }
- },
- onTryHit: function (target, source, move) {
- let hpType = target.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Water':
- neededWeather = 'raindance';
- break;
- case 'Ice':
- neededWeather = 'hail';
- break;
- case 'Rock':
- neededWeather = 'sandstorm';
- break;
- default:
- neededWeather = 'sunnyday';
- break;
- }
- if (move && move.id === 'yawn' && this.isWeather(neededWeather)) {
- return false;
- }
- }
- },
- "swiftswim": {
- inherit: true,
- onModifySpe: function (spe, pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Fire':
- neededWeather = 'sunnyday';
- break;
- case 'Ice':
- neededWeather = 'hail';
- break;
- case 'Rock':
- neededWeather = 'sandstorm';
- break;
- default:
- neededWeather = 'raindance';
- break;
- }
- if (this.isWeather(neededWeather)) {
- return this.chainModify(2);
- }
- },
- onImmunity: function (type, pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Ice':
- neededWeather = 'hail';
- break;
- default:
- neededWeather = 'sandstorm';
- break;
- }
- if (type === neededWeather) return false;
- }
- },
- "chlorophyll": {
- inherit: true,
- onModifySpe: function (spe, pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Water':
- neededWeather = 'raindance';
- break;
- case 'Ice':
- neededWeather = 'hail';
- break;
- case 'Rock':
- neededWeather = 'sandstorm';
- break;
- default:
- neededWeather = 'sunnyday';
- break;
- }
- if (this.isWeather(neededWeather)) {
- return this.chainModify(2);
- }
- },
- onImmunity: function (type, pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Ice':
- neededWeather = 'hail';
- break;
- default:
- neededWeather = 'sandstorm';
- break;
- }
- if (type === neededWeather) return false;
- }
- },
- "sandrush": {
- inherit: true,
- onModifySpe: function (spe, pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Water':
- neededWeather = 'raindance';
- break;
- case 'Ice':
- neededWeather = 'hail';
- break;
- case 'Fire':
- neededWeather = 'sunnyday';
- break;
- default:
- neededWeather = 'sandstorm';
- break;
- }
- if (this.isWeather(neededWeather)) {
- return this.chainModify(2);
- }
- },
- onImmunity: function (type, pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Ice':
- neededWeather = 'hail';
- break;
- default:
- neededWeather = 'sandstorm';
- break;
- }
- if (type === neededWeather) return false;
- }
- },
- "solarpower": {
- inherit: true,
- onModifySpA: function (spa, pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Water':
- neededWeather = 'raindance';
- break;
- case 'Ice':
- neededWeather = 'hail';
- break;
- case 'rock':
- neededWeather = 'sandstorm';
- break;
- default:
- neededWeather = 'sunnyday';
- break;
- }
- if (this.isWeather(neededWeather)) {
- return this.chainModify(1.5);
- }
- },
- onWeather: function (target, source, effect) {
- let hpType = target.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Water':
- neededWeather = 'raindance';
- break;
- case 'Ice':
- neededWeather = 'hail';
- break;
- case 'rock':
- neededWeather = 'sandstorm';
- break;
- default:
- neededWeather = 'sunnyday';
- break;
- }
- if (effect.id === neededWeather) {
- this.damage(target.maxhp / 8, target, target);
- }
- }
- },
- //ignoring flower gift bc it's exclusive to Cherrim
- //if you use cherrim, I'm sorry
- //also doesn't make any sense for it to change forms in something like hail
- //seriously though, if you use Cherrim, I'm sorry. Also don't use Cherrim.
- "sandveil": {
- inherit: true,
- onImmunity: function (type, pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Ice':
- neededWeather = 'hail';
- break;
- default:
- neededWeather = 'sandstorm';
- break;
- }
- if (type === neededWeather) return false;
- },
- onModifyAccuracy: function (accuracy, pokemon) {
- if (typeof accuracy !== 'number') return;
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Water':
- neededWeather = 'raindance';
- break;
- case 'Ice':
- neededWeather = 'hail';
- break;
- case 'Fire':
- neededWeather = 'sunnyday';
- break;
- default:
- neededWeather = 'sandstorm';
- break;
- }
- if (this.isWeather(neededWeather)) {
- this.debug('Sand Veil - decreasing accuracy');
- return accuracy * 0.8;
- }
- }
- },
- "snowcloak": {
- inherit: true,
- onImmunity: function (type, pokemon) {
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Rock':
- neededWeather = 'sandstorm';
- break;
- default:
- neededWeather = 'hail';
- break;
- }
- if (type === neededWeather) return false;
- },
- onModifyAccuracy: function (accuracy, pokemon) {
- if (typeof accuracy !== 'number') return;
- let hpType = pokemon.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Water':
- neededWeather = 'raindance';
- break;
- case 'Rock':
- neededWeather = 'sandstorm';
- break;
- case 'Fire':
- neededWeather = 'sunnyday';
- break;
- default:
- neededWeather = 'hail';
- break;
- }
- if (this.isWeather(neededWeather)) {
- this.debug('Snow Cloak - decreasing accuracy');
- return accuracy * 0.8;
- }
- }
- },
- "raindish": {
- inherit: true,
- onWeather: function (target, source, effect) {
- let hpType = target.hpType;
- let neededWeather = '';
- switch(hpType) {
- case 'Fire':
- neededWeather = 'sunnyday';
- break;
- case 'Ice':
- neededWeather = 'hail';
- break;
- case 'Rock':
- neededWeather = 'sandstorm';
- break;
- default:
- neededWeather = 'raindance';
- break;
- }
- if (effect.id === neededWeather) {
- this.heal(target.maxhp / 16);
- }
- }
- },
- //weather done, onto next ones, shouldn't need many switch functions now
- "aerilate": {
- inherit: true,
- onModifyMove: function (move, pokemon) {
- if (move.type === 'Normal' && move.id !== 'naturalgift') {
- move.type = pokemon.hpType;
- if (move.category !== 'Status') pokemon.addVolatile('aerilate');
- }
- }
- },
- "pixilate": {
- inherit: true,
- onModifyMove: function (move, pokemon) {
- if (move.type === 'Normal' && move.id !== 'naturalgift') {
- move.type = pokemon.hpType;
- if (move.category !== 'Status') pokemon.addVolatile('pixilate');
- }
- }
- },
- "refrigerate": {
- inherit: true,
- onModifyMove: function (move, pokemon) {
- if (move.type === 'Normal' && move.id !== 'naturalgift') {
- move.type = pokemon.hpType;
- if (move.category !== 'Status') pokemon.addVolatile('refrigerate');
- }
- }
- },
- //ates done
- "blaze": {
- inherit: true,
- onModifyAtk: function (atk, attacker, defender, move) {
- if (move.type === attacker.hpType && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Blaze boost');
- return this.chainModify(1.5);
- }
- },
- onModifySpA: function (atk, attacker, defender, move) {
- if (move.type === attacker.hpType && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Blaze boost');
- return this.chainModify(1.5);
- }
- }
- },
- "torrent": {
- inherit: true,
- onModifyAtk: function (atk, attacker, defender, move) {
- if (move.type === attacker.hpType && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Torrent boost');
- return this.chainModify(1.5);
- }
- },
- onModifySpA: function (atk, attacker, defender, move) {
- if (move.type === attacker.hpType && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Torrent boost');
- return this.chainModify(1.5);
- }
- }
- },
- "overgrow": {
- inherit: true,
- onModifyAtk: function (atk, attacker, defender, move) {
- if (move.type === attacker.hpType && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Overgrow boost');
- return this.chainModify(1.5);
- }
- },
- onModifySpA: function (atk, attacker, defender, move) {
- if (move.type === attacker.hpType && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Overgrow boost');
- return this.chainModify(1.5);
- }
- }
- },
- "swarm": {
- inherit: true,
- onModifyAtk: function (atk, attacker, defender, move) {
- if (move.type === attacker.hpType && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Swarm boost');
- return this.chainModify(1.5);
- }
- },
- onModifySpA: function (atk, attacker, defender, move) {
- if (move.type === attacker.hpType && attacker.hp <= attacker.maxhp / 3) {
- this.debug('Swarm boost');
- return this.chainModify(1.5);
- }
- }
- },
- //skipping Uber only abilities, also Flower Veil
- "galewings": {
- inherit: true,
- onModifyPriority: function (priority, pokemon, target, move) {
- if (move && move.type === pokemon.hpType) return priority + 1;
- }
- },
- "heatproof": {
- inherit: true,
- onSourceBasePower: function (basePower, attacker, defender, move) {
- if (move.type === defender.hpType) {
- return this.chainModify(0.5);
- }
- }
- //ignoring halving toxic damage bc they're already steel
- },
- "justified": {
- inherit: true,
- onAfterDamage: function (damage, target, source, effect) {
- if (effect && effect.type === target.hpType) {
- this.boost({atk:1});
- }
- }
- },
- "levitate": {
- inherit: true,
- onImmunity: function (type, pokemon) {
- if (type === pokemon.hpType) return false;
- }
- },
- "lightningrod": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === target.hpType) {
- if (!this.boost({spa:1})) {
- this.add('-immune', target, '[msg]', '[from] ability: Lightning Rod');
- }
- return null;
- }
- }
- },
- "magnetpull": {
- //fixed!
- inherit: true,
- onFoeModifyPokemon: function (pokemon) {
- //useful to know, user of ability is this.effectData.target
- if (pokemon.hasType(this.effectData.target.hpType) && this.isAdjacent(pokemon, this.effectData.target)) {
- pokemon.tryTrap(true);
- }
- },
- onFoeMaybeTrapPokemon: function (pokemon, source) {
- if (!source) source = this.effectData.target;
- if (pokemon.hasType(source.hpType) && this.isAdjacent(pokemon, source)) {
- pokemon.maybeTrapped = true;
- }
- }
- },
- "motordrive": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === target.hpType) {
- if (!this.boost({spe:1})) {
- this.add('-immune', target, '[msg]', '[from] ability: Motor Drive');
- }
- return null;
- }
- }
- },
- "normalize": {
- inherit: true,
- onModifyMove: function (move, pokemon) {
- if (move.id !== 'struggle') {
- move.type = pokemon.hpType;
- }
- }
- },
- //"scrappy" problem
- "stormdrain": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === target.hpType) {
- if (!this.boost({spa:1})) {
- this.add('-immune', target, '[msg]', '[from] ability: Storm Drain');
- }
- return null;
- }
- }
- },
- "sapsipper": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === target.hpType) {
- if (!this.boost({atk:1})) {
- this.add('-immune', target, '[msg]', '[from] ability: Sap Sipper');
- }
- return null;
- }
- }
- },
- "voltabsorb": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === target.hpType) {
- if (!this.heal(target.maxhp / 4)) {
- this.add('-immune', target, '[msg]', '[from] ability: Volt Absorb');
- }
- return null;
- }
- }
- },
- "waterabsorb": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === target.hpType) {
- if (!this.heal(target.maxhp / 4)) {
- this.add('-immune', target, '[msg]', '[from] ability: Water Absorb');
- }
- return null;
- }
- }
- },
- "flashfire": {
- //note: flash fire will raise the power of its Hidden Power type moves
- //can't change the message displayed
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === target.hpType) {
- move.accuracy = true;
- if (!target.addVolatile('flashfire')) {
- this.add('-immune', target, '[msg]', '[from] ability: Flash Fire');
- }
- return null;
- }
- },
- 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 === defender.hpType) {
- this.debug('Flash Fire boost');
- return this.chainModify(1.5);
- }
- },
- onModifySpAPriority: 5,
- onModifySpA: function (atk, attacker, defender, move) {
- if (move.type === defender.hpType) {
- this.debug('Flash Fire boost');
- return this.chainModify(1.5);
- }
- },
- onEnd: function (target) {
- this.add('-end', target, 'ability: Flash Fire', '[silent]');
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement