Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*config.formats.js*/
- {
- name: "Ghoul King's Pet Mod",
- desc: ["A Pet Mod aimed at improving balance."],
- section: "Other Metagames",
- mod: "ghoulking",
- ruleset: ['Pokemon', 'Standard', 'Baton Pass Clause', 'Team Preview'],
- banlist: ['Arceus', 'Blaziken', 'Darkrai', 'Deoxys', 'Deoxys-Attack', 'Deoxys-Defense', 'Deoxys-Speed', 'Giratina-Origin', 'Groudon',
- 'Ho-Oh', 'Kyogre', 'Kyurem-Black', 'Kyurem-White', 'Lugia', 'Mewtwo', 'Palkia', 'Rayquaza', 'Reshiram',
- 'Xerneas', 'Yveltal', 'Zekrom', 'Kangaskhanite', 'Salamencite', 'Soul Dew',
- ],
- onEffectiveness: function (typeMod, target, type, move) {
- if (move && move.effectType === 'Move' && (type === 'Dragon' || type === 'Fairy') && target.side.foe.active[0].hasType('Normal') && move.type === 'Normal') return 1;
- },
- onModifyMove: function (move) {
- let critMult;
- move.critRatio = this.clampIntRange(move.critRatio, 0, 4);
- critMult = [0, 0, 4, 2, 1];
- },
- },
- /*/* mods/ghoulking/moves.js */
- 'use strict';
- exports.BattleMovedex = {
- fakeout: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'faked',
- },
- },
- blizzard: {
- inherit: true,
- onModifyMove: function (move) {
- if (this.isWeather(['hail', 'iceage'])) move.accuracy = true;
- },
- },
- weatherball: {
- inherit: true,
- onModifyMove: function (move) {
- switch (this.effectiveWeather()) {
- case 'sunnyday':
- case 'desolateland':
- move.type = 'Fire';
- break;
- case 'raindance':
- case 'primordialsea':
- move.type = 'Water';
- break;
- case 'sandstorm':
- move.type = 'Rock';
- break;
- case 'hail':
- case 'iceage':
- move.type = 'Ice';
- break;
- }
- },
- },
- synthesis: {
- inherit: true,
- onHit: function (pokemon) {
- if (this.isWeather(['sunnyday', 'desolateland'])) {
- this.heal(this.modify(pokemon.maxhp, 0.667));
- } else if (this.isWeather(['raindance', 'primordialsea', 'sandstorm', 'hail', 'iceage'])) {
- this.heal(this.modify(pokemon.maxhp, 0.25));
- } else {
- this.heal(this.modify(pokemon.maxhp, 0.5));
- }
- },
- },
- moonlight: {
- inherit: true,
- onHit: function (pokemon) {
- if (this.isWeather(['sunnyday', 'desolateland'])) {
- this.heal(this.modify(pokemon.maxhp, 0.667));
- } else if (this.isWeather(['raindance', 'primordialsea', 'sandstorm', 'hail', 'iceage'])) {
- this.heal(this.modify(pokemon.maxhp, 0.25));
- } else {
- this.heal(this.modify(pokemon.maxhp, 0.5));
- }
- },
- },
- morningsun: {
- inherit: true,
- onHit: function (pokemon) {
- if (this.isWeather(['sunnyday', 'desolateland'])) {
- this.heal(this.modify(pokemon.maxhp, 0.667));
- } else if (this.isWeather(['raindance', 'primordialsea', 'sandstorm', 'hail', 'iceage'])) {
- this.heal(this.modify(pokemon.maxhp, 0.25));
- } else {
- this.heal(this.modify(pokemon.maxhp, 0.5));
- }
- },
- },
- skillswap: {
- inherit: true,
- onTryHit: function (target, source) {
- let bannedAbilities = {illusion:1, multitype:1, stancechange:1, wonderguard:1, fluidity:1, forecast:1};
- if (bannedAbilities[target.ability] || bannedAbilities[source.ability]) {
- return false;
- }
- },
- },
- entrainment: {
- inherit: true,
- onTryHit: function (target, source) {
- if (target === source) return false;
- let bannedTargetAbilities = {multitype:1, stancechange:1, truant:1, fluidity: 1, forecast:1};
- let bannedSourceAbilities = {flowergift:1, forecast:1, illusion:1, imposter:1, multitype:1, stancechange:1, trace:1, zenmode:1, fluidity: 1};
- if (bannedTargetAbilities[target.ability] || bannedSourceAbilities[source.ability] || target.ability === source.ability) {
- return false;
- }
- },
- },
- gastroacid: {
- inherit: true,
- onTryHit: function (pokemon) {
- let bannedAbilities = {multitype:1, stancechange:1, fluidity: 1, forecast:1};
- if (bannedAbilities[pokemon.ability]) {
- return false;
- }
- },
- },
- worryseed: {
- inherit: true,
- onTryHit: function (pokemon) {
- let bannedAbilities = {insomnia:1, multitype:1, stancechange:1, truant:1, fluidity: 1, forecast:1};
- if (bannedAbilities[pokemon.ability]) {
- return false;
- }
- },
- },
- roleplay: {
- inherit: true,
- onTryHit: function (target, source) {
- let bannedAbilities = {flowergift:1, forecast:1, illusion:1, imposter:1, multitype:1, trace:1, wonderguard:1, zenmode:1, fluidity: 1};
- if (bannedAbilities[target.ability] || source.ability === 'multitype' || target.ability === source.ability) {
- return false;
- }
- },
- },
- simplebeam: {
- inherit: true,
- onTryHit: function (pokemon) {
- let bannedAbilities = {multitype:1, simple:1, stancechange:1, truant:1, fluidity:1, forecast:1};
- if (bannedAbilities[pokemon.ability]) {
- return false;
- }
- },
- },
- willowisp: {
- inherit: true,
- accuracy: 100
- },
- toxic: {
- inherit: true,
- accuracy: 100
- },
- poisongas: {
- inerit: true,
- accuracy: 100,
- pp: 40,
- status: 'psn',
- target: 'allAdjacentFoes'
- },
- leechseed: {
- inherit: true,
- accuracy: 100
- },
- magmastorm: {
- inherit: true,
- accuracy: 100,
- basePower: 80
- },
- hyperfang: {
- inherit: true,
- accuracy: 100,
- basePower: 100,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- skydrop: {
- inherit: true,
- basePower: 75
- },
- dragontail: {
- inherit: true,
- accuracy: true
- },
- circlethrow: {
- inherit: true,
- accuracy: true
- },
- outrage: {
- inherit: true,
- target: "Normal",
- basePower: 150,
- pp: 5,
- self: {
- boosts: {
- spe: -1,
- def: -1,
- spd: -1
- }
- },
- },
- petaldance: {
- inherit: true,
- target: "Normal",
- basePower: 150,
- pp: 5,
- self: {
- boosts: {
- spe: -1,
- def: -1,
- spd: -1
- }
- },
- },
- thrash: {
- inherit: true,
- target: "Normal",
- basePower: 150,
- pp: 5,
- self: {
- boosts: {
- spe: -1,
- def: -1,
- spd: -1
- }
- },
- },
- rage: {
- inherit: true,
- Type: "Dark",
- basePower: 80,
- pp: 20,
- self: {
- boosts: {
- atk: 1,
- def: -1,
- spd: -1
- }
- },
- },
- megapunch: {
- inherit: true,
- priority: 1,
- accuracy: 100,
- self: {
- boosts: {
- def: -1,
- spd: -1
- }
- },
- },
- megakick: {
- inherit: true,
- priority: 1,
- accuracy: 100,
- self: {
- volatileStatus: 'mustrecharge'
- },
- },
- crushgrip: {
- inherit: true,
- basePowerCallback: function (pokemon, target) {
- return Math.floor(Math.floor((150 * (100 * Math.floor(target.hp * 4096 / target.maxhp)) + 2048 - 1) / 4096) / 100) || 1;
- },
- },
- crushclaw: {
- inherit: true,
- accuracy: 100,
- secondary: {
- chance: 100,
- boosts: {
- def: -1
- }
- },
- },
- stealthrock: {
- inherit: true,
- effect: {
- // this is a side condition
- onStart: function (side) {
- this.add('-sidestart', side, 'move: Stealth Rock');
- },
- onSwitchIn: function (pokemon) {
- if (pokemon.hasType('Rock') || pokemon.hasAbility('battlearmor')) {
- this.add('-sideend', pokemon.side, 'move: Stealth Rock', '[of] ' + pokemon);
- pokemon.side.removeSideCondition('stealthrock');
- }
- else var typeMod = this.clampIntRange(pokemon.runEffectiveness('Rock'), -6, 6);
- this.damage(pokemon.maxhp * Math.pow(2, typeMod) / 12);
- }
- },
- },
- spikes: {
- inherit: true,
- effect: {
- // this is a side condition
- onStart: function (side) {
- this.add('-sidestart', side, 'Spikes');
- this.effectData.layers = 1;
- },
- onRestart: function (side) {
- if (this.effectData.layers >= 3) return false;
- this.add('-sidestart', side, 'Spikes');
- this.effectData.layers++;
- },
- onSwitchIn: function (pokemon) {
- if (!pokemon.isGrounded()) return;
- if (pokemon.hasAbility('battlearmor')) {
- this.add('-sideend', pokemon.side, 'move: Spikes', '[of] ' + pokemon);
- pokemon.side.removeSideCondition('spikes');
- }
- if (!pokemon.hasAbility('battlearmor')) {
- let damageAmounts = [0, 3, 4, 6]; // 1/8, 1/6, 1/4
- this.damage(damageAmounts[this.effectData.layers] * pokemon.maxhp / 24);
- }
- }
- },
- },
- toxicspikes: {
- inherit: true,
- effect: {
- // this is a side condition
- onStart: function (side) {
- this.add('-sidestart', side, 'move: Toxic Spikes');
- this.effectData.layers = 1;
- },
- onRestart: function (side) {
- if (this.effectData.layers >= 2) return false;
- this.add('-sidestart', side, 'move: Toxic Spikes');
- this.effectData.layers++;
- },
- onSwitchIn: function (pokemon) {
- if (!pokemon.isGrounded()) return;
- if (!pokemon.runImmunity('Poison')) return;
- if (pokemon.hasType('Poison') || pokemon.hasAbility('battlearmor')) {
- this.add('-sideend', pokemon.side, 'move: Toxic Spikes', '[of] ' + pokemon);
- pokemon.side.removeSideCondition('toxicspikes');
- } else if (this.effectData.layers >= 2) {
- pokemon.trySetStatus('tox', pokemon.side.foe.active[0]);
- } else {
- pokemon.trySetStatus('psn', pokemon.side.foe.active[0]);
- }
- },
- },
- },
- stickyweb: {
- inherit: true,
- effect: {
- onStart: function (side) {
- this.add('-sidestart', side, 'move: Sticky Web');
- },
- onSwitchIn: function (pokemon) {
- if (!pokemon.isGrounded()) return;
- if (pokemon.hasAbility('battlearmor')) {
- this.add('-sideend', pokemon.side, 'move: stickyweb', '[of] ' + pokemon);
- pokemon.side.removeSideCondition('stickyweb');
- }
- else this.boost({spe: -1}, pokemon, pokemon.side.foe.active[0], this.getMove('stickyweb'));
- this.add('-activate', pokemon, 'move: Sticky Web');
- },
- },
- },
- assist: {
- inherit: true,
- onHit: function (target) {
- let moves = [];
- for (let i in exports.BattleMovedex) {
- let move = exports.BattleMovedex[i];
- if (i !== move.id) continue;
- if (move.isNonstandard) continue;
- let noMetronome = {
- afteryou:1, assist:1, belch:1, bestow:1, celebrate:1, chatter:1, copycat:1, counter:1, covet:1, craftyshield:1, destinybond:1, detect:1, diamondstorm:1, dragonascent:1, endure:1, feint:1, focuspunch:1, followme:1, happyhour:1, helpinghand:1, holdhands:1, hyperspacefury:1, hyperspacehole:1, kingsshield:1, lightofruin:1, matblock:1, mefirst:1, metronome:1, mimic:1, mirrorcoat:1, mirrormove:1, naturepower:1, originpulse:1, precipiceblades:1, protect:1, quash:1, quickguard:1, ragepowder:1, relicsong:1, secretsword:1, sketch:1, sleeptalk:1, snarl:1, snatch:1, snore:1, spikyshield:1, steameruption:1, struggle:1, switcheroo:1, technoblast:1, thief:1, thousandarrows:1, thousandwaves:1, transform:1, trick:1, vcreate:1, wideguard:1, ancientpower:1, silverwind:1, ominouswind:1,
- };
- if (!noMetronome[move.id]) {
- moves.push(move);
- }
- }
- let randomMove = '';
- if (moves.length) {
- moves.sort(function (a, b) {return a.num - b.num;});
- randomMove = moves[this.random(moves.length)].id;
- }
- if (!randomMove) {
- return false;
- }
- this.useMove(randomMove, target);
- },
- },
- copycat: {
- inherit: true,
- onHit: function (pokemon) {
- let noCopycat = {assist:1, bestow:1, chatter:1, circlethrow:1, copycat:1, counter:1, covet:1, destinybond:1, detect:1, dragontail:1, endure:1, feint:1, focuspunch:1, followme:1, helpinghand:1, mefirst:1, metronome:1, mimic:1, mirrorcoat:1, mirrormove:1, naturepower:1, protect:1, ragepowder:1, roar:1, sketch:1, sleeptalk:1, snatch:1, struggle:1, switcheroo:1, thief:1, transform:1, trick:1, whirlwind:1, ancientpower:1, silverwind:1, ominouswind:1,};
- if (!this.lastMove || noCopycat[this.lastMove]) {
- return false;
- }
- this.useMove(this.lastMove, pokemon);
- },
- },
- kingsshield: {
- inherit: true,
- effect: {
- duration: 1,
- onStart: function (target) {
- this.add('-singleturn', target, 'Protect');
- },
- onTryHitPriority: 3,
- onTryHit: function (target, source, move) {
- if (!move.flags['protect'] || move.category === 'Status') return;
- this.add('-activate', target, 'Protect');
- let lockedmove = source.getVolatile('lockedmove');
- if (lockedmove) {
- // Outrage counter is reset
- if (source.volatiles['lockedmove'].duration === 2) {
- delete source.volatiles['lockedmove'];
- }
- }
- if (move.flags['contact'] && !source.hasAbility('Rock Head')) {
- this.boost({atk:-2}, source, target, this.getMove("King's Shield"));
- }
- return null;
- },
- },
- },
- spikyshield: {
- inherit: true,
- effect: {
- duration: 1,
- onStart: function (target) {
- this.add('-singleturn', target, 'move: Protect');
- },
- onTryHitPriority: 3,
- onTryHit: function (target, source, move) {
- if (!move.flags['protect']) return;
- this.add('-activate', target, 'Protect');
- let lockedmove = source.getVolatile('lockedmove');
- if (lockedmove) {
- // Outrage counter is reset
- if (source.volatiles['lockedmove'].duration === 2) {
- delete source.volatiles['lockedmove'];
- }
- }
- if (move.flags['contact'] && !source.hasAbility('Rock Head')) {
- this.damage(source.maxhp / 8, source, target);
- }
- return null;
- },
- },
- },
- hyperbeam: {
- inherit: true,
- accuracy: 100,
- forceSwitch: true
- },
- gigaimpact: {
- inherit: true,
- accuracy: 100,
- forceSwitch: true
- },
- rockwrecker: {
- inherit: true,
- accuracy: 100,
- forceSwitch: true
- },
- roaroftime: {
- inherit: true,
- accuracy: 100,
- forceSwitch: true
- },
- hydrocannon: {
- inherit: true,
- accuracy: 100,
- forceSwitch: true
- },
- blastburn: {
- inherit: true,
- accuracy: 100,
- forceSwitch: true
- },
- frenzyplant: {
- inherit: true,
- accuracy: 100,
- forceSwitch: true
- },
- dreameater: {
- inherit: true,
- basePower: 120
- },
- rockslide: {
- inherit: true,
- accuracy: 100,
- basePower: 70,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- airslash: {
- inherit: true,
- accuracy: 100,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- wringout: {
- inherit: true,
- type: "Grass"
- },
- psychoboost: {
- inherit: true,
- accuracy: 100
- },
- leafstorm: {
- inherit: true,
- accuracy: 100
- },
- overheat: {
- inherit: true,
- accuracy: 100
- },
- dracometeor: {
- inherit: true,
- accuracy: 100
- },
- spacialrend: {
- inherit: true,
- accuracy: 100
- },
- firespin: {
- inherit: true,
- accuracy: 100
- },
- wrap: {
- inherit: true,
- accuracy: 100
- },
- clamp: {
- inherit: true,
- accuracy: 100
- },
- bind: {
- inherit: true,
- accuracy: 100
- },
- whirlpool: {
- inherit: true,
- accuracy: 100
- },
- sandtomb: {
- inherit: true,
- accuracy: 100
- },
- crabhammer: {
- inherit: true,
- accuracy: 100
- },
- superfang: {
- inherit: true,
- accuracy: 100
- },
- sacredfire: {
- inherit: true,
- accuracy: 100
- },
- aeroblast: {
- inherit: true,
- accuracy: 100
- },
- dynamicpunch: {
- inherit: true,
- basePower: 110
- },
- meteormash: {
- inherit: true,
- accuracy: 100
- },
- firefang: {
- inherit: true,
- accuracy: 100,
- secondaries: [
- {
- chance: 10,
- status: 'brn',
- }, {
- chance: 100,
- volatileStatus: 'flinch',
- },
- ],
- },
- thunderfang: {
- inherit: true,
- accuracy: 100,
- secondaries: [
- {
- chance: 10,
- status: 'par',
- }, {
- chance: 100,
- volatileStatus: 'flinch',
- },
- ],
- },
- icefang: {
- inherit: true,
- accuracy: 100,
- secondaries: [
- {
- chance: 10,
- status: 'frz',
- }, {
- chance: 100,
- volatileStatus: 'flinch',
- },
- ],
- },
- poisonfang: {
- inherit: true,
- secondaries: [
- {
- chance: 50,
- status: 'tox',
- }, {
- chance: 100,
- volatileStatus: 'flinch',
- },
- ],
- },
- zenheadbutt: {
- inherit: true,
- accuracy: 100,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- astonish: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- bite: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- darkpulse: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- dragonrush: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- extrasensory: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- headbutt: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- heartstamp: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- ironhead: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- needlearm: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- snore: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- rollingkick: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- steamroller: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- stomp: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- twister: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- waterfall: {
- inherit: true,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- drillrun: {
- inherit: true,
- accuracy: 100
- },
- aircutter: {
- inherit: true,
- accuracy: 100
- },
- snarl: {
- inherit: true,
- accuracy: 100
- },
- cometpunch: {
- inherit: true,
- accuracy: 100,
- basePower: 25
- },
- hypervoice: {
- inherit: true,
- basePower: 100
- },
- playrough: {
- inherit: true,
- accuracy: 100,
- basePower: 85
- },
- iciclecrash: {
- inherit: true,
- accuracy: 100,
- basePower: 80,
- secondary: {
- chance: 100,
- volatileStatus: 'flinch',
- },
- },
- spikecannon: {
- inherit: true,
- priority: 1
- },
- paraboliccharge: {
- inherit: true,
- basepower: 65
- },
- belch: {
- inherit: true,
- accuracy: 100,
- basePower: 135
- },
- selfdestruct: {
- inherit: true,
- basePower: 180,
- type: "Fire"
- },
- octazooka: {
- inherit: true,
- accuracy: 100,
- priority: 1,
- basePower: 80,
- self: {
- boosts: {
- spa: -2
- }
- },
- },
- quash: {
- inherit: true,
- priority: 1
- },
- blazekick: {
- inherit: true,
- onEffectiveness: function (typeMod, type, move) {
- return typeMod + this.getEffectiveness('Fighting', type);
- },
- },
- skullbash: {
- inherit: true,
- secondary: {
- boosts: {
- def: -2
- }
- },
- },
- razorwind: {
- inherit: true,
- basePower: 120,
- accuracy: 100,
- onHit: function (target) {
- target.clearBoosts();
- this.add('-clearboost', target);
- },
- },
- quickguard: {
- inherit: true,
- priority: 4
- },
- craftyshield :{
- inherit: true,
- sideCondition: 'craftyshield',
- onTryHitSide: function (side, source) {
- return !!this.willAct();
- },
- effect: {
- duration: 3,
- onStart: function (target, source) {
- this.add('-singleturn', source, 'Crafty Shield');
- },
- onTryHitPriority: 3,
- onTryHit: function (target, source, move) {
- if (move.breaksProtect) {
- target.side.removeSideCondition('craftyshield');
- return;
- }
- if (move && (move.target === 'self' || move.category !== 'Status')) return;
- this.add('-activate', target, 'Crafty Shield');
- return null;
- }
- },
- },
- iondeluge: {
- inherit: true,
- pseudoWeather: 'iondeluge',
- effect: {
- duration: 4,
- onStart: function (target) {
- this.add('-fieldactivate', 'move: Ion Deluge');
- },
- onModifyMovePriority: -2,
- onModifyMove: function (move) {
- if (move.type === 'Normal') {
- move.type = 'Electric';
- this.debug(move.name + "'s type changed to Electric");
- }
- }
- },
- },
- bonemerang: {
- inherit: true,
- accuracy: 100,
- basePower: 45,
- onEffectiveness: function (typeMod, type) {
- if (type === 'Flying') return 1;
- },
- ignoreImmunity: {'Ground': true},
- },
- bonerush: {
- inherit: true,
- accuracy: 100,
- ignoreImmunity: {'Ground': true},
- },
- boneclub: {
- inherit: true,
- accuracy: 100,
- volatileStatus: 'smackdown',
- effect: {
- onStart: function (pokemon) {
- var applies = false;
- if (pokemon.hasType('Flying') || pokemon.hasAbility('levitate')) applies = true;
- if (pokemon.hasItem('ironball') || pokemon.volatiles['ingrain'] || this.getPseudoWeather('gravity')) applies = false;
- if (pokemon.removeVolatile('fly') || pokemon.removeVolatile('bounce')) {
- applies = true;
- this.cancelMove(pokemon);
- pokemon.removeVolatile('twoturnmove');
- }
- if (pokemon.volatiles['magnetrise']) {
- applies = true;
- delete pokemon.volatiles['magnetrise'];
- }
- if (pokemon.volatiles['telekinesis']) {
- applies = true;
- delete pokemon.volatiles['telekinesis'];
- }
- if (!applies) return false;
- this.add('-start', pokemon, 'Smack Down');
- },
- onRestart: function (pokemon) {
- if (pokemon.removeVolatile('fly') || pokemon.removeVolatile('bounce')) {
- this.cancelMove(pokemon);
- this.add('-start', pokemon, 'Smack Down');
- }
- },
- onNegateImmunity: function (pokemon, type) {
- if (type === 'Ground') return false;
- }
- },
- ignoreImmunity: {'Ground': true},
- secondary: false,
- },
- acidspray: {
- inherit: true,
- onEffectiveness: function (typeMod, type) {
- if (type === 'Steel') return 1;
- },
- ignoreImmunity: {'Poison': true},
- },
- acid: {
- inherit: true,
- basePower: 65,
- secondary: {
- chance: 20,
- boosts: {
- spd: -1
- }
- },
- onEffectiveness: function (typeMod, type) {
- if (type === 'Steel') return 1;
- },
- ignoreImmunity: {'Poison': true},
- },
- waterspout: {
- inherit: true,
- basePower: 140,
- basePowerCallback: function (pokemon) {
- return 140 * pokemon.hp / pokemon.maxhp;
- },
- },
- eruption: {
- inherit: true,
- basePower: 140,
- basePowerCallback: function (pokemon) {
- return 140 * pokemon.hp / pokemon.maxhp;
- },
- },
- chargebeam: {
- inherit: true,
- accuracy: 100,
- basePower: 40,
- self: {
- chance: 100,
- boost: {
- spa: 1
- }
- },
- },
- slash: {
- inherit: true,
- basePower: 65,
- willCrit: true
- },
- muddywater: {
- inherit: true,
- basePower: 80,
- accuracy: 100,
- secondary: {
- chance: 100,
- boosts: {
- spe: -1
- }
- },
- },
- powdersnow: {
- inherit: true,
- secondary: {
- chance: 30,
- status: 'frz',
- },
- },
- skyuppercut: {
- inherit: true,
- basePower: 70,
- accuracy: 100,
- onEffectiveness: function (typeMod, type) {
- if (type === 'Flying') return 0;
- },
- },
- dizzypunch: {
- inherit: true,
- basePower: 80,
- secondary: {
- chance: 100,
- volatileStatus: 'confusion',
- },
- },
- nightdaze: {
- inherit: true,
- basePower: 80,
- accuracy: 100,
- selfSwitch: true,
- secondary: false,
- },
- relicsong: {
- inherit: true,
- basePower: 60,
- volatileStatus: 'yawn',
- onHit: function (pokemon) {
- return undefined;
- },
- secondary: {
- chance: 100,
- onHit: function (target, source) {
- target.addVolatile('yawn');
- }
- },
- },
- incinerate: {
- inherit: true,
- onBasePowerPriority: 4,
- onBasePower: function (basePower, pokemon, target) {
- let item = target.getItem();
- if ((item.isBerry || item.isGem)) {
- return this.chainModify(2);
- }
- },
- },
- mysticalfire: {
- inherit: true,
- secondary: {
- chance: 100,
- boosts: {
- spa: -1,
- spd: -1
- }
- },
- },
- drillpeck: {
- inherit: true,
- critRatio: 2
- },
- rocksmash: {
- inherit: true,
- secondary: {
- chance: 100,
- boosts: {
- def: -1
- }
- },
- },
- poisontail: {
- inherit: true,
- basePower: 60,
- secondary: {
- chance: 30,
- status: 'psn'
- },
- },
- payback: {
- inherit: true,
- basePower: 65,
- basePowerCallback: function (pokemon, target) {
- if (target.newlySwitched) {
- this.debug('Payback NOT boosted on a switch');
- return 65;
- }
- if (this.willMove(target)) {
- this.debug('Payback NOT boosted');
- return 65;
- }
- this.debug('Payback damage boost');
- return 130;
- },
- },
- punishment: {
- inherit: true,
- basePower: 0,
- basePowerCallback: function (pokemon, target) {
- return 60 + 30 * target.positiveBoosts();
- },
- },
- razorshell: {
- inherit: true,
- accuracy: 100,
- secondary: {
- chance: 100,
- boosts: {
- def: -1
- }
- },
- },
- diamondstorm: {
- inherit: true,
- accuracy: 100,
- secondary: {
- self: {
- chance: 100,
- boosts: {
- def: 1
- }
- }
- }
- },
- fellstinger: {
- inherit: true,
- basePower: 20,
- priority: 1
- },
- landswrath: {
- inherit: true,
- onHit: function (target) {
- target.clearBoosts();
- this.add('-clearboost', target);
- },
- },
- mistball: {
- inherit: true,
- secondary: {
- chance: 100,
- boosts: {
- spa: -1
- }
- },
- },
- lusterpurge: {
- inherit: true,
- secondary: {
- chance: 100,
- boosts: {
- spd: -1
- }
- },
- },
- skyattack: {
- inherit: true,
- accuracy: 100,
- onTry: function (attacker, defender, move) {
- if (attacker.removeVolatile(move.id)) {
- return;
- }
- this.add('-prepare', attacker, move.name, defender);
- this.boost({spe:1, atk:1}, attacker, attacker, this.getMove('skyattack'));
- if (!this.runEvent('ChargeMove', attacker, defender, move)) {
- this.add('-anim', attacker, move.name, defender);
- attacker.removeVolatile(move.id);
- return;
- }
- attacker.addVolatile('twoturnmove', defender);
- return null;
- },
- secondary: {
- chance: 30,
- status: 'brn',
- },
- },
- wideguard: {
- inherit: true,
- effect: {
- duration: 1,
- onStart: function (target, source) {
- this.add('-singleturn', source, 'Wide Guard');
- },
- onTryHitPriority: 4,
- onTryHit: function (target, source, effect) {
- // Wide Guard blocks spread moves
- if (effect && (effect.target !== 'allAdjacent' && effect.target !== 'allAdjacentFoes')) {
- return;
- }
- this.add('-activate', target, 'Wide Guard');
- var lockedmove = source.getVolatile('lockedmove');
- if (lockedmove) {
- // Outrage counter is reset
- if (source.volatiles['lockedmove'].duration === 2) {
- delete source.volatiles['lockedmove'];
- }
- }
- return null;
- }
- },
- },
- teleport: {
- inherit: true,
- onTryHit: true,
- effect: {
- duration: 1,
- onStart: function (target) {
- this.add('-start', target, 'Teleport');
- },
- onAnyTryMove: function (target, source, move) {
- if (move && move.id === 'Pursuit') {
- this.attrLastMove('[still]');
- this.add('-activate', this.effectData.target, 'move: Teleport');
- return false;
- }
- },
- },
- priority: 1,
- selfSwitch: true,
- },
- present: {
- inherit: true,
- category: "Status",
- accuracy: 100,
- basePower: 0,
- priority: 3,
- volatileStatus: 'present',
- onModifyMove: function (move) {
- move.category === "Status"
- },
- effect: {
- duration: 1,
- onStart: function (target) {
- this.add('-start', target, 'Present');
- },
- onTryMove: function (pokemon, target, move) {
- if (move.category === 'Status') {
- this.add('-activate', pokemon, 'Present');
- this.damage(this.clampIntRange(Math.round(pokemon.maxhp / 2), 1));
- return false;
- }
- }
- },
- },
- ominouswind: {
- inherit: true,
- priority: -3,
- flags: {protect:1},
- beforeTurnCallback: function (pokemon) {
- pokemon.addVolatile('ominouswind');
- },
- beforeMoveCallback: function (pokemon) {
- if (!pokemon.removeVolatile('ominouswind')) {
- return false;
- }
- if (pokemon.lastAttackedBy && pokemon.lastAttackedBy.thisTurn && pokemon.lastAttackedBy.damage > 0 && this.getMove(pokemon.lastAttackedBy.move).category !== 'Status') {
- this.add('cant', pokemon, 'Ominous Wind', 'Ominous Wind');
- return true;
- }
- },
- effect: {
- duration: 1,
- onStart: function (pokemon) {
- this.add('-singleturn', pokemon, 'move: Ominous Wind');
- }
- },
- secondary: {
- chance: 100,
- self: {
- boosts: {
- atk: 1,
- def: 1,
- spa: 1,
- spd: 1,
- spe: 1
- }
- },
- },
- },
- silverwind: {
- inherit: true,
- priority: -3,
- flags: {protect:1},
- beforeTurnCallback: function (pokemon) {
- pokemon.addVolatile('silverwind');
- },
- beforeMoveCallback: function (pokemon) {
- if (!pokemon.removeVolatile('silverwind')) {
- return false;
- }
- if (pokemon.lastAttackedBy && pokemon.lastAttackedBy.thisTurn && pokemon.lastAttackedBy.damage > 0 && this.getMove(pokemon.lastAttackedBy.move).category !== 'Status') {
- this.add('cant', pokemon, 'Silver Wind', 'Silver Wind');
- return true;
- }
- },
- effect: {
- duration: 1,
- onStart: function (pokemon) {
- this.add('-singleturn', pokemon, 'move: Silver Wind');
- }
- },
- secondary: {
- chance: 100,
- self: {
- boosts: {
- atk: 1,
- def: 1,
- spa: 1,
- spd: 1,
- spe: 1
- }
- },
- },
- },
- ancientpower: {
- inherit: true,
- priority: -3,
- flags: {protect:1},
- beforeTurnCallback: function (pokemon) {
- pokemon.addVolatile('ancientpower');
- },
- beforeMoveCallback: function (pokemon) {
- if (!pokemon.removeVolatile('ancientpower')) {
- return false;
- }
- if (pokemon.lastAttackedBy && pokemon.lastAttackedBy.thisTurn && pokemon.lastAttackedBy.damage > 0 && this.getMove(pokemon.lastAttackedBy.move).category !== 'Status') {
- this.add('cant', pokemon, 'Ancient Power', 'Ancient Power');
- return true;
- }
- },
- effect: {
- duration: 1,
- onStart: function (pokemon) {
- this.add('-singleturn', pokemon, 'move: Ancient Power');
- }
- },
- secondary: {
- chance: 100,
- self: {
- boosts: {
- atk: 1,
- def: 1,
- spa: 1,
- spd: 1,
- spe: 1
- }
- },
- },
- },
- endure: {
- inherit: true,
- onTryHit: function (pokemon) {
- return this.willAct() && this.runEvent('StallMove', pokemon);
- },
- onHit: function (pokemon) {
- pokemon.addVolatile('stall');
- },
- effect: {
- duration: 1,
- onStart: function (target) {
- this.add('-singleturn', target, 'move: Endure');
- },
- onDamagePriority: -10,
- onDamage: function (damage, target, source, effect) {
- if (effect && effect.effectType === 'Move' && damage >= target.hp) {
- this.add('-activate', target, 'move: Endure');
- return target.hp - 1;
- }
- },
- onHit: function (target, source, move) {
- if (target !== source && move.category !== 'Status') {
- this.boost({spe:1});
- }
- }
- },
- },
- charge: {
- inherit: true,
- effect: {
- onBasePowerPriority: 3,
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.type === 'Electric') {
- this.debug('charge boost');
- return this.chainModify(2);
- }
- }
- },
- },
- aromaticmist: {
- inherit: true,
- target: "AllySide",
- },
- uproar: {
- inherit: true,
- basePower: 80,
- sleepUsable: true,
- target: "Normal",
- self: {
- volatileStatus: 'uproar',
- },
- onTryHit: function (target) {
- for (let i = 0; i < target.side.active.length; i++) {
- let allyActive = target.side.active[i];
- if (allyActive && allyActive.status === 'slp') allyActive.cureStatus();
- let foeActive = target.side.foe.active[i];
- if (foeActive && foeActive.status === 'slp') foeActive.cureStatus();
- }
- },
- effect: {
- duration: 3,
- onStart: function (target) {
- this.add('-start', target, 'Uproar');
- },
- onResidual: function (target) {
- if (target.lastMove === 'struggle') {
- // don't lock
- delete target.volatiles['uproar'];
- }
- this.add('-start', target, 'Uproar', '[upkeep]');
- },
- onEnd: function (target) {
- this.add('-end', target, 'Uproar');
- },
- onAnySetStatus: function (status, pokemon) {
- if (status.id === 'slp') {
- if (pokemon === this.effectData.target) {
- this.add('-fail', pokemon, 'slp', '[from] Uproar', '[msg]');
- } else {
- this.add('-fail', pokemon, 'slp', '[from] Uproar');
- }
- return null;
- }
- },
- onAnyTryHit: function (target, source, move) {
- if (move && move.id === 'yawn') {
- return false;
- }
- },
- },
- onBasePower: function (basePower, pokemon) {
- if (pokemon.status && pokemon.status == 'slp') {
- return this.chainModify(2);
- }
- },
- },
- swallow: {
- inherit: true,
- onHit: function (pokemon) {
- var healAmount = [0.20, 0.40, 0.60];
- this.heal(this.modify(pokemon.maxhp, healAmount[(pokemon.volatiles['stockpile'].layers)]));
- },
- },
- spitup: {
- inherit: true,
- basePower: 0,
- basePowerCallback: function (pokemon) {
- return pokemon.volatiles['stockpile'].layers * 50
- },
- onAfterMove: false,
- },
- flyingpress: {
- inherit: true,
- accuracy: 100,
- onEffectiveness: function (typeMod, type) {
- if (type === 'Bug') return 1;
- if (type === 'Grass') return 1;
- if (type === 'Fighting') return 1;
- },
- },
- horndrill: {
- inherit: true,
- accuracy: true,
- priority: -3,
- onTry: function (pokemon, target) {
- if (target.status !== 'par') {
- return false;
- }
- },
- },
- fissure: {
- inherit: true,
- accuracy: true,
- priority: -3,
- onTry: function (pokemon, target) {
- if (target.status !== 'par') {
- return false;
- }
- },
- },
- guillotine: {
- inherit: true,
- accuracy: true,
- priority: -3,
- onTry: function (pokemon, target) {
- if (target.status !== 'slp') {
- return false;
- }
- },
- },
- sheercold: {
- inherit: true,
- accuracy: true,
- priority: -3,
- onTry: function (pokemon, target) {
- if (target.status !== 'frz') {
- return false;
- }
- },
- },
- technoblast: {
- inherit: true,
- type: 'Steel',
- onModifyMove: function (move, pokemon) {
- move.type = this.runEvent('Drive', pokemon, null, 'technoblast', 'Steel');
- },
- },
- phantomforce: {
- inherit: true,
- onTry: function (attacker, defender, move) {
- if (attacker.removeVolatile(move.id)) {
- return;
- }
- this.add('-prepare', attacker, move.name, defender);
- if (this.isWeather(['distortion']) || !this.runEvent('ChargeMove', attacker, defender, move)) {
- this.add('-anim', attacker, move.name, defender);
- return;
- }
- attacker.addVolatile('twoturnmove', defender);
- return null;
- },
- },
- shadowforce: {
- inherit: true,
- onTry: function (attacker, defender, move) {
- if (attacker.removeVolatile(move.id)) {
- return;
- }
- this.add('-prepare', attacker, move.name, defender);
- if (this.isWeather(['distortion']) || !this.runEvent('ChargeMove', attacker, defender, move)) {
- this.add('-anim', attacker, move.name, defender);
- return;
- }
- attacker.addVolatile('twoturnmove', defender);
- return null;
- },
- },
- venomdrench: {
- inherit: true,
- flags: {},
- pseudoWeather: 'venomdrench',
- onHit: function (target) {
- return true;
- },
- effect: {
- duration: 5,
- onStart: function (target, source) {
- this.add('-fieldstart', 'move: Venom Drench');
- },
- onResidualOrder: 5,
- onResidualSubOrder: 2,
- onResidual: function (battle) {
- this.debug('onResidual battle');
- let pokemon;
- for (let s in battle.sides) {
- for (let p in battle.sides[s].active) {
- pokemon = battle.sides[s].active[p];
- if (pokemon.status === 'psn' || pokemon.status === 'tox') {
- this.boost({spe:-1}, pokemon, pokemon);
- this.boost({atk:-1}, pokemon, pokemon);
- this.boost({spa:-1}, pokemon, pokemon);
- }
- }
- }
- }
- },
- onResidualOrder: 21,
- onEnd: function (battle) {
- this.add('-fieldend', 'move: Venom Drench');
- },
- target: "all"
- },
- sleeptalk: {
- inherit: true,
- onHit: function (pokemon) {
- let moves = [];
- for (let i = 0; i < pokemon.moveset.length; i++) {
- let move = pokemon.moveset[i].id;
- let NoSleepTalk = {
- assist:1, belch:1, bide:1, chatter:1, copycat:1, focuspunch:1, mefirst:1, metronome:1, mimic:1, mirrormove:1, naturepower:1, sketch:1, sleeptalk:1, uproar:1, silverwind:1, ominouswind:1, ancientpower:1, dragontail:1, circlethrow:1,
- };
- if (move && !(NoSleepTalk[move] || this.getMove(move).flags['charge'] || this.getMove(move).category === 'Status')) {
- moves.push(move);
- }
- }
- let randomMove = '';
- if (moves.length) randomMove = moves[this.random(moves.length)];
- if (!randomMove) {
- return false;
- }
- this.useMove(randomMove, pokemon);
- },
- },
- curse: {
- inherit: true,
- onHit: function (target, source) {
- this.directDamage(source.maxhp / 3, source, source);
- },
- },
- freezeshock: {
- inherit: true,
- onTry: true,
- basePower: 100,
- accuracy: 100,
- onEffectiveness: function (typeMod, type) {
- if (type === 'Water') return 1;
- },
- },
- iceburn: {
- inherit: true,
- onTry: true,
- basePower: 100,
- accuracy: 100,
- onEffectiveness: function (typeMod, type) {
- if (type === 'Steel') return 1;
- },
- },
- detect: {
- inherit: true,
- volatileStatus: 'detect',
- effect: {
- duration: 1,
- onStart: function (target) {
- this.add('-singleturn', target, 'Protect');
- },
- onTryHitPriority: 3,
- onTryHit: function (target, source, move) {
- if (!move.flags['protect']) return;
- this.add('-activate', target, 'Protect');
- let lockedmove = source.getVolatile('lockedmove');
- if (lockedmove) {
- // Outrage counter is reset
- if (source.volatiles['lockedmove'].duration === 2) {
- delete source.volatiles['lockedmove'];
- }
- }
- if (move.flags['protect']) {
- this.boost({spe:-2}, source, target, this.getMove("Detect"));
- }
- return null;
- },
- },
- },
- mudsport: {
- inherit: true,
- onHitField: null,
- onHit: function (target) {
- if (target.hasType('Ground')) return false;
- if (!target.addType('Ground')) return false;
- this.add('-start', target, 'typeadd', 'Ground', '[from] move: Mud Sport');
- },
- target: 'self'
- },
- watersport: {
- inherit: true,
- onHitField: null,
- onHit: function (target) {
- if (target.hasType('Water')) return false;
- if (!target.addType('Water')) return false;
- this.add('-start', target, 'typeadd', 'Ground', '[from] move: Water Sport');
- },
- target: 'self'
- },
- defog: {
- inherit: true,
- flags: {reflectable: 1, mirror: 1, authentic: 1},
- },
- ingrain: {
- inherit: true,
- effect: {
- onStart: function (pokemon) {
- this.add('-start', pokemon, 'move: Ingrain');
- },
- onResidualOrder: 7,
- onResidual: function (pokemon) {
- this.heal(pokemon.maxhp / 16);
- },
- onSwitchOut: function (pokemon) {
- if (!pokemon.hasType('Ghost') && !pokemon.hasAbility('runaway') && !pokemon.hasItem('shedshell')) {
- this.damage(pokemon.maxhp / 8);
- }
- },
- onNegateImmunity: function (pokemon, type) {
- if (type === 'Ground') return false;
- },
- onDragOut: function (pokemon) {
- this.add('-activate', pokemon, 'move: Ingrain');
- return null;
- },
- },
- },
- solarbeam: {
- inherit: true,
- onBasePowerPriority: 4,
- onBasePower: function (basePower, pokemon, target) {
- if (this.isWeather(['raindance', 'primordialsea', 'sandstorm', 'hail', 'iceage'])) {
- this.debug('weakened by weather');
- return this.chainModify(0.5);
- }
- },
- },
- poisonjab: {
- inherit: true,
- basePowerCallback: function (move, pokemon) {
- if (pokemon.template.species === 'Beedrill' || pokemon.template.species === 'Beedrill-Mega') {
- return 100;
- }
- else {
- return 80;
- }
- },
- onModifyMovePriority: 5,
- onModifyMove: function (move, pokemon) {
- if (pokemon.template.species === 'Beedrill' || pokemon.template.species === 'Beedrill-Mega') {
- if (!move.ignoreImmunity) move.ignoreImmunity = {};
- if (move.ignoreImmunity !== true) {
- move.ignoreImmunity['Poison'] = true;
- }
- }
- },
- onEffectiveness: function (typeMod, type) {
- if (type === 'Steel') return 1;
- },
- },
- attract: {
- inherit: true,
- effect: {
- noCopy: true, // doesn't get copied by Baton Pass
- onStart: function (pokemon, source, effect) {
- if (!(pokemon.gender === 'M' && source.gender === 'F') && !(pokemon.gender === 'F' && source.gender === 'M')) {
- this.debug('incompatible gender');
- return false;
- }
- if (!this.runEvent('Attract', pokemon, source)) {
- this.debug('Attract event failed');
- return false;
- }
- if (effect.id === 'cutecharm') {
- this.add('-start', pokemon, 'Attract', '[from] ability: Cute Charm', '[of] ' + source);
- } else if (effect.id === 'destinyknot') {
- this.add('-start', pokemon, 'Attract', '[from] item: Destiny Knot', '[of] ' + source);
- } else {
- this.add('-start', pokemon, 'Attract');
- }
- },
- onUpdate: function (pokemon) {
- if (this.effectData.source && !this.effectData.source.isActive && pokemon.volatiles['attract']) {
- this.debug('Removing Attract volatile on ' + pokemon);
- pokemon.removeVolatile('attract');
- }
- },
- onBasePowerPriority: 2,
- onBasePower: function (basePower, attacker, defender, move) {
- return this.chainModify(0.5);
- },
- onEnd: function (pokemon) {
- this.add('-end', pokemon, 'Attract', '[silent]');
- },
- },
- },
- grassyterrain: {
- inherit: true,
- effect: {
- duration: 5,
- onBasePower: function (basePower, attacker, defender, move) {
- var weakenedMoves = {'earthquake':1, 'bulldoze':1, 'magnitude':1};
- if (move.id in weakenedMoves) {
- this.debug('move weakened by grassy terrain');
- return this.chainModify(0.5);
- }
- if (attacker.hasType('Grass') && attacker.isGrounded()) {
- this.debug('grassy terrain boost');
- return this.chainModify(1.3);
- }
- },
- onStart: function (target, source) {
- this.add('-fieldstart', 'move: Grassy Terrain');
- },
- onResidualOrder: 5,
- onResidualSubOrder: 2,
- onResidual: function (battle) {
- this.debug('onResidual battle');
- var pokemon;
- for (var s in battle.sides) {
- for (var p in battle.sides[s].active) {
- pokemon = battle.sides[s].active[p];
- if (pokemon.isGrounded() && !pokemon.isSemiInvulnerable()) {
- this.debug('Pokemon is grounded, healing through Grassy Terrain.');
- this.heal(pokemon.maxhp / 8, pokemon, pokemon);
- }
- }
- }
- },
- onEnd: function () {
- this.add('-fieldend', 'move: Grassy Terrain');
- }
- },
- },
- mistyterrain: {
- inherit: true,
- effect: {
- duration: 5,
- onSetStatus: function (status, target, source, effect) {
- if (!target.isGrounded() || target.isSemiInvulnerable()) return;
- this.debug('misty terrain preventing status');
- return false;
- },
- onBasePower: function (basePower, attacker, defender, move) {
- if (attacker.hasType('Dragon') && attacker.isGrounded() && !defender.isSemiInvulnerable()) {
- this.debug('misty terrain weaken');
- return this.chainModify(0.5);
- }
- if (attacker.hasType('Fairy') && attacker.isGrounded()) {
- this.debug('misty terrain boost');
- return this.chainModify(1.3);
- }
- },
- onStart: function (side) {
- this.add('-fieldstart', 'Misty Terrain');
- },
- onResidualOrder: 21,
- onResidualSubOrder: 2,
- onEnd: function (side) {
- this.add('-fieldend', 'Misty Terrain');
- }
- },
- },
- electricterrain: {
- inherit: true,
- effect: {
- duration: 5,
- onSetStatus: function (status, target, source, effect) {
- if (status.id === 'slp' && target.isGrounded() && !target.isSemiInvulnerable()) {
- this.debug('interrupting sleep from Electric Terrain');
- return false;
- }
- },
- onTryHit: function (target, source, move) {
- if (!target.isGrounded() || target.isSemiInvulnerable()) return;
- if (move && move.id === 'yawn') {
- return false;
- }
- },
- onBasePower: function (basePower, attacker, defender, move) {
- if (attacker.hasType('Electric') && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
- this.debug('electric terrain boost');
- return this.chainModify(1.3);
- }
- },
- onUpdate: function (pokemon) {
- if (pokemon.status === 'slp' && pokemon.isGrounded() && !pokemon.isSemiInvulnerable()) {
- pokemon.cureStatus();
- }
- },
- onStart: function () {
- this.add('-fieldstart', 'move: Electric Terrain');
- },
- onResidualOrder: 21,
- onResidualSubOrder: 2,
- onEnd: function () {
- this.add('-fieldend', 'move: Electric Terrain');
- }
- },
- },
- };
- /*mods/ghoulking/statuses.js*/
- 'use strict';
- exports.BattleStatuses = {
- par: {
- effectType: 'Status',
- onStart: function (target) {
- this.add('-status', target, 'par');
- },
- onModifySpe: function (spe, pokemon) {
- if (!pokemon.hasAbility('quickfeet')) {
- return this.chainModify(0.25);
- }
- },
- onResidualOrder: 9,
- onResidual: function (pokemon) {
- this.boost({evasion:-1});
- },
- },
- psn: {
- effectType: 'Status',
- onStart: function (target) {
- this.add('-status', target, 'psn');
- },
- onResidualOrder: 9,
- onResidual: function (pokemon) {
- this.damage(pokemon.maxhp / 6);
- }
- },
- slp: {
- effectType: 'Status',
- onStart: function (target) {
- this.add('-status', target, 'slp');
- // 1-3 turns
- this.effectData.startTime = this.random(2, 5);
- this.effectData.time = this.effectData.startTime;
- },
- onBeforeMovePriority: 10,
- onBeforeMove: function (pokemon, target, move) {
- if (pokemon.hasAbility('earlybird')) {
- pokemon.statusData.time--;
- }
- pokemon.statusData.time--;
- if (pokemon.statusData.time <= 0) {
- pokemon.cureStatus();
- return;
- }
- this.add('cant', pokemon, 'slp');
- if (move.sleepUsable || move.category === 'Status' || move.category === 'Special' && pokemon.template.speciesid === 'darmanitanzen') {
- return;
- }
- return false;
- },
- },
- frz: {
- effectType: 'Status',
- onStart: function (target) {
- this.add('-status', target, 'frz');
- if (target.template.species === 'Shaymin-Sky' && target.baseTemplate.baseSpecies === 'Shaymin') {
- let template = this.getTemplate('Shaymin');
- target.formeChange(template);
- target.baseTemplate = template;
- target.setAbility(template.abilities['0']);
- target.baseAbility = target.ability;
- target.details = template.species + (target.level === 100 ? '' : ', L' + target.level) + (target.gender === '' ? '' : ', ' + target.gender) + (target.set.shiny ? ', shiny' : '');
- this.add('detailschange', target, target.details);
- this.add('-formechange', target, 'Shaymin', '[msg]');
- }
- },
- onResidualOrder: 9,
- onResidual: function (pokemon) {
- this.boost({spe:-1});
- this.boost({atk:-1});
- this.boost({def:-1});
- this.boost({spa:-1});
- this.boost({spd:-1});
- },
- onModifyMove: function (move, pokemon) {
- if (move.flags['defrost']) {
- this.add('-curestatus', pokemon, 'frz', '[from] move: ' + move);
- pokemon.setStatus('');
- }
- },
- onHit: function (target, source, move) {
- if (move.thawsTarget || move.type === 'Fire' && move.category !== 'Status') {
- target.cureStatus();
- }
- },
- },
- flinch: {
- duration: 1,
- onBasePower: function (basePower, user, target, move) {
- return this.chainModify([0.75]);
- },
- },
- trapped: {
- onSwitchOut: function (pokemon) {
- if (!pokemon.hasAbility('runaway') && !pokemon.hasItem('shedshell')) {
- this.damage(pokemon.maxhp / 8);
- }
- },
- },
- partiallytrapped: {
- duration: 5,
- durationCallback: function (target, source) {
- if (source.hasItem('gripclaw')) return 8;
- return this.random(5, 7);
- },
- onStart: function (pokemon, source) {
- this.add('-activate', pokemon, 'move: ' + this.effectData.sourceEffect, '[of] ' + source);
- },
- onResidualOrder: 11,
- onResidual: function (pokemon) {
- if (this.effectData.source && (!this.effectData.source.isActive || this.effectData.source.hp <= 0)) {
- delete pokemon.volatiles['partiallytrapped'];
- return;
- }
- if (this.effectData.source.hasItem('bindingband')) {
- this.damage(pokemon.maxhp / 6);
- } else {
- this.damage(pokemon.maxhp / 8);
- }
- },
- onEnd: function (pokemon) {
- this.add('-end', pokemon, this.effectData.sourceEffect, '[partiallytrapped]');
- },
- onSwitchOut: function (pokemon) {
- if (!pokemon.hasType('Ghost') && !pokemon.hasAbility('runaway') && !pokemon.hasItem('shedshell')){
- this.damage(pokemon.maxhp / 8);
- }
- },
- },
- confusion: {
- // this is a volatile status
- onStart: function (target, source, sourceEffect) {
- let result = this.runEvent('TryConfusion', target, source, sourceEffect);
- if (!result) return result;
- if (sourceEffect && sourceEffect.id === 'lockedmove') {
- this.add('-start', target, 'confusion', '[fatigue]');
- } else {
- this.add('-start', target, 'confusion');
- }
- this.effectData.time = this.random(2, 6);
- },
- onEnd: function (target) {
- this.add('-end', target, 'confusion');
- },
- onBeforeMove: function (pokemon) {
- pokemon.volatiles.confusion.time--;
- if (!pokemon.volatiles.confusion.time) {
- pokemon.removeVolatile('confusion');
- return;
- }
- this.damage(this.getDamage(pokemon, pokemon, 50), pokemon, pokemon, {
- id: 'confused',
- effectType: 'Move',
- type: '???',
- });
- },
- },
- faked: {
- duration: 1,
- onBeforeMovePriority: 8,
- onBeforeMove: function (pokemon) {
- if (!this.runEvent('Faked', pokemon) || pokemon.hasAbility('Inner Focus')) {
- return;
- }
- this.add('cant', pokemon, 'faked out');
- return false;
- },
- },
- iceage: {
- effectType: 'Weather',
- duration: 0,
- onEffectiveness: function (typeMod, target, type, move) {
- if (move && move.effectType === 'Move' && type === 'Ice' && typeMod > 0) {
- this.add('-activate', '', 'iceage');
- return 0;
- }
- },
- onStart: function (battle, source, effect) {
- this.add('-weather', 'IceAge', '[from] ability: ' + effect, '[of] ' + source);
- },
- onResidualOrder: 1,
- onResidual: function () {
- this.add('-weather', 'IceAge', '[upkeep]');
- this.eachEvent('Weather');
- },
- onWeather: function (target) {
- this.damage(target.maxhp / 16);
- },
- onEnd: function (battle, effect) {
- this.add('-weather', 'none');
- },
- },
- distortion: {
- effectType: 'Weather',
- duration: 5,
- onStart: function (battle, source, effect) {
- this.add('-weather', 'Distortion', '[from] ability: ' + effect, '[of] ' + source);
- },
- onBoost: function (boost, pokemon) {
- if (!pokemon.hasType('Ghost')) {
- for (let i in boost) {
- boost[i] *= -1;
- }
- }
- },
- onEnd: function (battle, effect) {
- this.add('-weather', 'none');
- },
- },
- meloetta: {
- // Meloetta: Fluidity
- onStart: function (pokemon) {
- if (pokemon.ability === 'serenegrace') {
- pokemon.ability = 'fluidity';
- pokemon.baseAbility = 'fluidity';
- }
- },
- },
- moltres: {
- // Moltres: Well of Power
- onStart: function (pokemon) {
- if (pokemon.ability === 'galewings') {
- pokemon.ability = 'wellofpower';
- pokemon.baseAbility = 'wellofpower';
- }
- },
- },
- articuno: {
- // Articuno: Ice Age
- onStart: function (pokemon) {
- if (pokemon.ability === 'snowwarning') {
- pokemon.ability = 'iceage';
- pokemon.baseAbility = 'iceage';
- }
- },
- },
- giratina: {
- // Giratina: Distortion
- onStart: function (pokemon) {
- if (pokemon.ability === 'shadowtag') {
- pokemon.ability = 'distortion';
- pokemon.baseAbility = 'distortion';
- }
- },
- },
- gengar: {
- // Gengar: Distortion
- onStart: function (pokemon) {
- if (pokemon.ability === 'shadowtag') {
- pokemon.ability = 'distortion';
- pokemon.baseAbility = 'distortion';
- }
- },
- },
- mismagius: {
- // Mismagius: Distortion
- onStart: function (pokemon) {
- if (pokemon.ability === 'shadowtag') {
- pokemon.ability = 'distortion';
- pokemon.baseAbility = 'distortion';
- }
- },
- },
- dusknoir: {
- // Dusknoir: Distortion
- onStart: function (pokemon) {
- if (pokemon.ability === 'shadowtag') {
- pokemon.ability = 'distortion';
- pokemon.baseAbility = 'distortion';
- }
- },
- },
- spiritomb: {
- // Spiritomb: Distortion
- onStart: function (pokemon) {
- if (pokemon.ability === 'shadowtag') {
- pokemon.ability = 'distortion';
- pokemon.baseAbility = 'distortion';
- }
- },
- },
- };
- /* mods/ghoulking/scripts.js */
- 'use strict';
- exports.BattleScripts = {
- init: function () {
- this.modData('Pokedex', 'zapdos').abilities['1'] = 'Drizzle';
- this.modData('Pokedex', 'articuno').abilities['1'] = 'Snow Warning';
- this.modData('Pokedex', 'moltres').abilities['1'] = 'Gale Wings';
- this.modData('Pokedex', 'abomasnowmega').abilities['0'] = 'Ice Age';
- this.modData('Pokedex', 'alakazammega').abilities['0'] = 'Transcendent';
- this.modData('Pokedex', 'gallademega').abilities['0'] = 'Moxie';
- this.modData('Pokedex', 'sceptilemega').abilities['0'] = 'Multiscale';
- this.modData('Pokedex', 'steelixmega').abilities['0'] = 'Arena Trap';
- this.modData('Pokedex', 'beedrillmega').abilities['0'] = 'Hustle';
- this.modData('Pokedex', 'durant').abilities['1'] = 'Adaptability';
- this.modData('Pokedex', 'giratina').abilities['1'] = 'Shadow Tag';
- this.modData('Pokedex', 'gengar').abilities['1'] = 'Shadow Tag';
- this.modData('Pokedex', 'mismagius').abilities['1'] = 'Shadow Tag';
- this.modData('Pokedex', 'dusknoir').abilities['1'] = 'Shadow Tag';
- this.modData('Pokedex', 'spiritomb').abilities['1'] = 'Shadow Tag';
- },
- pokemon: {
- deductPP: function (move, amount, source) {
- move = this.battle.getMove(move);
- let ppData = this.getMoveData(move);
- if (!ppData) return false;
- ppData.used = true;
- if (!ppData.pp) return false;
- ppData.pp -= amount || 1;
- console.log(toId(this.ability));
- if (toId(this.ability) === 'hustle') {
- ppData.pp -= 1;
- }
- if (ppData.pp <= 0) {
- ppData.pp = 0;
- }
- if (ppData.virtual) {
- let foeActive = this.side.foe.active;
- for (let i = 0; i < foeActive.length; i++) {
- if (foeActive[i].isStale >= 2) {
- if (move.selfSwitch) this.isStalePPTurns++;
- return true;
- }
- }
- }
- this.isStalePPTurns = 0;
- return true;
- }
- },
- };
- /* mods/ghoulking/pokedex.js */
- 'use strict';
- exports.BattlePokedex = {
- alakazammega: {
- inherit: true,
- baseStats: {hp: 55, atk: 50, def: 75, spa: 175, spd: 95, spe: 150},
- },
- beedrillmega: {
- inherit: true,
- baseStats: {hp: 65, atk: 150, def: 70, spa: 15, spd: 90, spe: 105},
- },
- castformsand: {
- num: 351,
- species: "Castform-Sand",
- baseSpecies: "Castform",
- forme: "Sand",
- formeLetter: "S",
- types: ["Rock"],
- baseStats: {hp: 70, atk: 70, def: 70, spa: 70, spd: 70, spe: 70},
- abilities: {0: "Forecast"},
- heightm: 0.3,
- weightkg: 0.8,
- color: "White",
- eggGroups: ["Fairy", "Amorphous"],
- },
- };
- /* mods/ghoulking/typechart.js */
- exports.BattleTypeChart = {
- "Bug": {
- damageTaken: {
- "Bug": 0,
- "Dark": 0,
- "Dragon": 0,
- "Electric": 0,
- "Fairy": 0,
- "Fighting": 2,
- "Fire": 1,
- "Flying": 1,
- "Ghost": 0,
- "Grass": 2,
- "Ground": 2,
- "Ice": 0,
- "Normal": 0,
- "Poison": 0,
- "Psychic": 0,
- "Rock": 1,
- "Steel": 0,
- "Water": 0
- },
- HPivs: {"atk":30, "def":30, "spd":30}
- },
- "Dark": {
- damageTaken: {
- "Bug": 1,
- "Dark": 2,
- "Dragon": 0,
- "Electric": 0,
- "Fairy": 1,
- "Fighting": 1,
- "Fire": 0,
- "Flying": 0,
- "Ghost": 2,
- "Grass": 0,
- "Ground": 0,
- "Ice": 0,
- "Normal": 0,
- "Poison": 0,
- "Psychic": 3,
- "Rock": 0,
- "Steel": 0,
- "Water": 0
- },
- HPivs: {}
- },
- "Dragon": {
- damageTaken: {
- "Bug": 0,
- "Dark": 0,
- "Dragon": 1,
- "Electric": 2,
- "Fairy": 1,
- "Fighting": 0,
- "Fire": 2,
- "Flying": 0,
- "Ghost": 0,
- "Grass": 2,
- "Ground": 0,
- "Ice": 1,
- "Normal": 0,
- "Poison": 0,
- "Psychic": 0,
- "Rock": 0,
- "Steel": 0,
- "Water": 2
- },
- HPivs: {"atk":30}
- },
- "Electric": {
- damageTaken: {
- par: 3,
- "Bug": 0,
- "Dark": 0,
- "Dragon": 0,
- "Electric": 2,
- "Fairy": 0,
- "Fighting": 0,
- "Fire": 0,
- "Flying": 2,
- "Ghost": 0,
- "Grass": 0,
- "Ground": 1,
- "Ice": 0,
- "Normal": 0,
- "Poison": 0,
- "Psychic": 0,
- "Rock": 0,
- "Steel": 2,
- "Water": 0
- },
- HPivs: {"spa":30}
- },
- "Fairy": {
- damageTaken: {
- "Bug": 2,
- "Dark": 2,
- "Dragon": 3,
- "Electric": 0,
- "Fairy": 0,
- "Fighting": 2,
- "Fire": 0,
- "Flying": 0,
- "Ghost": 1,
- "Grass": 0,
- "Ground": 0,
- "Ice": 0,
- "Normal": 0,
- "Poison": 1,
- "Psychic": 0,
- "Rock": 0,
- "Steel": 1,
- "Water": 0
- }
- },
- "Fighting": {
- damageTaken: {
- "Bug": 2,
- "Dark": 2,
- "Dragon": 0,
- "Electric": 0,
- "Fairy": 1,
- "Fighting": 0,
- "Fire": 0,
- "Flying": 1,
- "Ghost": 0,
- "Grass": 0,
- "Ground": 0,
- "Ice": 0,
- "Normal": 0,
- "Poison": 0,
- "Psychic": 1,
- "Rock": 2,
- "Steel": 0,
- "Water": 0
- },
- HPivs: {"def":30, "spa":30, "spd":30, "spe":30}
- },
- "Fire": {
- damageTaken: {
- brn: 3,
- "Bug": 2,
- "Dark": 0,
- "Dragon": 0,
- "Electric": 0,
- "Fairy": 2,
- "Fighting": 0,
- "Fire": 2,
- "Flying": 0,
- "Ghost": 0,
- "Grass": 2,
- "Ground": 1,
- "Ice": 2,
- "Normal": 0,
- "Poison": 0,
- "Psychic": 0,
- "Rock": 1,
- "Steel": 2,
- "Water": 1
- },
- HPivs: {"atk":30, "spa":30, "spe":30}
- },
- "Flying": {
- damageTaken: {
- "Bug": 2,
- "Dark": 0,
- "Dragon": 0,
- "Electric": 1,
- "Fairy": 0,
- "Fighting": 2,
- "Fire": 0,
- "Flying": 0,
- "Ghost": 0,
- "Grass": 2,
- "Ground": 3,
- "Ice": 1,
- "Normal": 0,
- "Poison": 0,
- "Psychic": 0,
- "Rock": 1,
- "Steel": 0,
- "Water": 0
- },
- HPivs: {"hp":30, "atk":30, "def":30, "spa":30, "spd":30}
- },
- "Ghost": {
- damageTaken: {
- trapped: 3,
- "Bug": 2,
- "Dark": 1,
- "Dragon": 1,
- "Electric": 0,
- "Fairy": 0,
- "Fighting": 3,
- "Fire": 0,
- "Flying": 0,
- "Ghost": 1,
- "Grass": 0,
- "Ground": 0,
- "Ice": 0,
- "Normal": 3,
- "Poison": 2,
- "Psychic": 0,
- "Rock": 0,
- "Steel": 0,
- "Water": 0
- },
- HPivs: {"def":30, "spd":30}
- },
- "Grass": {
- damageTaken: {
- powder: 3,
- "Bug": 1,
- "Dark": 0,
- "Dragon": 0,
- "Electric": 2,
- "Fairy": 0,
- "Fighting": 0,
- "Fire": 1,
- "Flying": 1,
- "Ghost": 0,
- "Grass": 2,
- "Ground": 2,
- "Ice": 1,
- "Normal": 0,
- "Poison": 1,
- "Psychic": 0,
- "Rock": 0,
- "Steel": 0,
- "Water": 2
- },
- HPivs: {"atk":30, "spa":30}
- },
- "Ground": {
- damageTaken: {
- sandstorm: 3,
- "Bug": 0,
- "Dark": 0,
- "Dragon": 0,
- "Electric": 3,
- "Fairy": 0,
- "Fighting": 0,
- "Fire": 0,
- "Flying": 0,
- "Ghost": 0,
- "Grass": 1,
- "Ground": 0,
- "Ice": 1,
- "Normal": 0,
- "Poison": 2,
- "Psychic": 0,
- "Rock": 2,
- "Steel": 0,
- "Water": 1
- },
- HPivs: {"spa":30, "spd":30}
- },
- "Ice": {
- damageTaken: {
- hail: 3,
- iceage: 3,
- frz: 3,
- "Bug": 0,
- "Dark": 0,
- "Dragon": 0,
- "Electric": 2,
- "Fairy": 0,
- "Fighting": 1,
- "Fire": 1,
- "Flying": 0,
- "Ghost": 2,
- "Grass": 0,
- "Ground": 0,
- "Ice": 2,
- "Normal": 0,
- "Poison": 0,
- "Psychic": 0,
- "Rock": 1,
- "Steel": 1,
- "Water": 0
- },
- HPivs: {"atk":30, "def":30}
- },
- "Normal": {
- damageTaken: {
- "Bug": 0,
- "Dark": 0,
- "Dragon": 2,
- "Electric": 0,
- "Fairy": 2,
- "Fighting": 1,
- "Fire": 0,
- "Flying": 0,
- "Ghost": 3,
- "Grass": 0,
- "Ground": 0,
- "Ice": 0,
- "Normal": 0,
- "Poison": 1,
- "Psychic": 1,
- "Rock": 0,
- "Steel": 0,
- "Water": 0
- }
- },
- "Poison": {
- damageTaken: {
- psn: 3,
- tox: 3,
- "Bug": 2,
- "Dark": 0,
- "Dragon": 0,
- "Electric": 0,
- "Fairy": 2,
- "Fighting": 2,
- "Fire": 0,
- "Flying": 0,
- "Ghost": 0,
- "Grass": 2,
- "Ground": 1,
- "Ice": 0,
- "Normal": 2,
- "Poison": 2,
- "Psychic": 1,
- "Rock": 0,
- "Steel": 0,
- "Water": 0
- },
- HPivs: {"def":30, "spa":30, "spd":30}
- },
- "Psychic": {
- damageTaken: {
- "Bug": 1,
- "Dark": 1,
- "Dragon": 2,
- "Electric": 0,
- "Fairy": 0,
- "Fighting": 2,
- "Fire": 0,
- "Flying": 0,
- "Ghost": 1,
- "Grass": 0,
- "Ground": 0,
- "Ice": 0,
- "Normal": 0,
- "Poison": 0,
- "Psychic": 2,
- "Rock": 0,
- "Steel": 0,
- "Water": 0
- },
- HPivs: {"atk":30, "spe":30}
- },
- "Rock": {
- damageTaken: {
- sandstorm: 3,
- "Bug": 0,
- "Dark": 0,
- "Dragon": 0,
- "Electric": 0,
- "Fairy": 0,
- "Fighting": 1,
- "Fire": 2,
- "Flying": 2,
- "Ghost": 0,
- "Grass": 1,
- "Ground": 1,
- "Ice": 0,
- "Normal": 2,
- "Poison": 2,
- "Psychic": 0,
- "Rock": 0,
- "Steel": 1,
- "Water": 1
- },
- HPivs: {"def":30, "spd":30, "spe":30}
- },
- "Steel": {
- damageTaken: {
- psn: 3,
- tox: 3,
- sandstorm: 3,
- "Bug": 2,
- "Dark": 0,
- "Dragon": 2,
- "Electric": 0,
- "Fairy": 2,
- "Fighting": 1,
- "Fire": 1,
- "Flying": 2,
- "Ghost": 0,
- "Grass": 2,
- "Ground": 1,
- "Ice": 2,
- "Normal": 2,
- "Poison": 3,
- "Psychic": 2,
- "Rock": 2,
- "Steel": 2,
- "Water": 0
- },
- HPivs: {"spd":30}
- },
- "Water": {
- damageTaken: {
- "Bug": 0,
- "Dark": 0,
- "Dragon": 1,
- "Electric": 1,
- "Fairy": 0,
- "Fighting": 0,
- "Fire": 2,
- "Flying": 0,
- "Ghost": 0,
- "Grass": 1,
- "Ground": 0,
- "Ice": 2,
- "Normal": 0,
- "Poison": 0,
- "Psychic": 0,
- "Rock": 0,
- "Steel": 2,
- "Water": 2
- },
- HPivs: {"atk":30, "def":30, "spa":30}
- }
- };
- /* mods/ghoulking/abilities.js */
- 'use strict';
- exports.BattleAbilities = {
- "illuminate": {
- inherit: true,
- onStart: function (pokemon) {
- var foeactive = pokemon.side.foe.active;
- var activated = false;
- for (var i = 0; i < foeactive.length; i++) {
- if (!foeactive[i] || !this.isAdjacent(foeactive[i], pokemon)) continue;
- if (!activated) {
- this.add('-ability', pokemon, 'Illuminate');
- activated = true;
- }
- if (foeactive[i].volatiles['substitute']) {
- this.add('-activate', foeactive[i], 'Substitute', 'ability: Illuminate', '[of] ' + pokemon);
- } else {
- this.boost({evasion: -1}, foeactive[i], pokemon);
- }
- }
- },
- },
- "steadfast": {
- inherit: true,
- onFlinch: function (pokemon) {
- this.boost({spe: 1, atk: 1});
- },
- },
- "angerpoint": {
- inherit: true,
- onHit: function (target, source, move) {
- if (move && move.id in {attract:1, disable:1, encore:1, healblock:1, taunt:1, torment:1}) {
- return this.boost({atk: 1, spe: 1});
- }
- },
- onAfterDamage: function (damage, target, source, move) {
- undefined;
- },
- },
- "reckless": {
- inherit: true,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, attacker, defender, move) {
- return undefined
- },
- onModifyPriority: function (priority, pokemon, target, move) {
- if (move.recoil && this.activeMove !== 'struggle') {
- return priority + 1;
- }
- },
- },
- "ironfist": {
- inherit: true,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, attacker, defender, move) {
- return undefined
- },
- onModifyMove: function (move) {
- if (move.flags['punch'])
- move.willCrit= true;
- },
- },
- "bigpecks": {
- inherit: true,
- onAnyModifyBoost: function (boosts, target) {
- let source = this.effectData.target;
- if (source === target) return;
- if (target === this.activePokemon && source === this.activeTarget) {
- boosts['atk'] = 0;
- }
- },
- },
- "thickfat": {
- inherit: true,
- onImmunity: function (type, pokemon) {
- if (type === 'hail', 'iceage') return false;
- }
- },
- "victorystar": {
- inherit: true,
- onAllyModifyMove: function (move) {
- if (typeof move.accuracy === 'number') {
- move.accuracy *= 1.2;
- }
- },
- },
- "hustle": {
- inherit: true,
- onModifyAtkPriority: 5,
- onModifyAtk: function (atk) {
- return this.chainModify(1.25);
- },
- onModifySpePriority: 5,
- onModifySpe: function (spe) {
- return this.chainModify(1.25);
- },
- onModifyMove: function (move) {
- return undefined;
- },
- },
- "grasspelt": {
- inherit: true,
- onModifyDefPriority: 6,
- onModifyDef: function (def) {
- if (this.isTerrain('grassyterrain')) return this.chainModify(2);
- },
- onModifySpdPriority: 6,
- onModifySpd: function (spd) {
- if (this.isTerrain('grassyterrain')) return this.chainModify(2);
- },
- onBasePowerPriority: 7,
- onFoeBasePower: function (basePower, attacker, defender, move) {
- if (this.effectData.target !== defender) return;
- if (move.type === 'Fire') {
- return this.chainModify(2);
- }
- },
- },
- "magmaarmor": {
- inherit: true,
- onUpdate: function (pokemon) {
- if (pokemon.status === 'frz') {
- pokemon.cureStatus();
- }
- },
- onImmunity: function (type, pokemon) {
- if (type === 'frz' || type === 'Water') return false;
- }
- },
- "immunity": {
- inherit: true,
- onUpdate: function (pokemon) {
- if (pokemon.status === 'psn' || pokemon.status === 'tox') {
- pokemon.cureStatus();
- }
- },
- onImmunity: function (type) {
- if (type === 'psn' || type === 'Poison') return false;
- }
- },
- "insomnia": {
- inherit: true,
- onUpdate: function (pokemon) {
- if (pokemon.status === 'slp') {
- pokemon.cureStatus();
- }
- },
- onImmunity: function (type, pokemon) {
- if (type === 'slp' || type === 'Dark') return false;
- }
- },
- "adaptability": {
- inherit: true,
- onModifyDamage: function (damage, source, target, move) {
- if (move.typeMod=1) {
- this.debug('Adaptability boost');
- return this.chainModify(1.5);
- }
- },
- },
- "toughclaws": {
- inherit: true,
- onSourceHit: function (target, source, move) {
- if (move && move.flags['contact']) target.addVolatile('trapped');
- },
- onBasePower: function (basePower, attacker, defender, move) {
- if (move.flags['contact']) {
- return this.chainModify([1.2]);
- }
- },
- },
- "stickyhold": {
- inherit: true,
- onSourceHit: function (target, source, move) {
- if (move && move.flags['contact']) target.addVolatile('trapped');
- },
- },
- "aerilate": {
- inherit: true,
- effect: {
- duration: 1,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, pokemon, target, move) {
- return this.chainModify([1.2]);
- },
- },
- },
- "pixilate": {
- inherit: true,
- effect: {
- duration: 1,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, pokemon, target, move) {
- return this.chainModify([1.2]);
- },
- },
- },
- "refrigerate": {
- inherit: true,
- effect: {
- duration: 1,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, pokemon, target, move) {
- return this.chainModify([1.2]);
- },
- },
- },
- "shedskin": {
- inherit: true,
- onResidual: function (pokemon) {
- return undefined;
- },
- onUpdate: function (pokemon) {
- if (pokemon.hp && pokemon.status) {
- pokemon.cureStatus();
- this.boost({spe:-1});
- }
- },
- },
- "marvelscale": {
- inherit: true,
- onModifySpdPriority: 6,
- onModifySpD: function (spd, pokemon) {
- if (pokemon.status) {
- return this.chainModify(1.5);
- }
- },
- },
- "damp": {
- inherit: true,
- onStart: function () {
- this.add('-clearallboost');
- for (let i = 0; i < this.sides.length; i++) {
- for (let j = 0; j < this.sides[i].active.length; j++) {
- if (this.sides[i].active[j] && this.sides[i].active[j].isActive) this.sides[i].active[j].clearBoosts();
- }
- }
- },
- },
- "waterveil": {
- inherit: true,
- onModifyAtk: function (atk, pokemon) {
- if (this.isWeather(['raindance', 'primordialsea'])) {
- return this.chainModify(1.5);
- }
- },
- onModifyDef: function (def, pokemon) {
- if (this.isWeather(['raindance', 'primordialsea'])) {
- return this.chainModify(1.5);
- }
- },
- },
- "raindish": {
- inherit: true,
- onModifySecondaries: function (secondaries) {
- if (this.isWeather(['raindance', 'primordialsea']))
- this.debug('Rain Dish prevent secondary');
- return secondaries.filter(function (effect) {
- return !!effect.self;
- });
- },
- },
- "icebody": {
- inherit: true,
- onModifySecondaries: function (secondaries) {
- if (this.isWeather(['hail', 'iceage']))
- this.debug('Ice Body prevent secondary');
- return secondaries.filter(function (effect) {
- return !!effect.self;
- });
- },
- },
- "overcoat": {
- inherit: true,
- onImmunity: function (type, pokemon) {
- if (type === 'sandstorm' || type === 'hail' || type === 'iceage' || type === 'powder') return false;
- },
- },
- "defeatist": {
- inherit: true,
- onModifySpA: function (spa) {
- return undefined;
- },
- onModifyAtk: function (atk) {
- return undefined;
- },
- onModifySpePriority: 5,
- onModifySpe: function (spe, pokemon) {
- if (pokemon.hp <= pokemon.maxhp / 2) {
- return this.chainModify(0.5);
- }
- },
- },
- "normalize": {
- inherit: true,
- onModifyMove: function (move) {
- return undefined
- },
- onBasePowerPriority: 8,
- onBasePower: function (basePower, attacker, defender, move) {
- if (move && move.category !== 'Status')
- return 100;
- },
- },
- "limber": {
- inherit: true,
- onUpdate: function (pokemon) {
- if (pokemon.status === 'par') {
- this.add('-activate', pokemon, 'ability: Limber');
- pokemon.cureStatus();
- }
- },
- onImmunity: function (type, pokemon) {
- if (type === 'par') return false;
- },
- onBoost: function (boost, target, source, effect) {
- if (source && target === source) return;
- if (boost['spe'] && boost['spe'] < 0) {
- boost['spe'] = 0;
- if (!effect.secondaries) this.add("-fail", target, "unboost", "Speed", "[from] ability: Limber", "[of] " + target);
- }
- },
- },
- "vitalspirit": {
- inherit: true,
- onUpdate: function (pokemon) {
- if (pokemon.status === 'slp') {
- this.add('-activate', pokemon, 'ability: Vital Spirit');
- pokemon.cureStatus();
- }
- },
- onImmunity: function (type) {
- if (type === 'slp') return false;
- },
- onAfterEachBoost: function (boost, target, source) {
- if (!source || target.side === source.side) {
- return;
- }
- let statsLowered = false;
- for (let i in boost) {
- if (boost[i] < 0) {
- statsLowered = true;
- }
- }
- if (statsLowered) {
- this.boost({spe: 2});
- }
- },
- },
- "arenatrap": {
- inherit: true,
- onFoeSwitchOut: function (pokemon) {
- if (!this.isAdjacent(pokemon, this.effectData.target) || pokemon.hasType ('Ghost') || pokemon.hasAbility('runaway') || pokemon.hasItem('shedshell')) return;
- if (pokemon.isGrounded())
- this.damage(pokemon.maxhp / 8);
- },
- onFoeTrapPokemon: null,
- onFoeMaybeTrapPokemon: null,
- },
- "magnetpull": {
- inherit: true,
- onFoeSwitchOut: function (pokemon) {
- if (pokemon.hasType('Steel') && !pokemon.hasAbility('runaway') && !pokemon.hasType('Ghost') && !pokemon.hasItem('shedshell') && this.isAdjacent(pokemon, this.effectData.target)) {
- this.damage(pokemon.maxhp / 8);
- }
- },
- onFoeTrapPokemon: null,
- onFoeMaybeTrapPokemon: null,
- },
- "shadowtag": {
- inherit: true,
- onFoeSwitchOut: function (pokemon) {
- if (!pokemon.hasAbility('shadowtag') && !pokemon.hasAbility('runaway') && !pokemon.hasType('Ghost') && !pokemon.hasItem('shedshell') && this.isAdjacent(pokemon, this.effectData.target)) {
- this.damage(pokemon.maxhp / 8);
- }
- },
- onFoeTrapPokemon: null,
- onFoeMaybeTrapPokemon: null,
- },
- "runaway": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (move && move.id === 'pursuit') {
- return null;
- }
- },
- },
- "cheekpouch": {
- inherit: true,
- onSwitchOut: function (pokemon) {
- if (pokemon.hp && !pokemon.item && this.getItem(pokemon.lastItem).isBerry) {
- pokemon.setItem(pokemon.lastItem);
- this.add('-item', pokemon, pokemon.getItem(), '[from] ability: Cheek Pouch');
- }
- }
- },
- "quickfeet": {
- inherit: true,
- onModifySpe: function (spe, pokemon) {
- if (pokemon.status) {
- return this.chainModify(2);
- }
- },
- },
- "heavymetal": {
- inherit: true,
- onModifyAtkPriority: 5,
- onModifyAtk: function (atk) {
- return this.chainModify(1.5);
- },
- onModifyDefPriority: 5,
- onModifyDef: function (def) {
- return this.chainModify(1.5);
- },
- onModifySpePriority: 5,
- onModifySpe: function (spe) {
- return this.chainModify(0.5);
- },
- },
- "lightmetal": {
- inherit: true,
- onModifyAtkPriority: 5,
- onModifyAtk: function (atk) {
- return this.chainModify(0.66);
- },
- onModifyDefPriority: 5,
- onModifyDef: function (def) {
- return this.chainModify(0.66);
- },
- onModifySpePriority: 5,
- onModifySpe: function (spe) {
- return this.chainModify(2);
- },
- },
- "wonderskin": {
- inherit: true,
- onTryHit: function (target, source, move) {
- if (target !== source && move.category === 'Status') {
- if (!this.heal(target.maxhp / 4)) {
- this.add('-immune', target, '[msg]', '[from] ability: Wonder Skin');
- }
- return null;
- }
- },
- },
- "roughskin": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (source && source !== target && move && move.flags['contact'] && !source.hasAbility('Rock Head')) {
- let typeMod = this.clampIntRange(source.runEffectiveness('Dark'), -6, 6);
- this.damage(source.maxhp * Math.pow(2, typeMod) /8, source, target, null, true);
- }
- },
- },
- "ironbarbs": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (source && source !== target && move && move.flags['contact'] && !source.hasAbility('Rock Head')) {
- let typeMod = this.clampIntRange(source.runEffectiveness('Steel'), -6, 6);
- this.damage(source.maxhp * Math.pow(2, typeMod) /8, source, target, null, true);
- }
- },
- },
- "static": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (source && source !== target && !source.hasType('Ground') && move && move.flags['contact'] && !source.hasAbility('Rock Head')) {
- let typeMod = this.clampIntRange(source.runEffectiveness('Electric'), -6, 6);
- this.damage(source.maxhp * Math.pow(2, typeMod) /8, source, target, null, true);
- }
- },
- },
- "flamebody": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (source && source !== target && move && move.flags['contact'] && !source.hasAbility('Rock Head')) {
- let typeMod = this.clampIntRange(source.runEffectiveness('Fire'), -6, 6);
- this.damage(source.maxhp * Math.pow(2, typeMod) /8, source, target, null, true);
- }
- },
- },
- "poisonpoint": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (source && source !== target && !source.hasType('Steel' && !source.hasAbility('Rock Head')) && move && move.flags['contact']) {
- let typeMod = this.clampIntRange(source.runEffectiveness('Poison'), -6, 6);
- this.damage(source.maxhp * Math.pow(2, typeMod) /8, source, target, null, true);
- }
- },
- },
- "pickpocket": {
- inherit: true,
- onAfterMoveSecondary: function (target, source, move) {
- if (source && source !== target && move && move.flags['contact'] && !source.hasAbility('Rock Head')) {
- if (target.item) {
- return;
- }
- let yourItem = source.takeItem(target);
- if (!yourItem) {
- return;
- }
- if (!target.setItem(yourItem)) {
- source.item = yourItem.id;
- return;
- }
- this.add('-item', target, yourItem, '[from] ability: Pickpocket', '[of] ' + source);
- }
- },
- },
- "gooey": {
- inherit: true,
- onAfterDamage: function (damage, target, source, effect) {
- if (effect && effect.flags['contact'] && !source.hasAbility('Rock Head')) {
- this.add('-ability', target, 'Gooey');
- this.boost({spe: -1}, source, target);
- }
- },
- },
- "cutecharm": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (move && move.flags['contact'] && !source.hasAbility('Rock Head')) {
- source.addVolatile('attract', target);
- }
- },
- },
- "effectspore": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (move && move.flags['contact'] && !source.status && !source.hasAbility('Rock Head') && source.runImmunity('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);
- }
- }
- },
- },
- "rockhead": {
- inherit: true,
- onDamage: function (damage, target, source, effect) {
- if (effect.id === 'recoil' && this.activeMove.id !== 'struggle' || effect && effect.id === 'aftermath') return null;
- },
- },
- "shellarmor": {
- inherit: true,
- onStart: function (pokemon) {
- pokemon.addVolatile('shellarmor');
- },
- onEnd: function (pokemon) {
- delete pokemon.volatiles['shellarmor'];
- this.add('-end', pokemon, 'Shell Armor', '[silent]');
- },
- effect: {
- duration: 1,
- onSourceModifyDamage: function (damage, source, target, move) {
- return this.chainModify(0.5);
- }
- },
- },
- "truant": {
- inherit: true,
- onBeforeMove: function (pokemon) {
- return undefined
- },
- onResidualOrder: 20,
- onResidual: function (pokemon) {
- if (pokemon.activeTurns) {
- if (!pokemon.setStatus('slp')) return false;
- pokemon.statusData.time = 2;
- pokemon.statusData.startTime = 2;
- }
- },
- },
- "slowstart": {
- inherit: true,
- onStart: null,
- onTryMove: function (pokemon, target) {
- if (pokemon.activeTurns < 2) {
- this.add('-fail', pokemon);
- this.add('-hint', "It's slow to get started.");
- return null;
- }
- },
- },
- "stench": {
- inherit: true,
- onModifyMove: function (move) {
- if (move.category !== "Status") {
- this.debug('Adding Stench flinch');
- if (!move.secondaries) move.secondaries = [];
- for (let i = 0; i < move.secondaries.length; i++) {
- if (move.secondaries[i].volatileStatus === 'flinch') return;
- }
- move.secondaries.push({
- chance: 100,
- volatileStatus: 'flinch',
- });
- }
- },
- },
- "toxicboost": {
- inherit: true,
- onModifySpe: function (spe, pokemon) {
- if (pokemon.status === 'psn' || pokemon.status === 'tox') {
- return this.chainModify(1.5);
- }
- },
- },
- "leafguard": {
- inherit: true,
- onModifySpd: function (spd) {
- if (this.isWeather(['sunnyday', 'desolateland'])) {
- return this.chainModify(1.5);
- }
- },
- onModifyDef: function (def) {
- if (this.isWeather(['sunnyday', 'desolateland'])) {
- return this.chainModify(1.5);
- }
- },
- },
- "snowcloak": {
- inherit: true,
- onModifyAccuracy: function (accuracy) {
- return undefined;
- },
- onWeather: function (pokemon, effect) {
- if (this.isWeather(['hail', 'iceage'])) {
- pokemon.addVolatile('substitute');
- }
- },
- },
- "sandveil": {
- inherit: true,
- onModifyAccuracy: function (accuracy) {
- return undefined;
- },
- onWeather: function (pokemon) {
- if (this.isWeather(['sandstorm'])) {
- pokemon.addVolatile('substitute');
- }
- },
- },
- "justified": {
- inherit: true,
- onAfterDamage: undefined,
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === 'Dark') {
- move.accuracy = true;
- if (!target.addVolatile('justified')) {
- this.add('-immune', target, '[msg]', '[from] ability: Justified');
- }
- return null;
- }
- },
- onEnd: function (pokemon) {
- pokemon.removeVolatile('justified');
- },
- effect: {
- onStart: function (target) {
- this.add('-start', target, 'ability: Justified');
- },
- onModifyAtkPriority: 5,
- onModifyAtk: function (atk, attacker, defender, move) {
- this.debug('Justified boost');
- return this.chainModify(1.5);
- }
- },
- },
- "healer": {
- inherit: true,
- onStart: function (pokemon, source) {
- let side = pokemon.side;
- for (let i = 0; i < side.pokemon.length; i++) {
- side.pokemon[i].status = '';
- }
- this.add('-cureteam', source, '[from] ability: Healer');
- },
- },
- "flareboost": {
- inherit: true,
- onBasePowerPriority: 8,
- onBasePower: function (basePower, attacker, defender, move) {
- if (attacker.status === 'brn' && move.category === 'Special') {
- return this.chainModify(1.5);
- }
- },
- onDamage: function (damage, target, source, effect) {
- if (effect.id === 'brn') {
- this.heal(target.maxhp / 16);
- return false;
- }
- },
- },
- "weakarmor": {
- inherit: true,
- onModifyDefPriority: 5,
- onModifyDef: function (def) {
- return this.chainModify(0.66);
- },
- onModifySpePriority: 5,
- onModifySpe: function (spe) {
- return this.chainModify(1.5);
- },
- },
- "heatproof": {
- inherit: true,
- onDamage: function (damage, target, source, effect) {
- if (effect && effect.id === 'brn') {
- return false;
- }
- },
- onTryHit: function (target, source, move) {
- if (target !== source && move.type === 'Fire') {
- if (!this.boost({def:1, spd:1})) {
- this.add('-immune', target, '[msg]', '[from] ability: Storm Drain');
- }
- return null;
- }
- },
- },
- "zenmode": {
- inherit: true,
- onResidualOrder: 27,
- onResidual: function (pokemon) {
- if (pokemon.baseTemplate.species !== 'Darmanitan') {
- return;
- }
- if (pokemon.status === 'slp' && pokemon.template.speciesid === 'darmanitan') {
- pokemon.addVolatile('zenmode');
- } else if (pokemon.status !== 'slp' && pokemon.template.speciesid === 'darmanitanzen') {
- pokemon.removeVolatile('zenmode');
- }
- },
- onEnd: function (pokemon) {
- if (!pokemon.volatiles['zenmode']) return;
- pokemon.transformed = false;
- delete pokemon.volatiles['zenmode'];
- if (pokemon.formeChange('Darmanitan')) {
- this.add('-formechange', pokemon, 'Darmanitan', '[silent]');
- }
- },
- effect: {
- onStart: function (pokemon) {
- if (pokemon.formeChange('Darmanitan-Zen')) {
- this.add('-formechange', pokemon, 'Darmanitan-Zen', '[from] ability: Zen Mode');
- } else {
- return false;
- }
- },
- onEnd: function (pokemon) {
- if (pokemon.formeChange('Darmanitan')) {
- this.add('-formechange', pokemon, 'Darmanitan', '[from] ability: Zen Mode');
- } else {
- return false;
- }
- },
- },
- },
- "trace": {
- inherit: true,
- onUpdate: function (pokemon) {
- let possibleTargets = [];
- for (let i = 0; i < pokemon.side.foe.active.length; i++) {
- if (pokemon.side.foe.active[i] && !pokemon.side.foe.active[i].fainted) possibleTargets.push(pokemon.side.foe.active[i]);
- }
- while (possibleTargets.length) {
- let rand = 0;
- if (possibleTargets.length > 1) rand = this.random(possibleTargets.length);
- let target = possibleTargets[rand];
- let ability = this.getAbility(target.ability);
- let bannedAbilities = {flowergift:1, forecast:1, illusion:1, imposter:1, multitype:1, stancechange:1, trace:1, zenmode:1, fluidity: 1};
- if (bannedAbilities[target.ability]) {
- possibleTargets.splice(rand, 1);
- continue;
- }
- this.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target);
- pokemon.setAbility(ability);
- return;
- }
- },
- },
- "forecast": {
- inherit: true,
- onSetWeather: function (pokemon) {
- this.boost({spe: 1, spa: 1, spd: 1})
- },
- onUpdate: function (pokemon) {
- if (pokemon.baseTemplate.species !== 'Castform' || pokemon.transformed) return;
- let forme = null;
- switch (this.effectiveWeather()) {
- case 'sunnyday':
- case 'desolateland':
- if (pokemon.template.speciesid !== 'castformsunny') forme = 'Castform-Sunny';
- break;
- case 'raindance':
- case 'primordialsea':
- if (pokemon.template.speciesid !== 'castformrainy') forme = 'Castform-Rainy';
- break;
- case 'hail':
- case 'iceage':
- if (pokemon.template.speciesid !== 'castformsnowy') forme = 'Castform-Snowy';
- break;
- case 'sandstorm':
- if (pokemon.template.speciesid !== 'castformsand') forme = 'Castform-Sand';
- break;
- default:
- if (pokemon.template.speciesid !== 'castform') forme = 'Castform';
- break;
- }
- if (pokemon.isActive && forme) {
- pokemon.formeChange(forme);
- this.add('-formechange', pokemon, forme, '[msg]');
- }
- },
- },
- "airlock": {
- inherit: true,
- suppressWeather: false,
- onStart: function (source) {
- this.setWeather('');
- },
- onAnySetWeather: function (target, source, weather) {
- return false;
- },
- },
- "primordialsea": {
- inherit: true,
- onAnySetWeather: function (target, source, weather) {
- if (this.getWeather().id === 'primordialsea' && !(weather.id in {desolateland:1, primordialsea:1, deltastream:1, iceage: 1})) return false;
- },
- },
- "desolateland": {
- inherit: true,
- onAnySetWeather: function (target, source, weather) {
- if (this.getWeather().id === 'desolateland' && !(weather.id in {desolateland:1, primordialsea:1, deltastream:1, iceage: 1})) return false;
- },
- },
- "deltastream": {
- inherit: true,
- onAnySetWeather: function (target, source, weather) {
- if (this.getWeather().id === 'deltastream' && !(weather.id in {desolateland:1, primordialsea:1, deltastream:1, iceage: 1})) return false;
- },
- },
- "transcendent": {
- shortDesc: "Moves with increased priority fail in the Pokemon's presence.",
- id: "transcendent",
- isNonstandard: true,
- name: "Transcendent",
- onAnyTryMove: function (target, source, effect) {
- if (effect && (effect.priority >= 1)) {
- this.attrLastMove('[still]');
- this.add('-activate', this.effectData.target, 'ability: Transcendent');
- return false;
- }
- },
- rating: 3.5,
- num: -5,
- },
- "iceage": {
- shortDesc: "On switch-in, this Pokemon summons Ice Age.",
- isNonstandard: true,
- onStart: function (source) {
- this.setWeather('iceage');
- },
- onAnySetWeather: function (target, source, weather) {
- if (this.getWeather().id === 'iceage' && !(weather.id in {desolateland:1, primordialsea:1, deltastream:1, iceage: 1})) return false;
- },
- onEnd: function (pokemon) {
- if (this.weatherData.source !== pokemon) return;
- for (let i = 0; i < this.sides.length; i++) {
- for (let j = 0; j < this.sides[i].active.length; j++) {
- let target = this.sides[i].active[j];
- if (target === pokemon) continue;
- if (target && target.hp && target.hasAbility('iceage')) {
- this.weatherData.source = target;
- return;
- }
- }
- }
- this.clearWeather();
- },
- id: "iceage",
- name: "Ice Age",
- rating: 5,
- num: -6,
- },
- "wellofpower": {
- shortDesc: "Pokemon uses two-turn moves in one turn.",
- isNonstandard: true,
- onChargeMove: function (pokemon, target, move) {
- this.debug('well of power - remove charge turn for ' + move.id);
- return false; // skip charge turn
- },
- id: "wellofpower",
- name: "Well of Power",
- rating: 5,
- num: -7,
- },
- "fluidity": {
- shortDesc: "Meloetta smoothly changes between formes.",
- isNonstandard: true,
- onBeforeMove: function (attacker, defender, move) {
- if (attacker.template.baseSpecies !== 'Meloetta') return;
- if (move.category === 'Status') return;
- let targetSpecies = (move.category === 'Special' ? 'Meloetta' : 'Meloetta-Pirouette');
- if (attacker.template.species !== targetSpecies && attacker.formeChange(targetSpecies)) {
- this.add('-formechange', attacker, targetSpecies, '[from] ability: Fluidity');
- }
- },
- id: "fluidity",
- name: "Fluidity",
- rating: 5,
- num: -8,
- },
- "distortion": {
- shortDesc: "The user brings the battle into the Distortion World.",
- isNonstandard: true,
- onStart: function (source) {
- this.setWeather('distortion');
- },
- onUpdate: function (pokemon) {
- if (!pokemon.isActive || pokemon.baseTemplate.speciesid !== 'giratina') return;
- if (this.isWeather(['distortion'])) {
- if (pokemon.template.speciesid !== 'giratinaorigin') {
- pokemon.formeChange('Giratina-Origin');
- this.add('-formechange', pokemon, 'Giratina-Origin', '[msg]');
- }
- } else {
- if (pokemon.template.speciesid === 'giratinaorigin') {
- pokemon.formeChange('Giratina');
- this.add('-formechange', pokemon, 'Giratina', '[msg]');
- }
- }
- },
- id: "distortion",
- name: "Distortion",
- rating: 5,
- num: -9,
- },
- };
- /* mods/ghoulking/items.js */
- 'use strict';
- exports.BattleItems = {
- "expertbelt": {
- inherit: true,
- onModifyDamage: function (damage, source, target, move) {
- if (move && move.typeMod > 0) {
- return this.chainModify([1.5]);
- }
- },
- },
- "shellbell": {
- inherit: true,
- onAfterMoveSecondarySelfPriority: -1,
- onAfterMoveSecondarySelf: function (pokemon, target, move) {
- if (move.category !== 'Status') {
- this.heal(pokemon.lastDamage / 3, pokemon);
- }
- },
- },
- "bigroot": {
- inherit: true,
- onTryHealPriority: 1,
- onTryHeal: function (damage, target, source, effect) {
- var heals = {drain: 1, leechseed: 1, ingrain: 1, aquaring: 1};
- if (heals[effect.id]) {
- return Math.ceil((damage * 2) - 0.5); // Big Root rounds half down
- }
- },
- },
- "widelens": {
- inherit: true,
- onSourceModifyAccuracy: function (accuracy) {
- if (typeof accuracy === 'number') {
- return accuracy * 1.2;
- }
- },
- },
- "zoomlens": {
- inherit: true,
- onSourceModifyAccuracy: function (accuracy, target) {
- if (typeof accuracy === 'number' && !this.willMove(target)) {
- this.debug('Zoom Lens boosting accuracy');
- return accuracy * 1.5;
- }
- },
- },
- "quickclaw": {
- inherit: true,
- onModifyPriority: function (priority, pokemon) {
- if (pokemon.activeTurns < 2) {
- this.add('-activate', pokemon, 'item: Quick Claw');
- return priority + 0.1;
- }
- },
- },
- "enigmaberry": {
- inherit: true,
- onEat: function (pokemon) {
- this.heal(pokemon.maxhp / 4 * 3);
- },
- },
- "kingsrock": {
- inherit: true,
- onModifyMovePriority: -1,
- onModifyMove: function (move) {
- if (move.category !== "Status") {
- if (!move.secondaries) move.secondaries = [];
- for (let i = 0; i < move.secondaries.length; i++) {
- if (move.secondaries[i].volatileStatus === 'flinch') return;
- }
- move.secondaries.push({
- chance: 100,
- volatileStatus: 'flinch',
- });
- }
- },
- },
- "razorfang": {
- inherit: true,
- onModifyMovePriority: -1,
- onModifyMove: function (move) {
- if (move.category !== "Status") {
- if (!move.secondaries) move.secondaries = [];
- for (let i = 0; i < move.secondaries.length; i++) {
- if (move.secondaries[i].volatileStatus === 'flinch') return;
- }
- move.secondaries.push({
- chance: 100,
- volatileStatus: 'flinch',
- });
- }
- },
- },
- "rockyhelmet": {
- inherit: true,
- onAfterDamage: function (damage, target, source, move) {
- if (source && source !== target && move && move.flags['contact'] && !source.hasAbility('Rock Head')) {
- this.damage(source.maxhp / 6, source, target, null, true);
- }
- },
- },
- "stickybarb": {
- inherit: true,
- onHit: function (target, source, move) {
- if (source && source !== target && !source.item && move && move.flags['contact'] && !source.hasAbility('Rock Head')) {
- let barb = target.takeItem();
- source.setItem(barb);
- // no message for Sticky Barb changing hands
- }
- },
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement