Add Same Color Clause
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run

This commit is contained in:
Kris Johnson 2025-09-13 19:27:04 -06:00 committed by GitHub
parent 9c52db4321
commit f20c0403bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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',