Add type restriction rule (monolocke)
Adds allowedTypes: string[] to NuzlockeRules. When set, the encounter selector hides non-matching Pokemon and the routes endpoint filters out routes with no matching encounters, so only eligible locations appear. Type picker UI in RulesConfiguration; active restriction shown in RuleBadges. Backend accepts allowed_types query param and joins through RouteEncounter.pokemon to filter by type. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,8 +16,14 @@ export interface NuzlockeRules {
|
||||
egglocke: boolean
|
||||
wonderlocke: boolean
|
||||
randomizer: boolean
|
||||
|
||||
// Type restriction (monolocke and variants)
|
||||
allowedTypes: string[]
|
||||
}
|
||||
|
||||
/** Keys of NuzlockeRules that are boolean toggles (excludes array fields) */
|
||||
type BooleanRuleKeys = Exclude<keyof NuzlockeRules, 'allowedTypes'>
|
||||
|
||||
export const DEFAULT_RULES: NuzlockeRules = {
|
||||
// Core rules
|
||||
duplicatesClause: true,
|
||||
@@ -36,10 +42,13 @@ export const DEFAULT_RULES: NuzlockeRules = {
|
||||
egglocke: false,
|
||||
wonderlocke: false,
|
||||
randomizer: false,
|
||||
|
||||
// Type restriction - no restriction by default
|
||||
allowedTypes: [],
|
||||
}
|
||||
|
||||
export interface RuleDefinition {
|
||||
key: keyof NuzlockeRules
|
||||
key: BooleanRuleKeys
|
||||
name: string
|
||||
description: string
|
||||
category: 'core' | 'playstyle' | 'variant'
|
||||
|
||||
Reference in New Issue
Block a user