From d8720e67065ededf37e3ea5e52a160b60bfbc056 Mon Sep 17 00:00:00 2001 From: Alexander B <4866817+MathyFurret@users.noreply.github.com> Date: Wed, 14 Dec 2022 13:44:46 -0600 Subject: [PATCH] Update randomized formats (#9184) * Update randomized formats * Delete/hide more stuff * Fix Mayhem * copy error * oops ! Co-authored-by: Karthik <32044378+Karthik99999@users.noreply.github.com> Co-authored-by: Karthik <32044378+Karthik99999@users.noreply.github.com> --- config/formats.ts | 221 ++++++++++------------ data/mods/gen8sharedpower/random-teams.ts | 32 ---- data/mods/sharedpower/random-teams.ts | 5 + 3 files changed, 105 insertions(+), 153 deletions(-) delete mode 100644 data/mods/gen8sharedpower/random-teams.ts create mode 100644 data/mods/sharedpower/random-teams.ts diff --git a/config/formats.ts b/config/formats.ts index 30260cf901..0c32dbe6d6 100644 --- a/config/formats.ts +++ b/config/formats.ts @@ -36,6 +36,22 @@ export const Formats: FormatList = [ team: 'random', ruleset: ['PotD', 'Obtainable', 'Species Clause', 'HP Percentage Mod', 'Cancel Mod', 'Sleep Clause Mod'], }, + { + name: "[Gen 9] Unrated Random Battle", + + mod: 'gen9', + team: 'random', + challengeShow: false, + rated: false, + ruleset: ['Obtainable', 'Species Clause', 'HP Percentage Mod', 'Cancel Mod', 'Sleep Clause Mod'], + }, + { + name: "[Gen 9] Random Battle (Blitz)", + + mod: 'gen9', + team: 'random', + ruleset: ['[Gen 9] Random Battle', 'Blitz'], + }, { name: "[Gen 9] OU", @@ -116,48 +132,6 @@ export const Formats: FormatList = [ ruleset: ['Flat Rules', '!! Adjust Level = 50', 'Paldea Pokedex', 'Min Source Gen = 9', 'VGC Timer'], banlist: ['Sub-Legendary'], }, - { - name: "[Gen 9] Hackmons Cup", - desc: `Randomized teams of level-balanced Pokémon with absolutely any ability, moves, and item.`, - - mod: 'gen9', - team: 'randomHC', - ruleset: ['HP Percentage Mod', 'Cancel Mod'], - banlist: ['Nonexistent'], - }, - { - name: "[Gen 9] Doubles Hackmons Cup", - desc: `Randomized teams of level-balanced Pokémon with absolutely any ability, moves, and item. Now with TWICE the Pokémon per side!`, - - mod: 'gen9', - team: 'randomHC', - searchShow: false, - gameType: 'doubles', - ruleset: ['[Gen 9] Hackmons Cup'], - }, - { - name: "[Gen 9] Challenge Cup 1v1", - - mod: 'gen9', - team: 'randomCC', - ruleset: ['Obtainable', 'HP Percentage Mod', 'Cancel Mod', 'Team Preview', 'Dynamax Clause', 'Picked Team Size = 1'], - }, - { - name: "[Gen 9] Challenge Cup 2v2", - - mod: 'gen9', - team: 'randomCC', - gameType: 'doubles', - ruleset: ['[Gen 9] Challenge Cup 1v1', '!! Picked Team Size = 2'], - }, - { - name: "[Gen 9] Challenge Cup 6v6", - - mod: 'gen9', - team: 'randomCC', - searchShow: false, - ruleset: ['[Gen 9] Challenge Cup 1v1', '!Picked Team Size'], - }, { name: "[Gen 9] Custom Game", @@ -2063,6 +2037,86 @@ export const Formats: FormatList = [ section: "Randomized Metas", column: 3, }, + { + name: "[Gen 9] Monotype Random Battle", + + mod: 'gen9', + team: 'random', + ruleset: ['Obtainable', 'Same Type Clause', 'HP Percentage Mod', 'Cancel Mod', 'Sleep Clause Mod'], + }, + { + name: "[Gen 9] Random Battle Mayhem", + desc: `[Gen 9] Random Battle with Team Preview and elements of Camomons, Inverse, Scalemons, and Shared Power.`, + + mod: 'sharedpower', + team: 'random', + ruleset: ['[Gen 9] Random Battle', 'Team Preview', 'Camomons Mod', 'Inverse Mod', 'Scalemons Mod'], + onBeforeSwitchIn(pokemon) { + let format = this.format; + if (!format.getSharedPower) format = this.dex.formats.get('gen9sharedpower'); + for (const ability of format.getSharedPower!(pokemon)) { + const effect = 'ability:' + ability; + pokemon.volatiles[effect] = {id: this.toID(effect), target: pokemon}; + if (!pokemon.m.abils) pokemon.m.abils = []; + if (!pokemon.m.abils.includes(effect)) pokemon.m.abils.push(effect); + } + }, + onSwitchInPriority: 2, + onSwitchIn(pokemon) { + let format = this.format; + if (!format.getSharedPower) format = this.dex.formats.get('gen9sharedpower'); + for (const ability of format.getSharedPower!(pokemon)) { + if (ability === 'noability') { + this.hint(`Mirror Armor and Trace break in Shared Power formats that don't use Shared Power as a base, so they get removed from non-base users.`); + } + const effect = 'ability:' + ability; + delete pokemon.volatiles[effect]; + pokemon.addVolatile(effect); + } + }, + }, + { + name: "[Gen 9] Hackmons Cup", + desc: `Randomized teams of level-balanced Pokémon with absolutely any ability, moves, and item.`, + + mod: 'gen9', + team: 'randomHC', + ruleset: ['HP Percentage Mod', 'Cancel Mod'], + banlist: ['Nonexistent'], + }, + { + name: "[Gen 9] Doubles Hackmons Cup", + desc: `Randomized teams of level-balanced Pokémon with absolutely any ability, moves, and item. Now with TWICE the Pokémon per side!`, + + mod: 'gen9', + team: 'randomHC', + searchShow: false, + gameType: 'doubles', + ruleset: ['[Gen 9] Hackmons Cup'], + }, + { + name: "[Gen 9] Challenge Cup 1v1", + + mod: 'gen9', + team: 'randomCC', + ruleset: ['Obtainable', 'HP Percentage Mod', 'Cancel Mod', 'Team Preview', 'Dynamax Clause', 'Picked Team Size = 1'], + }, + { + name: "[Gen 9] Challenge Cup 2v2", + + mod: 'gen9', + team: 'randomCC', + gameType: 'doubles', + ruleset: ['[Gen 9] Challenge Cup 1v1', '!! Picked Team Size = 2'], + }, + { + name: "[Gen 9] Challenge Cup 6v6", + + mod: 'gen9', + team: 'randomCC', + searchShow: false, + ruleset: ['[Gen 9] Challenge Cup 1v1', '!Picked Team Size'], + }, { name: "[Gen 8] Random Battle", desc: `Randomized teams of level-balanced Pokémon with sets that are generated to be competitively viable.`, @@ -2074,13 +2128,6 @@ export const Formats: FormatList = [ team: 'random', ruleset: ['PotD', 'Obtainable', 'Species Clause', 'HP Percentage Mod', 'Cancel Mod', 'Sleep Clause Mod'], }, - { - name: "[Gen 8] Random Battle (Blitz)", - desc: `gotta go fast!! like Random Battle, but you only have 10 seconds per turn.`, - mod: 'gen8', - team: 'random', - ruleset: ['[Gen 8] Random Battle', 'Blitz'], - }, { name: "[Gen 8] Free-For-All Random Battle", @@ -2106,44 +2153,6 @@ export const Formats: FormatList = [ 'Obtainable', 'Species Clause', 'HP Percentage Mod', 'Cancel Mod', 'Sleep Clause Mod', ], }, - { - name: "[Gen 8] Monotype Random Battle", - - mod: 'gen8', - team: 'random', - ruleset: ['Obtainable', 'Same Type Clause', 'HP Percentage Mod', 'Cancel Mod', 'Sleep Clause Mod'], - }, - { - name: "[Gen 8] Random Battle Mayhem", - desc: `[Gen 8] Random Battle (No Dmax) with Team Preview and elements of Camomons, Inverse, Scalemons, and Shared Power.`, - - mod: 'gen8sharedpower', - team: 'random', - ruleset: ['[Gen 8] Random Battle', 'Team Preview', 'Dynamax Clause', 'Camomons Mod', 'Inverse Mod', 'Scalemons Mod'], - onBeforeSwitchIn(pokemon) { - let format = this.format; - if (!format.getSharedPower) format = this.dex.formats.get('gen9sharedpower'); - for (const ability of format.getSharedPower!(pokemon)) { - const effect = 'ability:' + ability; - pokemon.volatiles[effect] = {id: this.toID(effect), target: pokemon}; - if (!pokemon.m.abils) pokemon.m.abils = []; - if (!pokemon.m.abils.includes(effect)) pokemon.m.abils.push(effect); - } - }, - onSwitchInPriority: 2, - onSwitchIn(pokemon) { - let format = this.format; - if (!format.getSharedPower) format = this.dex.formats.get('gen9sharedpower'); - for (const ability of format.getSharedPower!(pokemon)) { - if (ability === 'noability') { - this.hint(`Mirror Armor and Trace break in Shared Power formats that don't use Shared Power as a base, so they get removed from non-base users.`); - } - const effect = 'ability:' + ability; - delete pokemon.volatiles[effect]; - pokemon.addVolatile(effect); - } - }, - }, { name: "[Gen 8] Battle Factory", desc: `Randomized teams of Pokémon for a generated Smogon tier with sets that are competitively viable.`, @@ -2225,22 +2234,6 @@ export const Formats: FormatList = [ } }, }, - { - name: "[Gen 8] Challenge Cup 1v1", - - mod: 'gen8', - team: 'randomCC', - ruleset: ['Obtainable', 'HP Percentage Mod', 'Cancel Mod', 'Team Preview', 'Dynamax Clause', 'Picked Team Size = 1'], - }, - { - name: "[Gen 8] Challenge Cup 2v2", - - mod: 'gen8', - team: 'randomCC', - gameType: 'doubles', - searchShow: false, - ruleset: ['[Gen 8] Challenge Cup 1v1', '!! Picked Team Size = 2'], - }, { name: "[Gen 8] Hackmons Cup", desc: `Randomized teams of level-balanced Pokémon with absolutely any ability, moves, and item.`, @@ -2250,16 +2243,6 @@ export const Formats: FormatList = [ ruleset: ['HP Percentage Mod', 'Cancel Mod'], banlist: ['Nonexistent'], }, - { - name: "[Gen 8] Doubles Hackmons Cup", - - mod: 'gen8', - gameType: 'doubles', - team: 'randomHC', - searchShow: false, - ruleset: ['HP Percentage Mod', 'Cancel Mod'], - banlist: ['Nonexistent'], - }, { name: "[Gen 8] CAP 1v1", desc: `Randomly generated 1v1-style teams only including Pokémon made by the Create-A-Pokémon Project.`, @@ -2308,6 +2291,7 @@ export const Formats: FormatList = [ gameType: 'doubles', team: 'random', searchShow: false, + challengeShow: false, ruleset: ['Obtainable', 'HP Percentage Mod', 'Cancel Mod'], }, { @@ -2318,14 +2302,6 @@ export const Formats: FormatList = [ team: 'randomFactory', ruleset: ['Obtainable', 'Sleep Clause Mod', 'Team Preview', 'HP Percentage Mod', 'Cancel Mod', 'Mega Rayquaza Clause'], }, - { - name: "[Gen 7] Monotype Battle Factory", - desc: `Randomized teams of Pokémon with competitively-viable sets that all share a type.`, - - mod: 'gen7', - team: 'randomFactory', - ruleset: ['[Gen 7] Battle Factory', 'Same Type Clause'], - }, { name: "[Gen 7] BSS Factory", desc: `Randomized 3v3 Singles featuring Pokémon and movesets popular in Battle Spot Singles.`, @@ -2370,6 +2346,7 @@ export const Formats: FormatList = [ mod: 'gen6', team: 'randomFactory', searchShow: false, + challengeShow: false, ruleset: ['Obtainable', 'Sleep Clause Mod', 'Team Preview', 'HP Percentage Mod', 'Cancel Mod', 'Mega Rayquaza Clause'], }, { @@ -2413,6 +2390,7 @@ export const Formats: FormatList = [ mod: 'gen1', team: 'randomCC', searchShow: false, + challengeShow: false, ruleset: ['Obtainable', 'HP Percentage Mod', 'Cancel Mod', 'Desync Clause Mod', 'Sleep Clause Mod', 'Freeze Clause Mod'], }, { @@ -2422,6 +2400,7 @@ export const Formats: FormatList = [ mod: 'gen1', team: 'randomHC', searchShow: false, + challengeShow: false, ruleset: ['HP Percentage Mod', 'Cancel Mod', 'Desync Clause Mod', 'Sleep Clause Mod', 'Freeze Clause Mod', 'Team Type Preview'], banlist: ['Nonexistent'], onModifySpecies(species, target, source, effect) { diff --git a/data/mods/gen8sharedpower/random-teams.ts b/data/mods/gen8sharedpower/random-teams.ts deleted file mode 100644 index e4ea013245..0000000000 --- a/data/mods/gen8sharedpower/random-teams.ts +++ /dev/null @@ -1,32 +0,0 @@ -import {PRNG, PRNGSeed} from '../../../sim/prng'; -import RandomGen8Teams from '../gen8/random-teams'; - -export class RandomSharedPowerTeams extends RandomGen8Teams { - constructor(format: Format | string, prng: PRNG | PRNGSeed | null) { - super(format, prng); - } - - getPokemonPool( - type: string, - pokemonToExclude: RandomTeamsTypes.RandomSet[] = [], - isMonotype = false, - ) { - const exclude = ['golisopod', ...pokemonToExclude.map(p => toID(p.species))]; - const pokemonPool = []; - for (let species of this.dex.species.all()) { - if (species.gen > this.gen || exclude.includes(species.id)) continue; - if (this.dex.currentMod === 'gen8bdsp' && species.gen > 4) continue; - if (isMonotype) { - if (!species.types.includes(type)) continue; - if (typeof species.battleOnly === 'string') { - species = this.dex.species.get(species.battleOnly); - if (!species.types.includes(type)) continue; - } - } - pokemonPool.push(species.id); - } - return pokemonPool; - } -} - -export default RandomSharedPowerTeams; diff --git a/data/mods/sharedpower/random-teams.ts b/data/mods/sharedpower/random-teams.ts new file mode 100644 index 0000000000..db19a3c76c --- /dev/null +++ b/data/mods/sharedpower/random-teams.ts @@ -0,0 +1,5 @@ +import RandomTeams from '../../random-teams'; + +export class RandomSharedPowerTeams extends RandomTeams {} + +export default RandomSharedPowerTeams;