Skip to content

Commit

Permalink
Clarify species limit and requiredItem errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarel committed May 16, 2020
1 parent 88365ab commit 381bd75
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
20 changes: 12 additions & 8 deletions data/rulesets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,28 @@ export const BattleFormats: {[k: string]: FormatsData} = {
for (const set of team) {
if (set.species === 'Kyurem-White' || set.species === 'Kyurem-Black') {
if (kyuremCount > 0) {
return ['You cannot have more than one Kyurem-Black/Kyurem-White.'];
return [
`You cannot have more than one Kyurem-Black/Kyurem-White.`,
`(It's untradeable and you can only make one with the DNA Splicers.)`,
];
}
kyuremCount++;
}
if (set.species === 'Keldeo-Resolute') {
if (!set.moves.includes('secretsword')) {
return ['Keldeo-Resolute needs to have the move Secret Sword.'];
}
}
if (set.species === 'Necrozma-Dusk-Mane') {
if (necrozmaDMCount > 0) {
return ['You cannot have more than one Necrozma-Dusk-Mane.'];
return [
`You cannot have more than one Necrozma-Dusk-Mane`,
`(It's untradeable and you can only make one with the N-Solarizer.)`,
];
}
necrozmaDMCount++;
}
if (set.species === 'Necrozma-Dawn-Wings') {
if (necrozmaDWCount > 0) {
return ['You cannot have more than one Necrozma-Dawn-Wings.'];
return [
`You cannot have more than one Necrozma-Dawn-Wings`,
`(It's untradeable and you can only make one with the N-Lunarizer.)`,
];
}
necrozmaDWCount++;
}
Expand Down
22 changes: 18 additions & 4 deletions sim/team-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1132,8 +1132,8 @@ export class TeamValidator {
const species = dex.getSpecies(set.species);

if (species.name === 'Necrozma-Ultra') {
const whichMoves = (set.moves.includes('Sunsteel Strike') ? 1 : 0) +
(set.moves.includes('Moongeist Beam') ? 2 : 0);
const whichMoves = (set.moves.includes('sunsteelstrike') ? 1 : 0) +
(set.moves.includes('moongeistbeam') ? 2 : 0);
if (item.name !== 'Ultranecrozium Z') {
// Necrozma-Ultra transforms from one of two formes, and neither one is the base forme
problems.push(`Necrozma-Ultra must start the battle holding Ultranecrozium Z.`);
Expand Down Expand Up @@ -1178,13 +1178,27 @@ export class TeamValidator {
if (dex.gen >= 8 && (species.baseSpecies === 'Arceus' || species.baseSpecies === 'Silvally')) {
// Arceus/Silvally formes in gen 8 only require the item with Multitype/RKS System
if (set.ability === species.abilities[0]) {
problems.push(`${name} needs to hold ${species.requiredItems.join(' or ')}.`);
problems.push(
`${name} needs to hold ${species.requiredItems.join(' or ')}.`,
`(It will revert to its Normal forme if you remove the item or give it a different item.)`
);
}
} else {
// Memory/Drive/Griseous Orb/Plate/Z-Crystal - Forme mismatch
problems.push(`${name} needs to hold ${species.requiredItems.join(' or ')}.`);
const baseSpecies = Dex.getSpecies(species.changesFrom);
problems.push(
`${name} needs to hold ${species.requiredItems.join(' or ')} to be in its ${species.forme} forme.`,
`(It will revert to its ${baseSpecies.baseForme} forme if you remove the item or give it a different item.)`
);
}
}
if (species.requiredMove && !set.moves.includes(toID(species.requiredMove))) {
const baseSpecies = Dex.getSpecies(species.changesFrom);
problems.push(
`${name} needs to know the move ${species.requiredMove} to be in its ${species.forme} forme.`,
`(It will revert to its ${baseSpecies.baseForme} forme if it forgets the move.)`
);
}

// Mismatches between the set forme (if not base) and the item signature forme will have been rejected already.
// It only remains to assign the right forme to a set with the base species (Arceus/Genesect/Giratina/Silvally).
Expand Down

0 comments on commit 381bd75

Please sign in to comment.