﻿#################################
#     Healing Interactions      #
#################################

# Level I: Minor Healing
# Requires only a spark of divine power. Cleanses surface-level behavioral or social afflictions.
heal_minor = {
    category = interaction_category_friendly
    desc = heal_minor_desc
    icon = heal_divine_icon
    auto_accept = yes
    use_diplomatic_range = no

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god
                has_trait = fallen_god
                has_trait = young_god_light
                has_trait = young_god_dark
                has_trait = archangel
                has_trait = dark_archangel
                has_trait = angel
                has_trait = dark_angel
                has_trait = god_blood
                has_trait = angel_blood
            }
        }
        scope:recipient = {
            OR = {
                has_trait = lisping
                has_trait = stuttering
                has_trait = drunkard
                has_trait = depressed_1
                has_trait = reclusive
                has_trait = ill
                has_trait = flagellant
                has_trait = wheezing
                has_trait = spindly
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            remove_trait = lisping
            remove_trait = stuttering
            remove_trait = drunkard
            remove_trait = depressed_1
            remove_trait = reclusive
            remove_trait = ill
            remove_trait = flagellant
            remove_trait = wheezing
            remove_trait = spindly

            add_opinion = {
                target = scope:actor
                modifier = opinion_heal_minor
            }
        }
    }
}

# Level II: Moderate Healing
# Requires a deeper well of divine strength. Repairs physical deformities and non-lethal injuries.
heal_moderate = {
    category = interaction_category_friendly
    desc = heal_moderate_desc
    icon = heal_divine_icon
    auto_accept = yes
    use_diplomatic_range = no

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god
                has_trait = fallen_god
                has_trait = young_god_light
                has_trait = young_god_dark
                has_trait = archangel
                has_trait = dark_archangel
                has_trait = angel
                has_trait = dark_angel
            }
        }
        scope:recipient = {
            OR = {
                has_trait = clubfooted
                has_trait = hunchbacked
                has_trait = scaly
                has_trait = one_eyed
                has_trait = one_legged
                has_trait = disfigured
                has_trait = wounded_1
                has_trait = wounded_2
                has_trait = albino
                has_trait = sickly
                has_trait = lovers_pox
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            remove_trait = clubfooted
            remove_trait = hunchbacked
            remove_trait = scaly
            remove_trait = one_eyed
            remove_trait = one_legged
            remove_trait = disfigured
            remove_trait = wounded_1
            remove_trait = wounded_2
            remove_trait = albino
            remove_trait = sickly
            remove_trait = lovers_pox

            add_opinion = {
                target = scope:actor
                modifier = opinion_heal_moderate
            }
        }
    }
}

# Level III: Major Healing
# Reserved for those with a higher divine calling. Treats severe diseases and mental afflictions.
heal_major = {
    category = interaction_category_friendly
    desc = heal_major_desc
    icon = heal_divine_icon
    auto_accept = yes
    use_diplomatic_range = no

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god
                has_trait = fallen_god
                has_trait = young_god_light
                has_trait = young_god_dark
                has_trait = archangel
                has_trait = dark_archangel
            }
        }
        scope:recipient = {
            OR = {
                has_trait = infertile
                has_trait = impotent
                has_trait = possessed
                has_trait = lunatic_1
                has_trait = inbred
                has_trait = pneumonic
                has_trait = cancer
                has_trait = consumption
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            remove_trait = infertile
            remove_trait = impotent
            remove_trait = possessed
            remove_trait = lunatic_1
            remove_trait = inbred
            remove_trait = pneumonic
            remove_trait = cancer
            remove_trait = consumption

            add_opinion = {
                target = scope:actor
                modifier = opinion_heal_major
            }
        }
    }
}

# Level IV: Critical Healing
# Requires divine perfection. Capable of reversing deathly, congenital, or immutable conditions.
heal_critical = {
    category = interaction_category_friendly
    desc = heal_critical_desc
    icon = heal_divine_icon
    auto_accept = yes
    use_diplomatic_range = no

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god
                has_trait = fallen_god
            }
        }
        scope:recipient = {
            OR = {
                has_trait = dwarf
                has_trait = giant
                has_trait = eunuch
                has_trait = lunatic_genetic
                has_trait = possessed_genetic
                has_trait = wounded_3
                has_trait = leper
                has_trait = smallpox
                has_trait = bubonic_plague
                has_trait = incapable
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            remove_trait = dwarf
            remove_trait = giant
            remove_trait = eunuch
            remove_trait = lunatic_genetic
            remove_trait = possessed_genetic
            remove_trait = wounded_3
            remove_trait = leper
            remove_trait = smallpox
            remove_trait = bubonic_plague
            remove_trait = incapable

            add_opinion = {
                target = scope:actor
                modifier = opinion_heal_critical
            }
        }
    }
}

