mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Rename files in data for consistency
- rulesets.ts -> format-rules.ts - formats-data.ts -> pokedex-tiers.ts Variable names were updated to match.
This commit is contained in:
parent
6c46ab9924
commit
e9ec82327f
|
|
@ -1,12 +1,12 @@
|
|||
// Note: This is the list of formats
|
||||
// The rules that formats use are stored in data/rulesets.ts
|
||||
// The rules that formats use are stored in data/format-rules.ts
|
||||
/*
|
||||
If you want to add custom formats, create a file in this folder named: "custom-formats.ts"
|
||||
|
||||
Paste the following code into the file and add your desired formats and their sections between the brackets:
|
||||
--------------------------------------------------------------------------------
|
||||
// Note: This is the list of formats
|
||||
// The rules that formats use are stored in data/rulesets.ts
|
||||
// The rules that formats use are stored in data/format-rules.ts
|
||||
|
||||
export const Formats: FormatList = [
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
export const Conditions: import('../sim/dex-conditions').ConditionDataTable = {
|
||||
|
||||
// #region Statuses
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
brn: {
|
||||
name: 'brn',
|
||||
effectType: 'Status',
|
||||
|
|
@ -159,6 +163,15 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = {
|
|||
this.damage(this.clampIntRange(pokemon.baseMaxhp / 16, 1) * this.effectState.stage);
|
||||
},
|
||||
},
|
||||
|
||||
// #endregion
|
||||
// #region Generic conditions
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
// Most conditions are attached to the move or other effect that
|
||||
// gives them, but some are shared between multiple moves and not
|
||||
// specific to any of them. Those are defined here.
|
||||
|
||||
confusion: {
|
||||
name: 'confusion',
|
||||
// this is a volatile status
|
||||
|
|
@ -457,10 +470,71 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = {
|
|||
},
|
||||
},
|
||||
|
||||
// weather is implemented here since it's so important to the game
|
||||
// #endregion
|
||||
// #region Extra conditions
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
// Rollout and Commander need multiple conditions to function, so
|
||||
// those are defined here.
|
||||
|
||||
rolloutstorage: {
|
||||
name: 'Rollout storage',
|
||||
duration: 2,
|
||||
onBasePower(relayVar, source, target, move) {
|
||||
let bp = Math.max(1, move.basePower);
|
||||
bp *= Math.pow(2, source.volatiles['rolloutstorage'].contactHitCount);
|
||||
if (source.volatiles['defensecurl']) {
|
||||
bp *= 2;
|
||||
}
|
||||
source.removeVolatile('rolloutstorage');
|
||||
return bp;
|
||||
},
|
||||
},
|
||||
// Commander needs two conditions so they are implemented here
|
||||
// Dondozo
|
||||
commanded: {
|
||||
name: "Commanded",
|
||||
noCopy: true,
|
||||
onStart(pokemon) {
|
||||
this.boost({atk: 2, spa: 2, spe: 2, def: 2, spd: 2}, pokemon);
|
||||
},
|
||||
onDragOutPriority: 2,
|
||||
onDragOut() {
|
||||
return false;
|
||||
},
|
||||
// Prevents Shed Shell allowing a swap
|
||||
onTrapPokemonPriority: -11,
|
||||
onTrapPokemon(pokemon) {
|
||||
pokemon.trapped = true;
|
||||
},
|
||||
},
|
||||
// Tatsugiri
|
||||
commanding: {
|
||||
name: "Commanding",
|
||||
noCopy: true,
|
||||
onDragOutPriority: 2,
|
||||
onDragOut() {
|
||||
return false;
|
||||
},
|
||||
// Prevents Shed Shell allowing a swap
|
||||
onTrapPokemonPriority: -11,
|
||||
onTrapPokemon(pokemon) {
|
||||
pokemon.trapped = true;
|
||||
},
|
||||
// Dodging moves is handled in BattleActions#hitStepInvulnerabilityEvent
|
||||
// This is here for moves that manually call this event like Perish Song
|
||||
onInvulnerability: false,
|
||||
onBeforeTurn(pokemon) {
|
||||
this.queue.cancelAction(pokemon);
|
||||
},
|
||||
},
|
||||
|
||||
// #endregion
|
||||
// #region Weather
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
raindance: {
|
||||
name: 'RainDance',
|
||||
name: 'Rain Dance',
|
||||
effectType: 'Weather',
|
||||
duration: 5,
|
||||
durationCallback(source, effect) {
|
||||
|
|
@ -498,7 +572,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = {
|
|||
},
|
||||
},
|
||||
primordialsea: {
|
||||
name: 'PrimordialSea',
|
||||
name: 'Primordial Sea',
|
||||
effectType: 'Weather',
|
||||
duration: 0,
|
||||
onTryMovePriority: 1,
|
||||
|
|
@ -530,7 +604,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = {
|
|||
},
|
||||
},
|
||||
sunnyday: {
|
||||
name: 'SunnyDay',
|
||||
name: 'Sunny Day',
|
||||
effectType: 'Weather',
|
||||
duration: 5,
|
||||
durationCallback(source, effect) {
|
||||
|
|
@ -576,7 +650,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = {
|
|||
},
|
||||
},
|
||||
desolateland: {
|
||||
name: 'DesolateLand',
|
||||
name: 'Desolate Land',
|
||||
effectType: 'Weather',
|
||||
duration: 0,
|
||||
onTryMovePriority: 1,
|
||||
|
|
@ -713,7 +787,7 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = {
|
|||
},
|
||||
},
|
||||
deltastream: {
|
||||
name: 'DeltaStream',
|
||||
name: 'Delta Stream',
|
||||
effectType: 'Weather',
|
||||
duration: 0,
|
||||
onEffectivenessPriority: -1,
|
||||
|
|
@ -790,44 +864,9 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = {
|
|||
},
|
||||
},
|
||||
|
||||
// Commander needs two conditions so they are implemented here
|
||||
// Dondozo
|
||||
commanded: {
|
||||
name: "Commanded",
|
||||
noCopy: true,
|
||||
onStart(pokemon) {
|
||||
this.boost({atk: 2, spa: 2, spe: 2, def: 2, spd: 2}, pokemon);
|
||||
},
|
||||
onDragOutPriority: 2,
|
||||
onDragOut() {
|
||||
return false;
|
||||
},
|
||||
// Prevents Shed Shell allowing a swap
|
||||
onTrapPokemonPriority: -11,
|
||||
onTrapPokemon(pokemon) {
|
||||
pokemon.trapped = true;
|
||||
},
|
||||
},
|
||||
// Tatsugiri
|
||||
commanding: {
|
||||
name: "Commanding",
|
||||
noCopy: true,
|
||||
onDragOutPriority: 2,
|
||||
onDragOut() {
|
||||
return false;
|
||||
},
|
||||
// Prevents Shed Shell allowing a swap
|
||||
onTrapPokemonPriority: -11,
|
||||
onTrapPokemon(pokemon) {
|
||||
pokemon.trapped = true;
|
||||
},
|
||||
// Dodging moves is handled in BattleActions#hitStepInvulnerabilityEvent
|
||||
// This is here for moves that manually call this event like Perish Song
|
||||
onInvulnerability: false,
|
||||
onBeforeTurn(pokemon) {
|
||||
this.queue.cancelAction(pokemon);
|
||||
},
|
||||
},
|
||||
// #endregion
|
||||
// #region Species
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
// Arceus and Silvally's actual typing is implemented here.
|
||||
// Their true typing for all their formes is Normal, and it's only
|
||||
|
|
@ -865,17 +904,6 @@ export const Conditions: import('../sim/dex-conditions').ConditionDataTable = {
|
|||
return [type];
|
||||
},
|
||||
},
|
||||
rolloutstorage: {
|
||||
name: 'rolloutstorage',
|
||||
duration: 2,
|
||||
onBasePower(relayVar, source, target, move) {
|
||||
let bp = Math.max(1, move.basePower);
|
||||
bp *= Math.pow(2, source.volatiles['rolloutstorage'].contactHitCount);
|
||||
if (source.volatiles['defensecurl']) {
|
||||
bp *= 2;
|
||||
}
|
||||
source.removeVolatile('rolloutstorage');
|
||||
return bp;
|
||||
},
|
||||
},
|
||||
|
||||
// #endregion
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import type {Learnset} from "../sim/dex-species";
|
|||
// The list of formats is stored in config/formats.js
|
||||
export const Rulesets: import('../sim/dex-formats').FormatDataTable = {
|
||||
|
||||
// Rulesets
|
||||
// Rules
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
standard: {
|
||||
|
|
@ -2018,7 +2018,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = {
|
|||
effectType: 'ValidatorRule',
|
||||
name: "NC 2000 Move Legality",
|
||||
desc: "Prevents Pok\u00e9mon from having moves that would only be obtainable in Pok\u00e9mon Crystal.",
|
||||
// Implemented in mods/gen2/rulesets.ts
|
||||
// Implemented in mods/gen2/format-rules.ts
|
||||
},
|
||||
aptclause: {
|
||||
effectType: 'ValidatorRule',
|
||||
|
|
@ -2030,7 +2030,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = {
|
|||
effectType: 'ValidatorRule',
|
||||
name: "NC 1997 Move Legality",
|
||||
desc: "Bans move combinations on Pok\u00e9mon that weren't legal in NC 1997.",
|
||||
// Implemented in mods/gen1jpn/rulesets.ts
|
||||
// Implemented in mods/gen1jpn/format-rules.ts
|
||||
},
|
||||
noswitching: {
|
||||
effectType: 'Rule',
|
||||
|
|
@ -2768,12 +2768,12 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = {
|
|||
uselessmovesclause: {
|
||||
effectType: 'ValidatorRule',
|
||||
name: 'Useless Moves Clause',
|
||||
// implemented in /mods/moderngen2/rulesets.ts
|
||||
// implemented in /mods/moderngen2/format-rules.ts
|
||||
},
|
||||
uselessitemsclause: {
|
||||
effectType: 'ValidatorRule',
|
||||
name: 'Useless Items Clause',
|
||||
// implemented in /mods/moderngen2/rulesets.ts
|
||||
// implemented in /mods/moderngen2/format-rules.ts
|
||||
},
|
||||
ferventimpersonationmod: {
|
||||
effectType: 'Rule',
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
pichuspikyeared: {
|
||||
isNonstandard: "Future",
|
||||
tier: "Illegal",
|
||||
},
|
||||
};
|
||||
6
data/mods/gen4pt/pokedex-tiers.ts
Normal file
6
data/mods/gen4pt/pokedex-tiers.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
pichuspikyeared: {
|
||||
isNonstandard: "Future",
|
||||
tier: "Illegal",
|
||||
},
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
venusaur: {
|
||||
tier: "OU",
|
||||
},
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
beedrillmega: {
|
||||
isNonstandard: "Future",
|
||||
tier: "Illegal",
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
pikachupartner: {
|
||||
isNonstandard: "Future",
|
||||
tier: "Illegal",
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
// TODO: alphabetize move names. I'm trying to implement this on a low-quality laptop under time pressure, so I haven't bothered doing so.
|
||||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
pikachuworld: {
|
||||
isNonstandard: "Unobtainable",
|
||||
tier: "Unreleased",
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
isNonstandard: "Past",
|
||||
tier: "Illegal",
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
isNonstandard: "Past",
|
||||
tier: "Illegal",
|
||||
|
|
@ -1906,7 +1906,7 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa
|
|||
shortDesc: "Bypasses Sleep Clause Mod once per battle.",
|
||||
name: "I Did It Again",
|
||||
flags: {},
|
||||
// implemented in rulesets.ts
|
||||
// implemented in format-rules.ts
|
||||
},
|
||||
|
||||
// Pulse_kS
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
aegislash: {
|
||||
inherit: true,
|
||||
tier: "OU",
|
||||
|
|
@ -5,7 +5,7 @@ export const Scripts: ModdedBattleScriptsData = {
|
|||
if (!this.data.Items[i].megaStone) continue;
|
||||
this.modData('Items', i).onTakeItem = false;
|
||||
const id = this.toID(this.data.Items[i].megaStone);
|
||||
this.modData('FormatsData', id).isNonstandard = null;
|
||||
this.modData('PokedexTiers', id).isNonstandard = null;
|
||||
}
|
||||
},
|
||||
start() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../../../sim/dex-species').ModdedSpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../../../sim/dex-species').ModdedTiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -22,9 +22,9 @@ export const Scripts: ModdedBattleScriptsData = {
|
|||
for (const i in this.data.Pokedex) {
|
||||
if (this.species.get(i).gen > 2) this.modData('Pokedex', i).gen = 2;
|
||||
}
|
||||
for (const i in this.data.FormatsData) {
|
||||
for (const i in this.data.PokedexTiers) {
|
||||
if (this.forGen(9).species.get(i).isNonstandard === 'Past') {
|
||||
this.modData('FormatsData', i).isNonstandard = null;
|
||||
this.modData('PokedexTiers', i).isNonstandard = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export const FormatsData: import('../sim/dex-species').SpeciesFormatsDataTable = {
|
||||
export const PokedexTiers: import('../sim/dex-species').TiersDataTable = {
|
||||
bulbasaur: {
|
||||
tier: "LC",
|
||||
},
|
||||
|
|
@ -223,7 +223,7 @@ export class RandomLetsGoTeams extends RandomGen8Teams {
|
|||
const pokemon: RandomTeamsTypes.RandomSet[] = [];
|
||||
|
||||
const pokemonPool: string[] = [];
|
||||
for (const id in this.dex.data.FormatsData) {
|
||||
for (const id in this.dex.data.PokedexTiers) {
|
||||
const species = this.dex.species.get(id);
|
||||
if (
|
||||
species.num < 1 ||
|
||||
|
|
|
|||
|
|
@ -3164,7 +3164,7 @@ export const pages: Chat.PageTable = {
|
|||
`<ul><li><code>+ Blaziken</code>: Unban/unrestrict a Pokémon.</li></ul>`,
|
||||
`<p><a class="button" href="https://github.com/smogon/pokemon-showdown/blob/master/config/CUSTOM-RULES.md">More details</a></p>`,
|
||||
];
|
||||
const rulesets = [
|
||||
const formatRules = [
|
||||
`<h2><u>Rules, mods, and clauses</u></h2>`,
|
||||
`<p>The following rules can be added to challenges/tournaments to modify the style of play. Alternatively, already present rules can be removed from formats by preceding the rule name with <code>!</code></p>`,
|
||||
`<p>However, some rules, like <code>Obtainable</code>, are made of subrules, that can be individually turned on and off.</p>`,
|
||||
|
|
@ -3173,9 +3173,9 @@ export const pages: Chat.PageTable = {
|
|||
for (const rule of rules) {
|
||||
if (rule.hasValue) continue;
|
||||
const desc = rule.desc ? rule.desc : "No description.";
|
||||
rulesets.push(`<tr><td>${rule.name}</td><td>${desc}</td></tr>`);
|
||||
formatRules.push(`<tr><td>${rule.name}</td><td>${desc}</td></tr>`);
|
||||
}
|
||||
rulesets.push(
|
||||
formatRules.push(
|
||||
`</table></div>`,
|
||||
`<h3>Value rules</h3>`,
|
||||
`<ul><li>Value rules are formatted like [Name] = [value], e.g. "Force Monotype = Water" or "Min Team Size = 4"</li>`,
|
||||
|
|
@ -3186,10 +3186,10 @@ export const pages: Chat.PageTable = {
|
|||
for (const rule of rules) {
|
||||
if (!rule.hasValue) continue;
|
||||
const desc = rule.desc ? rule.desc : "No description.";
|
||||
rulesets.push(`<tr><td>${rule.name}</td><td>${desc}</td></tr>`);
|
||||
formatRules.push(`<tr><td>${rule.name}</td><td>${desc}</td></tr>`);
|
||||
}
|
||||
rulesets.push(`</table></div>`);
|
||||
rulesHTML += `${basics.concat(rulesets).join('')}</div>`;
|
||||
formatRules.push(`</table></div>`);
|
||||
rulesHTML += `${basics.concat(formatRules).join('')}</div>`;
|
||||
return rulesHTML;
|
||||
},
|
||||
buildformat(query, user) {
|
||||
|
|
|
|||
|
|
@ -612,7 +612,7 @@ export interface ModdedConditionDataTable {[id: IDEntry]: ModdedConditionData}
|
|||
|
||||
export class Condition extends BasicEffect implements
|
||||
Readonly<BasicEffect & SideConditionData & FieldConditionData & PokemonConditionData> {
|
||||
declare readonly effectType: 'Condition' | 'Weather' | 'Status' | 'Terastal';
|
||||
declare readonly effectType: 'Condition' | 'Weather' | 'Status';
|
||||
declare readonly counterMax?: number;
|
||||
|
||||
declare readonly durationCallback?: (this: Battle, target: Pokemon, source: Pokemon, effect: Effect | null) => number;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,14 @@ export type ModdedFormatData = FormatData | Omit<FormatData, 'name'> & {inherit:
|
|||
export interface FormatDataTable {[id: IDEntry]: FormatData}
|
||||
export interface ModdedFormatDataTable {[id: IDEntry]: ModdedFormatData}
|
||||
|
||||
type FormatEffectType = 'Format' | 'Ruleset' | 'Rule' | 'ValidatorRule';
|
||||
/**
|
||||
* All three of these are considered "formats", but `Format` is a list
|
||||
* of rules you can play, while `Rule` | `ValidatorRule` is a list of
|
||||
* rules that can only be used in other lists of rules. A
|
||||
* `ValidatorRule` is explicitly a rule that only affects validation
|
||||
* and has no effect after battle start.
|
||||
*/
|
||||
type FormatEffectType = ('Format' | 'Rule' | 'ValidatorRule') & EffectType;
|
||||
|
||||
/** rule, source, limit, bans */
|
||||
export type ComplexBan = [string, string, number, string[]];
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export interface SpeciesData extends Partial<Species> {
|
|||
|
||||
export type ModdedSpeciesData = SpeciesData | Partial<Omit<SpeciesData, 'name'>> & {inherit: true};
|
||||
|
||||
export interface SpeciesFormatsData {
|
||||
export interface TiersData {
|
||||
doublesTier?: TierTypes.Doubles | TierTypes.Other;
|
||||
gmaxUnreleased?: boolean;
|
||||
isNonstandard?: Nonstandard | null;
|
||||
|
|
@ -31,7 +31,7 @@ export interface SpeciesFormatsData {
|
|||
tier?: TierTypes.Singles | TierTypes.Other;
|
||||
}
|
||||
|
||||
export type ModdedSpeciesFormatsData = SpeciesFormatsData & {inherit?: true};
|
||||
export type ModdedTiersData = TiersData & {inherit?: true};
|
||||
|
||||
export interface LearnsetData {
|
||||
learnset?: {[moveid: IDEntry]: MoveSource[]};
|
||||
|
|
@ -50,8 +50,8 @@ export interface PokemonGoData {
|
|||
|
||||
export interface SpeciesDataTable {[speciesid: IDEntry]: SpeciesData}
|
||||
export interface ModdedSpeciesDataTable {[speciesid: IDEntry]: ModdedSpeciesData}
|
||||
export interface SpeciesFormatsDataTable {[speciesid: IDEntry]: SpeciesFormatsData}
|
||||
export interface ModdedSpeciesFormatsDataTable {[speciesid: IDEntry]: ModdedSpeciesFormatsData}
|
||||
export interface TiersDataTable {[speciesid: IDEntry]: TiersData}
|
||||
export interface ModdedTiersDataTable {[speciesid: IDEntry]: ModdedTiersData}
|
||||
export interface LearnsetDataTable {[speciesid: IDEntry]: LearnsetData}
|
||||
export interface ModdedLearnsetDataTable {[speciesid: IDEntry]: ModdedLearnsetData}
|
||||
export interface PokemonGoDataTable {[speciesid: IDEntry]: PokemonGoData}
|
||||
|
|
@ -84,7 +84,7 @@ export type MoveSource = `${
|
|||
'M' | 'T' | 'L' | 'R' | 'E' | 'D' | 'S' | 'V' | 'C'
|
||||
}${string}`;
|
||||
|
||||
export class Species extends BasicEffect implements Readonly<BasicEffect & SpeciesFormatsData> {
|
||||
export class Species extends BasicEffect implements Readonly<BasicEffect & TiersData> {
|
||||
declare readonly effectType: 'Pokemon';
|
||||
/**
|
||||
* Species ID. Identical to ID. Note that this is the full ID, e.g.
|
||||
|
|
@ -409,12 +409,12 @@ export class DexSpecies {
|
|||
if (species) return species;
|
||||
|
||||
if (this.dex.data.Aliases.hasOwnProperty(id)) {
|
||||
if (this.dex.data.FormatsData.hasOwnProperty(id)) {
|
||||
if (this.dex.data.PokedexTiers.hasOwnProperty(id)) {
|
||||
// special event ID, like Rockruff-Dusk
|
||||
const baseId = toID(this.dex.data.Aliases[id]);
|
||||
species = new Species({
|
||||
...this.dex.data.Pokedex[baseId],
|
||||
...this.dex.data.FormatsData[id],
|
||||
...this.dex.data.PokedexTiers[id],
|
||||
name: id,
|
||||
});
|
||||
species.abilities = {0: species.abilities['S']!};
|
||||
|
|
@ -480,7 +480,7 @@ export class DexSpecies {
|
|||
species = new Species({
|
||||
tags: baseSpeciesTags,
|
||||
...pokedexData,
|
||||
...this.dex.data.FormatsData[id],
|
||||
...this.dex.data.PokedexTiers[id],
|
||||
});
|
||||
// Inherit any statuses from the base species (Arceus, Silvally).
|
||||
const baseSpeciesStatuses = this.dex.data.Conditions[toID(species.baseSpecies)];
|
||||
|
|
@ -493,21 +493,21 @@ export class DexSpecies {
|
|||
}
|
||||
if (!species.tier && !species.doublesTier && !species.natDexTier && species.baseSpecies !== species.name) {
|
||||
if (species.baseSpecies === 'Mimikyu') {
|
||||
species.tier = this.dex.data.FormatsData[toID(species.baseSpecies)].tier || 'Illegal';
|
||||
species.doublesTier = this.dex.data.FormatsData[toID(species.baseSpecies)].doublesTier || 'Illegal';
|
||||
species.natDexTier = this.dex.data.FormatsData[toID(species.baseSpecies)].natDexTier || 'Illegal';
|
||||
species.tier = this.dex.data.PokedexTiers[toID(species.baseSpecies)].tier || 'Illegal';
|
||||
species.doublesTier = this.dex.data.PokedexTiers[toID(species.baseSpecies)].doublesTier || 'Illegal';
|
||||
species.natDexTier = this.dex.data.PokedexTiers[toID(species.baseSpecies)].natDexTier || 'Illegal';
|
||||
} else if (species.id.endsWith('totem')) {
|
||||
species.tier = this.dex.data.FormatsData[species.id.slice(0, -5)].tier || 'Illegal';
|
||||
species.doublesTier = this.dex.data.FormatsData[species.id.slice(0, -5)].doublesTier || 'Illegal';
|
||||
species.natDexTier = this.dex.data.FormatsData[species.id.slice(0, -5)].natDexTier || 'Illegal';
|
||||
species.tier = this.dex.data.PokedexTiers[species.id.slice(0, -5)].tier || 'Illegal';
|
||||
species.doublesTier = this.dex.data.PokedexTiers[species.id.slice(0, -5)].doublesTier || 'Illegal';
|
||||
species.natDexTier = this.dex.data.PokedexTiers[species.id.slice(0, -5)].natDexTier || 'Illegal';
|
||||
} else if (species.battleOnly) {
|
||||
species.tier = this.dex.data.FormatsData[toID(species.battleOnly)].tier || 'Illegal';
|
||||
species.doublesTier = this.dex.data.FormatsData[toID(species.battleOnly)].doublesTier || 'Illegal';
|
||||
species.natDexTier = this.dex.data.FormatsData[toID(species.battleOnly)].natDexTier || 'Illegal';
|
||||
species.tier = this.dex.data.PokedexTiers[toID(species.battleOnly)].tier || 'Illegal';
|
||||
species.doublesTier = this.dex.data.PokedexTiers[toID(species.battleOnly)].doublesTier || 'Illegal';
|
||||
species.natDexTier = this.dex.data.PokedexTiers[toID(species.battleOnly)].natDexTier || 'Illegal';
|
||||
} else {
|
||||
const baseFormatsData = this.dex.data.FormatsData[toID(species.baseSpecies)];
|
||||
const baseFormatsData = this.dex.data.PokedexTiers[toID(species.baseSpecies)];
|
||||
if (!baseFormatsData) {
|
||||
throw new Error(`${species.baseSpecies} has no formats-data entry`);
|
||||
throw new Error(`${species.baseSpecies} has no pokedex-tiers entry`);
|
||||
}
|
||||
species.tier = baseFormatsData.tier || 'Illegal';
|
||||
species.doublesTier = baseFormatsData.doublesTier || 'Illegal';
|
||||
|
|
|
|||
12
sim/dex.ts
12
sim/dex.ts
|
|
@ -45,18 +45,18 @@ const MODS_DIR = path.resolve(DATA_DIR, './mods');
|
|||
const dexes: {[mod: string]: ModdedDex} = Object.create(null);
|
||||
|
||||
type DataType =
|
||||
'Abilities' | 'Rulesets' | 'FormatsData' | 'Items' | 'Learnsets' | 'Moves' |
|
||||
'Abilities' | 'Rulesets' | 'PokedexTiers' | 'Items' | 'Learnsets' | 'Moves' |
|
||||
'Natures' | 'Pokedex' | 'Scripts' | 'Conditions' | 'TypeChart' | 'PokemonGoData';
|
||||
const DATA_TYPES: (DataType | 'Aliases')[] = [
|
||||
'Abilities', 'Rulesets', 'FormatsData', 'Items', 'Learnsets', 'Moves',
|
||||
'Abilities', 'Rulesets', 'PokedexTiers', 'Items', 'Learnsets', 'Moves',
|
||||
'Natures', 'Pokedex', 'Scripts', 'Conditions', 'TypeChart', 'PokemonGoData',
|
||||
];
|
||||
|
||||
const DATA_FILES = {
|
||||
Abilities: 'abilities',
|
||||
Aliases: 'aliases',
|
||||
Rulesets: 'rulesets',
|
||||
FormatsData: 'formats-data',
|
||||
Rulesets: 'format-rules',
|
||||
PokedexTiers: 'pokedex-tiers',
|
||||
Items: 'items',
|
||||
Learnsets: 'learnsets',
|
||||
Moves: 'moves',
|
||||
|
|
@ -81,7 +81,7 @@ interface DexTableData {
|
|||
Moves: DexTable<import('./dex-moves').MoveData>;
|
||||
Natures: DexTable<import('./dex-data').NatureData>;
|
||||
Pokedex: DexTable<import('./dex-species').SpeciesData>;
|
||||
FormatsData: DexTable<import('./dex-species').SpeciesFormatsData>;
|
||||
PokedexTiers: DexTable<import('./dex-species').TiersData>;
|
||||
PokemonGoData: DexTable<import('./dex-species').PokemonGoData>;
|
||||
Scripts: DexTable<AnyObject>;
|
||||
Conditions: DexTable<import('./dex-conditions').ConditionData>;
|
||||
|
|
@ -526,7 +526,7 @@ export class ModdedDex {
|
|||
// If it doesn't exist it's inherited from the parent data
|
||||
if (dataType === 'Pokedex') {
|
||||
// Pokedex entries can be modified too many different ways
|
||||
// e.g. inheriting different formats-data/learnsets
|
||||
// e.g. inheriting different pokedex-tiers/learnsets
|
||||
childTypedData[entryId] = this.deepClone(parentTypedData[entryId]);
|
||||
} else {
|
||||
childTypedData[entryId] = parentTypedData[entryId];
|
||||
|
|
|
|||
|
|
@ -110,8 +110,12 @@ interface EffectData {
|
|||
type ModdedEffectData = EffectData | Partial<EffectData> & {inherit: true};
|
||||
|
||||
type EffectType =
|
||||
'Condition' | 'Pokemon' | 'Move' | 'Item' | 'Ability' | 'Format' |
|
||||
'Nature' | 'Ruleset' | 'Weather' | 'Status' | 'Terastal' | 'Rule' | 'ValidatorRule';
|
||||
// effects with their own class
|
||||
'Pokemon' | 'Move' | 'Item' | 'Ability' | 'Nature' |
|
||||
// Conditions
|
||||
'Condition' | 'Weather' | 'Status' |
|
||||
// Formats
|
||||
'Format' | 'Rule' | 'ValidatorRule';
|
||||
|
||||
interface BasicEffect extends EffectData {
|
||||
id: ID;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user