﻿plc_field_hetman_court_position = {
    sort_order = 310
    max_available_positions = 1
    minimum_rank = kingdom
    skill = martial

    court_position_asset = {
        animation = debating
        background = "gfx/interface/illustrations/event_scenes/plc_field_hetman_background.dds"
    }

    opinion = { value = regular_court_position_opinion }
    aptitude_level_breakpoints = { 20 40 60 80 }

    aptitude = {
        value = 10
        add = { value = martial multiply = 2.5 max = 50 desc = court_position_skill_martial }
        add = { value = prowess multiply = 1.2 max = 24 desc = court_position_skill_prowess }
        if = { limit = { has_trait = education_martial_3 } add = { value = 10 desc = trait_education_martial_3 } }
        if = { limit = { has_trait = education_martial_4 } add = { value = 20 desc = trait_education_martial_4 } }
        add = general_aptitude_bonus
    }

    is_shown = {
        is_ruler = yes
        has_title = title:e_polish_commonwealth
    }

    valid_position = {
        highest_held_title_tier >= tier_kingdom
        has_title = title:e_polish_commonwealth
    }

    is_shown_character = {
        scope:employee = {
            court_position_employee_shown_trigger = yes
        }
    }

    valid_character = {
        scope:employee = {
            liege = scope:liege
            is_adult = yes
            is_imprisoned = no
            martial >= 10
            prowess >= 8
            court_position_does_not_already_have_a_job_trigger = yes
        }
    }

    salary = { round = no gold = { value = minor_court_position_salary } }

    base_employer_modifier = { }
    scaling_employer_modifiers = {
        terrible = { knight_effectiveness_mult = 0.01 levy_reinforcement_rate = 0.01 }
        poor = { knight_effectiveness_mult = 0.02 levy_reinforcement_rate = 0.02 defender_advantage = 1 }
        average = { knight_effectiveness_mult = 0.04 levy_reinforcement_rate = 0.03 defender_advantage = 1 }
        good = { knight_effectiveness_mult = 0.06 levy_reinforcement_rate = 0.04 defender_advantage = 2 movement_speed = 0.02 }
        excellent = { knight_effectiveness_mult = 0.08 levy_reinforcement_rate = 0.05 defender_advantage = 3 movement_speed = 0.03 }
    }

    modifier = { martial = 1 prowess = 1 monthly_prestige = 0.05 }

    on_court_position_received = { basic_gained_court_position_effect = yes }
    on_court_position_revoked = { basic_revoked_court_position_effect = yes }
    on_court_position_invalidated = { basic_invalidated_court_position_effect = yes }

    ai_position_score = {
        value = 80
        scope:liege = {
            if = { limit = { at_war = yes } add = 50 }
            if = { limit = { gold > 150 } add = 20 }
        }
        add = court_position_debt_considerations_value
    }
    ai_candidate_score = {
        value = 100
        add = scope:base_value
        add = court_position_candidate_score_base_value
        add = court_position_candidate_aptitude_value
    }
}

plc_crown_treasurer_court_position = {
    sort_order = 311
    max_available_positions = 1
    minimum_rank = kingdom
    skill = stewardship

    court_position_asset = {
        animation = reading
        background = "gfx/interface/illustrations/event_scenes/plc_crown_treasurer_background.dds"
    }

    opinion = { value = regular_court_position_opinion }
    aptitude_level_breakpoints = { 20 40 60 80 }

    aptitude = {
        value = 10
        add = { value = stewardship multiply = 2.5 max = 50 desc = court_position_skill_stewardship }
        add = { value = learning divide = 2 max = 20 desc = court_position_skill_learning }
        if = { limit = { has_trait = education_stewardship_3 } add = { value = 10 desc = trait_education_stewardship_3 } }
        if = { limit = { has_trait = education_stewardship_4 } add = { value = 20 desc = trait_education_stewardship_4 } }
        add = general_aptitude_bonus
    }

    is_shown = {
        is_ruler = yes
        has_title = title:e_polish_commonwealth
    }

    valid_position = {
        highest_held_title_tier >= tier_kingdom
        has_title = title:e_polish_commonwealth
    }

    is_shown_character = {
        scope:employee = {
            court_position_employee_shown_trigger = yes
        }
    }

    valid_character = {
        scope:employee = {
            liege = scope:liege
            is_adult = yes
            is_imprisoned = no
            stewardship >= 10
            court_position_does_not_already_have_a_job_trigger = yes
        }
    }

    salary = { round = no gold = { value = minor_court_position_salary } }

    base_employer_modifier = { }
    scaling_employer_modifiers = {
        terrible = { domain_tax_mult = 0.005 build_gold_cost = -0.01 }
        poor = { domain_tax_mult = 0.01 build_gold_cost = -0.02 }
        average = { domain_tax_mult = 0.02 build_gold_cost = -0.03 development_growth_factor = 0.01 }
        good = { domain_tax_mult = 0.03 build_gold_cost = -0.04 development_growth_factor = 0.02 }
        excellent = { domain_tax_mult = 0.04 build_gold_cost = -0.05 development_growth_factor = 0.03 monthly_county_control_growth_add = 0.05 }
    }

    modifier = { stewardship = 1 monthly_prestige = 0.04 }

    on_court_position_received = { basic_gained_court_position_effect = yes }
    on_court_position_revoked = { basic_revoked_court_position_effect = yes }
    on_court_position_invalidated = { basic_invalidated_court_position_effect = yes }

    ai_position_score = {
        value = 80
        scope:liege = {
            if = { limit = { gold > 150 } add = 50 }
            if = { limit = { monthly_character_income > monthly_character_expenses_plus_fourty_percent } add = 50 }
        }
        add = court_position_debt_considerations_value
    }
    ai_candidate_score = {
        value = 100
        add = scope:base_value
        add = court_position_candidate_score_base_value
        add = court_position_candidate_aptitude_value
    }
}
