namespace = qyv_sleep

# Decision: Sleep with partner
character_event = {
    id = qyv_sleep.0100
    title = qyv_sleep_partner_t
    desc = qyv_sleep_partner_d
    theme = romance
    
    trigger = {
        is_ruler = yes
        is_adult = yes
        OR = {
            has_spouse = yes
            has_concubine = yes
        }
    }
    
    option = {
        name = qyv_sleep_with_spouse
        trigger = {
            has_spouse = yes
        }
        ai_chance = { base = 50 }
        hidden_effect = {
            add_stress = -10
            add_opinion = { target = spouse modifier = qyv_slept_together years = 2 }
            spouse = { add_opinion = { target = root modifier = qyv_slept_together years = 2 } }
        }
    }
    
    option = {
        name = qyv_sleep_with_concubine
        trigger = {
            has_concubine = yes
        }
        ai_chance = { base = 30 }
        hidden_effect = {
            add_stress = -8
            random_concubine = {
                add_opinion = { target = root modifier = qyv_slept_together years = 2 }
            }
        }
    }
    
    option = {
        name = qyv_no_sleep
        ai_chance = { base = 20 }
    }
}

# Decision: Sleep with anyone of opposite sex
character_event = {
    id = qyv_sleep.0200
    title = qyv_sleep_anyone_t
    desc = qyv_sleep_anyone_d
    theme = romance
    
    trigger = {
        is_ruler = yes
        is_adult = yes
        any_courtier_or_guest = {
            is_adult = yes
            is_female = yes
            NOT = { is_spouse_of = root }
            NOT = { is_concubine_of = root }
            NOT = { is_close_family_of = root }
            opinion_of_self >= 0
        }
    }
    
    option = {
        name = qyv_sleep_with_courtier
        trigger = {
            any_courtier_or_guest = {
                is_adult = yes
                is_female = yes
                NOT = { is_spouse_of = root }
                NOT = { is_concubine_of = root }
                NOT = { is_close_family_of = root }
                opinion_of_self >= 0
            }
        }
        ai_chance = { base = 40 }
        hidden_effect = {
            random_courtier_or_guest = {
                limit = {
                    is_adult = yes
                    is_female = yes
                    NOT = { is_spouse_of = root }
                    NOT = { is_concubine_of = root }
                    NOT = { is_close_family_of = root }
                    opinion_of_self >= 0
                }
                add_opinion = { target = root modifier = qyv_slept_together years = 2 }
                root = { add_opinion = { target = this modifier = qyv_slept_together years = 2 } }
            }
            add_stress = -5
        }
    }
    
    option = {
        name = qyv_no_sleep_anyone
        ai_chance = { base = 60 }
    }
}

# Sleep with partner - female perspective
character_event = {
    id = qyv_sleep.0300
    title = qyv_sleep_partner_t
    desc = qyv_sleep_partner_d
    theme = romance
    
    trigger = {
        is_ruler = yes
        is_adult = yes
        is_female = yes
        OR = {
            has_spouse = yes
            has_concubine = yes
        }
    }
    
    option = {
        name = qyv_sleep_with_spouse
        trigger = {
            has_spouse = yes
        }
        ai_chance = { base = 50 }
        hidden_effect = {
            add_stress = -10
            add_opinion = { target = spouse modifier = qyv_slept_together years = 2 }
            spouse = { add_opinion = { target = root modifier = qyv_slept_together years = 2 } }
        }
    }
    
    option = {
        name = qyv_no_sleep
        ai_chance = { base = 50 }
    }
}
