﻿domcom_break_things_off_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 65
    desc = domcom_break_things_off_interaction_desc

    is_shown = {
        scope:recipient != scope:actor
        scope:actor = { is_alive = yes }
        scope:recipient = {
            is_alive = yes
            OR = {
                has_relation_lover = scope:actor
                has_relation_soulmate = scope:actor
            }
        }
    }

    on_accept = {
        scope:actor = { save_scope_as = domcom_breakup_patron }
        scope:recipient = { domcom_break_up_with_lover_effect = yes }
        scope:actor = {
            send_interface_toast = {
                type = event_toast_effect_neutral
                title = DOMCOM_BREAKUP_TOAST
                left_icon = scope:actor
                right_icon = scope:recipient
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_alpha_check_interaction = {
    icon = wrathful
    category = interaction_category_hostile
    common_interaction = yes
    use_diplomatic_range = yes
    interface_priority = 57
    desc = domcom_alpha_check_interaction_desc
    cooldown_against_recipient = { years = 1 }

    is_shown = {
        scope:actor = { is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = { domcom_general_alpha_target_trigger = yes }
    }

    is_valid_showing_failures_only = {
        scope:actor = {
            is_imprisoned = no
            custom_tooltip = {
                text = domcom_alpha_budget_spent_tt
                domcom_alpha_budget_available_trigger = yes
            }
        }
        scope:recipient = {
            is_imprisoned = no
            custom_tooltip = {
                text = domcom_alpha_recent_challenge_tt
                NOT = {
                    AND = {
                        has_character_flag = domcom_recent_alpha_challenge
                        has_variable = domcom_last_alpha_patron
                        var:domcom_last_alpha_patron = scope:actor
                    }
                }
            }
            custom_tooltip = {
                text = domcom_alpha_collapse_resolved_tt
                NOT = { has_character_flag = domcom_collapse_resolved }
            }
            custom_tooltip = {
                text = domcom_alpha_already_outclassed_tt
                NOT = {
                    AND = {
                        has_character_flag = domcom_dominated
                        has_variable = domcom_dominance_patron
                        var:domcom_dominance_patron = scope:actor
                        NOT = {
                            OR = {
                                domcom_cuck_evidence_trigger = yes
                                AND = {
                                    has_character_flag = domcom_cucked
                                    has_variable = domcom_cuck_patron
                                    var:domcom_cuck_patron = scope:actor
                                }
                            }
                        }
                    }
                }
            }
            custom_tooltip = {
                text = domcom_alpha_terminal_xp_tt
                NOT = {
                    AND = {
                        has_character_flag = domcom_owned_cuck
                        has_variable = domcom_patron
                        var:domcom_patron = scope:actor
                        has_variable = domcom_cuck_xp
                        var:domcom_cuck_xp >= 1000
                    }
                }
            }
        }
    }

    on_accept = {
        # This is the starting chance. The confrontation can move it up or down.
        show_as_tooltip = {
            scope:recipient = {
                random_list = {
                    0 = {
                        modifier = { add = domcom_alpha_check_chance_value }
                        custom_tooltip = domcom_alpha_check_tt_success
                    }
                    0 = {
                        modifier = { add = domcom_alpha_check_failure_weight_value }
                        custom_tooltip = domcom_alpha_check_tt_failure
                    }
                }
            }
        }

        hidden_effect = {
            scope:actor = {
                domcom_initialize_profile_effect = yes
                domcom_initialize_ledger_counters_effect = yes
                change_variable = { name = domcom_alpha_attempts add = 1 }
                domcom_spend_alpha_budget_effect = yes
                set_variable = { name = domcom_alpha_event_target value = scope:recipient }
                set_variable = { name = domcom_alpha_event_score value = 0 }
                save_scope_as = domcom_alpha_patron
            }
            scope:recipient = {
                domcom_initialize_profile_effect = yes
                add_character_flag = { flag = domcom_recent_alpha_challenge days = 365 }
                set_variable = { name = domcom_last_alpha_patron value = scope:actor }
                set_variable = { name = domcom_alpha_event_base_chance value = domcom_alpha_check_chance_value }
                if = {
                    limit = { domcom_is_cuck_target_of_actor_trigger = yes }
                    add_character_flag = domcom_alpha_event_has_cuck_evidence
                }
                else = { remove_character_flag = domcom_alpha_event_has_cuck_evidence }
                save_scope_as = domcom_alpha_target
            }
            scope:actor = { trigger_event = { id = domcom_alpha.100 } }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_tantalize_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = yes
    interface_priority = 56
    desc = domcom_tantalize_interaction_desc
    cooldown_against_recipient = { years = 1 }

    is_shown = {
        scope:actor = { age >= 18 is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = {
            domcom_tantalize_target_trigger = yes
            NOT = { is_consort_of = scope:actor }
        }
    }

    is_valid_showing_failures_only = {
        scope:actor = { is_imprisoned = no }
        scope:recipient = {
            is_imprisoned = no
            custom_tooltip = { text = domcom_tantalize_lawful_partner_block_tt NOT = { is_consort_of = scope:actor } }
        }
    }

    on_accept = {
        scope:actor = {
            save_scope_as = domcom_tantalize_patron
            save_scope_as = domcom_compatibility_target
        }

        # Use CK3's native random-effect tooltip so the actual calculated percentage is rendered as "X%
        # chance of:" instead of a blank %.
        show_as_tooltip = {
            custom_tooltip = domcom_tantalize_consequences_tt
            scope:recipient = {
                random_list = {
                    0 = {
                        modifier = { add = domcom_tantalize_chance_v063_value }
                        custom_tooltip = domcom_tantalize_tt_success
                    }
                    0 = {
                        modifier = { add = domcom_tantalize_failure_weight_value }
                        custom_tooltip = domcom_tantalize_tt_failure
                    }
                }
            }
        }

        hidden_effect = {
        scope:actor = {
            domcom_initialize_profile_effect = yes
            change_variable = { name = domcom_tantalize_attempts add = 1 }
            save_scope_as = domcom_tantalize_patron
            save_scope_as = domcom_compatibility_target
        }
        scope:recipient = {
            domcom_initialize_attraction_profile_effect = yes
            set_variable = { name = domcom_last_compatibility value = domcom_pair_compatibility_value }
        }

        scope:recipient = {
            random = {
                chance = domcom_tantalize_chance_v063_value
                add_character_flag = domcom_tantalize_succeeded
            }
        }

        if = {
            limit = { scope:recipient = { has_character_flag = domcom_tantalize_succeeded } }
            scope:actor = { domcom_dominion_success_stress_effect = yes }
            scope:recipient = {
                remove_character_flag = domcom_tantalize_succeeded
                domcom_apply_tantalize_success_effect = yes
                domcom_try_tantalize_intimacy_effect = yes
            }
            scope:actor = {
                change_variable = { name = domcom_tantalize_successes add = 1 }
                # v2.4.0: a successful Tantalize trains Endowment Mastery without altering the body.
                domcom_endowment_mastery_tantalize_success_effect = yes
                if = {
                    limit = { is_ai = no }
                    send_interface_toast = {
                        type = event_toast_effect_good
                        title = domcom_tantalize_success_toast
                        left_icon = scope:actor
                        right_icon = scope:recipient
                    }
                }
            }
            if = {
                limit = { scope:recipient = { has_character_flag = domcom_new_pet_created } }
                scope:recipient = { remove_character_flag = domcom_new_pet_created }
                scope:actor = {
                    if = {
                        limit = { is_ai = no }
                        send_interface_toast = {
                            type = event_toast_effect_good
                            title = domcom_pet_created_toast
                            left_icon = scope:actor
                            right_icon = scope:recipient
                        }
                    }
                }
            }
        }
        else = {
            scope:recipient = { add_opinion = { target = scope:actor modifier = domcom_rebuffed_tantalize_opinion } }
            scope:actor = {
                domcom_dominion_rejection_stress_effect = yes
                change_variable = { name = domcom_tantalize_failures add = 1 }
                # Failure costs a small amount of Mastery; XP can fall, but first-time rank rewards cannot
                # be farmed because the permanent high-water rank never falls.
                domcom_endowment_mastery_tantalize_failure_effect = yes
                if = {
                    limit = { is_ai = no }
                    if = {
                        limit = {
                            scope:recipient = {
                                OR = {
                                    has_relation_lover = scope:actor
                                    has_relation_soulmate = scope:actor
                                }
                            }
                        }
                        send_interface_toast = {
                            type = event_toast_effect_bad
                            title = domcom_tantalize_influence_resisted_toast
                            left_icon = scope:actor
                            right_icon = scope:recipient
                        }
                    }
                    else = {
                        send_interface_toast = {
                            type = event_toast_effect_bad
                            title = domcom_tantalize_failure_toast
                            left_icon = scope:actor
                            right_icon = scope:recipient
                        }
                    }
                }
            }
        }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

# Use an existing Lover/Soulmate as the intermediary when the target desires that person but is not
# necessarily attracted to the Patron. This creates Dominion leverage only; it never fabricates sex evidence.
domcom_entice_through_lover_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = yes
    interface_priority = 55
    desc = domcom_entice_through_lover_interaction_desc
    cooldown_against_recipient = { years = 1 }

    is_shown = {
        scope:actor = {
            is_ai = no
            age >= 18
            is_alive = yes
            OR = {
                any_relation = {
                    type = soulmate
                    is_alive = yes
                    age >= 18
                    # Intermediary willingness: Soulmate, strongly positive Lover, Owned, or deeply Devoted.
                    OR = {
                        has_relation_soulmate = scope:actor
                        opinion = { target = scope:actor value >= 50 }
                        domcom_is_owned_by_actor_trigger = yes
                        AND = {
                            has_variable = domcom_obedience_patron
                            var:domcom_obedience_patron = scope:actor
                            has_variable = domcom_obedience
                            var:domcom_obedience >= 500
                        }
                    }
                    is_attracted_to_gender_of = scope:recipient
                    scope:recipient = {
                        is_attracted_to_gender_of = prev
                        OR = { has_relation_crush = prev has_relation_lover = prev has_relation_soulmate = prev }
                    }
                }
                any_relation = {
                    type = lover
                    is_alive = yes
                    age >= 18
                    # Intermediary willingness: Soulmate, strongly positive Lover, Owned, or deeply Devoted.
                    OR = {
                        has_relation_soulmate = scope:actor
                        opinion = { target = scope:actor value >= 50 }
                        domcom_is_owned_by_actor_trigger = yes
                        AND = {
                            has_variable = domcom_obedience_patron
                            var:domcom_obedience_patron = scope:actor
                            has_variable = domcom_obedience
                            var:domcom_obedience >= 500
                        }
                    }
                    is_attracted_to_gender_of = scope:recipient
                    scope:recipient = {
                        is_attracted_to_gender_of = prev
                        OR = { has_relation_crush = prev has_relation_lover = prev has_relation_soulmate = prev }
                    }
                }
            }
        }
        scope:recipient != scope:actor
        scope:recipient = {
            is_alive = yes
            age >= 18
            is_imprisoned = no
            NOT = { has_character_flag = domcom_pet }
            OR = {
                NOT = { has_variable = domcom_obedience_patron }
                var:domcom_obedience_patron = scope:actor
            }
        }
    }

    on_accept = {
        scope:actor = { save_scope_as = domcom_bait_patron }
        # Prefer a soulmate intermediary; otherwise use an eligible lover.
        scope:actor = {
            random_relation = {
                type = soulmate
                limit = {
                    is_alive = yes age >= 18
                    # Intermediary willingness: Soulmate, strongly positive Lover, Owned, or deeply Devoted.
                    OR = {
                        has_relation_soulmate = scope:actor
                        opinion = { target = scope:actor value >= 50 }
                        domcom_is_owned_by_actor_trigger = yes
                        AND = {
                            has_variable = domcom_obedience_patron
                            var:domcom_obedience_patron = scope:actor
                            has_variable = domcom_obedience
                            var:domcom_obedience >= 500
                        }
                    }
                    is_attracted_to_gender_of = scope:recipient
                    scope:recipient = {
                        is_attracted_to_gender_of = prev
                        OR = { has_relation_crush = prev has_relation_lover = prev has_relation_soulmate = prev }
                    }
                }
                save_scope_as = domcom_bait
            }
        }
        if = {
            limit = { NOT = { exists = scope:domcom_bait } }
            scope:actor = {
                random_relation = {
                    type = lover
                    limit = {
                        is_alive = yes age >= 18
                        # Intermediary willingness: Soulmate, strongly positive Lover, Owned, or deeply Devoted.
                        OR = {
                            has_relation_soulmate = scope:actor
                            opinion = { target = scope:actor value >= 50 }
                            domcom_is_owned_by_actor_trigger = yes
                            AND = {
                                has_variable = domcom_obedience_patron
                                var:domcom_obedience_patron = scope:actor
                                has_variable = domcom_obedience
                                var:domcom_obedience >= 500
                            }
                        }
                        is_attracted_to_gender_of = scope:recipient
                        scope:recipient = {
                            is_attracted_to_gender_of = prev
                            OR = { has_relation_crush = prev has_relation_lover = prev has_relation_soulmate = prev }
                        }
                    }
                    save_scope_as = domcom_bait
                }
            }
        }

        show_as_tooltip = {
            scope:recipient = {
                random_list = {
                    0 = { modifier = { add = domcom_entice_through_lover_chance_value } custom_tooltip = domcom_entice_through_lover_success_tt }
                    0 = { modifier = { add = domcom_entice_through_lover_failure_weight_value } custom_tooltip = domcom_entice_through_lover_failure_tt }
                }
            }
        }

        hidden_effect = {
            scope:recipient = {
                random = {
                    chance = domcom_entice_through_lover_chance_value
                    add_character_flag = domcom_entice_through_lover_succeeded
                }
            }
            if = {
                limit = { scope:recipient = { has_character_flag = domcom_entice_through_lover_succeeded } }
                scope:recipient = {
                    remove_character_flag = domcom_entice_through_lover_succeeded
                    domcom_apply_entice_through_lover_success_effect = yes
                }
                scope:actor = { send_interface_toast = { type = event_toast_effect_good title = domcom_entice_through_lover_success_toast left_icon = scope:domcom_bait right_icon = scope:recipient } }
            }
            else = {
                scope:recipient = { add_opinion = { target = scope:actor modifier = domcom_rebuffed_tantalize_opinion } }
                scope:actor = { send_interface_toast = { type = event_toast_effect_bad title = domcom_entice_through_lover_failure_toast left_icon = scope:domcom_bait right_icon = scope:recipient } }
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_deepen_communion_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 56
    desc = domcom_deepen_communion_interaction_desc
    cooldown_against_recipient = { months = 6 }

    is_shown = {
        scope:actor = { age >= 18 is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = {
            is_alive = yes
            age >= 18
            OR = {
                has_relation_lover = scope:actor
                has_relation_soulmate = scope:actor
            }
            NOT = { has_character_flag = domcom_pet }
            OR = {
                NOT = { has_variable = domcom_obedience_patron }
                var:domcom_obedience_patron = scope:actor
            }
            OR = {
                NOT = { has_variable = domcom_obedience }
                var:domcom_obedience < 1000
            }
        }
    }

    is_valid_showing_failures_only = {
        scope:actor = { is_imprisoned = no }
        scope:recipient = { is_imprisoned = no }
    }

    on_accept = {
        hidden_effect = {
            scope:actor = {
                set_variable = { name = domcom_communion_event_target value = scope:recipient }
                set_variable = { name = domcom_communion_event_score value = 0 }
                save_scope_as = domcom_communion_patron
                save_scope_as = domcom_compatibility_target
            }
            scope:recipient = {
                domcom_initialize_attraction_profile_effect = yes
                if = { limit = { NOT = { has_variable = domcom_obedience } } set_variable = { name = domcom_obedience value = 0 } }
                if = { limit = { NOT = { has_variable = domcom_obedience_patron } } set_variable = { name = domcom_obedience_patron value = scope:actor } }
                set_variable = { name = domcom_communion_event_compatibility value = domcom_pair_compatibility_value }
                if = {
                    limit = { NOT = { has_character_flag = domcom_tantalized_registered } }
                    add_character_flag = domcom_tantalized_registered
                    save_temporary_scope_as = domcom_deepen_subject
                    scope:actor = { add_to_variable_list = { name = domcom_tantalized_registry target = scope:domcom_deepen_subject } }
                }
                save_scope_as = domcom_communion_target
            }
            scope:actor = { trigger_event = { id = domcom_communion.100 } }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_test_devotion_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 55
    desc = domcom_test_devotion_interaction_desc
    cooldown_against_recipient = { years = 2 }

    is_shown = {
        scope:actor = { age >= 18 is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = {
            is_alive = yes
            age >= 18
            OR = { has_relation_lover = scope:actor has_relation_soulmate = scope:actor }
            has_variable = domcom_obedience_patron
            var:domcom_obedience_patron = scope:actor
            has_variable = domcom_obedience
            var:domcom_obedience >= 600
            var:domcom_obedience < 1000
            NOT = { has_character_flag = domcom_pet }
        }
    }

    is_valid_showing_failures_only = {
        scope:actor = { is_imprisoned = no }
        scope:recipient = { is_imprisoned = no }
    }

    on_accept = {
        hidden_effect = {
            scope:actor = {
                set_variable = { name = domcom_communion_event_target value = scope:recipient }
                save_scope_as = domcom_communion_patron
            }
            scope:recipient = { save_scope_as = domcom_communion_target }
            scope:actor = { trigger_event = { id = domcom_communion.200 } }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_claim_as_pet_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 58
    desc = domcom_claim_as_pet_interaction_desc
    cooldown_against_recipient = { years = 1 }

    is_shown = { always = no }

    is_valid_showing_failures_only = {
        scope:actor = { is_imprisoned = no }
        scope:recipient = { is_imprisoned = no }
    }

    on_accept = {
        hidden_effect = {
            scope:actor = {
                set_variable = { name = domcom_communion_event_target value = scope:recipient }
                save_scope_as = domcom_communion_patron
            }
            scope:recipient = { save_scope_as = domcom_communion_target }
            scope:actor = { trigger_event = { id = domcom_communion.300 } }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

# A human Patron may deliberately convert one of their already-resolved Cuck-collapse subjects into
# the numbered Slave/Absolute Submission track. This is not automatic: Final Collapse and Devotion remain
# distinct until the player chooses to merge them.
domcom_take_collapsed_as_slave_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 59
    desc = domcom_take_collapsed_as_slave_interaction_desc

    is_shown = {
        scope:actor = { is_ai = no age >= 18 is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = {
            is_alive = yes
            age >= 18
            has_character_flag = domcom_collapse_resolved
            NOT = { has_character_flag = domcom_pet }
            OR = {
                AND = { has_variable = domcom_patron var:domcom_patron = scope:actor }
                AND = { has_variable = domcom_cuck_patron var:domcom_cuck_patron = scope:actor }
                AND = { has_variable = domcom_feminized_by var:domcom_feminized_by = scope:actor }
            }
        }
    }

    is_valid_showing_failures_only = {
        scope:actor = { is_imprisoned = no }
    }

    on_accept = {
        hidden_effect = {
            scope:actor = { save_scope_as = domcom_tantalize_patron }
            scope:recipient = {
                set_variable = { name = domcom_obedience_patron value = scope:actor }
                set_variable = { name = domcom_pet_patron value = scope:actor }
                set_variable = { name = domcom_obedience value = 1000 }
                domcom_create_pet_effect = yes
            }
            scope:actor = {
                send_interface_toast = {
                    type = event_toast_effect_good
                    title = DOMCOM_COLLAPSED_SLAVE_CREATED_TOAST
                    left_icon = scope:actor
                    right_icon = scope:recipient
                }
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_inspect_obedience_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 55
    desc = domcom_inspect_obedience_interaction_desc

    is_shown = {
        scope:recipient = {
            has_variable = domcom_obedience_patron
            var:domcom_obedience_patron = scope:actor
            has_variable = domcom_obedience
        }
    }
    on_accept = {
        scope:actor = {
            domcom_prepare_ui_shell_effect = yes
            set_variable = { name = domcom_ui_page value = flag:tantalized }
            domcom_prepare_tantalized_page_safe_effect = yes
            set_variable = { name = domcom_ui_open value = yes }
        }
    }
    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_inspect_dominion_interaction = {
    icon = arbitrary
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 54
    desc = domcom_inspect_dominion_interaction_desc

    is_shown = {
        scope:recipient = {
            OR = { has_character_flag = domcom_cucked has_character_flag = domcom_owned_cuck }
        }
    }
    on_accept = {
        scope:actor = {
            domcom_prepare_ui_shell_effect = yes
            if = {
                limit = { scope:recipient = { has_character_flag = domcom_owned_cuck } }
                set_variable = { name = domcom_ui_page value = flag:owned }
                domcom_prepare_owned_page_safe_effect = yes
            }
            else = {
                set_variable = { name = domcom_ui_page value = flag:cucked }
                domcom_prepare_cucked_page_safe_effect = yes
            }
            set_variable = { name = domcom_ui_open value = yes }
        }
    }
    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_embarrass_through_relative_interaction = {
    icon = wrathful
    category = interaction_category_hostile
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 53
    desc = domcom_embarrass_through_relative_interaction_desc
    cooldown_against_recipient = { months = 4 }

    is_shown = {
        scope:actor = { age >= 18 is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = { domcom_can_publicly_humiliate_through_recipient_trigger = yes }
    }

    on_accept = {
        show_as_tooltip = { custom_tooltip = domcom_embarrass_random_target_tt }
        hidden_effect = {
            scope:actor = { save_scope_as = domcom_public_patron }
            scope:recipient = { save_scope_as = domcom_public_partner }

            scope:recipient = {
                random_spouse = {
                    limit = { domcom_is_owned_by_actor_trigger = yes }
                    save_scope_as = domcom_humiliated_cuck
                }
            }
            if = {
                limit = { NOT = { exists = scope:domcom_humiliated_cuck } }
                scope:recipient = {
                    random_close_or_extended_family_member = {
                        limit = { domcom_is_owned_by_actor_trigger = yes }
                        save_scope_as = domcom_humiliated_cuck
                    }
                }
            }

            if = {
                limit = { exists = scope:domcom_humiliated_cuck scope:domcom_humiliated_cuck = { domcom_can_attempt_embarrass_owned_trigger = { PATRON = scope:actor } } }
                scope:domcom_humiliated_cuck = { domcom_prepare_embarrass_attempt_effect = yes }
                scope:actor = { domcom_resolve_embarrass_attempt_effect = yes }
            }
            }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

# 2.6.56 — old saves did not record whether a Protected Bond had been a spouse or concubine before
# a third-party Set Aside/divorce. These explicit player-facing repairs let the player resolve that one
# ambiguous legacy case instead of relying on hidden inference. New protections remember the exact state.
domcom_restore_protected_marriage_interaction = {
    icon = marriage
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 54
    desc = domcom_restore_protected_marriage_interaction_desc

    is_shown = {
        scope:actor = { is_ai = no is_alive = yes }
        scope:recipient = {
            is_alive = yes
            has_character_flag = domcom_protected_intimate
            has_variable = domcom_protected_intimate_patron
            var:domcom_protected_intimate_patron = scope:actor
            NOT = { is_spouse_of = scope:actor }
        }
    }

    is_valid_showing_failures_only = {
        scope:actor = { can_marry_character_trigger = { CHARACTER = scope:recipient } }
    }

    on_accept = {
        marry_on_realm_law = { SPOUSE_1 = scope:actor SPOUSE_2 = scope:recipient }
        scope:recipient = {
            add_character_flag = domcom_protected_origin_v2656
            add_character_flag = domcom_protected_was_spouse
            remove_character_flag = domcom_protected_was_concubine
        }
        scope:actor = {
            send_interface_toast = {
                type = event_toast_effect_good
                title = DOMCOM_PROTECTED_BOND_MANUAL_MARRIAGE_TOAST
                left_icon = scope:actor
                right_icon = scope:recipient
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_will_do = { base = 0 }
}

domcom_restore_protected_concubine_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 54
    desc = domcom_restore_protected_concubine_interaction_desc

    is_shown = {
        scope:actor = { is_ai = no is_alive = yes }
        scope:recipient = {
            is_alive = yes
            has_character_flag = domcom_protected_intimate
            has_variable = domcom_protected_intimate_patron
            var:domcom_protected_intimate_patron = scope:actor
            NOT = { is_consort_of = scope:actor }
        }
    }

    is_valid_showing_failures_only = {
        scope:actor = { allowed_more_concubines = yes }
        scope:recipient = { is_imprisoned = no is_married = no is_concubine = no }
    }

    on_accept = {
        scope:actor = { make_concubine = scope:recipient }
        scope:recipient = {
            add_character_flag = domcom_protected_origin_v2656
            add_character_flag = domcom_protected_was_concubine
            remove_character_flag = domcom_protected_was_spouse
        }
        scope:actor = {
            send_interface_toast = {
                type = event_toast_effect_good
                title = DOMCOM_PROTECTED_BOND_MANUAL_CONCUBINE_TOAST
                left_icon = scope:actor
                right_icon = scope:recipient
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_will_do = { base = 0 }
}

# Expose CK3's already-stored biological father. The actor must be one of the directly involved
# parents (assumed father, mother, or real father). This is deliberately player-facing: if CK3 already
# stores disputed parentage for your child, Dominion does not hide the reveal behind secret knowledge.
domcom_reveal_true_parentage_interaction = {
    icon = heir
    category = interaction_category_hostile
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 53
    desc = domcom_reveal_true_parentage_interaction_desc

    is_shown = {
        scope:actor = { is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = {
            is_alive = yes
            exists = real_father
            exists = father
            NOT = { father = real_father }
            OR = {
                father = scope:actor
                mother = scope:actor
                real_father = scope:actor
            }
        }
    }

    on_accept = {
        scope:actor = { save_scope_as = domcom_parentage_revealer }
        scope:recipient = { domcom_reveal_true_parentage_effect = yes }
        scope:actor = {
            send_interface_toast = {
                type = event_toast_effect_neutral
                title = domcom_reveal_true_parentage_toast
                left_icon = scope:actor
                right_icon = scope:recipient
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}


# Player-facing repair for concealed/stale noble identity. Unlike Reveal True Parentage, this is not
# restricted to the directly involved parents: the player explicitly targets the character to expose
# parentage/House information CK3 already stores. It never invents a father or House.
domcom_restore_concealed_identity_interaction = {
    icon = heir
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 52
    desc = domcom_restore_concealed_identity_interaction_desc

    is_shown = {
        scope:actor = { is_ai = no is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = {
            is_alive = yes
            exists = real_father
            real_father = { exists = house }
            OR = {
                NOT = { exists = father }
                AND = { exists = father NOT = { father = real_father } }
                NOT = { exists = house }
                AND = {
                    exists = house
                    real_father = { NOT = { house = scope:recipient.house } }
                }
            }
        }
    }

    on_accept = {
        scope:actor = { save_scope_as = domcom_parentage_revealer }
        scope:recipient = { domcom_restore_concealed_identity_effect = yes }
        scope:actor = {
            send_interface_toast = {
                type = event_toast_effect_neutral
                title = domcom_restore_concealed_identity_toast
                left_icon = scope:actor
                right_icon = scope:recipient
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_acknowledge_blood_interaction = {
    icon = heir
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 52
    desc = domcom_acknowledge_blood_interaction_desc

    is_shown = {
        scope:actor = { is_alive = yes exists = house }
        scope:recipient != scope:actor
        scope:recipient = {
            is_alive = yes
            OR = {
                real_father ?= scope:actor
                mother ?= scope:actor
                AND = {
                    father ?= scope:actor
                    NOT = { exists = real_father }
                }
            }
            OR = { NOT = { exists = house } NOT = { house = scope:actor.house } }
        }
    }

    on_accept = {
        scope:actor = { save_scope_as = domcom_ack_patron }
        scope:recipient = { domcom_acknowledge_child_effect = yes }
        if = {
            limit = { scope:actor = { is_ai = no } }
            scope:actor = {
                send_interface_toast = {
                    type = event_toast_effect_good
                    title = domcom_acknowledge_blood_toast
                    left_icon = scope:actor
                    right_icon = scope:recipient
                }
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_demand_abdication_for_blood_interaction = {
    icon = heir
    category = interaction_category_hostile
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 51
    desc = domcom_demand_abdication_for_blood_interaction_desc
    cooldown_against_recipient = { years = 1 }

    is_shown = {
        scope:actor = { is_alive = yes }
        scope:recipient = { domcom_can_demand_abdication_for_blood_trigger = { PATRON = scope:actor } }
    }

    on_accept = {
        scope:actor = { save_scope_as = domcom_abdication_patron }

        show_as_tooltip = {
            scope:recipient = {
                random_list = {
                    0 = {
                        modifier = { add = domcom_abdication_chance_value }
                        custom_tooltip = domcom_demand_abdication_tt_success
                    }
                    0 = {
                        modifier = { add = domcom_abdication_failure_weight_value }
                        custom_tooltip = domcom_demand_abdication_tt_failure
                    }
                }
            }
        }
        hidden_effect = {
            scope:recipient = {
                random = {
                    chance = domcom_abdication_chance_value
                    domcom_abdicate_to_blood_effect = yes
                    add_character_flag = domcom_abdication_succeeded
                }
            }
            if = {
                limit = { scope:recipient = { has_character_flag = domcom_abdication_succeeded } }
                scope:recipient = { remove_character_flag = domcom_abdication_succeeded }
                if = {
                    limit = { scope:actor = { is_ai = no } }
                    scope:actor = {
                        send_interface_toast = {
                            type = event_toast_effect_good
                            title = domcom_abdication_success_toast
                            left_icon = scope:actor
                            right_icon = scope:recipient
                        }
                    }
                }
            }
            else = {
                scope:recipient = {
                    change_variable = { name = domcom_cuck_xp add = 100 }
                    domcom_refresh_cuck_stage_effect = yes
                }
                if = {
                    limit = { scope:actor = { is_ai = no } }
                    scope:actor = {
                        send_interface_toast = {
                            type = event_toast_effect_bad
                            title = domcom_abdication_failure_toast
                            left_icon = scope:actor
                            right_icon = scope:recipient
                        }
                    }
                }
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}


domcom_claim_crowned_union_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 54
    desc = domcom_claim_crowned_union_interaction_desc
    cooldown_against_recipient = { years = 5 }

    is_shown = {
        scope:actor = {
            is_ai = no
            is_alive = yes
            age >= 18
            is_imprisoned = no
            can_marry_trigger = yes
        }
        scope:recipient = {
            is_ai = yes
            domcom_crowned_union_pet_trigger = { PARTNER = scope:actor }
        }
    }

    is_valid_showing_failures_only = {
        scope:actor = { is_imprisoned = no can_marry_trigger = yes }
        scope:recipient = {
            is_imprisoned = no
            domcom_crowned_union_proximity_trigger = { PARTNER = scope:actor }
        }
    }

    on_accept = {
        show_as_tooltip = { custom_tooltip = domcom_claim_crowned_union_tt }
        hidden_effect = {
            scope:actor = { save_scope_as = domcom_crowned_partner }
            scope:recipient = {
                save_scope_as = domcom_crowned_queen
                domcom_form_crowned_union_effect = yes
            }

            if = {
                limit = { scope:recipient = { has_character_flag = domcom_crowned_union_completed } }
                scope:recipient = { remove_character_flag = domcom_crowned_union_completed }
                scope:actor = {
                    send_interface_toast = {
                        type = event_toast_effect_good
                        title = domcom_crowned_union_success_toast
                        left_icon = scope:actor
                        right_icon = scope:recipient
                    }
                }
            }
            else = {
                scope:actor = {
                    send_interface_toast = {
                        type = event_toast_effect_bad
                        title = domcom_crowned_union_failed_toast
                        left_icon = scope:actor
                        right_icon = scope:recipient
                    }
                }
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}


domcom_taunt_cuck_interaction = {
    icon = wrathful
    category = interaction_category_hostile
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 56
    desc = domcom_taunt_cuck_interaction_desc
    cooldown_against_recipient = { months = 12 }

    is_shown = {
        scope:actor = { age >= 18 is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = {
            age >= 18
            is_alive = yes
            has_character_flag = domcom_cucked
            has_variable = domcom_cuck_patron
            var:domcom_cuck_patron = scope:actor
        }
    }

    is_valid_showing_failures_only = {
        scope:actor = { is_imprisoned = no }
        scope:recipient = { is_imprisoned = no }
    }

    on_accept = {
        scope:actor = { save_scope_as = domcom_taunt_patron }
        scope:recipient = {
            set_variable = { name = domcom_taunt_patron value = scope:actor }
            trigger_event = { id = domcom.600 days = 1 }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_invite_to_bed_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 56
    desc = domcom_invite_to_bed_interaction_desc
    cooldown_against_recipient = { months = 1 }

    is_shown = {
        scope:actor = { age >= 18 is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = { domcom_intimacy_partner_trigger = yes }
    }

    is_valid_showing_failures_only = {
        scope:actor = { is_imprisoned = no }
        scope:recipient = { is_imprisoned = no }
    }

    on_accept = {
        show_as_tooltip = { custom_tooltip = domcom_invite_to_bed_tt }
        hidden_effect = {
            # 2.6.27: keep interaction context only long enough to persist the selected partner
            # on the player. The actual choice event is isolated in its own namespace/file and
            # reconstructs all intimacy scopes one day later.
            scope:recipient = { save_scope_as = domcom_intimacy_partner_bridge }
            scope:actor = {
                set_variable = { name = domcom_intimacy_pending_partner value = scope:domcom_intimacy_partner_bridge }
                trigger_event = { id = domcom_intimacy.0001 }
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}


# Final Collapse follow-up available only to the Patron who imposed Feminization. This does not create a
# second progression track; it simply reasserts public presentation and adds a temporary public-display cost.
domcom_enforce_feminized_presentation_interaction = {
    icon = lover
    category = interaction_category_hostile
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 57
    desc = domcom_enforce_feminized_presentation_interaction_desc
    cooldown_against_recipient = { years = 1 }

    is_shown = {
        scope:actor = { age >= 18 is_alive = yes }
        scope:recipient != scope:actor
        scope:recipient = {
            is_alive = yes
            age >= 18
            is_male = yes
            has_trait = domcom_feminized_trait
            has_variable = domcom_feminized_by
            var:domcom_feminized_by = scope:actor
        }
    }

    is_valid_showing_failures_only = {
        scope:actor = { is_imprisoned = no }
        scope:recipient = { is_imprisoned = no }
    }

    on_accept = {
        show_as_tooltip = { custom_tooltip = domcom_enforce_feminized_presentation_tt }
        hidden_effect = {
            scope:actor = { save_scope_as = domcom_feminization_patron }
            scope:recipient = {
                domcom_refresh_feminized_reputation_effect = yes
                add_character_modifier = { modifier = domcom_feminized_public_display_modifier years = 3 }
                add_opinion = { target = scope:actor modifier = domcom_feminized_display_opinion }
                add_prestige = -150
            }
            scope:actor = {
                add_prestige = 75
                add_dread = 2
                send_interface_toast = {
                    type = event_toast_effect_good
                    title = domcom_feminized_presentation_toast
                    left_icon = scope:actor
                    right_icon = scope:recipient
                }
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}


# Player-only debug/fantasy tool for deliberately configuring a favorite adult character.
domcom_power_fantasy_override_interaction = {
    icon = arbitrary
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 40
    desc = domcom_power_fantasy_override_interaction_desc

    is_shown = {
        scope:actor = { is_ai = no age >= 18 is_alive = yes }
        scope:recipient = { is_alive = yes age >= 18 }
    }

    on_accept = {
        scope:actor = {
            set_variable = { name = domcom_power_override_target value = scope:recipient }
            save_scope_as = domcom_power_override_actor
            trigger_event = { id = domcom_override.100 }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}


# -----------------------------------------------------------------------------
# 2.6.0 — Human Amongst AI powers
# -----------------------------------------------------------------------------
domcom_human_ai_mind_read_interaction = {
    icon = intrigue
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 95
    desc = domcom_human_ai_mind_read_interaction_desc
    is_shown = { scope:actor = { has_trait = domcom_human_among_ai_trait is_alive = yes NOT = { has_character_modifier = domcom_human_ai_contained_modifier } NOT = { has_character_modifier = domcom_human_ai_godsbane_modifier } } scope:recipient != scope:actor scope:recipient = { is_alive = yes } }
    on_accept = { scope:recipient = { every_secret = { reveal_to = scope:actor } every_spouse = { every_secret = { reveal_to = scope:actor } } } }
    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_human_ai_telepathic_command_interaction = {
    icon = intrigue
    category = interaction_category_hostile
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 94
    desc = domcom_human_ai_telepathic_command_interaction_desc
    is_shown = { scope:actor = { has_trait = domcom_human_among_ai_trait is_alive = yes NOT = { has_character_modifier = domcom_human_ai_contained_modifier } NOT = { has_character_modifier = domcom_human_ai_godsbane_modifier } } scope:recipient != scope:actor scope:recipient = { is_alive = yes } }
    on_accept = {
        scope:actor = { save_scope_as = domcom_human_ai_patron }
        if = { limit = { scope:actor = { can_add_hook = { target = scope:recipient type = loyalty_hook } } } scope:actor = { add_hook_no_toast = { target = scope:recipient type = loyalty_hook } } }
        if = {
            limit = { scope:actor = { OR = { NOT = { has_variable = domcom_human_ai_time_charges } var:domcom_human_ai_time_charges <= 0 } } }
            scope:recipient = { add_opinion = { target = scope:actor modifier = domcom_human_ai_psychic_violation_opinion } }
            scope:actor = { add_prestige = -100 }
        }
        else = { scope:actor = { domcom_human_ai_consume_time_charge_effect = yes } }
    }
    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_human_ai_teleport_to_court_interaction = {
    icon = intrigue
    category = interaction_category_hostile
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 93
    desc = domcom_human_ai_teleport_to_court_interaction_desc
    is_shown = {
        scope:actor = { has_trait = domcom_human_among_ai_trait is_alive = yes NOT = { has_character_modifier = domcom_human_ai_contained_modifier } NOT = { has_character_modifier = domcom_human_ai_godsbane_modifier } }
        scope:recipient != scope:actor
        scope:recipient = {
            is_alive = yes
            is_landed = no
            is_ruler = no
            is_imprisoned = no
            NOT = { is_landless_adventurer = yes }
            NOT = { employer = scope:actor }
        }
    }
    is_valid_showing_failures_only = {
        scope:recipient = { is_ruler = no NOT = { is_landless_adventurer = yes } }
    }
    on_accept = {
        scope:recipient = { set_employer = scope:actor }
        if = {
            limit = { scope:actor = { OR = { NOT = { has_variable = domcom_human_ai_time_charges } var:domcom_human_ai_time_charges <= 0 } } }
            scope:recipient = { add_opinion = { target = scope:actor modifier = domcom_human_ai_forced_teleport_opinion } }
            scope:actor = { add_prestige = -150 }
        }
        else = { scope:actor = { domcom_human_ai_consume_time_charge_effect = yes } }
    }
    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_human_ai_demand_submission_interaction = {
    icon = wrathful
    category = interaction_category_hostile
    common_interaction = yes
    use_diplomatic_range = yes
    interface_priority = 96
    desc = domcom_human_ai_demand_submission_interaction_desc
    is_shown = {
        scope:actor = { has_trait = domcom_human_among_ai_trait is_alive = yes NOT = { has_character_modifier = domcom_human_ai_contained_modifier } NOT = { has_character_modifier = domcom_human_ai_godsbane_modifier } is_landed = yes is_independent_ruler = yes }
        scope:recipient != scope:actor
        scope:recipient = { is_alive = yes is_landed = yes is_independent_ruler = yes }
    }
    on_accept = {
        start_tributary_interaction_effect = { TRIBUTARY = scope:recipient SUZERAIN = scope:actor }
        if = {
            limit = { scope:actor = { OR = { NOT = { has_variable = domcom_human_ai_time_charges } var:domcom_human_ai_time_charges <= 0 } } }
            scope:recipient = { add_opinion = { target = scope:actor modifier = domcom_human_ai_submission_opinion } }
            scope:actor = { add_prestige = -250 }
        }
        else = { scope:actor = { domcom_human_ai_consume_time_charge_effect = yes } }
    }
    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}


# 2.6.21 — Reputation reward. A genuine Patron can turn an established reputation into material support.
domcom_bestow_patronage_interaction = {
    icon = gift
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = yes
    interface_priority = 42
    desc = domcom_bestow_patronage_interaction_desc
    cooldown_against_recipient = { years = 5 }

    is_shown = {
        scope:actor = {
            is_alive = yes
            has_variable = domcom_reputation_strength
            var:domcom_reputation_strength >= 25
            has_variable = domcom_rep_patron
            var:domcom_rep_patron >= 25
        }
        scope:recipient != scope:actor
        scope:recipient = { is_alive = yes }
    }

    is_valid_showing_failures_only = {
        scope:actor = {
            custom_tooltip = { text = domcom_bestow_patronage_gold_tt gold >= 150 }
        }
    }

    on_accept = {
        scope:actor = {
            remove_short_term_gold = 150
            domcom_rep_gain_patron_major_effect = yes
        }
        scope:recipient = {
            add_gold = 100
            add_character_modifier = { modifier = domcom_under_patronage years = 5 }
            add_opinion = { target = scope:actor modifier = domcom_patronage_gratitude_opinion }
        }
        scope:actor = {
            send_interface_toast = {
                type = event_toast_effect_good
                title = domcom_bestow_patronage_toast
                left_icon = scope:actor
                right_icon = scope:recipient
            }
        }
    }

    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}


# 2.6.59 — Optional public status for a Devoted woman. This is a player choice; Devotion never auto-assigns it.
domcom_designate_trophy_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 54
    desc = domcom_designate_trophy_interaction_desc

    is_shown = {
        scope:actor = { is_alive = yes age >= 18 is_ai = no }
        scope:recipient != scope:actor
        scope:recipient = {
            is_alive = yes age >= 18 is_female = yes
            has_variable = domcom_obedience
            var:domcom_obedience >= 800
            has_variable = domcom_obedience_patron
            var:domcom_obedience_patron = scope:actor
            NOT = { has_character_flag = domcom_public_trophy }
        }
    }
    is_valid_showing_failures_only = { scope:actor = { is_imprisoned = no } }
    on_accept = {
        scope:actor = { save_scope_as = domcom_trophy_patron }
        scope:recipient = { domcom_designate_trophy_effect = yes }
    }
    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}

domcom_end_trophy_interaction = {
    icon = lover
    category = interaction_category_friendly
    common_interaction = yes
    use_diplomatic_range = no
    interface_priority = 53
    desc = domcom_end_trophy_interaction_desc

    is_shown = {
        scope:actor = { is_alive = yes age >= 18 is_ai = no }
        scope:recipient = {
            is_alive = yes
            has_character_flag = domcom_public_trophy
            has_variable = domcom_trophy_patron
            var:domcom_trophy_patron = scope:actor
        }
    }
    on_accept = { scope:recipient = { domcom_end_trophy_effect = yes } }
    auto_accept = yes
    ai_accept = { base = 100 }
    ai_frequency = 0
}
