use crate::reaction::Reaction;
use crate::types::Element;
#[derive(Debug, Clone, PartialEq, thiserror::Error)]
pub enum CalcError {
#[error("character level must be 1..=90, got {0}")]
InvalidCharacterLevel(u32),
#[error("enemy level must be 1..=200, got {0}")]
InvalidEnemyLevel(u32),
#[error("crit_rate must be 0.0..=1.0, got {0}")]
InvalidCritRate(f64),
#[error("def_reduction must be 0.0..=1.0, got {0}")]
InvalidDefReduction(f64),
#[error("def_ignore must be 0.0..=1.0, got {0}")]
InvalidDefIgnore(f64),
#[error("talent_multiplier must be > 0.0, got {0}")]
InvalidTalentMultiplier(f64),
#[error("amplifying reaction requires an element, but element is None (physical)")]
AmplifyingRequiresElement,
#[error("elemental_mastery must be >= 0.0, got {0}")]
InvalidElementalMastery(f64),
#[error("reaction_bonus must be >= 0.0, got {0}")]
InvalidReactionBonus(f64),
#[error("reaction {0:?} is not amplifying or catalyze; use calculate_transformative")]
UseTransformativeFunction(Reaction),
#[error("reaction {0:?} is not amplifying or catalyze; use calculate_lunar")]
UseLunarFunction(Reaction),
#[error("reaction {0:?} is not a transformative reaction")]
NotTransformative(Reaction),
#[error("reaction {0:?} is not a lunar reaction")]
NotLunar(Reaction),
#[error("swirl element must be Pyro, Hydro, Electro, or Cryo, got {0:?}")]
InvalidSwirlElement(Element),
#[error("invalid amplifying combination: {0:?} with {1:?} trigger")]
InvalidAmplifyingCombination(Reaction, Element),
#[error("character level must be 1..=100 for reaction calculations, got {0}")]
InvalidReactionLevel(u32),
#[error("invalid base value: {0} (must be >= 0)")]
InvalidBaseValue(f64),
#[error("invalid percent bonus: {0} (must be >= -1.0)")]
InvalidPercentBonus(f64),
#[error("invalid flat bonus: {0} (must be >= 0)")]
InvalidFlatBonus(f64),
#[error("crit_dmg must be >= 0.0, got {0}")]
InvalidCritDmg(f64),
#[error("energy_recharge must be >= 0.0, got {0}")]
InvalidEnergyRecharge(f64),
#[error("dmg_bonus must be >= -1.0, got {0}")]
InvalidDmgBonus(f64),
#[error("team must have 1..=4 members, got {0}")]
InvalidTeamSize(usize),
#[error("target index {index} out of bounds for team of size {team_size}")]
InvalidTargetIndex {
index: usize,
team_size: usize,
},
#[error("constellation must be 0..=6, got {0}")]
InvalidConstellation(u8),
#[error("talent level must be 1..=15, got {0}")]
InvalidTalentLevel(u8),
#[error("weapon refinement must be 1..=5, got {0}")]
InvalidRefinement(u8),
}