import type {Skills} from "./Skill.ts";

export interface AttributeValue {
  id: string;
  value: number;
}

export interface PermanentAttribute {
  lost: number;
  redeemed?: number;
}

export interface Attributes {
  values: AttributeValue[];
  attributeAdjustmentSelected: string;
  ae: number;
  kp: number;
  lp: number;
  permanentAE: PermanentAttribute;
  permanentKP: PermanentAttribute;
  permanentLP: {
    lost: number;
  };
}

export interface PersonalDetails {
  family: string;
  placeofbirth: string;
  age: string;
  haircolor: number;
  eyecolor: number;
  size: string;
  weight: string;
  socialstatus: number;
  cultureAreaKnowledge: string;
}

export interface AdventurePoints {
  total: number;
}

export interface ActivatableItem {
  sid?: number | string;
  sid2?: number;
  tier?: number;
}

export interface Activatables {
  [key: string]: ActivatableItem[];
}

export interface CombatTechniques {
  [key: string]: number;
}

export interface Spells {
  [key: string]: number;
}

export interface Purse {
  d: string; // Ducat
  s: string; // Silver
  h: string; // Heller
  k: string; // Kreuzer
}

export interface Belongings {
  items: Record<string, unknown>;
  armorZones: Record<string, unknown>;
  purse: Purse;
}

export interface Rules {
  higherParadeValues: number;
  attributeValueLimit: boolean;
  enableAllRuleBooks: boolean;
  enabledRuleBooks: string[];
  enableLanguageSpecializations: boolean;
}

export interface CharacterData {
  clientVersion: string;
  dateCreated: string;
  dateModified: string;
  id: string;
  phase: number;
  locale: string;
  name: string;
  ap: AdventurePoints;
  el: string; // Experience Level
  r: string;  // Race
  c: string;  // Culture
  p: string;  // Profession
  sex: string;
  pers: PersonalDetails;
  attr: Attributes;
  activatable: Activatables;
  talents: Skills;
  ct: CombatTechniques;
  spells: Spells;
  cantrips: string[];
  liturgies: Record<string, unknown>;
  blessings: string[];
  belongings: Belongings;
  rules: Rules;
  pets: Record<string, unknown>;
}
