mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-02 07:42:12 -05:00
Sync data
This time, we're adding all server-side data files to client. This doesn't really have any side effects, but makes syncing data more straightforward, and also allows anyone who wants to request data files from client a way to do so.
This commit is contained in:
@@ -89,9 +89,6 @@ exports.BattleAbilities = {
|
||||
onStart: function (pokemon) {
|
||||
this.add('-ability', pokemon, 'Air Lock');
|
||||
},
|
||||
onAnyModifyPokemon: function (pokemon) {
|
||||
pokemon.ignore['WeatherTarget'] = true;
|
||||
},
|
||||
onAnyTryWeather: false,
|
||||
id: "airlock",
|
||||
name: "Air Lock",
|
||||
@@ -150,20 +147,18 @@ exports.BattleAbilities = {
|
||||
num: 107
|
||||
},
|
||||
"arenatrap": {
|
||||
desc: "Prevents adjacent opposing Pokemon from choosing to switch out unless they are immune to trapping or have immunity to Ground.",
|
||||
shortDesc: "Prevents adjacent foes from choosing to switch unless they are immune to Ground.",
|
||||
desc: "Prevents adjacent opposing Pokemon from choosing to switch out unless they are immune to trapping or are airborne.",
|
||||
shortDesc: "Prevents adjacent foes from choosing to switch unless they are airborne.",
|
||||
onFoeModifyPokemon: function (pokemon) {
|
||||
if (!this.isAdjacent(pokemon, this.effectData.target)) return;
|
||||
if (!pokemon.runImmunity('Ground', false)) return;
|
||||
if (!pokemon.hasType('Flying') || pokemon.hasItem('ironball') || this.getPseudoWeather('gravity') || pokemon.volatiles['ingrain']) {
|
||||
if (pokemon.isGrounded()) {
|
||||
pokemon.tryTrap(true);
|
||||
}
|
||||
},
|
||||
onFoeMaybeTrapPokemon: function (pokemon, source) {
|
||||
if (!source) source = this.effectData.target;
|
||||
if (!this.isAdjacent(pokemon, source)) return;
|
||||
if (!pokemon.runImmunity('Ground', false)) return;
|
||||
if (!pokemon.hasType('Flying') || pokemon.hasItem('ironball') || this.getPseudoWeather('gravity') || pokemon.volatiles['ingrain']) {
|
||||
if (pokemon.isGrounded()) {
|
||||
pokemon.maybeTrapped = true;
|
||||
}
|
||||
},
|
||||
@@ -326,9 +321,6 @@ exports.BattleAbilities = {
|
||||
onStart: function (pokemon) {
|
||||
this.add('-ability', pokemon, 'Cloud Nine');
|
||||
},
|
||||
onAnyModifyPokemon: function (pokemon) {
|
||||
pokemon.ignore['WeatherTarget'] = true;
|
||||
},
|
||||
onAnyTryWeather: false,
|
||||
id: "cloudnine",
|
||||
name: "Cloud Nine",
|
||||
@@ -526,7 +518,7 @@ exports.BattleAbilities = {
|
||||
for (var j = 0; j < this.sides[i].active.length; j++) {
|
||||
var target = this.sides[i].active[j];
|
||||
if (target === pokemon) continue;
|
||||
if (target && target.hp && target.ability === 'deltastream' && target.ignore['Ability'] !== true) {
|
||||
if (target && target.hp && target.hasAbility('deltastream')) {
|
||||
this.weatherData.source = target;
|
||||
return;
|
||||
}
|
||||
@@ -554,7 +546,7 @@ exports.BattleAbilities = {
|
||||
for (var j = 0; j < this.sides[i].active.length; j++) {
|
||||
var target = this.sides[i].active[j];
|
||||
if (target === pokemon) continue;
|
||||
if (target && target.hp && target.ability === 'desolateland' && target.ignore['Ability'] !== true) {
|
||||
if (target && target.hp && target.hasAbility('desolateland')) {
|
||||
this.weatherData.source = target;
|
||||
return;
|
||||
}
|
||||
@@ -1309,11 +1301,7 @@ exports.BattleAbilities = {
|
||||
"klutz": {
|
||||
desc: "This Pokemon's held item has no effect. This Pokemon cannot use Fling successfully. Macho Brace, Power Anklet, Power Band, Power Belt, Power Bracer, Power Lens, and Power Weight still have their effects.",
|
||||
shortDesc: "This Pokemon's held item has no effect, except Macho Brace. Fling cannot be used.",
|
||||
onModifyPokemonPriority: 1,
|
||||
onModifyPokemon: function (pokemon) {
|
||||
if (pokemon.getItem().megaEvolves) return;
|
||||
pokemon.ignore['Item'] = true;
|
||||
},
|
||||
// Item suppression implemented in BattlePokemon.ignoringItem() within battle-engine.js
|
||||
id: "klutz",
|
||||
name: "Klutz",
|
||||
rating: -1,
|
||||
@@ -1562,18 +1550,7 @@ exports.BattleAbilities = {
|
||||
onStart: function (pokemon) {
|
||||
this.add('-ability', pokemon, 'Mold Breaker');
|
||||
},
|
||||
onAllyModifyPokemonPriority: 100,
|
||||
onAllyModifyPokemon: function (pokemon) {
|
||||
if (this.activePokemon === this.effectData.target && pokemon !== this.activePokemon) {
|
||||
pokemon.ignore['Ability'] = 'A';
|
||||
}
|
||||
},
|
||||
onFoeModifyPokemonPriority: 100,
|
||||
onFoeModifyPokemon: function (pokemon) {
|
||||
if (this.activePokemon === this.effectData.target) {
|
||||
pokemon.ignore['Ability'] = 'A';
|
||||
}
|
||||
},
|
||||
stopAttackEvents: true,
|
||||
id: "moldbreaker",
|
||||
name: "Mold Breaker",
|
||||
rating: 3.5,
|
||||
@@ -2009,7 +1986,7 @@ exports.BattleAbilities = {
|
||||
for (var j = 0; j < this.sides[i].active.length; j++) {
|
||||
var target = this.sides[i].active[j];
|
||||
if (target === pokemon) continue;
|
||||
if (target && target.hp && target.ability === 'primordialsea' && target.ignore['Ability'] !== true) {
|
||||
if (target && target.hp && target.hasAbility('primordialsea')) {
|
||||
this.weatherData.source = target;
|
||||
return;
|
||||
}
|
||||
@@ -2157,7 +2134,9 @@ exports.BattleAbilities = {
|
||||
"rockhead": {
|
||||
desc: "This Pokemon does not take recoil damage besides Struggle, Life Orb, and crash damage.",
|
||||
shortDesc: "This Pokemon does not take recoil damage besides Struggle/Life Orb/crash damage.",
|
||||
// Implemented in scripts.js
|
||||
onDamage: function (damage, target, source, effect) {
|
||||
if (effect.id === 'recoil' && this.activeMove.id !== 'struggle') return null;
|
||||
},
|
||||
id: "rockhead",
|
||||
name: "Rock Head",
|
||||
rating: 3,
|
||||
@@ -2342,7 +2321,7 @@ exports.BattleAbilities = {
|
||||
onModifyMove: function (move, pokemon) {
|
||||
if (move.secondaries) {
|
||||
delete move.secondaries;
|
||||
move.negateSecondary = true;
|
||||
// Actual negation of `AfterMoveSecondary` effects implemented in scripts.js
|
||||
pokemon.addVolatile('sheerforce');
|
||||
}
|
||||
},
|
||||
@@ -2833,16 +2812,7 @@ exports.BattleAbilities = {
|
||||
onStart: function (pokemon) {
|
||||
this.add('-ability', pokemon, 'Teravolt');
|
||||
},
|
||||
onAllyModifyPokemon: function (pokemon) {
|
||||
if (this.activePokemon === this.effectData.target && pokemon !== this.activePokemon) {
|
||||
pokemon.ignore['Ability'] = 'A';
|
||||
}
|
||||
},
|
||||
onFoeModifyPokemon: function (pokemon) {
|
||||
if (this.activePokemon === this.effectData.target) {
|
||||
pokemon.ignore['Ability'] = 'A';
|
||||
}
|
||||
},
|
||||
stopAttackEvents: true,
|
||||
id: "teravolt",
|
||||
name: "Teravolt",
|
||||
rating: 3.5,
|
||||
@@ -2983,16 +2953,7 @@ exports.BattleAbilities = {
|
||||
onStart: function (pokemon) {
|
||||
this.add('-ability', pokemon, 'Turboblaze');
|
||||
},
|
||||
onAllyModifyPokemon: function (pokemon) {
|
||||
if (this.activePokemon === this.effectData.target && pokemon !== this.activePokemon) {
|
||||
pokemon.ignore['Ability'] = 'A';
|
||||
}
|
||||
},
|
||||
onFoeModifyPokemon: function (pokemon) {
|
||||
if (this.activePokemon === this.effectData.target) {
|
||||
pokemon.ignore['Ability'] = 'A';
|
||||
}
|
||||
},
|
||||
stopAttackEvents: true,
|
||||
id: "turboblaze",
|
||||
name: "Turboblaze",
|
||||
rating: 3.5,
|
||||
|
||||
@@ -13,11 +13,10 @@ exports.BattleAliases = {
|
||||
"vgc2015": "Battle Spot Doubles (VGC 2015)",
|
||||
"battlespotdoubles": "Battle Spot Doubles (VGC 2015)",
|
||||
"createapokemon": "CAP",
|
||||
"cc1v1": "Challenge Cup 1-vs-1",
|
||||
"bc1v1": "Battle Cup 1v1",
|
||||
"bh": "Balanced Hackmons",
|
||||
"aaa": "Almost Any Ability",
|
||||
"monorandom": "Monotype Random Battle",
|
||||
"hackmonscc": "Hackmons Challenge Cup",
|
||||
|
||||
// mega evos
|
||||
"megaabomasnow": "Abomasnow-Mega",
|
||||
@@ -44,6 +43,8 @@ exports.BattleAliases = {
|
||||
"megadrill": "Beedrill-Mega",
|
||||
"megagallade": "Gallade-Mega",
|
||||
"megagarchomp": "Garchomp-Mega",
|
||||
"megagard": "Gardevoir-Mega",
|
||||
"megagarde": "Gardevoir-Mega",
|
||||
"megagardevoir": "Gardevoir-Mega",
|
||||
"megagengar": "Gengar-Mega",
|
||||
"megaglalie": "Glalie-Mega",
|
||||
@@ -75,15 +76,19 @@ exports.BattleAliases = {
|
||||
"megapinsir": "Pinsir-Mega",
|
||||
"megaray": "Rayquaza-Mega",
|
||||
"megarayquaza": "Rayquaza-Mega",
|
||||
"megasab": "Sableye-Mega",
|
||||
"megasable": "Sableye-Mega",
|
||||
"megasableye": "Sableye-Mega",
|
||||
"megasalamence": "Salamence-Mega",
|
||||
"megamence": "Salamence-Mega",
|
||||
"megascept": "Sceptile-Mega",
|
||||
"megasceptile": "Sceptile-Mega",
|
||||
"megascizor": "Scizor-Mega",
|
||||
"megasharpedo": "Sharpedo-Mega",
|
||||
"megaslowbro": "Slowbro-Mega",
|
||||
"megasteelix": "Steelix-Mega",
|
||||
"megaswampert": "Swampert-Mega",
|
||||
"megapert": "Swampert-Mega",
|
||||
"megatyranitar": "Tyranitar-Mega",
|
||||
"megattar": "Tyranitar-Mega",
|
||||
"megavenusaur": "Venusaur-Mega",
|
||||
@@ -99,9 +104,11 @@ exports.BattleAliases = {
|
||||
"primalgroudon": "Groudon-Primal",
|
||||
"primaldon": "Groudon-Primal",
|
||||
"pgroudon": "Groudon-Primal",
|
||||
"pdon": "Groudon-Primal",
|
||||
"primalkyogre": "Kyogre-Primal",
|
||||
"primalogre": "Kyogre-Primal",
|
||||
"pkyogre": "Kyogre-Primal",
|
||||
"pogre": "Kyogre-Primal",
|
||||
|
||||
// formes
|
||||
"bugceus": "Arceus-Bug",
|
||||
@@ -216,8 +223,10 @@ exports.BattleAliases = {
|
||||
"lefties": "Leftovers",
|
||||
"leppa": "Leppa Berry",
|
||||
"lo": "Life Orb",
|
||||
"lorb": "Life Orb",
|
||||
"lum": "Lum Berry",
|
||||
"occa": "Occa Berry",
|
||||
"petaya": "Petaya Berry",
|
||||
"salac": "Salac Berry",
|
||||
"sash": "Focus Sash",
|
||||
"scarf": "Choice Scarf",
|
||||
@@ -239,10 +248,15 @@ exports.BattleAliases = {
|
||||
|
||||
// pokemon
|
||||
"aboma": "Abomasnow",
|
||||
"aegi": "Aegislash",
|
||||
"aegiblade": "Aegislash-Blade",
|
||||
"aegis": "Aegislash",
|
||||
"bliss": "Blissey",
|
||||
"chomp": "Garchomp",
|
||||
"cofag": "Cofagrigus",
|
||||
"cress": "Cresselia",
|
||||
"cube": "Kyurem-Black",
|
||||
"cune": "Suicune",
|
||||
"dnite": "Dragonite",
|
||||
"don": "Groudon",
|
||||
"dogars": "Koffing",
|
||||
@@ -254,6 +268,10 @@ exports.BattleAliases = {
|
||||
"garde": "Gardevoir",
|
||||
"hera": "Heracross",
|
||||
"hippo": "Hippowdon",
|
||||
"honch": "Honchkrow",
|
||||
"keld": "Keldeo",
|
||||
"klef": "Klefki",
|
||||
"kou": "Raikou",
|
||||
"kyub": "Kyurem-Black",
|
||||
"kyuw": "Kyurem-White",
|
||||
"lando": "Landorus",
|
||||
@@ -261,19 +279,31 @@ exports.BattleAliases = {
|
||||
"landot": "Landorus-Therian",
|
||||
"luke": "Lucario",
|
||||
"lurk": "Golurk",
|
||||
"mamo": "Mamoswine",
|
||||
"mandi": "Mandibuzz",
|
||||
"mence": "Salamence",
|
||||
"milo": "Milotic",
|
||||
"obama": "Abomasnow",
|
||||
"ogre": "Kyogre",
|
||||
"pert": "Swampert",
|
||||
"p2": "Porygon2",
|
||||
"pory2": "Porygon2",
|
||||
"pz": "Porygon-Z",
|
||||
"poryz": "Porygon-Z",
|
||||
"rank": "Reuniclus",
|
||||
"smogon": "Koffing",
|
||||
"sab": "Sableye",
|
||||
"sable": "Sableye",
|
||||
"scept": "Sceptile",
|
||||
"scoli": "Scolipede",
|
||||
"skarm": "Skarmory",
|
||||
"smogon": "Koffing",
|
||||
"sui": "Suicune",
|
||||
"talon": "Talonflame",
|
||||
"terra": "Terrakion",
|
||||
"tran": "Heatran",
|
||||
"ttar": "Tyranitar",
|
||||
"venu": "Venusaur",
|
||||
"whimsi": "Whimsicott",
|
||||
"zam": "Alakazam",
|
||||
"zard": "Charizard",
|
||||
"ohmagod":"Plasmanta",
|
||||
|
||||
1
data/factory-sets.json
Normal file
1
data/factory-sets.json
Normal file
File diff suppressed because one or more lines are too long
@@ -613,7 +613,7 @@ exports.BattleFormatsData = {
|
||||
{"generation":3,"level":38,"abilities":["guts"],"moves":["seismictoss","foresight","revenge","vitalthrow"]},
|
||||
{"generation":5,"level":30,"isHidden":false,"moves":["lowsweep","foresight","seismictoss","revenge"],"pokeball":"cherishball"}
|
||||
],
|
||||
tier: "NFE"
|
||||
tier: "PU"
|
||||
},
|
||||
machamp: {
|
||||
randomBattleMoves: ["dynamicpunch","icepunch","stoneedge","bulletpunch","knockoff","substitute"],
|
||||
@@ -1050,7 +1050,7 @@ exports.BattleFormatsData = {
|
||||
{"generation":3,"level":50,"abilities":["swiftswim"],"moves":["leer","watergun","twister","agility"]},
|
||||
{"generation":5,"level":50,"gender":"M","nature":"Timid","isHidden":false,"abilities":["swiftswim"],"moves":["dracometeor","muddywater","dragonpulse","protect"],"pokeball":"cherishball"}
|
||||
],
|
||||
tier: "RU"
|
||||
tier: "BL2"
|
||||
},
|
||||
goldeen: {
|
||||
randomBattleMoves: ["waterfall","megahorn","knockoff","drillrun","icebeam"],
|
||||
@@ -1479,7 +1479,8 @@ exports.BattleFormatsData = {
|
||||
chikorita: {
|
||||
randomBattleMoves: ["reflect","lightscreen","aromatherapy","grasswhistle","leechseed","toxic","gigadrain","synthesis"],
|
||||
eventPokemon: [
|
||||
{"generation":3,"level":10,"gender":"M","moves":["tackle","growl","razorleaf"]}
|
||||
{"generation":3,"level":10,"gender":"M","moves":["tackle","growl","razorleaf"]},
|
||||
{"generation":3,"level":5,"moves":["tackle","growl","ancientpower","frenzyplant"]}
|
||||
],
|
||||
tier: "LC"
|
||||
},
|
||||
@@ -1498,7 +1499,8 @@ exports.BattleFormatsData = {
|
||||
cyndaquil: {
|
||||
randomBattleMoves: ["eruption","fireblast","flamethrower","hiddenpowergrass","hiddenpowerice"],
|
||||
eventPokemon: [
|
||||
{"generation":3,"level":10,"gender":"M","moves":["tackle","leer","smokescreen"]}
|
||||
{"generation":3,"level":10,"gender":"M","moves":["tackle","leer","smokescreen"]},
|
||||
{"generation":3,"level":5,"moves":["tackle","leer","reversal","blastburn"]}
|
||||
],
|
||||
tier: "LC"
|
||||
},
|
||||
@@ -1518,7 +1520,8 @@ exports.BattleFormatsData = {
|
||||
totodile: {
|
||||
randomBattleMoves: ["aquajet","waterfall","crunch","icepunch","superpower","dragondance","swordsdance"],
|
||||
eventPokemon: [
|
||||
{"generation":3,"level":10,"gender":"M","moves":["scratch","leer","rage"]}
|
||||
{"generation":3,"level":10,"gender":"M","moves":["scratch","leer","rage"]},
|
||||
{"generation":3,"level":5,"moves":["scratch","leer","crunch","hydrocannon"]}
|
||||
],
|
||||
tier: "LC"
|
||||
},
|
||||
@@ -2069,7 +2072,7 @@ exports.BattleFormatsData = {
|
||||
eventPokemon: [
|
||||
{"generation":3,"level":70,"moves":["swift","raindance","hydropump","recover"]},
|
||||
{"generation":3,"level":70,"moves":["recover","hydropump","raindance","swift"]},
|
||||
{"generation":3,"level":50,"moves":["psychoboost","recover","hydropump","featherdance"]}
|
||||
{"generation":3,"level":50,"moves":["psychoboost","earthquake","hydropump","featherdance"]}
|
||||
],
|
||||
dreamWorldPokeball: 'dreamball',
|
||||
tier: "Uber"
|
||||
@@ -2176,7 +2179,7 @@ exports.BattleFormatsData = {
|
||||
poochyena: {
|
||||
randomBattleMoves: ["superfang","foulplay","suckerpunch","toxic","crunch","firefang","icefang","poisonfang"],
|
||||
eventPokemon: [
|
||||
{"generation":3,"level":10,"abilities":["runaway"],"moves":["healbell","dig","poisonfang","growl"]}
|
||||
{"generation":3,"level":10,"abilities":["runaway"],"moves":["healbell","dig","poisonfang","howl"]}
|
||||
],
|
||||
tier: "LC"
|
||||
},
|
||||
@@ -2314,7 +2317,7 @@ exports.BattleFormatsData = {
|
||||
gallade: {
|
||||
randomBattleMoves: ["bulkup","drainpunch","icepunch","shadowsneak","closecombat","zenheadbutt","knockoff","trick"],
|
||||
randomDoubleBattleMoves: ["closecombat","trick","stoneedge","shadowsneak","drainpunch","icepunch","zenheadbutt","knockoff","trickroom","protect","helpinghand","healpulse"],
|
||||
tier: "UU"
|
||||
tier: "NU"
|
||||
},
|
||||
gallademega: {
|
||||
randomBattleMoves: ["swordsdance","closecombat","drainpunch","knockoff","zenheadbutt","substitute"],
|
||||
@@ -3922,7 +3925,7 @@ exports.BattleFormatsData = {
|
||||
},
|
||||
servine: {
|
||||
randomBattleMoves: ["leafstorm","hiddenpowerfire","substitute","leechseed","hiddenpowerice","gigadrain"],
|
||||
tier: "PU"
|
||||
tier: "NFE"
|
||||
},
|
||||
serperior: {
|
||||
randomBattleMoves: ["leafstorm","dragonpulse","hiddenpowerfire","substitute","leechseed","glare"],
|
||||
@@ -4176,7 +4179,7 @@ exports.BattleFormatsData = {
|
||||
},
|
||||
whirlipede: {
|
||||
randomBattleMoves: ["toxicspikes","steamroller","spikes","poisonjab"],
|
||||
tier: "PU"
|
||||
tier: "NFE"
|
||||
},
|
||||
scolipede: {
|
||||
randomBattleMoves: ["substitute","spikes","toxicspikes","megahorn","rockslide","earthquake","swordsdance","batonpass","poisonjab"],
|
||||
@@ -4747,7 +4750,7 @@ exports.BattleFormatsData = {
|
||||
randomBattleMoves: ["calmmind","rockpolish","earthpower","focusblast","psychic","sludgewave","stealthrock","knockoff"],
|
||||
randomDoubleBattleMoves: ["earthpower","focusblast","rockpolish","hiddenpowerice","psychic","sludgebomb","protect"],
|
||||
dreamWorldPokeball: 'dreamball',
|
||||
tier: "OU"
|
||||
tier: "Uber"
|
||||
},
|
||||
landorustherian: {
|
||||
randomBattleMoves: ["swordsdance","rockpolish","earthquake","stoneedge","uturn","superpower","stealthrock"],
|
||||
@@ -5300,6 +5303,11 @@ exports.BattleFormatsData = {
|
||||
isNonstandard: true,
|
||||
tier: "CAP"
|
||||
},
|
||||
naviathan: {
|
||||
randomBattleMoves: ["dragondance","waterfall","ironhead","iciclecrash"],
|
||||
isNonstandard: true,
|
||||
tier: "CAP"
|
||||
},
|
||||
syclant: {
|
||||
randomBattleMoves: ["bugbuzz","icebeam","blizzard","earthpower","spikes","superpower","tailglow","uturn","focusblast"],
|
||||
isNonstandard: true,
|
||||
|
||||
@@ -102,6 +102,9 @@ exports.BattleItems = {
|
||||
pokemon.eatItem();
|
||||
}
|
||||
},
|
||||
onEatItem: function (item, pokemon) {
|
||||
if (!this.runEvent('TryHeal', pokemon)) return false;
|
||||
},
|
||||
onEat: function (pokemon) {
|
||||
this.heal(pokemon.maxhp / 8);
|
||||
if (pokemon.getNature().minus === 'spd') {
|
||||
@@ -120,7 +123,9 @@ exports.BattleItems = {
|
||||
basePower: 10
|
||||
},
|
||||
onStart: function (target) {
|
||||
this.add('-item', target, 'Air Balloon');
|
||||
if (!target.ignoringItem()) {
|
||||
this.add('-item', target, 'Air Balloon');
|
||||
}
|
||||
},
|
||||
onImmunity: function (type) {
|
||||
if (type === 'Ground') return false;
|
||||
@@ -253,7 +258,7 @@ exports.BattleItems = {
|
||||
onModifySpD: function (spd) {
|
||||
return this.chainModify(1.5);
|
||||
},
|
||||
onModifyPokemon: function (pokemon) {
|
||||
onDisableMove: function (pokemon) {
|
||||
var moves = pokemon.moveset;
|
||||
for (var i = 0; i < moves.length; i++) {
|
||||
if (this.getMove(moves[i].move).category === 'Status') {
|
||||
@@ -351,7 +356,7 @@ exports.BattleItems = {
|
||||
},
|
||||
onUpdate: function (pokemon) {
|
||||
if (pokemon.hp <= pokemon.maxhp / 2) {
|
||||
if (pokemon.useItem()) {
|
||||
if (this.runEvent('TryHeal', pokemon) && pokemon.useItem()) {
|
||||
this.heal(20);
|
||||
}
|
||||
}
|
||||
@@ -1285,6 +1290,9 @@ exports.BattleItems = {
|
||||
}
|
||||
}
|
||||
},
|
||||
onEatItem: function (item, pokemon) {
|
||||
if (!this.runEvent('TryHeal', pokemon)) return false;
|
||||
},
|
||||
onEat: function (pokemon) {
|
||||
this.heal(pokemon.maxhp / 4);
|
||||
},
|
||||
@@ -1391,6 +1399,9 @@ exports.BattleItems = {
|
||||
pokemon.eatItem();
|
||||
}
|
||||
},
|
||||
onEatItem: function (item, pokemon) {
|
||||
if (!this.runEvent('TryHeal', pokemon)) return false;
|
||||
},
|
||||
onEat: function (pokemon) {
|
||||
this.heal(pokemon.maxhp / 8);
|
||||
if (pokemon.getNature().minus === 'atk') {
|
||||
@@ -1921,6 +1932,9 @@ exports.BattleItems = {
|
||||
pokemon.eatItem();
|
||||
}
|
||||
},
|
||||
onEatItem: function (item, pokemon) {
|
||||
if (!this.runEvent('TryHeal', pokemon)) return false;
|
||||
},
|
||||
onEat: function (pokemon) {
|
||||
this.heal(pokemon.maxhp / 8);
|
||||
if (pokemon.getNature().minus === 'def') {
|
||||
@@ -2574,6 +2588,9 @@ exports.BattleItems = {
|
||||
pokemon.eatItem();
|
||||
}
|
||||
},
|
||||
onEatItem: function (item, pokemon) {
|
||||
if (!this.runEvent('TryHeal', pokemon)) return false;
|
||||
},
|
||||
onEat: function (pokemon) {
|
||||
this.heal(pokemon.maxhp / 8);
|
||||
if (pokemon.getNature().minus === 'spe') {
|
||||
@@ -3099,6 +3116,9 @@ exports.BattleItems = {
|
||||
pokemon.eatItem();
|
||||
}
|
||||
},
|
||||
onEatItem: function (item, pokemon) {
|
||||
if (!this.runEvent('TryHeal', pokemon)) return false;
|
||||
},
|
||||
onEat: function (pokemon) {
|
||||
this.heal(10);
|
||||
},
|
||||
@@ -3810,7 +3830,7 @@ exports.BattleItems = {
|
||||
if (type === 'sandstorm' || type === 'hail' || type === 'powder') return false;
|
||||
},
|
||||
onTryHit: function (pokemon, source, move) {
|
||||
if (move.flags['powder']) {
|
||||
if (move.flags['powder'] && move.id !== 'ragepowder') {
|
||||
this.add('-activate', pokemon, 'Safety Goggles', move.name);
|
||||
return null;
|
||||
}
|
||||
@@ -4061,6 +4081,9 @@ exports.BattleItems = {
|
||||
pokemon.eatItem();
|
||||
}
|
||||
},
|
||||
onEatItem: function (item, pokemon) {
|
||||
if (!this.runEvent('TryHeal', pokemon)) return false;
|
||||
},
|
||||
onEat: function (pokemon) {
|
||||
this.heal(pokemon.maxhp / 4);
|
||||
},
|
||||
@@ -4719,6 +4742,9 @@ exports.BattleItems = {
|
||||
pokemon.eatItem();
|
||||
}
|
||||
},
|
||||
onEatItem: function (item, pokemon) {
|
||||
if (!this.runEvent('TryHeal', pokemon)) return false;
|
||||
},
|
||||
onEat: function (pokemon) {
|
||||
this.heal(pokemon.maxhp / 8);
|
||||
if (pokemon.getNature().minus === 'spa') {
|
||||
|
||||
1427
data/learnsets-g6.js
1427
data/learnsets-g6.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
192
data/moves.js
192
data/moves.js
@@ -445,7 +445,10 @@ exports.BattleMovedex = {
|
||||
onHit: function (pokemon, source, move) {
|
||||
var side = pokemon.side;
|
||||
for (var i = 0; i < side.pokemon.length; i++) {
|
||||
if (side.pokemon[i].volatiles['substitute'] && !move.infiltrates) continue;
|
||||
if (side.pokemon[i] !== source && ((side.pokemon[i].hasAbility('sapsipper')) ||
|
||||
(side.pokemon[i].volatiles['substitute'] && !move.infiltrates))) {
|
||||
continue;
|
||||
}
|
||||
side.pokemon[i].status = '';
|
||||
}
|
||||
this.add('-cureteam', source, '[from] move: Aromatherapy');
|
||||
@@ -633,6 +636,9 @@ exports.BattleMovedex = {
|
||||
this.add('cant', pokemon, 'Attract');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
onEnd: function (pokemon) {
|
||||
this.add('-end', pokemon, 'Attract', '[silent]');
|
||||
}
|
||||
},
|
||||
secondary: false,
|
||||
@@ -876,11 +882,7 @@ exports.BattleMovedex = {
|
||||
pp: 10,
|
||||
priority: 0,
|
||||
flags: {protect: 1},
|
||||
onTryHit: function (target, pokemon) {
|
||||
if (!pokemon.ateBerry) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
// Move disabling implemented in Battle#nextTurn in battle-engine.js
|
||||
secondary: false,
|
||||
target: "normal",
|
||||
type: "Poison"
|
||||
@@ -2545,7 +2547,7 @@ exports.BattleMovedex = {
|
||||
pp: 5,
|
||||
priority: 4,
|
||||
flags: {},
|
||||
stallingMove: true, // Note: stallingMove is not used anywhere.
|
||||
stallingMove: true,
|
||||
volatileStatus: 'protect',
|
||||
onPrepareHit: function (pokemon) {
|
||||
return !!this.willAct() && this.runEvent('StallMove', pokemon);
|
||||
@@ -2682,7 +2684,7 @@ exports.BattleMovedex = {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
onModifyPokemon: function (pokemon) {
|
||||
onDisableMove: function (pokemon) {
|
||||
var moves = pokemon.moveset;
|
||||
for (var i = 0; i < moves.length; i++) {
|
||||
if (moves[i].id === this.effectData.move) {
|
||||
@@ -3353,13 +3355,19 @@ exports.BattleMovedex = {
|
||||
effect: {
|
||||
duration: 5,
|
||||
onSetStatus: function (status, target, source, effect) {
|
||||
if (status.id === 'slp' && target.runImmunity('Ground')) {
|
||||
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 (move.type === 'Electric' && attacker.runImmunity('Ground')) {
|
||||
if (move.type === 'Electric' && attacker.isGrounded() && !attacker.isSemiInvulnerable()) {
|
||||
this.debug('electric terrain boost');
|
||||
return this.chainModify(1.5);
|
||||
}
|
||||
@@ -3477,14 +3485,10 @@ exports.BattleMovedex = {
|
||||
onStart: function (pokemon) {
|
||||
this.add('-start', pokemon, 'Embargo');
|
||||
},
|
||||
// Item suppression implemented in BattlePokemon.ignoringItem() within battle-engine.js
|
||||
onResidualOrder: 18,
|
||||
onEnd: function (pokemon) {
|
||||
this.add('-end', pokemon, 'Embargo');
|
||||
},
|
||||
onModifyPokemonPriority: 1,
|
||||
onModifyPokemon: function (pokemon) {
|
||||
if (pokemon.getItem().megaEvolves) return;
|
||||
pokemon.ignore['Item'] = true;
|
||||
}
|
||||
},
|
||||
secondary: false,
|
||||
@@ -3553,7 +3557,7 @@ exports.BattleMovedex = {
|
||||
onEnd: function (target) {
|
||||
this.add('-end', target, 'Encore');
|
||||
},
|
||||
onModifyPokemon: function (pokemon) {
|
||||
onDisableMove: function (pokemon) {
|
||||
if (!this.effectData.move || !pokemon.hasMove(this.effectData.move)) {
|
||||
return;
|
||||
}
|
||||
@@ -3603,7 +3607,7 @@ exports.BattleMovedex = {
|
||||
pp: 10,
|
||||
priority: 4,
|
||||
flags: {},
|
||||
stallingMove: true, // Note: stallingMove is not used anywhere.
|
||||
stallingMove: true,
|
||||
volatileStatus: 'endure',
|
||||
onTryHit: function (pokemon) {
|
||||
return this.willAct() && this.runEvent('StallMove', pokemon);
|
||||
@@ -3619,6 +3623,7 @@ exports.BattleMovedex = {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -4407,7 +4412,7 @@ exports.BattleMovedex = {
|
||||
priority: 0,
|
||||
flags: {protect: 1, mirror: 1},
|
||||
beforeMoveCallback: function (pokemon) {
|
||||
if (pokemon.ignore['Item']) return;
|
||||
if (pokemon.ignoringItem()) return;
|
||||
var item = pokemon.getItem();
|
||||
var noFling = item.onTakeItem && item.onTakeItem(item, pokemon) === false;
|
||||
if (item.fling && !noFling) {
|
||||
@@ -4519,7 +4524,7 @@ exports.BattleMovedex = {
|
||||
if (source.volatiles['lockon'] && target === source.volatiles['lockon'].source) return;
|
||||
return 0;
|
||||
},
|
||||
onSourceBasePower: function (basePower, target, source, move) {
|
||||
onSourceModifyDamage: function (damage, source, target, move) {
|
||||
if (move.id === 'gust' || move.id === 'twister') {
|
||||
return this.chainModify(2);
|
||||
}
|
||||
@@ -4679,14 +4684,17 @@ exports.BattleMovedex = {
|
||||
accuracy: true,
|
||||
basePower: 0,
|
||||
category: "Status",
|
||||
desc: "Causes the target to have its positive evasiveness stat stage set to 0 while it is active. Normal- and Fighting-type attacks can hit the target if it is a Ghost type. The effect ends when the target is no longer active. Fails if the target is already affected.",
|
||||
shortDesc: "Blocks evasion mods. Fighting, Normal hit Ghost.",
|
||||
desc: "Causes the target to have its positive evasiveness stat stage ignored while it is active. Normal- and Fighting-type attacks can hit the target if it is a Ghost type. The effect ends when the target is no longer active. Fails if the target is already affected, or affected by Miracle Eye or Odor Sleuth.",
|
||||
shortDesc: "Fighting, Normal hit Ghost. Evasiveness ignored.",
|
||||
id: "foresight",
|
||||
name: "Foresight",
|
||||
pp: 40,
|
||||
priority: 0,
|
||||
flags: {protect: 1, reflectable: 1, mirror: 1, authentic: 1},
|
||||
volatileStatus: 'foresight',
|
||||
onTryHit: function (target) {
|
||||
if (target.volatiles['miracleeye']) return false;
|
||||
},
|
||||
effect: {
|
||||
onStart: function (pokemon) {
|
||||
this.add('-start', pokemon, 'Foresight');
|
||||
@@ -5040,13 +5048,10 @@ exports.BattleMovedex = {
|
||||
}
|
||||
},
|
||||
effect: {
|
||||
// Ability suppression implemented in BattlePokemon.ignoringAbility() within battle-engine.js
|
||||
onStart: function (pokemon) {
|
||||
this.add('-endability', pokemon);
|
||||
this.singleEvent('End', this.getAbility(pokemon.ability), pokemon.abilityData, pokemon, pokemon, 'gastroacid');
|
||||
},
|
||||
onModifyPokemonPriority: 2,
|
||||
onModifyPokemon: function (pokemon) {
|
||||
pokemon.ignore['Ability'] = true;
|
||||
}
|
||||
},
|
||||
secondary: false,
|
||||
@@ -5326,7 +5331,7 @@ exports.BattleMovedex = {
|
||||
this.debug('move weakened by grassy terrain');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
if (move.type === 'Grass' && attacker.runImmunity('Ground')) {
|
||||
if (move.type === 'Grass' && attacker.isGrounded()) {
|
||||
this.debug('grassy terrain boost');
|
||||
return this.chainModify(1.5);
|
||||
}
|
||||
@@ -5338,11 +5343,13 @@ exports.BattleMovedex = {
|
||||
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) {
|
||||
if (battle.sides[s].active[p].runImmunity('Ground')) {
|
||||
pokemon = battle.sides[s].active[p];
|
||||
if (pokemon.isGrounded() && !pokemon.isSemiInvulnerable()) {
|
||||
this.debug('Pokemon is grounded, healing through Grassy Terrain.');
|
||||
this.heal(battle.sides[s].active[p].maxhp / 16, battle.sides[s].active[p], battle.sides[s].active[p]);
|
||||
this.heal(pokemon.maxhp / 16, pokemon, pokemon);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5383,17 +5390,20 @@ exports.BattleMovedex = {
|
||||
if (typeof accuracy !== 'number') return;
|
||||
return accuracy * 5 / 3;
|
||||
},
|
||||
onModifyPokemonPriority: 100,
|
||||
onModifyPokemon: function (pokemon) {
|
||||
pokemon.negateImmunity['Ground'] = true;
|
||||
onDisableMove: function (pokemon) {
|
||||
var disabledMoves = {bounce:1, fly:1, flyingpress:1, highjumpkick:1, jumpkick:1, magnetrise:1, skydrop:1, splash:1, telekinesis:1};
|
||||
for (var m in disabledMoves) {
|
||||
pokemon.disableMove(m);
|
||||
}
|
||||
},
|
||||
onModifyPokemonPriority: 100,
|
||||
onModifyPokemon: function (pokemon) {
|
||||
pokemon.negateImmunity['Ground'] = true;
|
||||
var applies = false;
|
||||
if (pokemon.removeVolatile('bounce') || pokemon.removeVolatile('fly')) {
|
||||
applies = true;
|
||||
this.cancelMove(pokemon);
|
||||
pokemon.removeVolatile('twoturnmove');
|
||||
}
|
||||
if (pokemon.volatiles['skydrop']) {
|
||||
applies = true;
|
||||
@@ -5846,7 +5856,7 @@ exports.BattleMovedex = {
|
||||
onStart: function (pokemon) {
|
||||
this.add('-start', pokemon, 'move: Heal Block');
|
||||
},
|
||||
onModifyPokemon: function (pokemon) {
|
||||
onDisableMove: function (pokemon) {
|
||||
var disabledMoves = {healingwish:1, lunardance:1, rest:1, swallow:1, wish:1};
|
||||
var move;
|
||||
for (var i = 0; i < pokemon.moveset.length; i++) {
|
||||
@@ -6992,7 +7002,7 @@ exports.BattleMovedex = {
|
||||
onStart: function (target) {
|
||||
this.add('-start', target, 'move: Imprison');
|
||||
},
|
||||
onFoeModifyPokemon: function (pokemon) {
|
||||
onFoeDisableMove: function (pokemon) {
|
||||
var foeMoves = this.effectData.source.moveset;
|
||||
for (var f = 0; f < foeMoves.length; f++) {
|
||||
pokemon.disableMove(foeMoves[f].id, true);
|
||||
@@ -7001,7 +7011,7 @@ exports.BattleMovedex = {
|
||||
},
|
||||
onFoeBeforeMovePriority: 4,
|
||||
onFoeBeforeMove: function (attacker, defender, move) {
|
||||
if (attacker.disabledMoves[move.id]) {
|
||||
if (this.effectData.source.hasMove(move.id)) {
|
||||
this.add('cant', attacker, 'move: Imprison', move);
|
||||
return false;
|
||||
}
|
||||
@@ -7283,7 +7293,7 @@ exports.BattleMovedex = {
|
||||
pp: 10,
|
||||
priority: 4,
|
||||
flags: {},
|
||||
stallingMove: true, // Note: stallingMove is not used anywhere.
|
||||
stallingMove: true,
|
||||
volatileStatus: 'kingsshield',
|
||||
onTryHit: function (pokemon) {
|
||||
return !!this.willAct() && this.runEvent('StallMove', pokemon);
|
||||
@@ -7942,11 +7952,7 @@ exports.BattleMovedex = {
|
||||
onStart: function (target, source) {
|
||||
this.add('-fieldstart', 'move: Magic Room', '[of] ' + source);
|
||||
},
|
||||
onModifyPokemonPriority: 1,
|
||||
onModifyPokemon: function (pokemon) {
|
||||
if (pokemon.getItem().megaEvolves) return;
|
||||
pokemon.ignore['Item'] = true;
|
||||
},
|
||||
// Item suppression implemented in BattlePokemon.ignoringItem() within battle-engine.js
|
||||
onResidualOrder: 25,
|
||||
onEnd: function () {
|
||||
this.add('-fieldend', 'move: Magic Room', '[of] ' + this.effectData.source);
|
||||
@@ -8115,7 +8121,7 @@ exports.BattleMovedex = {
|
||||
pp: 10,
|
||||
priority: 0,
|
||||
flags: {snatch: 1, nonsky: 1},
|
||||
stallingMove: true, // Note: stallingMove is not used anywhere.
|
||||
stallingMove: true,
|
||||
volatileStatus: 'matblock',
|
||||
onTryHitSide: function (side, source) {
|
||||
if (source.activeTurns > 1) {
|
||||
@@ -8499,9 +8505,9 @@ exports.BattleMovedex = {
|
||||
flags: {protect: 1, authentic: 1},
|
||||
onHit: function (target, source) {
|
||||
var disallowedMoves = {chatter:1, mimic:1, sketch:1, struggle:1, transform:1};
|
||||
if (source.transformed || !target.lastMove || disallowedMoves[target.lastMove] || source.moves.indexOf(target.lastMove) !== -1) return false;
|
||||
if (source.transformed || !target.lastMove || disallowedMoves[target.lastMove] || source.moves.indexOf(target.lastMove) >= 0) return false;
|
||||
var moveslot = source.moves.indexOf('mimic');
|
||||
if (moveslot === -1) return false;
|
||||
if (moveslot < 0) return false;
|
||||
var move = Tools.getMove(target.lastMove);
|
||||
source.moveset[moveslot] = {
|
||||
move: move.name,
|
||||
@@ -8581,14 +8587,17 @@ exports.BattleMovedex = {
|
||||
accuracy: true,
|
||||
basePower: 0,
|
||||
category: "Status",
|
||||
desc: "Causes the target to have its positive evasiveness stat stage set to 0 while it is active. Psychic-type attacks can hit the target if it is a Dark type. The effect ends when the target is no longer active. Fails if the target is already affected.",
|
||||
shortDesc: "Blocks evasion mods. Psychic hits Dark.",
|
||||
desc: "Causes the target to have its positive evasiveness stat stage ignored while it is active. Psychic-type attacks can hit the target if it is a Dark type. The effect ends when the target is no longer active. Fails if the target is already affected, or affected by Foresight or Odor Sleuth.",
|
||||
shortDesc: "Psychic hits Dark. Evasiveness ignored.",
|
||||
id: "miracleeye",
|
||||
name: "Miracle Eye",
|
||||
pp: 40,
|
||||
priority: 0,
|
||||
flags: {protect: 1, reflectable: 1, mirror: 1, authentic: 1},
|
||||
volatileStatus: 'miracleeye',
|
||||
onTryHit: function (target) {
|
||||
if (target.volatiles['foresight']) return false;
|
||||
},
|
||||
effect: {
|
||||
onStart: function (pokemon) {
|
||||
this.add('-start', pokemon, 'Miracle Eye');
|
||||
@@ -8773,21 +8782,12 @@ exports.BattleMovedex = {
|
||||
effect: {
|
||||
duration: 5,
|
||||
onSetStatus: function (status, target, source, effect) {
|
||||
if (!target.runImmunity('Ground')) return;
|
||||
if (source && source !== target) {
|
||||
this.debug('misty terrain preventing status');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
onTryHit: function (target, source, move) {
|
||||
if (!target.runImmunity('Ground')) return;
|
||||
if (move && move.id === 'yawn') {
|
||||
this.debug('misty terrain blocking yawn');
|
||||
return false;
|
||||
}
|
||||
if (!target.isGrounded() || target.isSemiInvulnerable()) return;
|
||||
this.debug('misty terrain preventing status');
|
||||
return false;
|
||||
},
|
||||
onBasePower: function (basePower, attacker, defender, move) {
|
||||
if (move.type === 'Dragon' && defender.runImmunity('Ground')) {
|
||||
if (move.type === 'Dragon' && defender.isGrounded() && !defender.isSemiInvulnerable()) {
|
||||
this.debug('misty terrain weaken');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
@@ -9309,14 +9309,17 @@ exports.BattleMovedex = {
|
||||
accuracy: true,
|
||||
basePower: 0,
|
||||
category: "Status",
|
||||
desc: "Causes the target to have its positive evasiveness stat stage set to 0 while it is active. Normal- and Fighting-type attacks can hit the target if it is a Ghost type. The effect ends when the target is no longer active. Fails if the target is already affected.",
|
||||
shortDesc: "Blocks evasion mods. Fighting, Normal hit Ghost.",
|
||||
desc: "Causes the target to have its positive evasiveness stat stage ignored while it is active. Normal- and Fighting-type attacks can hit the target if it is a Ghost type. The effect ends when the target is no longer active. Fails if the target is already affected, or affected by Foresight or Miracle Eye.",
|
||||
shortDesc: "Fighting, Normal hit Ghost. Evasiveness ignored.",
|
||||
id: "odorsleuth",
|
||||
name: "Odor Sleuth",
|
||||
pp: 40,
|
||||
priority: 0,
|
||||
flags: {protect: 1, reflectable: 1, mirror: 1, authentic: 1},
|
||||
volatileStatus: 'foresight',
|
||||
onTryHit: function (target) {
|
||||
if (target.volatiles['miracleeye']) return false;
|
||||
},
|
||||
secondary: false,
|
||||
target: "normal",
|
||||
type: "Normal"
|
||||
@@ -9380,6 +9383,11 @@ exports.BattleMovedex = {
|
||||
self: {
|
||||
volatileStatus: 'lockedmove'
|
||||
},
|
||||
onAfterMove: function (pokemon) {
|
||||
if (pokemon.volatiles['lockedmove'] && pokemon.volatiles['lockedmove'].duration === 1) {
|
||||
pokemon.removeVolatile('lockedmove');
|
||||
}
|
||||
},
|
||||
secondary: false,
|
||||
target: "randomNormal",
|
||||
type: "Dragon"
|
||||
@@ -9545,24 +9553,25 @@ exports.BattleMovedex = {
|
||||
priority: 0,
|
||||
flags: {sound: 1, distance: 1, authentic: 1},
|
||||
onHitField: function (target, source) {
|
||||
var result = true;
|
||||
var result = false;
|
||||
var message = false;
|
||||
for (var i = 0; i < this.sides.length; i++) {
|
||||
for (var j = 0; j < this.sides[i].active.length; j++) {
|
||||
if (this.sides[i].active[j]) {
|
||||
if (!this.sides[i].active[j].volatiles['perishsong']) {
|
||||
result = false;
|
||||
}
|
||||
if (!this.sides[i].active[j].hasAbility('soundproof')) {
|
||||
this.sides[i].active[j].addVolatile('perishsong');
|
||||
} else {
|
||||
if (this.sides[i].active[j].hasAbility('soundproof')) {
|
||||
this.add('-immune', this.sides[i].active[j], '[msg]');
|
||||
this.add('-end', this.sides[i].active[j], 'Perish Song');
|
||||
result = true;
|
||||
} else if (!this.sides[i].active[j].volatiles['perishsong']) {
|
||||
this.sides[i].active[j].addVolatile('perishsong');
|
||||
this.add('-start', this.sides[i].active[j], 'perish3', '[silent]');
|
||||
result = true;
|
||||
message = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result) return false;
|
||||
this.add('-fieldactivate', 'move: Perish Song');
|
||||
if (!result) return false;
|
||||
if (message) this.add('-fieldactivate', 'move: Perish Song');
|
||||
},
|
||||
effect: {
|
||||
duration: 4,
|
||||
@@ -9612,6 +9621,11 @@ exports.BattleMovedex = {
|
||||
self: {
|
||||
volatileStatus: 'lockedmove'
|
||||
},
|
||||
onAfterMove: function (pokemon) {
|
||||
if (pokemon.volatiles['lockedmove'] && pokemon.volatiles['lockedmove'].duration === 1) {
|
||||
pokemon.removeVolatile('lockedmove');
|
||||
}
|
||||
},
|
||||
secondary: false,
|
||||
target: "randomNormal",
|
||||
type: "Grass"
|
||||
@@ -10136,7 +10150,7 @@ exports.BattleMovedex = {
|
||||
pp: 10,
|
||||
priority: 4,
|
||||
flags: {},
|
||||
stallingMove: true, // Note: stallingMove is not used anywhere.
|
||||
stallingMove: true,
|
||||
volatileStatus: 'protect',
|
||||
onPrepareHit: function (pokemon) {
|
||||
return !!this.willAct() && this.runEvent('StallMove', pokemon);
|
||||
@@ -10654,8 +10668,7 @@ exports.BattleMovedex = {
|
||||
}
|
||||
}
|
||||
if (pokemon.hp && pokemon.volatiles['partiallytrapped']) {
|
||||
this.add('-remove', pokemon, pokemon.volatiles['partiallytrapped'].sourceEffect.name, '[from] move: Rapid Spin', '[of] ' + pokemon, '[partiallytrapped]');
|
||||
delete pokemon.volatiles['partiallytrapped'];
|
||||
pokemon.removeVolatile('partiallytrapped');
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -10715,8 +10728,12 @@ exports.BattleMovedex = {
|
||||
priority: 0,
|
||||
flags: {charge: 1, protect: 1, mirror: 1},
|
||||
onTry: function (attacker, defender, move) {
|
||||
if (attacker.removeVolatile(move.id)) {
|
||||
return;
|
||||
if (attacker.volatiles['twoturnmove']) {
|
||||
if (attacker.volatiles['twoturnmove'].duration === 1) {
|
||||
return;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
this.add('-prepare', attacker, move.name, defender);
|
||||
if (!this.runEvent('ChargeMove', attacker, defender, move)) {
|
||||
@@ -12123,9 +12140,9 @@ exports.BattleMovedex = {
|
||||
flags: {authentic: 1},
|
||||
onHit: function (target, source) {
|
||||
var disallowedMoves = {chatter:1, sketch:1, struggle:1};
|
||||
if (source.transformed || !target.lastMove || disallowedMoves[target.lastMove] || source.moves.indexOf(target.lastMove) !== -1) return false;
|
||||
if (source.transformed || !target.lastMove || disallowedMoves[target.lastMove] || source.moves.indexOf(target.lastMove) >= 0) return false;
|
||||
var moveslot = source.moves.indexOf('sketch');
|
||||
if (moveslot === -1) return false;
|
||||
if (moveslot < 0) return false;
|
||||
var move = Tools.getMove(target.lastMove);
|
||||
var sketchedMove = {
|
||||
move: move.name,
|
||||
@@ -12725,7 +12742,7 @@ exports.BattleMovedex = {
|
||||
pp: 10,
|
||||
priority: 4,
|
||||
flags: {},
|
||||
stallingMove: true, // Note: stallingMove is not used anywhere.
|
||||
stallingMove: true,
|
||||
volatileStatus: 'spikyshield',
|
||||
onTryHit: function (target, source, move) {
|
||||
return !!this.willAct() && this.runEvent('StallMove', target);
|
||||
@@ -12955,8 +12972,7 @@ exports.BattleMovedex = {
|
||||
},
|
||||
onSwitchIn: function (pokemon) {
|
||||
var side = pokemon.side;
|
||||
if (!pokemon.runImmunity('Ground')) return;
|
||||
if (pokemon.hasType('Flying') && !pokemon.hasItem('ironball') && !this.pseudoWeather.gravity && !pokemon.volatiles['ingrain']) return;
|
||||
if (!pokemon.isGrounded()) return;
|
||||
var damageAmounts = [0, 3, 4, 6]; // 1/8, 1/6, 1/4
|
||||
this.damage(damageAmounts[this.effectData.layers] * pokemon.maxhp / 24);
|
||||
}
|
||||
@@ -13149,8 +13165,7 @@ exports.BattleMovedex = {
|
||||
this.add('-sidestart', side, 'move: Sticky Web');
|
||||
},
|
||||
onSwitchIn: function (pokemon) {
|
||||
if (!pokemon.runImmunity('Ground')) return;
|
||||
if (pokemon.hasType('Flying') && !pokemon.hasItem('ironball') && !this.pseudoWeather.gravity && !pokemon.volatiles['ingrain']) return;
|
||||
if (!pokemon.isGrounded()) return;
|
||||
this.add('-activate', pokemon, 'move: Sticky Web');
|
||||
this.boost({spe: -1}, pokemon, pokemon.side.foe.active[0], this.getMove('stickyweb'));
|
||||
}
|
||||
@@ -13959,7 +13974,7 @@ exports.BattleMovedex = {
|
||||
onEnd: function (target) {
|
||||
this.add('-end', target, 'move: Taunt');
|
||||
},
|
||||
onModifyPokemon: function (pokemon) {
|
||||
onDisableMove: function (pokemon) {
|
||||
var moves = pokemon.moveset;
|
||||
for (var i = 0; i < moves.length; i++) {
|
||||
if (this.getMove(moves[i].move).category === 'Status') {
|
||||
@@ -14158,6 +14173,11 @@ exports.BattleMovedex = {
|
||||
self: {
|
||||
volatileStatus: 'lockedmove'
|
||||
},
|
||||
onAfterMove: function (pokemon) {
|
||||
if (pokemon.volatiles['lockedmove'] && pokemon.volatiles['lockedmove'].duration === 1) {
|
||||
pokemon.removeVolatile('lockedmove');
|
||||
}
|
||||
},
|
||||
secondary: false,
|
||||
target: "randomNormal",
|
||||
type: "Normal"
|
||||
@@ -14358,7 +14378,7 @@ exports.BattleMovedex = {
|
||||
onEnd: function (pokemon) {
|
||||
this.add('-end', pokemon, 'Torment');
|
||||
},
|
||||
onModifyPokemon: function (pokemon) {
|
||||
onDisableMove: function (pokemon) {
|
||||
if (pokemon.lastMove !== 'struggle') pokemon.disableMove(pokemon.lastMove);
|
||||
}
|
||||
},
|
||||
@@ -14416,9 +14436,8 @@ exports.BattleMovedex = {
|
||||
this.effectData.layers++;
|
||||
},
|
||||
onSwitchIn: function (pokemon) {
|
||||
if (!pokemon.runImmunity('Ground')) return;
|
||||
if (!pokemon.isGrounded()) return;
|
||||
if (!pokemon.runImmunity('Poison')) return;
|
||||
if (pokemon.hasType('Flying') && !pokemon.hasItem('ironball') && !this.pseudoWeather.gravity && !pokemon.volatiles['ingrain']) return;
|
||||
if (pokemon.hasType('Poison')) {
|
||||
this.add('-sideend', pokemon.side, 'move: Toxic Spikes', '[of] ' + pokemon);
|
||||
pokemon.side.removeSideCondition('toxicspikes');
|
||||
@@ -15573,6 +15592,7 @@ exports.BattleMovedex = {
|
||||
this.add('-start', target, 'move: Yawn', '[of] ' + source);
|
||||
},
|
||||
onEnd: function (target) {
|
||||
this.add('-end', target, 'move: Yawn', '[silent]');
|
||||
target.trySetStatus('slp');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -842,6 +842,7 @@ malaconda:{num:-5,species:"Malaconda",types:["Dark","Grass"],baseStats:{hp:115,a
|
||||
cawmodore:{num:-6,species:"Cawmodore",types:["Steel","Flying"],baseStats:{hp:50,atk:92,def:130,spa:65,spd:75,spe:118},abilities:{0:"Intimidate",1:"Volt Absorb",H:"Big Pecks"},heightm:1.7,weightkg:37.0,color:"Black",eggGroups:["Flying"]},
|
||||
volkraken:{num:-7,species:"Volkraken",types:["Water","Fire"],baseStats:{hp:100,atk:45,def:80,spa:135,spd:100,spe:95},abilities:{0:"Analytic",1:"Infiltrator",H:"Pressure"},heightm:1.3,weightkg:44.5,color:"Red",eggGroups:["Water 1","Water 2"]},
|
||||
plasmanta:{num:-8,species:"Plasmanta",types:["Electric","Poison"],baseStats:{hp:60,atk:57,def:119,spa:131,spd:98,spe:100},abilities:{0:"Storm Drain",1:"Vital Spirit",H:"Telepathy"},heightm:7,weightkg:460,color:"Purple",eggGroups:["Water 1","Water 2"]},
|
||||
naviathan:{num:-9,species:"Naviathan",types:["Water","Steel"],baseStats:{hp:103,atk:110,def:90,spa:95,spd:65,spe:97},abilities:{0:"Water Veil",1:"Heatproof"},heightm:3,weightkg:510,color:"Gray",eggGroups:["Water 1","Field"]},
|
||||
syclant:{num:-51,species:"Syclant",types:["Ice","Bug"],baseStats:{hp:70,atk:116,def:70,spa:114,spd:64,spe:121},abilities:{0:"Compound Eyes",1:"Mountaineer"},heightm:1.7,weightkg:52,color:"Blue",eggGroups:["Bug"]},
|
||||
revenankh:{num:-52,species:"Revenankh",types:["Ghost","Fighting"],baseStats:{hp:90,atk:105,def:90,spa:65,spd:110,spe:65},abilities:{0:"Shed Skin",1:"Air Lock"},heightm:1.8,weightkg:44,color:"White",eggGroups:["Amorphous","Human-Like"]},
|
||||
pyroak:{num:-53,species:"Pyroak",types:["Fire","Grass"],baseStats:{hp:120,atk:70,def:105,spa:95,spd:90,spe:60},abilities:{0:"Rock Head",1:"Battle Armor"},heightm:2.1,weightkg:168,color:"Brown",eggGroups:["Monster","Dragon"]},
|
||||
|
||||
644
data/rulesets.js
Normal file
644
data/rulesets.js
Normal file
File diff suppressed because one or more lines are too long
3287
data/scripts.js
Normal file
3287
data/scripts.js
Normal file
File diff suppressed because it is too large
Load Diff
642
data/statuses.js
Normal file
642
data/statuses.js
Normal file
@@ -0,0 +1,642 @@
|
||||
exports.BattleStatuses = {
|
||||
brn: {
|
||||
effectType: 'Status',
|
||||
onStart: function (target, source, sourceEffect) {
|
||||
if (sourceEffect && sourceEffect.id === 'flameorb') {
|
||||
this.add('-status', target, 'brn', '[from] item: Flame Orb');
|
||||
return;
|
||||
}
|
||||
this.add('-status', target, 'brn');
|
||||
},
|
||||
// Damage reduction is handled directly in the battle-engine.js damage function
|
||||
onResidualOrder: 9,
|
||||
onResidual: function (pokemon) {
|
||||
this.damage(pokemon.maxhp / 8);
|
||||
}
|
||||
},
|
||||
par: {
|
||||
effectType: 'Status',
|
||||
onStart: function (target) {
|
||||
this.add('-status', target, 'par');
|
||||
},
|
||||
onModifySpe: function (speMod, pokemon) {
|
||||
if (!pokemon.hasAbility('quickfeet')) {
|
||||
return this.chain(speMod, 0.25);
|
||||
}
|
||||
},
|
||||
onBeforeMovePriority: 1,
|
||||
onBeforeMove: function (pokemon) {
|
||||
if (this.random(4) === 0) {
|
||||
this.add('cant', pokemon, 'par');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
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) {
|
||||
return;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
frz: {
|
||||
effectType: 'Status',
|
||||
onStart: function (target) {
|
||||
this.add('-status', target, 'frz');
|
||||
if (target.template.species === 'Shaymin-Sky' && target.baseTemplate.baseSpecies === 'Shaymin') {
|
||||
var 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]');
|
||||
}
|
||||
},
|
||||
onBeforeMovePriority: 10,
|
||||
onBeforeMove: function (pokemon, target, move) {
|
||||
if (move.flags['defrost']) return;
|
||||
if (this.random(5) === 0) {
|
||||
pokemon.cureStatus();
|
||||
return;
|
||||
}
|
||||
this.add('cant', pokemon, 'frz');
|
||||
return false;
|
||||
},
|
||||
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();
|
||||
}
|
||||
}
|
||||
},
|
||||
psn: {
|
||||
effectType: 'Status',
|
||||
onStart: function (target) {
|
||||
this.add('-status', target, 'psn');
|
||||
},
|
||||
onResidualOrder: 9,
|
||||
onResidual: function (pokemon) {
|
||||
this.damage(pokemon.maxhp / 8);
|
||||
}
|
||||
},
|
||||
tox: {
|
||||
effectType: 'Status',
|
||||
onStart: function (target, source, sourceEffect) {
|
||||
this.effectData.stage = 0;
|
||||
if (sourceEffect && sourceEffect.id === 'toxicorb') {
|
||||
this.add('-status', target, 'tox', '[from] item: Toxic Orb');
|
||||
return;
|
||||
}
|
||||
this.add('-status', target, 'tox');
|
||||
},
|
||||
onSwitchIn: function () {
|
||||
this.effectData.stage = 0;
|
||||
},
|
||||
onResidualOrder: 9,
|
||||
onResidual: function (pokemon) {
|
||||
if (this.effectData.stage < 15) {
|
||||
this.effectData.stage++;
|
||||
}
|
||||
this.damage(this.clampIntRange(pokemon.maxhp / 16, 1) * this.effectData.stage);
|
||||
}
|
||||
},
|
||||
confusion: {
|
||||
// this is a volatile status
|
||||
onStart: function (target, source, sourceEffect) {
|
||||
var 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');
|
||||
},
|
||||
onBeforeMovePriority: 3,
|
||||
onBeforeMove: function (pokemon) {
|
||||
pokemon.volatiles.confusion.time--;
|
||||
if (!pokemon.volatiles.confusion.time) {
|
||||
pokemon.removeVolatile('confusion');
|
||||
return;
|
||||
}
|
||||
this.add('-activate', pokemon, 'confusion');
|
||||
if (this.random(2) === 0) {
|
||||
return;
|
||||
}
|
||||
this.directDamage(this.getDamage(pokemon, pokemon, 40));
|
||||
return false;
|
||||
}
|
||||
},
|
||||
flinch: {
|
||||
duration: 1,
|
||||
onBeforeMovePriority: 8,
|
||||
onBeforeMove: function (pokemon) {
|
||||
if (!this.runEvent('Flinch', pokemon)) {
|
||||
return;
|
||||
}
|
||||
this.add('cant', pokemon, 'flinch');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
trapped: {
|
||||
noCopy: true,
|
||||
onModifyPokemon: function (pokemon) {
|
||||
pokemon.tryTrap();
|
||||
},
|
||||
onStart: function (target) {
|
||||
this.add('-activate', target, 'trapped');
|
||||
}
|
||||
},
|
||||
trapper: {
|
||||
noCopy: true
|
||||
},
|
||||
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]');
|
||||
},
|
||||
onModifyPokemon: function (pokemon) {
|
||||
pokemon.tryTrap();
|
||||
}
|
||||
},
|
||||
lockedmove: {
|
||||
// Outrage, Thrash, Petal Dance...
|
||||
duration: 2,
|
||||
onResidual: function (target) {
|
||||
if (target.status === 'slp') {
|
||||
// don't lock, and bypass confusion for calming
|
||||
delete target.volatiles['lockedmove'];
|
||||
}
|
||||
this.effectData.trueDuration--;
|
||||
},
|
||||
onStart: function (target, source, effect) {
|
||||
this.effectData.trueDuration = this.random(2, 4);
|
||||
this.effectData.move = effect.id;
|
||||
},
|
||||
onRestart: function () {
|
||||
if (this.effectData.trueDuration >= 2) {
|
||||
this.effectData.duration = 2;
|
||||
}
|
||||
},
|
||||
onEnd: function (target) {
|
||||
if (this.effectData.trueDuration > 1) return;
|
||||
target.addVolatile('confusion');
|
||||
},
|
||||
onLockMove: function (pokemon) {
|
||||
return this.effectData.move;
|
||||
}
|
||||
},
|
||||
twoturnmove: {
|
||||
// Skull Bash, SolarBeam, Sky Drop...
|
||||
duration: 2,
|
||||
onStart: function (target, source, effect) {
|
||||
this.effectData.move = effect.id;
|
||||
// source and target are reversed since the event target is the
|
||||
// pokemon using the two-turn move
|
||||
this.effectData.targetLoc = this.getTargetLoc(source, target);
|
||||
target.addVolatile(effect.id, source);
|
||||
},
|
||||
onEnd: function (target) {
|
||||
target.removeVolatile(this.effectData.move);
|
||||
},
|
||||
onLockMove: function () {
|
||||
return this.effectData.move;
|
||||
},
|
||||
onLockMoveTarget: function () {
|
||||
return this.effectData.targetLoc;
|
||||
}
|
||||
},
|
||||
choicelock: {
|
||||
onStart: function (pokemon) {
|
||||
if (!this.activeMove.id || this.activeMove.sourceEffect && this.activeMove.sourceEffect !== this.activeMove.id) return false;
|
||||
this.effectData.move = this.activeMove.id;
|
||||
},
|
||||
onDisableMove: function (pokemon) {
|
||||
if (!pokemon.getItem().isChoice || !pokemon.hasMove(this.effectData.move)) {
|
||||
pokemon.removeVolatile('choicelock');
|
||||
return;
|
||||
}
|
||||
if (pokemon.ignoringItem()) {
|
||||
return;
|
||||
}
|
||||
var moves = pokemon.moveset;
|
||||
for (var i = 0; i < moves.length; i++) {
|
||||
if (moves[i].id !== this.effectData.move) {
|
||||
pokemon.disableMove(moves[i].id, false, this.effectData.sourceEffect);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mustrecharge: {
|
||||
duration: 2,
|
||||
onBeforeMovePriority: 11,
|
||||
onBeforeMove: function (pokemon) {
|
||||
this.add('cant', pokemon, 'recharge');
|
||||
pokemon.removeVolatile('mustrecharge');
|
||||
return false;
|
||||
},
|
||||
onLockMove: function (pokemon) {
|
||||
this.add('-mustrecharge', pokemon);
|
||||
return 'recharge';
|
||||
}
|
||||
},
|
||||
futuremove: {
|
||||
// this is a side condition
|
||||
onStart: function (side) {
|
||||
this.effectData.positions = [];
|
||||
for (var i = 0; i < side.active.length; i++) {
|
||||
this.effectData.positions[i] = null;
|
||||
}
|
||||
},
|
||||
onResidualOrder: 3,
|
||||
onResidual: function (side) {
|
||||
var finished = true;
|
||||
for (var i = 0; i < side.active.length; i++) {
|
||||
var posData = this.effectData.positions[i];
|
||||
if (!posData) continue;
|
||||
|
||||
posData.duration--;
|
||||
|
||||
if (posData.duration > 0) {
|
||||
finished = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
// time's up; time to hit! :D
|
||||
var target = side.foe.active[posData.targetPosition];
|
||||
var move = this.getMove(posData.move);
|
||||
if (target.fainted) {
|
||||
this.add('-hint', '' + move.name + ' did not hit because the target is fainted.');
|
||||
this.effectData.positions[i] = null;
|
||||
continue;
|
||||
}
|
||||
|
||||
this.add('-end', target, 'move: ' + move.name);
|
||||
target.removeVolatile('Protect');
|
||||
target.removeVolatile('Endure');
|
||||
|
||||
if (posData.moveData.ignoreImmunity === undefined) {
|
||||
posData.moveData.ignoreImmunity = false;
|
||||
}
|
||||
|
||||
if (target.hasAbility('wonderguard') && this.gen > 5) {
|
||||
this.debug('Wonder Guard immunity: ' + move.id);
|
||||
if (target.runEffectiveness(move) <= 0) {
|
||||
this.add('-activate', target, 'ability: Wonder Guard');
|
||||
this.effectData.positions[i] = null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Prior to gen 5, these moves had no STAB and no effectiveness.
|
||||
// This is done here and to moveData's type for two reasons:
|
||||
// - modifyMove event happens before the moveHit function is run.
|
||||
// - moveData here is different from move, as one is generated here and the other by the move itself.
|
||||
// So here we centralise any future hit move getting typeless on hit as it should be.
|
||||
if (this.gen < 5) {
|
||||
posData.moveData.type = '???';
|
||||
}
|
||||
|
||||
this.moveHit(target, posData.source, move, posData.moveData);
|
||||
|
||||
this.effectData.positions[i] = null;
|
||||
}
|
||||
if (finished) {
|
||||
side.removeSideCondition('futuremove');
|
||||
}
|
||||
}
|
||||
},
|
||||
stall: {
|
||||
// Protect, Detect, Endure counter
|
||||
duration: 2,
|
||||
counterMax: 729,
|
||||
onStart: function () {
|
||||
this.effectData.counter = 3;
|
||||
},
|
||||
onStallMove: function () {
|
||||
// this.effectData.counter should never be undefined here.
|
||||
// However, just in case, use 1 if it is undefined.
|
||||
var counter = this.effectData.counter || 1;
|
||||
this.debug("Success chance: " + Math.round(100 / counter) + "%");
|
||||
return (this.random(counter) === 0);
|
||||
},
|
||||
onRestart: function () {
|
||||
if (this.effectData.counter < this.effect.counterMax) {
|
||||
this.effectData.counter *= 3;
|
||||
}
|
||||
this.effectData.duration = 2;
|
||||
}
|
||||
},
|
||||
gem: {
|
||||
duration: 1,
|
||||
affectsFainted: true,
|
||||
onBasePower: function (basePower, user, target, move) {
|
||||
this.debug('Gem Boost');
|
||||
return this.chainModify([0x14CD, 0x1000]);
|
||||
}
|
||||
},
|
||||
aura: {
|
||||
duration: 1,
|
||||
onBasePowerPriority: 8,
|
||||
onBasePower: function (basePower, user, target, move) {
|
||||
var modifier = 0x1547;
|
||||
this.debug('Aura Boost');
|
||||
if (user.volatiles['aurabreak']) {
|
||||
modifier = 0x0C00;
|
||||
this.debug('Aura Boost reverted by Aura Break');
|
||||
}
|
||||
return this.chainModify([modifier, 0x1000]);
|
||||
}
|
||||
},
|
||||
|
||||
// weather is implemented here since it's so important to the game
|
||||
|
||||
raindance: {
|
||||
effectType: 'Weather',
|
||||
duration: 5,
|
||||
durationCallback: function (source, effect) {
|
||||
if (source && source.hasItem('damprock')) {
|
||||
return 8;
|
||||
}
|
||||
return 5;
|
||||
},
|
||||
onBasePower: function (basePower, attacker, defender, move) {
|
||||
if (move.type === 'Water') {
|
||||
this.debug('rain water boost');
|
||||
return this.chainModify(1.5);
|
||||
}
|
||||
if (move.type === 'Fire') {
|
||||
this.debug('rain fire suppress');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
},
|
||||
onStart: function (battle, source, effect) {
|
||||
if (effect && effect.effectType === 'Ability' && this.gen <= 5) {
|
||||
this.effectData.duration = 0;
|
||||
this.add('-weather', 'RainDance', '[from] ability: ' + effect, '[of] ' + source);
|
||||
} else {
|
||||
this.add('-weather', 'RainDance');
|
||||
}
|
||||
},
|
||||
onResidualOrder: 1,
|
||||
onResidual: function () {
|
||||
this.add('-weather', 'RainDance', '[upkeep]');
|
||||
this.eachEvent('Weather');
|
||||
},
|
||||
onEnd: function () {
|
||||
this.add('-weather', 'none');
|
||||
}
|
||||
},
|
||||
primordialsea: {
|
||||
effectType: 'Weather',
|
||||
duration: 0,
|
||||
onTryMove: function (target, source, effect) {
|
||||
if (effect.type === 'Fire' && effect.category !== 'Status') {
|
||||
this.debug('Primordial Sea fire suppress');
|
||||
this.add('-fail', source, effect, '[from] Primordial Sea');
|
||||
return null;
|
||||
}
|
||||
},
|
||||
onBasePower: function (basePower, attacker, defender, move) {
|
||||
if (move.type === 'Water') {
|
||||
this.debug('Rain water boost');
|
||||
return this.chainModify(1.5);
|
||||
}
|
||||
},
|
||||
onStart: function () {
|
||||
this.add('-weather', 'PrimordialSea');
|
||||
},
|
||||
onResidualOrder: 1,
|
||||
onResidual: function () {
|
||||
this.add('-weather', 'PrimordialSea', '[upkeep]');
|
||||
this.eachEvent('Weather');
|
||||
},
|
||||
onEnd: function () {
|
||||
this.add('-weather', 'none');
|
||||
}
|
||||
},
|
||||
sunnyday: {
|
||||
effectType: 'Weather',
|
||||
duration: 5,
|
||||
durationCallback: function (source, effect) {
|
||||
if (source && source.hasItem('heatrock')) {
|
||||
return 8;
|
||||
}
|
||||
return 5;
|
||||
},
|
||||
onBasePower: function (basePower, attacker, defender, move) {
|
||||
if (move.type === 'Fire') {
|
||||
this.debug('Sunny Day fire boost');
|
||||
return this.chainModify(1.5);
|
||||
}
|
||||
if (move.type === 'Water') {
|
||||
this.debug('Sunny Day water suppress');
|
||||
return this.chainModify(0.5);
|
||||
}
|
||||
},
|
||||
onStart: function (battle, source, effect) {
|
||||
if (effect && effect.effectType === 'Ability' && this.gen <= 5) {
|
||||
this.effectData.duration = 0;
|
||||
this.add('-weather', 'SunnyDay', '[from] ability: ' + effect, '[of] ' + source);
|
||||
} else {
|
||||
this.add('-weather', 'SunnyDay');
|
||||
}
|
||||
},
|
||||
onImmunity: function (type) {
|
||||
if (type === 'frz') return false;
|
||||
},
|
||||
onResidualOrder: 1,
|
||||
onResidual: function () {
|
||||
this.add('-weather', 'SunnyDay', '[upkeep]');
|
||||
this.eachEvent('Weather');
|
||||
},
|
||||
onEnd: function () {
|
||||
this.add('-weather', 'none');
|
||||
}
|
||||
},
|
||||
desolateland: {
|
||||
effectType: 'Weather',
|
||||
duration: 0,
|
||||
onTryMove: function (target, source, effect) {
|
||||
if (effect.type === 'Water' && effect.category !== 'Status') {
|
||||
this.debug('Desolate Land water suppress');
|
||||
this.add('-fail', source, effect, '[from] Desolate Land');
|
||||
return null;
|
||||
}
|
||||
},
|
||||
onBasePower: function (basePower, attacker, defender, move) {
|
||||
if (move.type === 'Fire') {
|
||||
this.debug('Sunny Day fire boost');
|
||||
return this.chainModify(1.5);
|
||||
}
|
||||
},
|
||||
onStart: function () {
|
||||
this.add('-weather', 'DesolateLand');
|
||||
},
|
||||
onImmunity: function (type) {
|
||||
if (type === 'frz') return false;
|
||||
},
|
||||
onResidualOrder: 1,
|
||||
onResidual: function () {
|
||||
this.add('-weather', 'DesolateLand', '[upkeep]');
|
||||
this.eachEvent('Weather');
|
||||
},
|
||||
onEnd: function () {
|
||||
this.add('-weather', 'none');
|
||||
}
|
||||
},
|
||||
sandstorm: {
|
||||
effectType: 'Weather',
|
||||
duration: 5,
|
||||
durationCallback: function (source, effect) {
|
||||
if (source && source.hasItem('smoothrock')) {
|
||||
return 8;
|
||||
}
|
||||
return 5;
|
||||
},
|
||||
// This should be applied directly to the stat before any of the other modifiers are chained
|
||||
// So we give it increased priority.
|
||||
onModifySpDPriority: 10,
|
||||
onModifySpD: function (spd, pokemon) {
|
||||
if (pokemon.hasType('Rock') && this.isWeather('sandstorm')) {
|
||||
return this.modify(spd, 1.5);
|
||||
}
|
||||
},
|
||||
onStart: function (battle, source, effect) {
|
||||
if (effect && effect.effectType === 'Ability' && this.gen <= 5) {
|
||||
this.effectData.duration = 0;
|
||||
this.add('-weather', 'Sandstorm', '[from] ability: ' + effect, '[of] ' + source);
|
||||
} else {
|
||||
this.add('-weather', 'Sandstorm');
|
||||
}
|
||||
},
|
||||
onResidualOrder: 1,
|
||||
onResidual: function () {
|
||||
this.add('-weather', 'Sandstorm', '[upkeep]');
|
||||
if (this.isWeather('sandstorm')) this.eachEvent('Weather');
|
||||
},
|
||||
onWeather: function (target) {
|
||||
this.damage(target.maxhp / 16);
|
||||
},
|
||||
onEnd: function () {
|
||||
this.add('-weather', 'none');
|
||||
}
|
||||
},
|
||||
hail: {
|
||||
effectType: 'Weather',
|
||||
duration: 5,
|
||||
durationCallback: function (source, effect) {
|
||||
if (source && source.hasItem('icyrock')) {
|
||||
return 8;
|
||||
}
|
||||
return 5;
|
||||
},
|
||||
onStart: function (battle, source, effect) {
|
||||
if (effect && effect.effectType === 'Ability' && this.gen <= 5) {
|
||||
this.effectData.duration = 0;
|
||||
this.add('-weather', 'Hail', '[from] ability: ' + effect, '[of] ' + source);
|
||||
} else {
|
||||
this.add('-weather', 'Hail');
|
||||
}
|
||||
},
|
||||
onResidualOrder: 1,
|
||||
onResidual: function () {
|
||||
this.add('-weather', 'Hail', '[upkeep]');
|
||||
if (this.isWeather('hail')) this.eachEvent('Weather');
|
||||
},
|
||||
onWeather: function (target) {
|
||||
this.damage(target.maxhp / 16);
|
||||
},
|
||||
onEnd: function () {
|
||||
this.add('-weather', 'none');
|
||||
}
|
||||
},
|
||||
deltastream: {
|
||||
effectType: 'Weather',
|
||||
duration: 0,
|
||||
onEffectiveness: function (typeMod, target, type, move) {
|
||||
if (move && move.effectType === 'Move' && type === 'Flying' && typeMod > 0) {
|
||||
this.add('-activate', '', 'deltastream');
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
onStart: function () {
|
||||
this.add('-weather', 'DeltaStream');
|
||||
},
|
||||
onResidualOrder: 1,
|
||||
onResidual: function () {
|
||||
this.add('-weather', 'DeltaStream', '[upkeep]');
|
||||
this.eachEvent('Weather');
|
||||
},
|
||||
onEnd: function () {
|
||||
this.add('-weather', 'none');
|
||||
}
|
||||
},
|
||||
|
||||
arceus: {
|
||||
// Arceus's actual typing is implemented here
|
||||
// Arceus's true typing for all its formes is Normal, and it's only
|
||||
// Multitype that changes its type, but its formes are specified to
|
||||
// be their corresponding type in the Pokedex, so that needs to be
|
||||
// overridden. This is mainly relevant for Hackmons and Balanced
|
||||
// Hackmons.
|
||||
onSwitchInPriority: 101,
|
||||
onSwitchIn: function (pokemon) {
|
||||
var type = 'Normal';
|
||||
if (pokemon.ability === 'multitype') {
|
||||
type = pokemon.getItem().onPlate;
|
||||
if (!type || type === true) {
|
||||
type = 'Normal';
|
||||
}
|
||||
}
|
||||
pokemon.setType(type, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user