#################################
#     Gift of Awakening         #
#################################

gift_awakening = {
    category = interaction_category_friendly
    desc = gift_awakening_desc                      ## Tooltip: Mark with divine potential — entry-tier divine traits
    icon = gift_of_awakening
    auto_accept = yes
    use_diplomatic_range = no
    interface_priority = 100

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god
                has_trait = fallen_god
                has_trait = archangel
                has_trait = dark_archangel
                has_trait = young_god_light
                has_trait = young_god_dark
                has_trait = demi_god
                has_trait = angel
                has_trait = dark_angel
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            ## Remove higher-tier divine traits
            remove_trait = beauty_good_3
            remove_trait = intellect_good_3
            remove_trait = physique_good_3
            remove_trait = beauty_good_2
            remove_trait = intellect_good_2
            remove_trait = physique_good_2
            remove_trait = beauty_good_1
            remove_trait = intellect_good_1
            remove_trait = physique_good_1
            remove_trait = beauty_bad_3
            remove_trait = intellect_bad_3
            remove_trait = physique_bad_3
            remove_trait = beauty_bad_2
            remove_trait = intellect_bad_2
            remove_trait = physique_bad_2
            remove_trait = beauty_bad_1
            remove_trait = intellect_bad_1
            remove_trait = physique_bad_1

            ## Grant entry-tier traits: Comely, Quick, Hale
            add_trait = beauty_good_1
            add_trait = intellect_good_1
            add_trait = physique_good_1

            ## Apply corresponding opinion modifier
            if = {
                limit = { has_character_flag = gift_awakening }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_awakening
                }
                remove_character_flag = gift_awakening
            }
            if = {
                limit = { has_character_flag = gift_refinement }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_refinement
                }
                remove_character_flag = gift_refinement
            }
            if = {
                limit = { has_character_flag = gift_ascension }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_ascension
                }
                remove_character_flag = gift_ascension
            }
            if = {
                limit = { has_character_flag = curse_descent }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_descent
                }
                remove_character_flag = curse_descent
            }
            if = {
                limit = { has_character_flag = curse_corruption }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_corruption
                }
                remove_character_flag = curse_corruption
            }
            if = {
                limit = { has_character_flag = curse_oblivion }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_oblivion
                }
                remove_character_flag = curse_oblivion
            }
            add_opinion = {
                target = scope:actor
                modifier = opinion_gift_awakening         ## "You awakened latent divinity within this character..."
            }
            add_character_flag = gift_awakening
        }
    }
}

#################################
#     Gift of Refinement        #
#################################

gift_refinement = {
    category = interaction_category_friendly
    desc = gift_refinement_desc                      ## Tooltip: Elevate with refined grace — middle-tier divine traits
    icon = gift_of_refinement
    auto_accept = yes
    use_diplomatic_range = no
    interface_priority = 101

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god
                has_trait = fallen_god
                has_trait = archangel
                has_trait = dark_archangel
                has_trait = young_god_light
                has_trait = young_god_dark
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            ## Remove lower and higher-tier traits
            remove_trait = beauty_good_3
            remove_trait = intellect_good_3
            remove_trait = physique_good_3
            remove_trait = beauty_good_2
            remove_trait = intellect_good_2
            remove_trait = physique_good_2
            remove_trait = beauty_good_1
            remove_trait = intellect_good_1
            remove_trait = physique_good_1
            remove_trait = beauty_bad_3
            remove_trait = intellect_bad_3
            remove_trait = physique_bad_3
            remove_trait = beauty_bad_2
            remove_trait = intellect_bad_2
            remove_trait = physique_bad_2
            remove_trait = beauty_bad_1
            remove_trait = intellect_bad_1
            remove_trait = physique_bad_1

            ## Grant middle-tier traits: Pretty, Intelligent, Robust
            add_trait = beauty_good_2
            add_trait = intellect_good_2
            add_trait = physique_good_2

            ## Apply corresponding opinion modifier
            if = {
                limit = { has_character_flag = gift_awakening }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_awakening
                }
                remove_character_flag = gift_awakening
            }
            if = {
                limit = { has_character_flag = gift_refinement }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_refinement
                }
                remove_character_flag = gift_refinement
            }
            if = {
                limit = { has_character_flag = gift_ascension }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_ascension
                }
                remove_character_flag = gift_ascension
            }
            if = {
                limit = { has_character_flag = curse_descent }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_descent
                }
                remove_character_flag = curse_descent
            }
            if = {
                limit = { has_character_flag = curse_corruption }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_corruption
                }
                remove_character_flag = curse_corruption
            }
            if = {
                limit = { has_character_flag = curse_oblivion }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_oblivion
                }
                remove_character_flag = curse_oblivion
            } 
            add_opinion = {
                target = scope:actor
                modifier = opinion_gift_refinement       ## "You refined this character’s form and mind..."
            }
            add_character_flag = gift_refinement
        }
    }
}

