mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
In most other similar systems, like TeamValidator, we use `thing.dex` instead of having it extend `ModdedDex`. Battle has always extended `ModdedDex`, though. This changes Battle to match the others. This should fix an issue with `Battle.data` not being cached. This also frees up Battle to extend ObjectReadWriteStream<string> in a future update.
25 lines
764 B
JavaScript
25 lines
764 B
JavaScript
'use strict';
|
|
|
|
/**@type {{[k: string]: ModdedFormatsData}} */
|
|
let BattleFormats = {
|
|
validatestats: {
|
|
inherit: true,
|
|
onValidateSet(set) {
|
|
let template = this.dex.getTemplate(set.species);
|
|
let item = this.dex.getItem(set.item);
|
|
if (item && item.id === 'griseousorb' && template.num !== 487) {
|
|
return ['Griseous Orb can only be held by Giratina in Generation 4.'];
|
|
}
|
|
if (template.num === 493 && set.evs && (set.moves.includes('roaroftime') || set.moves.includes('shadowforce') || set.moves.includes('spacialrend'))) {
|
|
for (let stat in set.evs) {
|
|
// @ts-ignore
|
|
if (set.evs[stat] > 100) return ["Event Arceus may not have more than 100 of any EVs in Generation 4."];
|
|
}
|
|
}
|
|
},
|
|
},
|
|
};
|
|
|
|
exports.BattleFormats = BattleFormats;
|
|
|