mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-08-28 03:56:35 -05:00
Make "All Pokemon" rules more convenient (#10932)
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run
* Make "All Pokemon" rules more convenient Previously, "+All Pokemon" did nothing except override "-All Pokemon", which switched from a default-allow to default-deny system. They still do that, but they now also override all previous pokemon bans/unbans. This makes it easier to replace a banlist/whitelist from an inherited ruleset without needing to reverse every previous ban/unban. This also adds an error if you use `+All Pokemon` in a ruleset where it doesn't do anything. Fixes #10772
This commit is contained in:
@@ -47,8 +47,11 @@ assert.atMost = function (value, threshold, message) {
|
||||
});
|
||||
};
|
||||
|
||||
assert.legalTeam = function (team, format, message) {
|
||||
const actual = require('../dist/sim/team-validator').TeamValidator.get(format).validateTeam(team);
|
||||
assert.legalTeam = function (team, formatName, message) {
|
||||
require('../dist/sim/dex').Dex.formats.validate(formatName);
|
||||
const format = require('../dist/sim/team-validator').TeamValidator.get(formatName);
|
||||
// console.log(`${formatName}: ${[...format.ruleTable.keys()].join(', ')}`);
|
||||
const actual = format.validateTeam(team);
|
||||
if (actual === null) return;
|
||||
throw new AssertionError({
|
||||
message: message || "Expected team to be valid, but it was rejected because:\n" + actual.join("\n"),
|
||||
|
||||
Reference in New Issue
Block a user