mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
This commit is contained in:
parent
9c52db4321
commit
f20c0403bc
|
|
@ -1525,6 +1525,34 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = {
|
|||
desc: "Forces Pokémon to have a Tera Type matching one of their original types.",
|
||||
// implemented in sametypeclause
|
||||
},
|
||||
samecolorclause: {
|
||||
effectType: 'ValidatorRule',
|
||||
name: 'Same Color Clause',
|
||||
desc: "Forces all Pokémon on a team to share a color",
|
||||
onBegin() {
|
||||
this.add('rule', 'Same Color Clause: Pokémon in a team must be the same color');
|
||||
},
|
||||
onValidateTeam(team) {
|
||||
let color = "";
|
||||
for (const [i, set] of team.entries()) {
|
||||
let species = this.dex.species.get(set.species);
|
||||
if (!species.color) return [`Invalid Pok\u00e9mon ${set.name || set.species}`];
|
||||
if (color && species.color !== color) {
|
||||
return [`All Pok\u00e9mon must share a color.`];
|
||||
}
|
||||
color = species.color;
|
||||
const item = this.dex.items.get(set.item);
|
||||
if (item.megaStone && species.baseSpecies === item.megaEvolves) {
|
||||
species = this.dex.species.get(item.megaStone);
|
||||
color = species.color;
|
||||
}
|
||||
if (item.id === "ultranecroziumz" && species.baseSpecies === "Necrozma") {
|
||||
species = this.dex.species.get("Necrozma-Ultra");
|
||||
color = species.color;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
megarayquazaclause: {
|
||||
effectType: 'Rule',
|
||||
name: 'Mega Rayquaza Clause',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user