#################################
#     Gift of Ascension         #
#################################

gift_ascension = {
    category = interaction_category_friendly
    desc = gift_ascension_desc                      ## Tooltip: Imbue with radiant perfection — the highest divine traits
    icon = gift_of_ascension
    auto_accept = yes
    use_diplomatic_range = no
    interface_priority = 102

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god             ## Only highest gods
                has_trait = fallen_god
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            ## Remove lower-tier divine traits
            remove_trait = beauty_good_3
            remove_trait = intellect_good_3
            remove_trait = physique_good_3
            remove_trait = beauty_good_2
            remove_trait = intellect_good_2
            remove_trait = physique_good_2
            remove_trait = beauty_good_1
            remove_trait = intellect_good_1
            remove_trait = physique_good_1
            remove_trait = beauty_bad_3
            remove_trait = intellect_bad_3
            remove_trait = physique_bad_3
            remove_trait = beauty_bad_2
            remove_trait = intellect_bad_2
            remove_trait = physique_bad_2
            remove_trait = beauty_bad_1
            remove_trait = intellect_bad_1
            remove_trait = physique_bad_1

            ## Grant highest-tier traits: Beautiful, Genius, Herculean/Amazonian
            add_trait = beauty_good_3
            add_trait = intellect_good_3
            add_trait = physique_good_3

            ## Apply corresponding opinion modifier
            if = {
                limit = { has_character_flag = gift_awakening }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_awakening
                }
                remove_character_flag = gift_awakening
            }
            if = {
                limit = { has_character_flag = gift_refinement }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_refinement
                }
                remove_character_flag = gift_refinement
            }
            if = {
                limit = { has_character_flag = gift_ascension }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_ascension
                }
                remove_character_flag = gift_ascension
            }
            if = {
                limit = { has_character_flag = curse_descent }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_descent
                }
                remove_character_flag = curse_descent
            }
            if = {
                limit = { has_character_flag = curse_corruption }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_corruption
                }
                remove_character_flag = curse_corruption
            }
            if = {
                limit = { has_character_flag = curse_oblivion }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_oblivion
                }
                remove_character_flag = curse_oblivion
            }
            add_opinion = {
                target = scope:actor
                modifier = opinion_gift_ascension       ## "You imbued this character with radiant perfection..."
            }
            add_character_flag = gift_ascension
        }
    }
}

#########################################
#     Gift of Humbling (Stage I)        #
#     Reduces traits by 1 level         #
#########################################

