export interface NuzlockeRules {
  // Core rules
  firstEncounterOnly: boolean
  permadeath: boolean
  nicknameRequired: boolean
  duplicatesClause: boolean
  shinyClause: boolean
  pinwheelClause: boolean

  // Difficulty modifiers
  hardcoreMode: boolean
  levelCaps: boolean
  setModeOnly: boolean

  // Completion
  postGameCompletion: boolean
}

export const DEFAULT_RULES: NuzlockeRules = {
  // Core rules - standard Nuzlocke
  firstEncounterOnly: true,
  permadeath: true,
  nicknameRequired: true,
  duplicatesClause: true,
  shinyClause: true,
  pinwheelClause: true,

  // Difficulty modifiers - off by default
  hardcoreMode: false,
  levelCaps: false,
  setModeOnly: false,

  // Completion
  postGameCompletion: false,
}

export interface RuleDefinition {
  key: keyof NuzlockeRules
  name: string
  description: string
  category: 'core' | 'difficulty' | 'completion'
}

export const RULE_DEFINITIONS: RuleDefinition[] = [
  // Core rules
  {
    key: 'firstEncounterOnly',
    name: 'First Encounter Only',
    description:
      'You may only catch the first Pokémon encountered in each area. If you fail to catch it, you get nothing from that area.',
    category: 'core',
  },
  {
    key: 'permadeath',
    name: 'Permadeath',
    description:
      'If a Pokémon faints, it is considered dead and must be released or permanently boxed.',
    category: 'core',
  },
  {
    key: 'nicknameRequired',
    name: 'Nickname Required',
    description:
      'All caught Pokémon must be given a nickname to form a stronger bond.',
    category: 'core',
  },
  {
    key: 'duplicatesClause',
    name: 'Duplicates Clause',
    description:
      'If your first encounter is a species you already own (alive or dead), you may skip it and try again until you find something new.',
    category: 'core',
  },
  {
    key: 'shinyClause',
    name: 'Shiny Clause',
    description:
      'Shiny Pokémon may always be caught, regardless of whether they are your first encounter.',
    category: 'core',
  },
  {
    key: 'pinwheelClause',
    name: 'Pinwheel Clause',
    description:
      'Sub-zones within a location group each get their own encounter instead of sharing one.',
    category: 'core',
  },

  // Difficulty modifiers
  {
    key: 'hardcoreMode',
    name: 'Hardcore Mode',
    description:
      'No items may be used during battle. Held items are still allowed.',
    category: 'difficulty',
  },
  {
    key: 'levelCaps',
    name: 'Level Caps',
    description:
      "Your Pokémon cannot exceed the level of the next Gym Leader's highest-level Pokémon before challenging them.",
    category: 'difficulty',
  },
  {
    key: 'setModeOnly',
    name: 'Set Mode Only',
    description:
      'The game must be played in "Set" battle style, meaning you cannot switch Pokémon after knocking out an opponent.',
    category: 'difficulty',
  },

  // Completion
  {
    key: 'postGameCompletion',
    name: 'Post-Game Completion',
    description:
      'The run continues into post-game content instead of ending after the Champion is defeated.',
    category: 'completion',
  },
]
