import { computeTalentModifiers, type TalentAllocation, type TalentModifiers } from './claudeCraftTalents'
import type { PlayerClass } from './claudeCraftTypes'

export type ActionCombatProfile = {
  classId: PlayerClass
  talentModifiers: TalentModifiers
}

export function createActionCombatProfile(character?: { classId: PlayerClass, talents: TalentAllocation } | null): ActionCombatProfile {
  const classId = character?.classId ?? 'priest'
  return {
    classId,
    talentModifiers: character ? computeTalentModifiers(classId, character.talents) : createEmptyTalentModifiers(),
  }
}

export function createEmptyTalentModifiers(): TalentModifiers {
  return {
    spec: null,
    role: null,
    abilities: {},
    global: { healPct: 0, meleeDmgPct: 0, spellDmgPct: 0, threatPct: 0 },
    grants: [],
  }
}