gift_humbling_awakening = {
    category = interaction_category_friendly
    desc = gift_humbling_awakening_desc                 ## Tooltip: Diminish the divine glow by a single step
    icon = gift_of_humbling
    auto_accept = yes
    use_diplomatic_range = no
    interface_priority = 99

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = young_god_light              ## Only accessible to young gods, angels, and low-tier divine beings
                has_trait = young_god_dark
                has_trait = demi_god
                has_trait = angel
                has_trait = dark_angel
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            ## Reduce beauty by 1 step
            if = { limit = { has_trait = beauty_good_3 } remove_trait = beauty_good_3 add_trait = beauty_good_2 }
            else_if = { limit = { has_trait = beauty_good_2 } remove_trait = beauty_good_2 add_trait = beauty_good_1 }
            else_if = { limit = { has_trait = beauty_good_1 } remove_trait = beauty_good_1 }

            ## Reduce intellect by 1 step
            if = { limit = { has_trait = intellect_good_3 } remove_trait = intellect_good_3 add_trait = intellect_good_2 }
            else_if = { limit = { has_trait = intellect_good_2 } remove_trait = intellect_good_2 add_trait = intellect_good_1 }
            else_if = { limit = { has_trait = intellect_good_1 } remove_trait = intellect_good_1 }

            ## Reduce physique by 1 step
            if = { limit = { has_trait = physique_good_3 } remove_trait = physique_good_3 add_trait = physique_good_2 }
            else_if = { limit = { has_trait = physique_good_2 } remove_trait = physique_good_2 add_trait = physique_good_1 }
            else_if = { limit = { has_trait = physique_good_1 } remove_trait = physique_good_1 }

            ## Reduce beauty by 1 step (bad)
            if = { limit = { has_trait = beauty_bad_3 } remove_trait = beauty_bad_3 add_trait = beauty_bad_2 }
            else_if = { limit = { has_trait = beauty_bad_2 } remove_trait = beauty_bad_2 add_trait = beauty_bad_1 }
            else_if = { limit = { has_trait = beauty_bad_1 } remove_trait = beauty_bad_1 }

            ## Reduce intellect by 1 step (bad)
            if = { limit = { has_trait = intellect_bad_3 } remove_trait = intellect_bad_3 add_trait = intellect_bad_2 }
            else_if = { limit = { has_trait = intellect_bad_2 } remove_trait = intellect_bad_2 add_trait = intellect_bad_1 }
            else_if = { limit = { has_trait = intellect_bad_1 } remove_trait = intellect_bad_1 }

            ## Reduce physique by 1 step (bad)
            if = { limit = { has_trait = physique_bad_3 } remove_trait = physique_bad_3 add_trait = physique_bad_2 }
            else_if = { limit = { has_trait = physique_bad_2 } remove_trait = physique_bad_2 add_trait = physique_bad_1 }
            else_if = { limit = { has_trait = physique_bad_1 } remove_trait = physique_bad_1 }

            ## Apply opinion penalty for reducing divine favor
            add_opinion = {
                target = scope:actor
                modifier = opinion_gift_humbling_awakening    ## "You reduced this character’s divine essence by one step..."
            }
        }
    }
}

#########################################
#     Gift of Humbling (Stage II)       #
#     Reduces traits by 2 levels        #
#########################################

gift_humbling_refinement = {
    category = interaction_category_friendly
    desc = gift_humbling_refinement_desc                ## Tooltip: Strip away two layers of refinement
    icon = gift_of_humbling
    auto_accept = yes
    use_diplomatic_range = no
    interface_priority = 98

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = archangel                      ## Accessible to mid-tier divine beings
                has_trait = dark_archangel
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            ## Reduce beauty by 2 steps
            if = { limit = { has_trait = beauty_good_3 } remove_trait = beauty_good_3 add_trait = beauty_good_1 }
            else_if = { limit = { has_trait = beauty_good_2 } remove_trait = beauty_good_2 }
            else_if = { limit = { has_trait = beauty_good_1 } remove_trait = beauty_good_1 }

            ## Reduce intellect by 2 steps
            if = { limit = { has_trait = intellect_good_3 } remove_trait = intellect_good_3 add_trait = intellect_good_1 }
            else_if = { limit = { has_trait = intellect_good_2 } remove_trait = intellect_good_2 }
            else_if = { limit = { has_trait = intellect_good_1 } remove_trait = intellect_good_1 }

            ## Reduce physique by 2 steps
            if = { limit = { has_trait = physique_good_3 } remove_trait = physique_good_3 add_trait = physique_good_1 }
            else_if = { limit = { has_trait = physique_good_2 } remove_trait = physique_good_2 }
            else_if = { limit = { has_trait = physique_good_1 } remove_trait = physique_good_1 }

            ## Reduce beauty by 2 steps (bad)
            if = { limit = { has_trait = beauty_bad_3 } remove_trait = beauty_bad_3 add_trait = beauty_bad_1 }
            else_if = { limit = { has_trait = beauty_bad_2 } remove_trait = beauty_bad_2 }
            else_if = { limit = { has_trait = beauty_bad_1 } remove_trait = beauty_bad_1 }

            ## Reduce intellect by 2 steps (bad)
            if = { limit = { has_trait = intellect_bad_3 } remove_trait = intellect_bad_3 add_trait = intellect_bad_1 }
            else_if = { limit = { has_trait = intellect_bad_2 } remove_trait = intellect_bad_2 }
            else_if = { limit = { has_trait = intellect_bad_1 } remove_trait = intellect_bad_1 }

            ## Reduce physique by 2 steps (bad)
            if = { limit = { has_trait = physique_bad_3 } remove_trait = physique_bad_3 add_trait = physique_bad_1 }
            else_if = { limit = { has_trait = physique_bad_2 } remove_trait = physique_bad_2 }
            else_if = { limit = { has_trait = physique_bad_1 } remove_trait = physique_bad_1 }

            ## Apply opinion penalty for removing refinement
            add_opinion = {
                target = scope:actor
                modifier = opinion_gift_humbling_refinement  ## "You stripped away multiple layers of divine refinement..."
            }
        }
    }
}

