From 7cefd6762621bc8d91e72952e5f90d74525f09a5 Mon Sep 17 00:00:00 2001 From: Ivo Julca Date: Tue, 20 Oct 2015 16:49:09 -0500 Subject: [PATCH] Reject illegal non-shiny sets rather than fixing Closes #2197 --- data/rulesets.js | 7 ++++--- team-validator.js | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/data/rulesets.js b/data/rulesets.js index 10fc690bf606..e13038325764 100644 --- a/data/rulesets.js +++ b/data/rulesets.js @@ -160,6 +160,10 @@ exports.BattleFormats = { if (perfectIVs < 3) problems.push((set.name || set.species) + " has less than three perfect IVs."); } + if (set.shiny && template.unobtainableShiny) { + problems.push((set.name || set.species) + " may not be shiny."); + } + // limit one of each move var moves = []; if (set.moves) { @@ -258,9 +262,6 @@ exports.BattleFormats = { set.species = 'Aegislash'; } - if (template.unobtainableShiny) { - set.shiny = false; - } return problems; } }, diff --git a/team-validator.js b/team-validator.js index 9ae7ddfae00c..0c72a013b633 100644 --- a/team-validator.js +++ b/team-validator.js @@ -463,8 +463,8 @@ Validator = (function () { if (eventData.nature && eventData.nature !== set.nature) { problems.push(name + " must have a " + eventData.nature + " nature because it has a move only available from a specific event."); } - if (eventData.shiny) { - set.shiny = true; + if (eventData.shiny && !set.shiny) { + problems.push(name + " must be shiny because it has a move only available from a specific event."); } if (eventData.generation < 5) eventData.isHidden = false; if (eventData.isHidden !== undefined && eventData.isHidden !== isHidden) {