# Qyvaria CK3 - Culling trigger (fixed)
# All syntax verified against CK3 1.20 Crozier vanilla game files.
# Removed invalid constructs: is_important_character, is_playable_ruler,
# is_regent, has_active_claim, any_relation { who= relation= }.
# Heirs protected via is_primary_heir_of. Councillors via has_any_court_position.

performance_should_cull_character = {
    trigger = {
        ai = yes
        NOT = { is_playable_character = yes }
        NOT = { is_primary_heir_of = root }
        NOT = { has_any_court_position = yes }
        age >= 16
        NOT = { is_imprisoned = yes }
        NOT = { has_character_flag = important_character }
        NOT = {
            liege = { is_playable_character = yes }
        }
        NOT = {
            is_vassal_of = root
        }
        NOT = {
            any_relation = {
                type = guardian
                this = { is_playable_character = yes }
            }
        }
        NOT = {
            any_relation = {
                type = ward
                this = { is_playable_character = yes }
            }
        }
        NOT = {
            any_relation = {
                type = wet_nurse
                this = { is_playable_character = yes }
            }
        }
        NOT = {
            OR = {
                diplomacy >= 10
                martial >= 10
                stewardship >= 10
                intrigue >= 10
                learning >= 10
                prowess >= 10
            }
        }
    }
}