export interface Campaign {
  id: number;
  name: string;
  created_by: string;
  created_at: string;
}

export interface Stat {
  stat_name: string;
  value: number;
}

export interface Gear {
  id: number;
  character_id: number;
  name: string;
  type: "weapon" | "armor" | "gear" | "spell";
  slot_count: number;
  properties: Record<string, unknown>;
  effects: Record<string, unknown>;
  game_item_id: number | null;
}

export interface Talent {
  id: number;
  character_id: number;
  name: string;
  description: string;
  effect: Record<string, unknown>;
  game_talent_id: number | null;
}

export interface Character {
  id: number;
  campaign_id: number;
  created_by: string;
  name: string;
  class: string;
  ancestry: string;
  level: number;
  xp: number;
  hp_current: number;
  hp_max: number;
  ac: number;
  alignment: string;
  title: string;
  notes: string;
  background: string;
  deity: string;
  languages: string;
  gp: number;
  sp: number;
  cp: number;
  gear_slots_max: number;
  overrides: Record<string, unknown>;
  color: string;
  luck_token: number;
  torch_lit_at: string | null;
  stats: Stat[];
  gear: Gear[];
  talents: Talent[];
}

export interface GameItem {
  id: number;
  name: string;
  type: "weapon" | "armor" | "gear";
  slot_count: number;
  effects: Record<string, unknown>;
  properties: Record<string, unknown>;
}

export interface GameTalent {
  id: number;
  name: string;
  source: string;
  description: string;
  effect: Record<string, unknown>;
}

export interface AttackLine {
  name: string;
  modifier: number;
  modifierStr: string;
  damage: string;
  tags: string[];
  isTalent: boolean;
  description?: string;
}

export interface RollResult {
  id: number;
  campaign_id: number;
  character_id: number | null;
  character_name: string;
  character_color: string;
  type: "attack" | "ability-check" | "custom";
  label: string;
  dice_expression: string;
  rolls: number[];
  modifier: number;
  total: number;
  advantage: boolean;
  disadvantage: boolean;
  nat20: boolean;
  created_at: string;
}
