use enum_map::{enum_map, EnumMap};

use crate::asset::{Perk, Skill, Stat};

#[derive(Clone, Copy, Debug)]
pub enum ReqTarget {
    GlobalVar(usize),
    Skill(Skill),
    Stat(Stat),
}

#[derive(Clone, Copy, Debug)]
pub enum ReqValue {
    GreaterOrEqual(i32),
    Less(i32),
}

pub type Req = (ReqTarget, ReqValue);

#[derive(Clone, Copy, Debug)]
pub enum ReqOp {
    Any,
    All,
}

pub struct PerkDef {
    pub image_fid_id: u32,
    /// Having None here means the perk is special is not selectable by player.
    pub max_rank: Option<u32>,
    pub min_level: u32,
    pub stat_bonuses: &'static [(Stat, i32)],

    /// All of the requirements must match.
    /// Empty makes this test always pass.
    pub all: &'static [Req],

    /// If `Some`, one of the requirements must match.
    /// `Some(&[])` makes this test always fail.
    /// `all` and `any` tests are combined with logical "and".
    pub any: Option<&'static [Req]>,
}

impl PerkDef {
    pub fn defaults() -> EnumMap<Perk, PerkDef> {
        use Perk::*;
        use ReqTarget::*;
        use ReqValue::*;
        use crate::asset::Skill::*;
        use crate::asset::Stat::*;
        use crate::game::script::GVAR_PLAYER_REPUTATION;

        enum_map! {
        BonusAwareness => Self {
            image_fid_id: 72,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Perception), GreaterOrEqual(5))],
            any: None,
        },
        BonusHthAttacks => Self {
            image_fid_id: 73,
            max_rank: Some(1),
            min_level: 15,
            stat_bonuses: &[],
            all: &[(Stat(Agility), GreaterOrEqual(6))],
            any: None,
        },
        BonusHthDamage => Self {
            image_fid_id: 74,
            max_rank: Some(3),
            min_level: 3,
            stat_bonuses: &[(MeleeDmg, 2)],
            all: &[(Stat(Strength), GreaterOrEqual(6)), (Stat(Agility), GreaterOrEqual(6))],
            any: None,
        },
        BonusMove => Self {
            image_fid_id: 75,
            max_rank: Some(2),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Stat(Agility), GreaterOrEqual(5))],
            any: None,
        },
        BonusRangedDamage => Self {
            image_fid_id: 76,
            max_rank: Some(2),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Stat(Agility), GreaterOrEqual(6)), (Stat(Luck), GreaterOrEqual(6))],
            any: None,
        },
        BonusRateOfFire => Self {
            image_fid_id: 77,
            max_rank: Some(1),
            min_level: 15,
            stat_bonuses: &[],
            all: &[(Stat(Perception), GreaterOrEqual(6)), (Stat(Intelligence), GreaterOrEqual(6)), (Stat(Agility), GreaterOrEqual(7))],
            any: None,
        },
        EarlierSequence => Self {
            image_fid_id: 78,
            max_rank: Some(3),
            min_level: 3,
            stat_bonuses: &[(Sequence, 2)],
            all: &[(Stat(Perception), GreaterOrEqual(6))],
            any: None,
        },
        FasterHealing => Self {
            image_fid_id: 79,
            max_rank: Some(3),
            min_level: 3,
            stat_bonuses: &[(HealRate, 2)],
            all: &[(Stat(Endurance), GreaterOrEqual(6))],
            any: None,
        },
        MoreCriticals => Self {
            image_fid_id: 80,
            max_rank: Some(3),
            min_level: 6,
            stat_bonuses: &[(CritChance, 5)],
            all: &[(Stat(Luck), GreaterOrEqual(6))],
            any: None,
        },
        NightVision => Self {
            image_fid_id: 81,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Perception), GreaterOrEqual(6))],
            any: None,
        },
        Presence => Self {
            image_fid_id: 82,
            max_rank: Some(3),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Charisma), GreaterOrEqual(6))],
            any: None,
        },
        RadResistance => Self {
            image_fid_id: 83,
            max_rank: Some(2),
            min_level: 6,
            stat_bonuses: &[(RadResist, 15)],
            all: &[(Stat(Endurance), GreaterOrEqual(6)), (Stat(Intelligence), GreaterOrEqual(4))],
            any: None,
        },
        Toughness => Self {
            image_fid_id: 84,
            max_rank: Some(3),
            min_level: 3,
            stat_bonuses: &[(DmgResist, 10)],
            all: &[(Stat(Endurance), GreaterOrEqual(6)), (Stat(Luck), GreaterOrEqual(6))],
            any: None,
        },
        StrongBack => Self {
            image_fid_id: 85,
            max_rank: Some(3),
            min_level: 3,
            stat_bonuses: &[(CarryWeight, 50)],
            all: &[(Stat(Strength), GreaterOrEqual(6)), (Stat(Endurance), GreaterOrEqual(6))],
            any: None,
        },
        Sharpshooter => Self {
            image_fid_id: 86,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[],
            all: &[(Stat(Perception), GreaterOrEqual(7)), (Stat(Intelligence), GreaterOrEqual(6))],
            any: None,
        },
        SilentRunning => Self {
            image_fid_id: 87,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Skill(Sneak), GreaterOrEqual(50)), (Stat(Agility), GreaterOrEqual(6))],
            any: None,
        },
        Survivalist => Self {
            image_fid_id: 88,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Skill(Outdoorsman), GreaterOrEqual(40)), (Stat(Endurance), GreaterOrEqual(6)), (Stat(Intelligence), GreaterOrEqual(6))],
            any: None,
        },
        MasterTrader => Self {
            image_fid_id: 89,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Skill(Barter), GreaterOrEqual(75)), (Stat(Charisma), GreaterOrEqual(7))],
            any: None,
        },
        Educated => Self {
            image_fid_id: 90,
            max_rank: Some(3),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Stat(Intelligence), GreaterOrEqual(6))],
            any: None,
        },
        Healer => Self {
            image_fid_id: 91,
            max_rank: Some(2),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Skill(FirstAid), GreaterOrEqual(40)), (Stat(Perception), GreaterOrEqual(7)), (Stat(Intelligence), GreaterOrEqual(5)), (Stat(Agility), GreaterOrEqual(6))],
            any: None,
        },
        FortuneFinder => Self {
            image_fid_id: 92,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Stat(Luck), GreaterOrEqual(8))],
            any: None,
        },
        BetterCriticals => Self {
            image_fid_id: 93,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[(BetterCrit, 20)],
            all: &[(Stat(Perception), GreaterOrEqual(6)), (Stat(Agility), GreaterOrEqual(4)), (Stat(Luck), GreaterOrEqual(6))],
            any: None,
        },
        Empathy => Self {
            image_fid_id: 94,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Stat(Perception), GreaterOrEqual(7)), (Stat(Intelligence), GreaterOrEqual(5))],
            any: None,
        },
        Slayer => Self {
            image_fid_id: 95,
            max_rank: Some(1),
            min_level: 24,
            stat_bonuses: &[],
            all: &[(Skill(UnarmedCombat), GreaterOrEqual(80)), (Stat(Strength), GreaterOrEqual(8)), (Stat(Agility), GreaterOrEqual(8))],
            any: None,
        },
        Sniper => Self {
            image_fid_id: 96,
            max_rank: Some(1),
            min_level: 24,
            stat_bonuses: &[],
            all: &[(Skill(SmallGuns), GreaterOrEqual(80)), (Stat(Perception), GreaterOrEqual(8)), (Stat(Agility), GreaterOrEqual(8))],
            any: None,
        },
        SilentDeath => Self {
            image_fid_id: 97,
            max_rank: Some(1),
            min_level: 18,
            stat_bonuses: &[],
            all: &[(Skill(Sneak), GreaterOrEqual(80)), (Skill(UnarmedCombat), GreaterOrEqual(80)), (Stat(Agility), GreaterOrEqual(10))],
            any: None,
        },
        ActionBoy => Self {
            image_fid_id: 98,
            max_rank: Some(2),
            min_level: 12,
            stat_bonuses: &[(ActionPoints, 1)],
            all: &[(Stat(Agility), GreaterOrEqual(5))],
            any: None,
        },
        MentalBlock => Self {
            image_fid_id: 99,
            max_rank: Some(1),
            min_level: 310,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        Lifegiver => Self {
            image_fid_id: 100,
            max_rank: Some(2),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Stat(Endurance), GreaterOrEqual(4))],
            any: None,
        },
        Dodger => Self {
            image_fid_id: 101,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[(ArmorClass, 5)],
            all: &[(Stat(Agility), GreaterOrEqual(6))],
            any: None,
        },
        Snakeater => Self {
            image_fid_id: 102,
            max_rank: Some(2),
            min_level: 6,
            stat_bonuses: &[(PoisonResist, 25)],
            all: &[(Stat(Endurance), GreaterOrEqual(3))],
            any: None,
        },
        MrFixit => Self {
            image_fid_id: 103,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[],
            any: Some(&[(Skill(Repair), GreaterOrEqual(40)), (Skill(Science), GreaterOrEqual(40))]),
        },
        Medic => Self {
            image_fid_id: 104,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[],
            any: Some(&[(Skill(FirstAid), GreaterOrEqual(40)), (Skill(Doctor), GreaterOrEqual(40))]),
        },
        MasterThief => Self {
            image_fid_id: 105,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Skill(Steal), GreaterOrEqual(50)), (Skill(Lockpick), GreaterOrEqual(50))],
            any: None,
        },
        Speaker => Self {
            image_fid_id: 106,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[],
            all: &[(Skill(Conversant), GreaterOrEqual(50))],
            any: None,
        },
        HeaveHo => Self {
            image_fid_id: 107,
            max_rank: Some(3),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Stat(Strength), Less(9))],
            any: None,
        },
        FriendlyFoe => Self {
            image_fid_id: 108,
            max_rank: Some(1),
            min_level: 310,
            stat_bonuses: &[],
            all: &[(Stat(Perception), GreaterOrEqual(4))],
            any: None,
        },
        Pickpocket => Self {
            image_fid_id: 109,
            max_rank: Some(1),
            min_level: 15,
            stat_bonuses: &[],
            all: &[(Skill(Steal), GreaterOrEqual(80)), (Stat(Agility), GreaterOrEqual(8))],
            any: None,
        },
        Ghost => Self {
            image_fid_id: 110,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Skill(Sneak), GreaterOrEqual(60))],
            any: None,
        },
        CultOfPersonality => Self {
            image_fid_id: 111,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Stat(Charisma), GreaterOrEqual(10))],
            any: None,
        },
        Scrounger => Self {
            image_fid_id: 112,
            max_rank: Some(1),
            min_level: 310,
            stat_bonuses: &[],
            all: &[(Stat(Luck), GreaterOrEqual(8))],
            any: None,
        },
        Explorer => Self {
            image_fid_id: 113,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        FlowerChild => Self {
            image_fid_id: 114,
            max_rank: Some(1),
            min_level: 310,
            stat_bonuses: &[],
            all: &[(Stat(Endurance), GreaterOrEqual(5))],
            any: None,
        },
        Pathfinder => Self {
            image_fid_id: 115,
            max_rank: Some(2),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Skill(Outdoorsman), GreaterOrEqual(40)), (Stat(Endurance), GreaterOrEqual(6))],
            any: None,
        },
        AnimalFriend => Self {
            image_fid_id: 116,
            max_rank: Some(1),
            min_level: 310,
            stat_bonuses: &[],
            all: &[(Skill(Outdoorsman), GreaterOrEqual(25)), (Stat(Intelligence), GreaterOrEqual(5))],
            any: None,
        },
        Scout => Self {
            image_fid_id: 117,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Perception), GreaterOrEqual(7))],
            any: None,
        },
        MysteriousStranger => Self {
            image_fid_id: 118,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[],
            all: &[(Stat(Luck), GreaterOrEqual(4))],
            any: None,
        },
        Ranger => Self {
            image_fid_id: 119,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Stat(Perception), GreaterOrEqual(6))],
            any: None,
        },
        QuickPockets => Self {
            image_fid_id: 120,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Agility), GreaterOrEqual(5))],
            any: None,
        },
        SmoothTalker => Self {
            image_fid_id: 121,
            max_rank: Some(3),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Intelligence), GreaterOrEqual(4))],
            any: None,
        },
        SwiftLearner => Self {
            image_fid_id: 122,
            max_rank: Some(3),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Intelligence), GreaterOrEqual(4))],
            any: None,
        },
        Tag => Self {
            image_fid_id: 123,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        Mutate => Self {
            image_fid_id: 124,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        AddNuka => Self {
            image_fid_id: 125,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        BuffoutReliance => Self {
            image_fid_id: 126,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(Strength, -2), (Endurance, -2), (Agility, -3)],
            all: &[],
            any: None,
        },
        MentatsReliance => Self {
            image_fid_id: 127,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(Intelligence, -3), (Agility, -2)],
            all: &[],
            any: None,
        },
        PsychoReliance => Self {
            image_fid_id: 128,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(Intelligence, -2)],
            all: &[],
            any: None,
        },
        RadawayReliance => Self {
            image_fid_id: 129,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(RadResist, -20)],
            all: &[],
            any: None,
        },
        WeaponLongRange => Self {
            image_fid_id: 130,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        WeaponAccurate => Self {
            image_fid_id: 131,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        WeaponPenetrate => Self {
            image_fid_id: 132,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        WeaponKnockback => Self {
            image_fid_id: 133,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        ArmorPowered => Self {
            image_fid_id: 134,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(RadResist, 30), (Strength, 3)],
            all: &[],
            any: None,
        },
        ArmorCombat => Self {
            image_fid_id: 135,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(RadResist, 20)],
            all: &[],
            any: None,
        },
        WeaponScopeRange => Self {
            image_fid_id: 136,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        WeaponFastReload => Self {
            image_fid_id: 137,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        WeaponNightSight => Self {
            image_fid_id: 138,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        WeaponFlameboy => Self {
            image_fid_id: 139,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        ArmorAdvanced1 => Self {
            image_fid_id: 140,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(RadResist, 60), (Strength, 4)],
            all: &[],
            any: None,
        },
        ArmorAdvanced2 => Self {
            image_fid_id: 141,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(RadResist, 75), (Strength, 4)],
            all: &[],
            any: None,
        },
        JetReliance => Self {
            image_fid_id: 136,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(ActionPoints, -1), (Strength, -1), (Perception, -1)],
            all: &[],
            any: None,
        },
        TragicReliance => Self {
            image_fid_id: 149,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(Perception, -2), (Intelligence, -1), (Luck, -1)],
            all: &[],
            any: None,
        },
        ArmorCharisma => Self {
            image_fid_id: 154,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(Charisma, 2)],
            all: &[],
            any: None,
        },
        GeckoSkinning => Self {
            image_fid_id: 158,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        DermalArmor => Self {
            image_fid_id: 157,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        DermalEnhancement => Self {
            image_fid_id: 157,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(Charisma, -1)],
            all: &[],
            any: None,
        },
        PhoenixArmor => Self {
            image_fid_id: 168,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        PhoenixEnhancement => Self {
            image_fid_id: 168,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[(Charisma, -1)],
            all: &[],
            any: None,
        },
        VaultCityInoculations => Self {
            image_fid_id: 172,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        AdrenalineRush => Self {
            image_fid_id: 155,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Stat(Strength), Less(10))],
            any: None,
        },
        CautiousNature => Self {
            image_fid_id: 156,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Perception), GreaterOrEqual(6))],
            any: None,
        },
        Comprehension => Self {
            image_fid_id: 122,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Intelligence), GreaterOrEqual(6))],
            any: None,
        },
        DemolitionExpert => Self {
            image_fid_id: 39,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[],
            all: &[(Skill(Traps), GreaterOrEqual(75)), (Stat(Agility), GreaterOrEqual(4))],
            any: None,
        },
        Gambler => Self {
            image_fid_id: 44,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Skill(Gambling), GreaterOrEqual(50))],
            any: None,
        },
        GainStrength => Self {
            image_fid_id: 0,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Stat(Strength), Less(10))],
            any: None,
        },
        GainPerception => Self {
            image_fid_id: 1,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Stat(Perception), Less(10))],
            any: None,
        },
        GainEndurance => Self {
            image_fid_id: 2,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Stat(Endurance), Less(10))],
            any: None,
        },
        GainCharisma => Self {
            image_fid_id: 3,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Stat(Charisma), Less(10))],
            any: None,
        },
        GainIntelligence => Self {
            image_fid_id: 4,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Stat(Intelligence), Less(10))],
            any: None,
        },
        GainAgility => Self {
            image_fid_id: 5,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Stat(Agility), Less(10))],
            any: None,
        },
        GainLuck => Self {
            image_fid_id: 6,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Stat(Luck), Less(10))],
            any: None,
        },
        Harmless => Self {
            image_fid_id: 160,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Skill(Steal), GreaterOrEqual(50)),
                (GlobalVar(GVAR_PLAYER_REPUTATION), GreaterOrEqual(50))],
            any: None,
        },
        HereAndNow => Self {
            image_fid_id: 161,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        HthEvade => Self {
            image_fid_id: 159,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Skill(UnarmedCombat), GreaterOrEqual(75))],
            any: None,
        },
        KamaSutra => Self {
            image_fid_id: 163,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Endurance), GreaterOrEqual(5)), (Stat(Agility), GreaterOrEqual(5))],
            any: None,
        },
        KarmaBeacon => Self {
            image_fid_id: 162,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[],
            all: &[(Stat(Charisma), GreaterOrEqual(6))],
            any: None,
        },
        LightStep => Self {
            image_fid_id: 164,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[],
            all: &[(Stat(Agility), GreaterOrEqual(5)), (Stat(Luck), GreaterOrEqual(5))],
            any: None,
        },
        LivingAnatomy => Self {
            image_fid_id: 165,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Skill(Doctor), GreaterOrEqual(60))],
            any: None,
        },
        MagneticPersonality => Self {
            image_fid_id: 166,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Stat(Charisma), Less(10))],
            any: None,
        },
        Negotiator => Self {
            image_fid_id: 43,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Skill(Barter), GreaterOrEqual(50)), (Skill(Conversant), GreaterOrEqual(50))],
            any: None,
        },
        PackRat => Self {
            image_fid_id: 167,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[(CarryWeight, 50)],
            all: &[],
            any: None,
        },
        Pyromaniac => Self {
            image_fid_id: 169,
            max_rank: Some(1),
            min_level: 9,
            stat_bonuses: &[],
            all: &[(Skill(BigGuns), GreaterOrEqual(75))],
            any: None,
        },
        QuickRecovery => Self {
            image_fid_id: 170,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Stat(Agility), GreaterOrEqual(5))],
            any: None,
        },
        Salesman => Self {
            image_fid_id: 121,
            max_rank: Some(1),
            min_level: 6,
            stat_bonuses: &[],
            all: &[(Skill(Barter), GreaterOrEqual(50))],
            any: None,
        },
        Stonewall => Self {
            image_fid_id: 171,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[(Stat(Strength), GreaterOrEqual(6))],
            any: None,
        },
        Thief => Self {
            image_fid_id: 38,
            max_rank: Some(1),
            min_level: 3,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        WeaponHandling => Self {
            image_fid_id: 173,
            max_rank: Some(1),
            min_level: 12,
            stat_bonuses: &[],
            all: &[(Stat(Strength), Less(7)), (Stat(Agility), GreaterOrEqual(5))],
            any: None,
        },
        VaultCityTraining => Self {
            image_fid_id: 104,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[(Skill(Doctor), GreaterOrEqual(75))],
            any: None,
        },
        AlcoholHpBonus1 => Self {
            image_fid_id: 142,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        AlcoholHpBonus2 => Self {
            image_fid_id: 142,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        AlcoholHpNeg1 => Self {
            image_fid_id: 52,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        AlcoholHpNeg2 => Self {
            image_fid_id: 52,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        AutodocHpBonus1 => Self {
            image_fid_id: 104,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        AutodocHpBonus2 => Self {
            image_fid_id: 104,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        AutodocHpNeg1 => Self {
            image_fid_id: 35,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        AutodocHpNeg2 => Self {
            image_fid_id: 35,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        ExpertExcrementExpediter => Self {
            image_fid_id: 154,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        WeaponKnockout => Self {
            image_fid_id: 154,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        Jinxed => Self {
            image_fid_id: 64,
            max_rank: None,
            min_level: 1,
            stat_bonuses: &[],
            all: &[],
            any: None,
        },
        }
    }
}