#########################################
#     Gift of Humbling (Stage III)      #
#     Removes all divine traits         #
#########################################

gift_humbling_ascension = {
    category = interaction_category_friendly
    desc = gift_humbling_ascension_desc                 ## Tooltip: Purge all divine enhancements
    icon = gift_of_humbling
    auto_accept = yes
    use_diplomatic_range = no
    interface_priority = 97

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god                ## Only full gods can fully strip divine power
                has_trait = fallen_god
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            ## Remove all beauty, intellect, and physique divine traits
            remove_trait = beauty_good_3
            remove_trait = intellect_good_3
            remove_trait = physique_good_3
            remove_trait = beauty_good_2
            remove_trait = intellect_good_2
            remove_trait = physique_good_2
            remove_trait = beauty_good_1
            remove_trait = intellect_good_1
            remove_trait = physique_good_1
            remove_trait = beauty_bad_3
            remove_trait = intellect_bad_3
            remove_trait = physique_bad_3
            remove_trait = beauty_bad_2
            remove_trait = intellect_bad_2
            remove_trait = physique_bad_2
            remove_trait = beauty_bad_1
            remove_trait = intellect_bad_1
            remove_trait = physique_bad_1

            ## Apply harsh opinion penalty for total loss of divine essence
            add_opinion = {
                target = scope:actor
                modifier = opinion_gift_humbling_ascension    ## "You removed all divine enhancements from this character..."
            }
        }
    }
}

#################################
#     Curse of Descent          #
#################################

curse_descent = {
    category = interaction_category_friendly
    desc = curse_descent_desc                      ## Tooltip: Mark with divine potential — entry-tier divine traits
    icon = curse_of_descent
    auto_accept = yes
    use_diplomatic_range = no
    interface_priority = 96

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god
                has_trait = fallen_god
                has_trait = archangel
                has_trait = dark_archangel
                has_trait = young_god_light
                has_trait = young_god_dark
                has_trait = demi_god
                has_trait = angel
                has_trait = dark_angel
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            ## Remove higher-tier divine traits
            remove_trait = beauty_good_3
            remove_trait = intellect_good_3
            remove_trait = physique_good_3
            remove_trait = beauty_good_2
            remove_trait = intellect_good_2
            remove_trait = physique_good_2
            remove_trait = beauty_good_1
            remove_trait = intellect_good_1
            remove_trait = physique_good_1
            remove_trait = beauty_bad_3
            remove_trait = intellect_bad_3
            remove_trait = physique_bad_3
            remove_trait = beauty_bad_2
            remove_trait = intellect_bad_2
            remove_trait = physique_bad_2
            remove_trait = beauty_bad_1
            remove_trait = intellect_bad_1
            remove_trait = physique_bad_1

            ## Grant entry-tier traits: Comely, Quick, Hale
            add_trait = beauty_bad_1
            add_trait = intellect_bad_1
            add_trait = physique_bad_1

            ## Apply corresponding opinion modifier
            if = {
                limit = { has_character_flag = gift_awakening }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_awakening
                }
                remove_character_flag = gift_awakening
            }
            if = {
                limit = { has_character_flag = gift_refinement }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_refinement
                }
                remove_character_flag = gift_refinement
            }
            if = {
                limit = { has_character_flag = gift_ascension }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_ascension
                }
                remove_character_flag = gift_ascension
            }
            if = {
                limit = { has_character_flag = curse_descent }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_descent
                }
                remove_character_flag = curse_descent
            }
            if = {
                limit = { has_character_flag = curse_corruption }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_corruption
                }
                remove_character_flag = curse_corruption
            }
            if = {
                limit = { has_character_flag = curse_oblivion }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_oblivion
                }
                remove_character_flag = curse_oblivion
            }
            add_opinion = {
                target = scope:actor
                modifier = opinion_curse_descent         ## "You awakened latent divinity within this character..."
            }
            add_character_flag = curse_descent
        }
    }
}

