use crate::ElementType;

use super::tsv_util::from_sequence;
use serde::Deserialize;

#[derive(Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AvatarSkillData {
    pub id: u32,
    pub skill_icon: String,
    pub ability_name: String,
    pub lock_shape: String,
    #[serde(deserialize_with = "from_sequence")]
    pub lock_weight_params: Vec<f32>,
    pub proud_skill_group_id: u32,
    pub cost_elem_type: ElementType,
    pub cost_elem_val: f32,
    #[serde(rename = "shareCDID")]
    pub share_cd_id: u32,
    pub max_charge_num: u32,
    pub is_ranged: bool,
    pub cost_stamina: f32,
    pub drag_type: String, // TODO: enum
    pub energy_min: f32,
    pub cd_slot: u32,
    #[serde(rename = "triggerID")]
    pub trigger_id: u32,
    pub is_attack_camera_lock: bool,
    #[serde(rename = "ignoreCDMinusRatio")]
    pub ignore_cd_minus_ratio: bool,
    pub force_can_do_skill: bool,
    pub cd_time: f32,
}
