export const BESTIARY_VERSION = 1;

export const ENTRIES = [
  // Butterfly
  {
    id: "dungeon:butterfly",
    nameKey: "entity.dungeon:butterfly.name",
    lockedIcon: "textures/ui/bestiary/butterfly/butterfly_locked",
    icon: "textures/ui/bestiary/butterfly/butterfly_blue",

    progression: {
      full: "variants",      // "seen" | "kill" | "variants"
      advanced: "variants"       // "full" | "kill" | "variants"
    },
    descriptions: {
      basic: "bestiary.dungeon.butterfly.desc_basic",
      full: "bestiary.dungeon.butterfly.desc_full",
      advanced: "bestiary.dungeon.butterfly.desc_advanced"
    },

    bestiaryInfo: {
      effectsNoteKey: "bestiary.dungeon.butterfly.effects_note",
      playerEffects: {
        radiusBlocks: 8,
        byVariant: [
          { variantId: "blue", effects: [{ effectKey: "effect.dungeon.water_breathing", amp: 0 }] },
          { variantId: "purple", effects: [{ effectKey: "effect.dungeon.resistance", amp: 0 }] },
          { variantId: "pink", effects: [{ effectKey: "effect.dungeon.regeneration", amp: 0 }] },
          { variantId: "dark_green", effects: [{ effectKey: "effect.dungeon.jump_boost", amp: 0 }] },
          { variantId: "orange", effects: [{ effectKey: "effect.dungeon.fire_resistance", amp: 0 }] },
          { variantId: "light_blue", effects: [{ effectKey: "effect.dungeon.speed", amp: 0 }] },
          { variantId: "light_green", effects: [{ effectKey: "effect.dungeon.saturation", amp: 0 }] },
          { variantId: "yellow", effects: [{ effectKey: "effect.dungeon.haste", amp: 0 }] },
          { variantId: "golden", effects: [{ effectKey: "effect.dungeon.absorption", amp: 0 }] },
        ]
      }
    },

    typeId: "dungeon:butterfly",

    variants: [
      { id: "blue", nameKey: "bestiary.dungeon.butterfly.variant.blue", icon: "textures/ui/bestiary/butterfly/butterfly_blue", detect: { mcVariant: 0 } },
      { id: "purple", nameKey: "bestiary.dungeon.butterfly.variant.purple", icon: "textures/ui/bestiary/butterfly/butterfly_purple", detect: { mcVariant: 1 } },
      { id: "pink", nameKey: "bestiary.dungeon.butterfly.variant.pink", icon: "textures/ui/bestiary/butterfly/butterfly_pink", detect: { mcVariant: 2 } },
      { id: "dark_green", nameKey: "bestiary.dungeon.butterfly.variant.dark_green", icon: "textures/ui/bestiary/butterfly/butterfly_dark_green", detect: { mcVariant: 3 } },
      { id: "orange", nameKey: "bestiary.dungeon.butterfly.variant.orange", icon: "textures/ui/bestiary/butterfly/butterfly_orange", detect: { mcVariant: 4 } },
      { id: "light_blue", nameKey: "bestiary.dungeon.butterfly.variant.light_blue", icon: "textures/ui/bestiary/butterfly/butterfly_light_blue", detect: { mcVariant: 5 } },
      { id: "light_green", nameKey: "bestiary.dungeon.butterfly.variant.light_green", icon: "textures/ui/bestiary/butterfly/butterfly_light_green", detect: { mcVariant: 6 } },
      { id: "yellow", nameKey: "bestiary.dungeon.butterfly.variant.yellow", icon: "textures/ui/bestiary/butterfly/butterfly_yellow", detect: { mcVariant: 7 } },
      { id: "golden", nameKey: "bestiary.dungeon.butterfly.variant.golden", icon: "textures/ui/bestiary/butterfly/butterfly_golden", detect: { mcVariant: 8 } },
      { id: "tamed", nameKey: "bestiary.dungeon.butterfly.variant.tamed", icon: "textures/ui/bestiary/butterfly/butterfly_tamed", detect: { mcVariant: 9 } },
    ],

    unlock: { seen: true, killed: false },
    tags: ["flying", "diurnal", "insect"]
  },
  // Dragonfly
  {

    id: "dungeon:dragonfly",
    nameKey: "entity.dungeon:dragonfly.name",
    lockedIcon: "textures/ui/bestiary/dragonfly/dragonfly_locked",
    icon: "textures/ui/bestiary/dragonfly/dragonfly0",

    progression: {
      full: "variants",      // "seen" | "kill" | "variants"
    },

    descriptions: {
      basic: "bestiary.dungeon.dragonfly.desc_basic",
      full: "bestiary.dungeon.dragonfly.desc_full"
    },

    bestiaryInfo: {
      effectsNoteKey: "bestiary.dungeon.dragonfly.effects_note",
      playerEffects: {
        radiusBlocks: 8.2,
        byVariant: [
          { variantId: "light_green", effects: [{ effectKey: "effect.dungeon.saturation", amp: 0 }] },
          { variantId: "pink", effects: [{ effectKey: "effect.dungeon.speed", amp: 0 }] },
          { variantId: "green", effects: [{ effectKey: "effect.dungeon.strength", amp: 0 }] },
          { variantId: "dark_green", effects: [{ effectKey: "effect.dungeon.absorption", amp: 0 }] },
          { variantId: "blue", effects: [{ effectKey: "effect.dungeon.regeneration", amp: 0 }] },
          { variantId: "orange", effects: [{ effectKey: "effect.dungeon.resistance", amp: 0 }] }
        ]
      }
    },

    typeId: "dungeon:dragonfly",

    variants: [
      { id: "light_green", nameKey: "bestiary.dungeon.dragonfly.variant.light_green", icon: "textures/ui/bestiary/dragonfly/dragonfly0", detect: { mcVariant: 0 } },
      { id: "pink", nameKey: "bestiary.dungeon.dragonfly.variant.pink", icon: "textures/ui/bestiary/dragonfly/dragonfly1", detect: { mcVariant: 1 } },
      { id: "green", nameKey: "bestiary.dungeon.dragonfly.variant.green", icon: "textures/ui/bestiary/dragonfly/dragonfly2", detect: { mcVariant: 2 } },
      { id: "dark_green", nameKey: "bestiary.dungeon.dragonfly.variant.dark_green", icon: "textures/ui/bestiary/dragonfly/dragonfly3", detect: { mcVariant: 3 } },
      { id: "blue", nameKey: "bestiary.dungeon.dragonfly.variant.blue", icon: "textures/ui/bestiary/dragonfly/dragonfly4", detect: { mcVariant: 4 } },
      { id: "orange", nameKey: "bestiary.dungeon.dragonfly.variant.orange", icon: "textures/ui/bestiary/dragonfly/dragonfly5", detect: { mcVariant: 5 } }
    ],

    unlock: { seen: true, killed: false },
    tags: ["flying", "diurnal", "insect"]
  }
];

// Índice rápido por typeId
export const ENTRY_BY_ID = new Map(ENTRIES.map(e => [e.id, e]));