#################################
#     Curse of Corruption       #
#################################

curse_corruption = {
    category = interaction_category_friendly
    desc = curse_corruption_desc                      ## Tooltip: Elevate with refined grace — middle-tier divine traits
    icon = curse_of_corruption
    auto_accept = yes
    use_diplomatic_range = no
    interface_priority = 95

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god
                has_trait = fallen_god
                has_trait = archangel
                has_trait = dark_archangel
                has_trait = young_god_light
                has_trait = young_god_dark
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            ## Remove lower and higher-tier traits
            remove_trait = beauty_good_3
            remove_trait = intellect_good_3
            remove_trait = physique_good_3
            remove_trait = beauty_good_2
            remove_trait = intellect_good_2
            remove_trait = physique_good_2
            remove_trait = beauty_good_1
            remove_trait = intellect_good_1
            remove_trait = physique_good_1
            remove_trait = beauty_bad_3
            remove_trait = intellect_bad_3
            remove_trait = physique_bad_3
            remove_trait = beauty_bad_2
            remove_trait = intellect_bad_2
            remove_trait = physique_bad_2
            remove_trait = beauty_bad_1
            remove_trait = intellect_bad_1
            remove_trait = physique_bad_1

            ## Grant middle-tier traits: Pretty, Intelligent, Robust
            add_trait = beauty_bad_2
            add_trait = intellect_bad_2
            add_trait = physique_bad_2

            ## Apply corresponding opinion modifier
            if = {
                limit = { has_character_flag = gift_awakening }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_awakening
                }
                remove_character_flag = gift_awakening
            }
            if = {
                limit = { has_character_flag = gift_refinement }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_refinement
                }
                remove_character_flag = gift_refinement
            }
            if = {
                limit = { has_character_flag = gift_ascension }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_ascension
                }
                remove_character_flag = gift_ascension
            }
            if = {
                limit = { has_character_flag = curse_descent }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_descent
                }
                remove_character_flag = curse_descent
            }
            if = {
                limit = { has_character_flag = curse_corruption }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_corruption
                }
                remove_character_flag = curse_corruption
            }
            if = {
                limit = { has_character_flag = curse_oblivion }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_oblivion
                }
                remove_character_flag = curse_oblivion
            }
            add_opinion = {
                target = scope:actor
                modifier = opinion_curse_corruption       ## "You refined this character’s form and mind..."
            }
            add_character_flag = curse_corruption
        }
    }
}

#################################
#     Curse of Oblivion         #
#################################

curse_oblivion = {
    category = interaction_category_friendly
    desc = curse_oblivion_desc                      ## Tooltip: Imbue with radiant perfection — the highest divine traits
    icon = curse_of_oblivion
    auto_accept = yes
    use_diplomatic_range = no
    interface_priority = 94

    is_shown = {
        scope:actor = {
            is_ai = no
            OR = {
                has_trait = angel_full_god             ## Only highest gods
                has_trait = fallen_god
            }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:recipient = {
            ## Remove lower-tier divine traits
            remove_trait = beauty_good_3
            remove_trait = intellect_good_3
            remove_trait = physique_good_3
            remove_trait = beauty_good_2
            remove_trait = intellect_good_2
            remove_trait = physique_good_2
            remove_trait = beauty_good_1
            remove_trait = intellect_good_1
            remove_trait = physique_good_1
            remove_trait = beauty_bad_3
            remove_trait = intellect_bad_3
            remove_trait = physique_bad_3
            remove_trait = beauty_bad_2
            remove_trait = intellect_bad_2
            remove_trait = physique_bad_2
            remove_trait = beauty_bad_1
            remove_trait = intellect_bad_1
            remove_trait = physique_bad_1

            ## Grant highest-tier traits: Beautiful, Genius, Herculean/Amazonian
            add_trait = beauty_bad_3
            add_trait = intellect_bad_3
            add_trait = physique_bad_3

            ## Apply corresponding opinion modifier
            if = {
                limit = { has_character_flag = gift_awakening }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_awakening
                }
                remove_character_flag = gift_awakening
            }
            if = {
                limit = { has_character_flag = gift_refinement }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_refinement
                }
                remove_character_flag = gift_refinement
            }
            if = {
                limit = { has_character_flag = gift_ascension }
                remove_opinion = {
                    target = scope:actor modifier = opinion_gift_ascension
                }
                remove_character_flag = gift_ascension
            }
            if = {
                limit = { has_character_flag = curse_descent }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_descent
                }
                remove_character_flag = curse_descent
            }
            if = {
                limit = { has_character_flag = curse_corruption }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_corruption
                }
                remove_character_flag = curse_corruption
            }
            if = {
                limit = { has_character_flag = curse_oblivion }
                remove_opinion = {
                    target = scope:actor modifier = opinion_curse_oblivion
                }
                remove_character_flag = curse_oblivion
            }
            add_opinion = {
                target = scope:actor
                modifier = opinion_curse_oblivion       ## "You imbued this character with radiant perfection..."
            }
            add_character_flag = curse_oblivion
        }
    }
}

