import { GameConfig } from "../../types";

export const odinCardsConfig: GameConfig = {
  imagePath: "/games-assets/odin-logo.webp",
  bannerPath: "/games-assets/odin-banner.webp",
  rulesUrl: "/games-assets/odin-rules.pdf",
  id: "odin_cards",
  name: "Odin",
  minPlayers: 2,
  maxPlayers: 6,
  scoreType: "negative",
  targetScoreCondition: "reaches",
  description:
    "Videz votre main le plus vite possible. Un point par carte restante. La partie s'arrête quand le score cible est atteint, le plus petit score gagne.",
  icon: "Sword",
  colors: {
    primary: "#c2410c", // Orange intense/feu tiré de la boite Odin
  },
  options: [
    {
      id: "target_score",
      label: "Score de fin de partie",
      type: "select",
      defaultValue: "15",
      options: [
        { label: "Partie courte (15 pts)", value: "15" },
        { label: "Partie classique (20 pts)", value: "20" },
        { label: "Personnalisé", value: "custom" },
      ],
    },
    {
      id: "custom_target_score",
      label: "Score personnalisé",
      type: "number",
      defaultValue: 25,
    },
  ],
  getTargetScore: (options) => {
    if (options?.target_score === "custom") {
      return parseInt(options?.custom_target_score || "25", 10);
    }
    return parseInt(options?.target_score || "15", 10);
  },
};
