import type { CombinationDef, ItemDef } from "@psx/shared";

/** Item catalogue for the Ashgrove Precinct Level 1 campaign. */
export const ITEM_DEFS: ItemDef[] = [
  {
    id: "crank-handle",
    name: "Crank Handle",
    description: "A heavy iron handle, snapped off at the base. The square socket looks intact.",
    category: "key",
    isKeyItem: true,
    iconColor: 0x8a7f6d,
  },
  {
    id: "broken-shaft",
    name: "Broken Shaft",
    description: "The other half of something. Threaded at one end.",
    category: "key",
    isKeyItem: true,
    iconColor: 0x6d6a63,
  },
  {
    id: "repaired-crank",
    name: "Repaired Crank",
    description: "Handle and shaft, reunited. It should open the records shutter.",
    category: "key",
    isKeyItem: true,
    iconColor: 0xb0a284,
  },
  {
    id: "green-herb",
    name: "Green Herb",
    description: "Bitter, fibrous, and somehow still the best medicine available.",
    category: "consumable",
    stackable: true,
    maxStack: 6,
    iconColor: 0x4a7f42,
  },
  {
    id: "handgun-rounds",
    name: "Handgun Rounds",
    description: "Nine millimetre. Not nearly enough of them.",
    category: "ammo",
    stackable: true,
    maxStack: 30,
    iconColor: 0xc9a227,
  },
  {
    id: "torn-photograph",
    name: "Torn Photograph",
    description:
      "Two people on the precinct steps. One of the faces has been scratched away.",
    category: "document",
    iconColor: 0xd8cdb8,
  },
  {
    id: "brass-key",
    name: "Brass Key",
    description: "Warm to the touch. The bow is stamped with a tiny kettle — break room.",
    category: "key",
    isKeyItem: true,
    iconColor: 0xc9a227,
  },
  {
    id: "cellar-key",
    name: "Vault Key",
    description: "Heavy iron. The bit is caked with red clay from the evidence stairs.",
    category: "key",
    isKeyItem: true,
    iconColor: 0x8a8070,
  },
  {
    id: "witness-statement",
    name: "Witness Statement",
    description:
      "Nora Voss, unsigned. 'Kane left for coffee. He returned smelling of the vault.' Blank signature line.",
    category: "document",
    iconColor: 0xf0e8d8,
  },
  {
    id: "badge-case",
    name: "Badge Case",
    description:
      "Sgt. Marrow's case. The badge is missing; the foam insert holds a scrap of burgundy silk — the same shade as Kane's tie.",
    category: "document",
    isKeyItem: true,
    iconColor: 0x2a2a30,
  },
];

/** GDD §6.3 combination recipes. */
export const COMBINATIONS: CombinationDef[] = [
  {
    inputs: ["crank-handle", "broken-shaft"],
    output: { itemId: "repaired-crank", quantity: 1 },
    consumes: [true, true],
  },
];

export const ITEM_CATALOGUE: ReadonlyMap<string, ItemDef> = new Map(
  ITEM_DEFS.map((def) => [def.id, def]),
);