#########################################
#             Gift of Love              #
#########################################

divine_conception = {
    category = interaction_category_friendly
    desc = divine_conception_desc
    icon = divine_conception
    auto_accept = yes
    use_diplomatic_range = no
    ignores_pending_interaction_block = yes

    is_shown = {
        scope:actor = {
            is_ai = no
        }
        scope:recipient = {
            is_female = yes
            is_alive = yes
            NOT = { has_trait = pregnant }
        }
    }

    is_valid = {
        always = yes
    }

    on_accept = {
        scope:actor = {
            trigger_event = {
                id = divine_conception_event.1000
                days = 0
            }
        }
    }
}

# ================================================================
# Divine Relation Interaction – High God Level
# ================================================================

## Opens the "Divine Bond (High)" interface
## Allows extremely powerful beings to forge or sever divine-level relationships
## Description: "Forge or sever powerful bonds as a being of ultimate divine authority."
divine_relation_interaction_high = {
	category = interaction_category_friendly
	use_diplomatic_range = no
	icon = love_divine_icon
	ignores_pending_interaction_block = yes

	is_shown = {
		# Must not target self
		NOT = { scope:recipient = scope:actor }

		# Actor must be a high god or equivalent
		scope:actor = {
			OR = {
				has_trait = angel_full_god
				has_trait = fallen_god
			}
		}

		# Recipient must not be divine-level
		scope:recipient = {
			NOR = {
				has_trait = angel_full_god
				has_trait = fallen_god
			}
		}
	}

	on_accept = {
		## Triggers divine_relationship_event.1111, which includes:
		## - Declaring someone an Eternal Ally ("Declared Eternal Ally")
		## - Binding them as a Celestial Soulmate ("Bound as Celestial Soulmate")
		## - Marking them as a Nemesis ("Condemned as Nemesis")
		scope:actor = { trigger_event = divine_relationship_event.1111 }
	}

	auto_accept = yes
}

# ================================================================
# Divine Relation Interaction – Low God Level
# ================================================================

## Opens the "Divine Bond (Low)" interface
## Used by demi-gods and lesser celestials to influence mortal relationships
## Description: "Whisper fate's command to bind or unbind lesser ties with sacred intent."
divine_relation_interaction_low = {
	category = interaction_category_friendly
	use_diplomatic_range = no
	icon = love_divine_icon
	ignores_pending_interaction_block = yes

	is_shown = {
		# Must not target self
		NOT = { scope:recipient = scope:actor }

		# Actor must be a lesser divine being (e.g., young god, angel)
		scope:actor = {
			OR = {
				has_trait = young_god_light
                has_trait = young_god_dark
                has_trait = archangel
                has_trait = dark_archangel
			}
		}

		# Recipient must not be divine-level
		scope:recipient = {
			NOR = {
				has_trait = angel_full_god
				has_trait = fallen_god
				has_trait = archangel
				has_trait = dark_archangel
				has_trait = young_god_light
                has_trait = young_god_dark
			}
		}
	}

	on_accept = {
		## Triggers divine_relationship_event.1112, which includes:
		## - Naming a Favored Companion ("Named Favored Companion")
		## - Declaring a Lesser Rival ("Declared Lesser Rival")
		## - Reclaiming divine affection ("Affection Reclaimed")
		scope:actor = { trigger_event = divine_relationship_event.1112 }
	}

	auto_accept = yes
}
