import type { LibrarySlug } from "./libraries";
import type { VistaId } from "./world-input";

export type Vec3 = [number, number, number];

export type Vista = {
  id: VistaId;
  name: string;
  kicker: string;
  hint: string;
  viewpoint: Vec3;
  target: Vec3;
  planeW: number;
  planeH: number;
  depth: number;
  seed: number;
};

export const VISTAS: Vista[] = [
  {
    id: "strata",
    name: "STRATA",
    kicker: "The name in the stones",
    hint: "Stand in the gate and look down the ridge.",
    viewpoint: [0, 1.6, 14],
    target: [0, 3.1, -10],
    planeW: 16.5,
    planeH: 5.2,
    depth: 4.5,
    seed: 11,
  },
  {
    id: "watcher",
    name: "The Watcher",
    kicker: "A face in the east wall",
    hint: "Stand on the east mark. Look toward the ridge.",
    viewpoint: [22, 1.6, 8],
    target: [38, 3.8, 8],
    planeW: 9,
    planeH: 12,
    depth: 6.5,
    seed: 29,
  },
  {
    id: "tern",
    name: "The Tern",
    kicker: "A bird in the west scatter",
    hint: "Stand on the west mark. Look toward the dark stone.",
    viewpoint: [-22, 1.6, 8],
    target: [-38, 3.4, 8],
    planeW: 12,
    planeH: 7,
    depth: 6.5,
    seed: 47,
  },
];

export const LIBRARY_PLACEMENTS: { slug: LibrarySlug; position: Vec3 }[] = [
  { slug: "2d-animation", position: [-15, 0, 11] },
  { slug: "3d-animation", position: [-17, 0, 16.5] },
  { slug: "concepting", position: [-15, 0, 21] },
  { slug: "life-drawing", position: [-13.5, 0, 6] },
  { slug: "traditional-art", position: [13.5, 0, 6] },
  { slug: "diy", position: [15, 0, 11] },
  { slug: "level-design", position: [17, 0, 16.5] },
  { slug: "character-design", position: [15, 0, 21] },
];

export const STORE_POSITION: Vec3 = [0, 0, 24];

export const LENTICULARS: {
  id: string;
  position: Vec3;
  mapA: string;
  mapB: string;
  rotation: number;
}[] = [
  {
    id: "stele-a",
    position: [-11, 1.8, 1.5],
    mapA: "/art/anim2d-traveler.jpg",
    mapB: "/art/concept-city.jpg",
    rotation: 0.5,
  },
  {
    id: "stele-b",
    position: [11, 1.8, 1.5],
    mapA: "/art/character-ione.jpg",
    mapB: "/art/concept-cistern.jpg",
    rotation: -0.5,
  },
  {
    id: "stele-c",
    position: [0, 1.8, 30],
    mapA: "/art/anim2d-foxes.jpg",
    mapB: "/art/anim3d-colossus.jpg",
    rotation: Math.PI,
  },
];

export const COLLIDERS: { x: number; z: number; r: number }[] = [
  { x: -1.55, z: 14, r: 0.55 },
  { x: 1.55, z: 14, r: 0.55 },
  { x: STORE_POSITION[0], z: STORE_POSITION[2], r: 1.6 },
  ...LIBRARY_PLACEMENTS.map((p) => ({ x: p.position[0], z: p.position[2], r: 1.15 })),
  ...LENTICULARS.map((s) => ({ x: s.position[0], z: s.position[2], r: 1.2 })),
  { x: -28, z: -8, r: 4.5 },
  { x: 30, z: -12, r: 5 },
  { x: -22, z: 32, r: 4.2 },
  { x: 24, z: 34, r: 4.8 },
  { x: 0, z: -38, r: 6 },
  { x: 42, z: 18, r: 5 },
  { x: -42, z: 18, r: 5 },
];

export const MESAS: { position: Vec3; scale: Vec3; color: string }[] = [
  { position: [-28, 1.2, -8], scale: [5.5, 3.4, 4.2], color: "#9a7a58" },
  { position: [30, 1.6, -12], scale: [6.2, 4.2, 5], color: "#8c6d4e" },
  { position: [-22, 1.1, 32], scale: [5, 3.2, 4.4], color: "#7a6756" },
  { position: [24, 1.4, 34], scale: [5.8, 3.8, 4.6], color: "#6f5a48" },
  { position: [0, 2.2, -38], scale: [9, 5.5, 6], color: "#a18462" },
  { position: [42, 1.8, 18], scale: [6, 4.4, 5.2], color: "#5c534a" },
  { position: [-42, 1.7, 18], scale: [6, 4.2, 5], color: "#4e4a45" },
];
