text: 'use strict';
  
  /**@type {{[k: string]: ModdedMoveData}} */
  let BattleMovedex = {
  	allyswitch: {
  		inherit: true,
  		desc: "The user swaps positions with its ally on the opposite side of the field. Fails if there is no Pokemon at that position, if the user is the only Pokemon on its side, or if the user is in the middle.",
  		shortDesc: "Switches position with the ally on the far side.",
  		priority: 1,
  	},
  	assist: {
  		inherit: true,
  		desc: "A random move among those known by the user's party members is selected for use. Does not select Assist, Belch, Bestow, Bounce, Celebrate, Chatter, Circle Throw, Copycat, Counter, Covet, Destiny Bond, Detect, Dig, Dive, Dragon Tail, Endure, Feint, Fly, Focus Punch, Follow Me, Helping Hand, Hold Hands, King's Shield, Mat Block, Me First, Metronome, Mimic, Mirror Coat, Mirror Move, Nature Power, Phantom Force, Protect, Rage Powder, Roar, Shadow Force, Sketch, Sky Drop, Sleep Talk, Snatch, Spiky Shield, Struggle, Switcheroo, Thief, Transform, Trick, or Whirlwind.",
  	},
  	bestow: {
  		inherit: true,
  		desc: "The target receives the user's held item. Fails if the user has no item or is holding a Mail, if the target is already holding an item, if the user is a Kyogre holding a Blue Orb, a Groudon holding a Red Orb, a Giratina holding a Griseous Orb, an Arceus holding a Plate, a Genesect holding a Drive, a Pokemon that can Mega Evolve holding the Mega Stone for its species, or if the target is one of those Pokemon and the user is holding the respective item.",
  	},
  	brickbreak: {
  		inherit: true,
  		desc: "If this attack does not miss, the effects of Reflect and Light Screen end for the target's side of the field before damage is calculated.",
  	},
  	camouflage: {
  		inherit: true,
  		desc: "The user's type changes based on the battle terrain. Normal type on the regular Wi-Fi terrain, Electric type during Electric Terrain, Fairy type during Misty Terrain, and Grass type during Grassy Terrain. Fails if the user's type cannot be changed or if the user is already purely that type.",
  	},
  	copycat: {
  		inherit: true,
  		desc: "The user uses the last move used by any Pokemon, including itself. Fails if no move has been used, or if the last move used was Assist, Baneful Bunker, Belch, Bestow, Celebrate, Chatter, Circle Throw, Copycat, Counter, Covet, Destiny Bond, Detect, Dragon Tail, Endure, Feint, Focus Punch, Follow Me, Helping Hand, Hold Hands, King's Shield, Mat Block, Me First, Metronome, Mimic, Mirror Coat, Mirror Move, Nature Power, Protect, Rage Powder, Roar, Sketch, Sleep Talk, Snatch, Spiky Shield, Struggle, Switcheroo, Thief, Transform, Trick, or Whirlwind.",
  	},
  	counter: {
  		inherit: true,
  		desc: "Deals damage to the last opposing Pokemon to hit the user with a physical attack this turn equal to twice the HP lost by the user from that attack. If the user did not lose HP from the attack, this move deals damage with a power of 1 instead. If that opposing Pokemon's position is no longer in use, the damage is done to a random opposing Pokemon in range. Only the last hit of a multi-hit attack is counted. Fails if the user was not hit by an opposing Pokemon's physical attack this turn.",
  	},
  	covet: {
  		inherit: true,
  		desc: "If this attack was successful and the user has not fainted, it steals the target's held item if the user is not holding one. The target's item is not stolen if it is a Mail, or if the target is a Kyogre holding a Blue Orb, a Groudon holding a Red Orb, a Giratina holding a Griseous Orb, an Arceus holding a Plate, a Genesect holding a Drive, or a Pokemon that can Mega Evolve holding the Mega Stone for its species. Items lost to this move cannot be regained with Recycle or the Harvest Ability.",
  	},
  	darkvoid: {
  		inherit: true,
  		desc: "Causes the target to fall asleep.",
  		shortDesc: "Causes the foe(s) to fall asleep.",
  		accuracy: 80,
  		onTryMove() {},
  	},
  	defog: {
  		inherit: true,
  		desc: "Lowers the target's evasiveness by 1 stage. If this move is successful and whether or not the target's evasiveness was affected, the effects of Reflect, Light Screen, Safeguard, Mist, Spikes, Toxic Spikes, Stealth Rock, and Sticky Web end for the target's side, and the effects of Spikes, Toxic Spikes, Stealth Rock, and Sticky Web end for the user's side. Ignores a target's substitute, although a substitute will still block the lowering of evasiveness.",
  	},
  	destinybond: {
  		inherit: true,
  		desc: "Until the user's next turn, if an opposing Pokemon's attack knocks the user out, that Pokemon faints as well, unless the attack was Doom Desire or Future Sight.",
  		onPrepareHit(pokemon) {
  			pokemon.removeVolatile('destinybond');
  		},
  	},
  	detect: {
  		inherit: true,
  		desc: "The user is protected from most attacks made by other Pokemon during this turn. This move has a 1/X chance of being successful, where X starts at 1 and triples each time this move is successfully used. X resets to 1 if this move fails, if the user's last move used is not Detect, Endure, King's Shield, Protect, Quick Guard, Spiky Shield, or Wide Guard, or if it was one of those moves and the user's protection was broken. Fails if the user moves last this turn.",
  	},
  	diamondstorm: {
  		inherit: true,
  		desc: "Has a 50% chance to raise the user's Defense by 1 stage.",
  		shortDesc: "50% chance to raise user's Def by 1 for each hit.",
  		secondary: {
  			chance: 50,
  			self: {
  				boosts: {
  					def: 1,
  				},
  			},
  		},
  	},
  	encore: {
  		inherit: true,
  		desc: "For 3 turns, the target is forced to repeat its last move used. If the affected move runs out of PP, the effect ends. Fails if the target is already under this effect, if it has not made a move, if the move has 0 PP, or if the move is Encore, Mimic, Mirror Move, Sketch, Struggle, or Transform.",
  		effect: {
  			duration: 3,
  			onStart(target) {
  				let noEncore = ['encore', 'mimic', 'mirrormove', 'sketch', 'struggle', 'transform'];
  				let moveIndex = target.lastMove ? target.moves.indexOf(target.lastMove.id) : -1;
  				if (!target.lastMove || noEncore.includes(target.lastMove.id) || !target.moveSlots[moveIndex] || target.moveSlots[moveIndex].pp <= 0) {
  					// it failed
  					delete target.volatiles['encore'];
  					return false;
  				}
  				this.effectData.move = target.lastMove.id;
  				this.add('-start', target, 'Encore');
  				if (!this.willMove(target)) {
  					this.effectData.duration++;
  				}
  			},
  			onOverrideAction(pokemon, target, move) {
  				if (move.id !== this.effectData.move) return this.effectData.move;
  			},
  			onResidualOrder: 13,
  			onResidual(target) {
  				if (target.moves.includes(this.effectData.move) && target.moveSlots[target.moves.indexOf(this.effectData.move)].pp <= 0) { // early termination if you run out of PP
  					delete target.volatiles.encore;
  					this.add('-end', target, 'Encore');
  				}
  			},
  			onEnd(target) {
  				this.add('-end', target, 'Encore');
  			},
  			onDisableMove(pokemon) {
  				if (!this.effectData.move || !pokemon.hasMove(this.effectData.move)) {
  					return;
  				}
  				for (const moveSlot of pokemon.moveSlots) {
  					if (moveSlot.id !== this.effectData.move) {
  						pokemon.disableMove(moveSlot.id);
  					}
  				}
  			},
  		},
  	},
  	endure: {
  		inherit: true,
  		desc: "The user will survive attacks made by other Pokemon during this turn with at least 1 HP. This move has a 1/X chance of being successful, where X starts at 1 and triples each time this move is successfully used. X resets to 1 if this move fails, if the user's last move used is not Detect, Endure, King's Shield, Protect, Quick Guard, Spiky Shield, or Wide Guard, or if it was one of those moves and the user's protection was broken. Fails if the user moves last this turn.",
  	},
  	entrainment: {
  		inherit: true,
  		desc: "Causes the target's Ability to become the same as the user's. Fails if the target's Ability is Multitype, Stance Change, Truant, or the same Ability as the user, or if the user's Ability is Flower Gift, Forecast, Illusion, Imposter, Multitype, Stance Change, Trace, or Zen Mode.",
  	},
  	feint: {
  		inherit: true,
  		desc: "If this move is successful, it breaks through the target's Detect, King's Shield, Protect, or Spiky Shield for this turn, allowing other Pokemon to attack the target normally. If the target's side is protected by Crafty Shield, Mat Block, Quick Guard, or Wide Guard, that protection is also broken for this turn and other Pokemon may attack the target's side normally.",
  	},
  	fellstinger: {
  		inherit: true,
  		desc: "Raises the user's Attack by 2 stages if this move knocks out the target.",
  		shortDesc: "Raises user's Attack by 2 if this KOes the target.",
  		basePower: 30,
  		onAfterMoveSecondarySelf(pokemon, target, move) {
  			if (!target || target.fainted || target.hp <= 0) this.boost({atk: 2}, pokemon, pokemon, move);
  		},
  	},
  	flameburst: {
  		inherit: true,
  		desc: "If this move is successful, each ally adjacent to the target loses 1/16 of its maximum HP, rounded down, unless it has the Magic Guard Ability.",
  	},
  	flyingpress: {
  		inherit: true,
  		basePower: 80,
  	},
  	followme: {
  		inherit: true,
  		desc: "Until the end of the turn, all single-target attacks from the opposing side are redirected to the user if they are in range. Such attacks are redirected to the user before they can be reflected by Magic Coat or the Magic Bounce Ability, or drawn in by the Lightning Rod or Storm Drain Abilities. Fails if it is not a Double or Triple Battle. This effect is ignored while the user is under the effect of Sky Drop.",
  	},
  	gastroacid: {
  		inherit: true,
  		desc: "Causes the target's Ability to be rendered ineffective as long as it remains active. If the target uses Baton Pass, the replacement will remain under this effect. If the target's Ability is Multitype or Stance Change, this move fails, and receiving the effect through Baton Pass ends the effect immediately.",
  		onTryHit(pokemon) {
  			let bannedAbilities = ['multitype', 'stancechange'];
  			if (bannedAbilities.includes(pokemon.ability)) {
  				return false;
  			}
  		},
  	},
  	heavyslam: {
  		inherit: true,
  		desc: "The power of this move depends on (user's weight / target's weight), rounded down. Power is equal to 120 if the result is 5 or more, 100 if 4, 80 if 3, 60 if 2, and 40 if 1 or less.",
  	},
  	hyperspacefury: {
  		inherit: true,
  		desc: "Lowers the user's Defense by 1 stage. This move cannot be used successfully unless the user's current form, while considering Transform, is Hoopa Unbound. If this move is successful, it breaks through the target's Detect, King's Shield, Protect, or Spiky Shield for this turn, allowing other Pokemon to attack the target normally. If the target's side is protected by Crafty Shield, Mat Block, Quick Guard, or Wide Guard, that protection is also broken for this turn and other Pokemon may attack the target's side normally.",
  	},
  	hyperspacehole: {
  		inherit: true,
  		desc: "If this move is successful, it breaks through the target's Detect, King's Shield, Protect, or Spiky Shield for this turn, allowing other Pokemon to attack the target normally. If the target's side is protected by Crafty Shield, Mat Block, Quick Guard, or Wide Guard, that protection is also broken for this turn and other Pokemon may attack the target's side normally.",
  	},
  	iceball: {
  		inherit: true,
  		desc: "If this move is successful, the user is locked into this move and cannot make another move until it misses, 5 turns have passed, or the attack cannot be used. Power doubles with each successful hit of this move and doubles again if Defense Curl was used previously by the user. If this move is called by Sleep Talk, the move is used for one turn.",
  	},
  	kingsshield: {
  		inherit: true,
  		desc: "The user is protected from most attacks made by other Pokemon during this turn, and Pokemon trying to make contact with the user have their Attack lowered by 2 stages. Non-damaging moves go through this protection. This move has a 1/X chance of being successful, where X starts at 1 and triples each time this move is successfully used. X resets to 1 if this move fails, if the user's last move used is not Detect, Endure, King's Shield, Protect, Quick Guard, Spiky Shield, or Wide Guard, or if it was one of those moves and the user's protection was broken. Fails if the user moves last this turn.",
  	},
  	knockoff: {
  		inherit: true,
  		desc: "If the target is holding an item that can be removed from it, ignoring the Sticky Hold Ability, this move's power is multiplied by 1.5. If the user has not fainted, the target loses its held item. This move cannot cause Pokemon with the Sticky Hold Ability to lose their held item, cause Pokemon that can Mega Evolve to lose the Mega Stone for their species, or cause a Kyogre, a Groudon, a Giratina, an Arceus, or a Genesect to lose their Blue Orb, Red Orb, Griseous Orb, Plate, or Drive, respectively. Items lost to this move cannot be regained with Recycle or the Harvest Ability.",
  	},
  	leechlife: {
  		inherit: true,
  		basePower: 20,
  		isViable: false,
  		pp: 15,
  	},
  	lightscreen: {
  		inherit: true,
  		desc: "For 5 turns, the user and its party members take 0.5x damage from special attacks, or 0.66x damage if in a Double or Triple Battle. Critical hits ignore this effect. It is removed from the user's side if the user or an ally is successfully hit by Brick Break or Defog. Lasts for 8 turns if the user is holding Light Clay. Fails if the effect is already active on the user's side.",
  	},
  	mefirst: {
  		inherit: true,
  		desc: "The user uses the move the target chose for use this turn against it, if possible, with its power multiplied by 1.5. The move must be a damaging move other than Chatter, Counter, Covet, Focus Punch, Me First, Metal Burst, Mirror Coat, Struggle, or Thief. Fails if the target moves before the user. Ignores the target's substitute for the purpose of copying the move.",
  	},
  	metalburst: {
  		inherit: true,
  		desc: "Deals damage to the last opposing Pokemon to hit the user with an attack this turn equal to 1.5 times the HP lost by the user from that attack, rounded down. If the user did not lose HP from the attack, this move deals damage with a power of 1 instead. If that opposing Pokemon's position is no longer in use, the damage is done to a random opposing Pokemon in range. Only the last hit of a multi-hit attack is counted. Fails if the user was not hit by an opposing Pokemon's attack this turn.",
  	},
  	metronome: {
  		inherit: true,
  		desc: "A random move is selected for use, other than After You, Assist, Belch, Bestow, Celebrate, Chatter, Copycat, Counter, Covet, Crafty Shield, Destiny Bond, Detect, Diamond Storm, Dragon Ascent, Endure, Feint, Focus Punch, Follow Me, Freeze Shock, Helping Hand, Hold Hands, Hyperspace Fury, Hyperspace Hole, Ice Burn, King's Shield, Light of Ruin, Mat Block, Me First, Metronome, Mimic, Mirror Coat, Mirror Move, Nature Power, Origin Pulse, Precipice Blades, Protect, Quash, Quick Guard, Rage Powder, Relic Song, Secret Sword, Sketch, Sleep Talk, Snarl, Snatch, Snore, Spiky Shield, Steam Eruption, Struggle, Switcheroo, Techno Blast, Thief, Thousand Arrows, Thousand Waves, Transform, Trick, V-create, or Wide Guard.",
  	},
  	mimic: {
  		inherit: true,
  		desc: "While the user remains active, this move is replaced by the last move used by the target. The copied move has the maximum PP for that move. Fails if the target has not made a move, if the user has Transformed, if the user already knows the move, or if the move is Chatter, Mimic, Sketch, Struggle, or Transform.",
  	},
  	minimize: {
  		inherit: true,
  		desc: "Raises the user's evasiveness by 2 stages. Whether or not the user's evasiveness was changed, Body Slam, Dragon Rush, Flying Press, Heat Crash, Phantom Force, Shadow Force, Steamroller, and Stomp will not check accuracy and have their damage doubled if used against the user while it is active.",
  		effect: {
  			noCopy: true,
  			onSourceModifyDamage(damage, source, target, move) {
  				if (['stomp', 'steamroller', 'bodyslam', 'flyingpress', 'dragonrush', 'phantomforce', 'heatcrash', 'shadowforce'].includes(move.id)) {
  					return this.chainModify(2);
  				}
  			},
  			onAccuracy(accuracy, target, source, move) {
  				if (['stomp', 'steamroller', 'bodyslam', 'flyingpress', 'dragonrush', 'phantomforce', 'heatcrash', 'shadowforce'].includes(move.id)) {
  					return true;
  				}
  				return accuracy;
  			},
  		},
  	},
  	mirrorcoat: {
  		inherit: true,
  		desc: "Deals damage to the last opposing Pokemon to hit the user with a special attack this turn equal to twice the HP lost by the user from that attack. If the user did not lose HP from the attack, this move deals damage with a power of 1 instead. If that opposing Pokemon's position is no longer in use, the damage is done to a random opposing Pokemon in range. Only the last hit of a multi-hit attack is counted. Fails if the user was not hit by an opposing Pokemon's special attack this turn.",
  	},
  	mistyterrain: {
  		inherit: true,
  		desc: "For 5 turns, the terrain becomes Misty Terrain. During the effect, the power of Dragon-type attacks used against grounded Pokemon is multiplied by 0.5 and grounded Pokemon cannot be inflicted with a major status condition. Camouflage transforms the user into a Fairy type, Nature Power becomes Moonblast, and Secret Power has a 30% chance to lower Special Attack by 1 stage. Fails if the current terrain is Misty Terrain.",
  		effect: {
  			duration: 5,
  			durationCallback(source, effect) {
  				if (source && source.hasItem('terrainextender')) {
  					return 8;
  				}
  				return 5;
  			},
  			onSetStatus(status, target, source, effect) {
  				if (!target.isGrounded() || target.isSemiInvulnerable()) return;
  				if (effect.id === 'synchronize' || (effect.effectType === 'Move' && !effect.secondaries)) {
  					this.add('-activate', target, 'move: Misty Terrain');
  				}
  				return false;
  			},
  			onBasePower(basePower, attacker, defender, move) {
  				if (move.type === 'Dragon' && defender.isGrounded() && !defender.isSemiInvulnerable()) {
  					this.debug('misty terrain weaken');
  					return this.chainModify(0.5);
  				}
  			},
  			onStart(battle, source, effect) {
  				if (effect && effect.effectType === 'Ability') {
  					this.add('-fieldstart', 'move: Misty Terrain', '[from] ability: ' + effect, '[of] ' + source);
  				} else {
  					this.add('-fieldstart', 'move: Misty Terrain');
  				}
  			},
  			onResidualOrder: 21,
  			onResidualSubOrder: 2,
  			onEnd(side) {
  				this.add('-fieldend', 'Misty Terrain');
  			},
  		},
  	},
  	mysticalfire: {
  		inherit: true,
  		basePower: 65,
  	},
  	naturepower: {
  		inherit: true,
  		desc: "This move calls another move for use based on the battle terrain. Tri Attack on the regular Wi-Fi terrain, Thunderbolt during Electric Terrain, Moonblast during Misty Terrain, and Energy Ball during Grassy Terrain.",
  	},
  	outrage: {
  		inherit: true,
  		desc: "The user spends two or three turns locked into this move and becomes confused immediately after its move on the last turn of the effect if it is not already. This move targets an adjacent opposing Pokemon at random on each turn. If the user is prevented from moving, is asleep at the beginning of a turn, or the attack is not successful against the target on the first turn of the effect or the second turn of a three-turn effect, the effect ends without causing confusion. If this move is called by Sleep Talk, the move is used for one turn and does not confuse the user.",
  	},
  	paraboliccharge: {
  		inherit: true,
  		basePower: 50,
  	},
  	partingshot: {
  		inherit: true,
  		desc: "Lowers the target's Attack and Special Attack by 1 stage. If this move is successful, the user switches out even if it is trapped and is replaced immediately by a selected party member. The user does not switch out if there are no unfainted party members.",
  	},
  	payback: {
  		inherit: true,
  		desc: "Power doubles if the user moves after the target this turn. Switching in does not count as an action.",
  	},
  	petaldance: {
  		inherit: true,
  		desc: "The user spends two or three turns locked into this move and becomes confused immediately after its move on the last turn of the effect if it is not already. This move targets an adjacent opposing Pokemon at random on each turn. If the user is prevented from moving, is asleep at the beginning of a turn, or the attack is not successful against the target on the first turn of the effect or the second turn of a three-turn effect, the effect ends without causing confusion. If this move is called by Sleep Talk, the move is used for one turn and does not confuse the user.",
  	},
  	phantomforce: {
  		inherit: true,
  		desc: "If this move is successful, it breaks through the target's Detect, King's Shield, Protect, or Spiky Shield for this turn, allowing other Pokemon to attack the target normally. If the target's side is protected by Crafty Shield, Mat Block, Quick Guard, or Wide Guard, that protection is also broken for this turn and other Pokemon may attack the target's side normally. This attack charges on the first turn and executes on the second. On the first turn, the user avoids all attacks. If the user is holding a Power Herb, the move completes in one turn. Damage doubles and no accuracy check is done if the target has used Minimize while active.",
  	},
  	powder: {
  		inherit: true,
  		desc: "If the target uses a Fire-type move this turn, it is prevented from executing and the target loses 1/4 of its maximum HP, rounded half up. This effect happens before the Fire-type move would be prevented by Primordial Sea.",
  		effect: {
  			duration: 1,
  			onStart(target) {
  				this.add('-singleturn', target, 'Powder');
  			},
  			onTryMovePriority: 1,
  			onTryMove(pokemon, target, move) {
  				if (move.type === 'Fire') {
  					this.add('-activate', pokemon, 'move: Powder');
  					this.damage(this.clampIntRange(Math.round(pokemon.maxhp / 4), 1));
  					return false;
  				}
  			},
  		},
  	},
  	protect: {
  		inherit: true,
  		desc: "The user is protected from most attacks made by other Pokemon during this turn. This move has a 1/X chance of being successful, where X starts at 1 and triples each time this move is successfully used. X resets to 1 if this move fails, if the user's last move used is not Detect, Endure, King's Shield, Protect, Quick Guard, Spiky Shield, or Wide Guard, or if it was one of those moves and the user's protection was broken. Fails if the user moves last this turn.",
  	},
  	pursuit: {
  		inherit: true,
  		desc: "If an adjacent opposing Pokemon switches out this turn, this move hits that Pokemon before it leaves the field, even if it was not the original target. If the user moves after an opponent using Parting Shot, U-turn, or Volt Switch, but not Baton Pass, it will hit that opponent before it leaves the field. Power doubles and no accuracy check is done if the user hits an opponent switching out, and the user's turn is over; if an opponent faints from this, the replacement Pokemon does not become active until the end of the turn.",
  	},
  	quickguard: {
  		inherit: true,
  		desc: "The user and its party members are protected from attacks with original or altered priority greater than 0 made by other Pokemon, including allies, during this turn. This move modifies the same 1/X chance of being successful used by other protection moves, where X starts at 1 and triples each time this move is successfully used, but does not use the chance to check for failure. X resets to 1 if this move fails, if the user's last move used is not Detect, Endure, King's Shield, Protect, Quick Guard, Spiky Shield, or Wide Guard, or if it was one of those moves and the user's protection was broken. Fails if the user moves last this turn or if this move is already in effect for the user's side.",
  	},
  	ragepowder: {
  		inherit: true,
  		desc: "Until the end of the turn, all single-target attacks from the opposing side are redirected to the user if they are in range. Such attacks are redirected to the user before they can be reflected by Magic Coat or the Magic Bounce Ability, or drawn in by the Lightning Rod or Storm Drain Abilities. Fails if it is not a Double or Triple Battle. This effect is ignored while the user is under the effect of Sky Drop.",
  	},
  	reflect: {
  		inherit: true,
  		desc: "For 5 turns, the user and its party members take 0.5x damage from physical attacks, or 0.66x damage if in a Double or Triple Battle. Critical hits ignore this effect. It is removed from the user's side if the user or an ally is successfully hit by Brick Break or Defog. Lasts for 8 turns if the user is holding Light Clay. Fails if the effect is already active on the user's side.",
  	},
  	reflecttype: {
  		inherit: true,
  		desc: "Causes the user's types to become the same as the current types of the target. Fails if the user is an Arceus.",
  	},
  	rockblast: {
  		inherit: true,
  		flags: {protect: 1, mirror: 1},
  	},
  	roleplay: {
  		inherit: true,
  		desc: "The user's Ability changes to match the target's Ability. Fails if the user's Ability is Multitype, Stance Change, or already matches the target, or if the target's Ability is Flower Gift, Forecast, Illusion, Imposter, Multitype, Stance Change, Trace, Wonder Guard, or Zen Mode.",
  	},
  	rollout: {
  		inherit: true,
  		desc: "If this move is successful, the user is locked into this move and cannot make another move until it misses, 5 turns have passed, or the attack cannot be used. Power doubles with each successful hit of this move and doubles again if Defense Curl was used previously by the user. If this move is called by Sleep Talk, the move is used for one turn.",
  	},
  	secretpower: {
  		inherit: true,
  		desc: "Has a 30% chance to cause a secondary effect on the target based on the battle terrain. Causes paralysis on the regular Wi-Fi terrain, causes paralysis during Electric Terrain, lowers Special Attack by 1 stage during Misty Terrain, and causes sleep during Grassy Terrain.",
  	},
  	shadowforce: {
  		inherit: true,
  		desc: "If this move is successful, it breaks through the target's Detect, King's Shield, Protect, or Spiky Shield for this turn, allowing other Pokemon to attack the target normally. If the target's side is protected by Crafty Shield, Mat Block, Quick Guard, or Wide Guard, that protection is also broken for this turn and other Pokemon may attack the target's side normally. This attack charges on the first turn and executes on the second. On the first turn, the user avoids all attacks. If the user is holding a Power Herb, the move completes in one turn. Damage doubles and no accuracy check is done if the target has used Minimize while active.",
  	},
  	sheercold: {
  		inherit: true,
  		desc: "Deals damage to the target equal to the target's maximum HP. Ignores accuracy and evasiveness modifiers. This attack's accuracy is equal to (user's level - target's level + 30)%, and fails if the target is at a higher level. Pokemon with the Sturdy Ability are immune.",
  		shortDesc: "OHKOs the target. Fails if user is a lower level.",
  		ohko: true,
  	},
  	simplebeam: {
  		inherit: true,
  		desc: "Causes the target's Ability to become Simple. Fails if the target's Ability is Multitype, Simple, Stance Change, or Truant.",
  		onTryHit(pokemon) {
  			let bannedAbilities = ['multitype', 'simple', 'stancechange', 'truant'];
  			if (bannedAbilities.includes(pokemon.ability)) {
  				return false;
  			}
  		},
  	},
  	skillswap: {
  		inherit: true,
  		desc: "The user swaps its Ability with the target's Ability. Fails if either the user or the target's Ability is Illusion, Multitype, Stance Change, or Wonder Guard.",
  		onTryHit(target, source) {
  			let bannedAbilities = ['illusion', 'multitype', 'stancechange', 'wonderguard'];
  			if (bannedAbilities.includes(target.ability) || bannedAbilities.includes(source.ability)) {
  				return false;
  			}
  		},
  	},
  	sleeptalk: {
  		inherit: true,
  		desc: "One of the user's known moves, besides this move, is selected for use at random. Fails if the user is not asleep. The selected move does not have PP deducted from it, and can currently have 0 PP. This move cannot select Assist, Belch, Bide, Celebrate, Chatter, Copycat, Focus Punch, Hold Hands, Me First, Metronome, Mimic, Mirror Move, Nature Power, Sketch, Sleep Talk, Struggle, Uproar, or any two-turn move.",
  	},
  	soak: {
  		inherit: true,
  		desc: "Causes the target to become a Water type. Fails if the target is an Arceus, or if the target is already purely Water type.",
  	},
  	spikyshield: {
  		inherit: true,
  		desc: "The user is protected from most attacks made by other Pokemon during this turn, and Pokemon making contact with the user lose 1/8 of their maximum HP, rounded down. This move has a 1/X chance of being successful, where X starts at 1 and triples each time this move is successfully used. X resets to 1 if this move fails, if the user's last move used is not Detect, Endure, King's Shield, Protect, Quick Guard, Spiky Shield, or Wide Guard, or if it was one of those moves and the user's protection was broken. Fails if the user moves last this turn.",
  	},
  	stockpile: {
  		inherit: true,
  		effect: {
  			noCopy: true,
  			onStart(target) {
  				this.effectData.layers = 1;
  				this.add('-start', target, 'stockpile' + this.effectData.layers);
  				this.boost({def: 1, spd: 1}, target, target);
  			},
  			onRestart(target) {
  				if (this.effectData.layers >= 3) return false;
  				this.effectData.layers++;
  				this.add('-start', target, 'stockpile' + this.effectData.layers);
  				this.boost({def: 1, spd: 1}, target, target);
  			},
  			onEnd(target) {
  				let layers = this.effectData.layers * -1;
  				this.effectData.layers = 0;
  				this.boost({def: layers, spd: layers}, target, target);
  				this.add('-end', target, 'Stockpile');
  			},
  		},
  	},
  	struggle: {
  		inherit: true,
  		desc: "Deals typeless damage to a random adjacent opposing Pokemon. If this move was successful, the user loses 1/4 of its maximum HP, rounded half up, and the Rock Head Ability does not prevent this. This move is automatically used if none of the user's known moves can be selected.",
  	},
  	suckerpunch: {
  		inherit: true,
  		basePower: 80,
  	},
  	swagger: {
  		inherit: true,
  		accuracy: 90,
  	},
  	switcheroo: {
  		inherit: true,
  		desc: "The user swaps its held item with the target's held item. Fails if either the user or the target is holding a Mail, if neither is holding an item, if the user is trying to give or take a Mega Stone to or from the species that can Mega Evolve with it, or if the user is trying to give or take a Blue Orb, a Red Orb, a Griseous Orb, a Plate, or a Drive to or from a Kyogre, a Groudon, a Giratina, an Arceus, or a Genesect, respectively. The target is immune to this move if it has the Sticky Hold Ability.",
  	},
  	tackle: {
  		inherit: true,
  		basePower: 50,
  	},
  	telekinesis: {
  		inherit: true,
  		desc: "For 3 turns, the target cannot avoid any attacks made against it, other than OHKO moves, as long as it remains active. During the effect, the target is immune to Ground-type attacks and the effects of Spikes, Toxic Spikes, Sticky Web, and the Arena Trap Ability as long as it remains active. If the target uses Baton Pass, the replacement will gain the effect. Ingrain, Smack Down, Thousand Arrows, and Iron Ball override this move if the target is under any of their effects. Fails if the target is already under this effect or the effects of Ingrain, Smack Down, or Thousand Arrows. The target is immune to this move on use if its species is Diglett, Dugtrio, or Gengar while Mega-Evolved. Mega Gengar cannot be under this effect by any means.",
  	},
  	thief: {
  		inherit: true,
  		desc: "If this attack was successful and the user has not fainted, it steals the target's held item if the user is not holding one. The target's item is not stolen if it is a Mail, or if the target is a Kyogre holding a Blue Orb, a Groudon holding a Red Orb, a Giratina holding a Griseous Orb, an Arceus holding a Plate, a Genesect holding a Drive, or a Pokemon that can Mega Evolve holding the Mega Stone for its species. Items lost to this move cannot be regained with Recycle or the Harvest Ability.",
  	},
  	thousandarrows: {
  		inherit: true,
  		isUnreleased: true,
  	},
  	thousandwaves: {
  		inherit: true,
  		isUnreleased: true,
  	},
  	thrash: {
  		inherit: true,
  		desc: "The user spends two or three turns locked into this move and becomes confused immediately after its move on the last turn of the effect if it is not already. This move targets an adjacent opposing Pokemon at random on each turn. If the user is prevented from moving, is asleep at the beginning of a turn, or the attack is not successful against the target on the first turn of the effect or the second turn of a three-turn effect, the effect ends without causing confusion. If this move is called by Sleep Talk, the move is used for one turn and does not confuse the user.",
  	},
  	thunderwave: {
  		inherit: true,
  		accuracy: 100,
  	},
  	trick: {
  		inherit: true,
  		desc: "The user swaps its held item with the target's held item. Fails if either the user or the target is holding a Mail, if neither is holding an item, if the user is trying to give or take a Mega Stone to or from the species that can Mega Evolve with it, or if the user is trying to give or take a Blue Orb, a Red Orb, a Griseous Orb, a Plate, or a Drive to or from a Kyogre, a Groudon, a Giratina, an Arceus, or a Genesect, respectively. The target is immune to this move if it has the Sticky Hold Ability.",
  	},
  	uproar: {
  		inherit: true,
  		desc: "The user spends three turns locked into this move. This move targets an adjacent opponent at random on each turn. On the first of the three turns, all sleeping active Pokemon wake up. During the three turns, no active Pokemon can fall asleep by any means, and Pokemon switched in during the effect do not wake up. If the user is prevented from moving or the attack is not successful against the target during one of the turns, the effect ends.",
  	},
  	uturn: {
  		inherit: true,
  		desc: "If this move is successful and the user has not fainted, the user switches out even if it is trapped and is replaced immediately by a selected party member. The user does not switch out if there are no unfainted party members, or if the target switched out using an Eject Button.",
  	},
  	voltswitch: {
  		inherit: true,
  		desc: "If this move is successful and the user has not fainted, the user switches out even if it is trapped and is replaced immediately by a selected party member. The user does not switch out if there are no unfainted party members, or if the target switched out using an Eject Button.",
  	},
  	watershuriken: {
  		inherit: true,
  		desc: "Hits two to five times. Has a 1/3 chance to hit two or three times, and a 1/6 chance to hit four or five times. If one of the hits breaks the target's substitute, it will take damage for the remaining hits. If the user has the Skill Link Ability, this move will always hit five times.",
  		category: "Physical",
  	},
  	wideguard: {
  		inherit: true,
  		desc: "The user and its party members are protected from damaging attacks made by other Pokemon, including allies, during this turn that target all adjacent foes or all adjacent Pokemon. This move modifies the same 1/X chance of being successful used by other protection moves, where X starts at 1 and triples each time this move is successfully used, but does not use the chance to check for failure. X resets to 1 if this move fails, if the user's last move used is not Detect, Endure, King's Shield, Protect, Quick Guard, Spiky Shield, or Wide Guard, or if it was one of those moves and the user's protection was broken. Fails if the user moves last this turn or if this move is already in effect for the user's side.",
  		shortDesc: "Protects allies from multi-target hits this turn.",
  		effect: {
  			duration: 1,
  			onStart(target, source) {
  				this.add('-singleturn', source, 'Wide Guard');
  			},
  			onTryHitPriority: 4,
  			onTryHit(target, source, effect) {
  				// Wide Guard blocks damaging spread moves
  				if (effect && (effect.category === 'Status' || (effect.target !== 'allAdjacent' && effect.target !== 'allAdjacentFoes'))) {
  					return;
  				}
  				this.add('-activate', target, 'move: Wide Guard');
  				let lockedmove = source.getVolatile('lockedmove');
  				if (lockedmove) {
  					// Outrage counter is reset
  					if (source.volatiles['lockedmove'].duration === 2) {
  						delete source.volatiles['lockedmove'];
  					}
  				}
  				return null;
  			},
  		},
  	},
  	worryseed: {
  		inherit: true,
  		desc: "Causes the target's Ability to become Insomnia. Fails if the target's Ability is Insomnia, Multitype, Stance Change, or Truant.",
  		onTryHit(pokemon) {
  			let bannedAbilities = ['insomnia', 'multitype', 'stancechange', 'truant'];
  			if (bannedAbilities.includes(pokemon.ability)) {
  				return false;
  			}
  		},
  	},
  };
  
  exports.BattleMovedex = BattleMovedex;
  