// Note: These are the rules that formats use // The list of formats is stored in config/formats.js exports.BattleFormats = { // Rulesets /////////////////////////////////////////////////////////////////// standard: { effectType: 'Banlist', ruleset: ['Sleep Clause Mod', 'Species Clause', 'OHKO Clause', 'Moody Clause', 'Evasion Moves Clause', 'Endless Battle Clause', 'HP Percentage Mod'], banlist: ['Unreleased', 'Illegal'] }, standardnext: { effectType: 'Banlist', ruleset: ['Sleep Clause Mod', 'Species Clause', 'OHKO Clause', 'HP Percentage Mod'], banlist: ['Illegal', 'Soul Dew'] }, standardubers: { effectType: 'Banlist', ruleset: ['Sleep Clause Mod', 'Species Clause', 'Moody Clause', 'OHKO Clause', 'Endless Battle Clause', 'HP Percentage Mod'], banlist: ['Unreleased', 'Illegal'] }, standardgbu: { effectType: 'Banlist', ruleset: ['Species Clause', 'Item Clause'], banlist: ['Unreleased', 'Illegal', 'Soul Dew', 'Mewtwo', 'Mewtwo-Mega-X', 'Mewtwo-Mega-Y', 'Mew', 'Lugia', 'Ho-Oh', 'Celebi', 'Kyogre', 'Groudon', 'Rayquaza', 'Jirachi', 'Deoxys', 'Deoxys-Attack', 'Deoxys-Defense', 'Deoxys-Speed', 'Dialga', 'Palkia', 'Giratina', 'Giratina-Origin', 'Phione', 'Manaphy', 'Darkrai', 'Shaymin', 'Shaymin-Sky', 'Arceus', 'Arceus-Bug', 'Arceus-Dark', 'Arceus-Dragon', 'Arceus-Electric', 'Arceus-Fairy', 'Arceus-Fighting', 'Arceus-Fire', 'Arceus-Flying', 'Arceus-Ghost', 'Arceus-Grass', 'Arceus-Ground', 'Arceus-Ice', 'Arceus-Poison', 'Arceus-Psychic', 'Arceus-Rock', 'Arceus-Steel', 'Arceus-Water', 'Victini', 'Reshiram', 'Zekrom', 'Kyurem', 'Kyurem-Black', 'Kyurem-White', 'Keldeo', 'Meloetta', 'Genesect', 'Xerneas', 'Yveltal', 'Zygarde' ] }, standarddoubles: { effectType: 'Banlist', ruleset: ['Species Clause', 'OHKO Clause', 'Moody Clause', 'Evasion Abilities Clause', 'Evasion Moves Clause', 'Endless Battle Clause', 'HP Percentage Mod'], banlist: ['Unreleased', 'Illegal'] }, pokemon: { effectType: 'Banlist', validateSet: function(set, format, isNonstandard) { var item = this.getItem(set.item); var template = this.getTemplate(set.species); var problems = []; if (set.species === set.name) delete set.name; if (template.gen > this.gen) { problems.push(set.species+' does not exist in gen '+this.gen+'.'); } var ability = {}; if (set.ability) { ability = this.getAbility(set.ability); if (ability.gen > this.gen) { problems.push(ability.name+' does not exist in gen '+this.gen+'.'); } } if (set.moves) for (var i=0; i this.gen) { problems.push(move.name+' does not exist in gen '+this.gen+'.'); } else if (!isNonstandard && move.isNonstandard) { problems.push(move.name+' is not a real move.'); } } if (item.gen > this.gen) { problems.push(item.name+' does not exist in gen '+this.gen+'.'); } if (set.moves && set.moves.length > 4) { problems.push((set.name||set.species) + ' has more than four moves.'); } if (set.level && set.level > 100) { problems.push((set.name||set.species) + ' is higher than level 100.'); } if (!isNonstandard) { if (template.isNonstandard) { problems.push(set.species+' is not a real Pokemon.'); } if (ability.isNonstandard) { problems.push(ability.name+' is not a real ability.'); } if (item.isNonstandard) { problems.push(item.name + ' is not a real item.'); } } // ----------- legality line ------------------------------------------ if (!format.banlistTable || !format.banlistTable['illegal']) return problems; // everything after this line only happens if we're doing legality enforcement // limit one of each move var moves = []; if (set.moves) { var hasMove = {}; for (var i=0; i= 2) { return ["You are limited to two of each ability by the Ability Clause.","(You have more than two " + this.getAbility(ability).name + ")"]; } abilityTable[ability]++; } else { abilityTable[ability] = 1; } } } }, ohkoclause: { effectType: 'Rule', onStart: function() { this.add('rule', 'OHKO Clause: OHKO moves are banned'); }, validateSet: function(set) { var problems = []; if (set.moves) { for (var i in set.moves) { var move = this.getMove(set.moves[i]); if (move.ohko) problems.push(move.name+' is banned by OHKO Clause.'); } } return problems; } }, evasionabilitiesclause: { effectType: 'Banlist', name: 'Evasion Abilities Clause', banlist: ['Sand Veil', 'Snow Cloak'], onStart: function() { this.add('rule', 'Evasion Abilities Clause: Evasion abilities are banned'); } }, evasionmovesclause: { effectType: 'Banlist', name: 'Evasion Moves Clause', banlist: ['Minimize', 'Double Team'], onStart: function() { this.add('rule', 'Evasion Moves Clause: Evasion moves are banned'); } }, endlessbattleclause: { effectType: 'Banlist', name: 'Endless Battle Clause', banlist: ['Leppa Berry + Recycle', 'Harvest + Leppa Berry', 'Shadow Tag + Leppa Berry + Trick'], onStart: function() { this.add('rule', 'Endless Battle Clause: Forcing endless battles is banned.'); } }, moodyclause: { effectType: 'Banlist', name: 'Moody Clause', banlist: ['Moody'], onStart: function() { this.add('rule', 'Moody Clause: Moody is banned'); } }, hppercentagemod: { effectType: 'Rule', name: 'HP Percentage Mod', onStart: function() { this.add('rule', 'HP Percentage Mod: HP is reported as percentages'); this.reportPercentages = true; } }, sleepclausemod: { effectType: 'Rule', onStart: function() { this.add('rule', 'Sleep Clause Mod: Limit one foe put to sleep'); }, onSetStatus: function(status, target, source) { if (source && source.side === target.side) { return; } if (status.id === 'slp') { for (var i=0; i= team.length) { return; } } return ["Your team must share a type."]; } } };