﻿

namespace = agot_coronation

###########################
# Default Coronation Event
###########################

agot_coronation.1000 = {  
    type = character_event

    theme = crown
    override_background = agot_iron_throne

    immediate = {
        play_music_cue = "agot_coronation_001"
        title:e_the_iron_throne.holder = { save_scope_as = the_new_king }
        if = {
            limit = {
                NOT = { has_global_variable = agot_coronation_debug }
            }
            set_global_variable = {
                name = agot_coronation_debug
                value = 0
            }           
        }        
    }

    title = agot_coronation_event_title    
    desc = agot_coronation_event_desc

    left_portrait = {
        character = character:Targaryen_27.faith.religious_head
        animation = throne_room_applaud_1
    }
    
    right_portrait = {
        character = scope:the_new_king

        #female
        triggered_animation = {
            trigger = {
                scope:the_new_king = { is_female = yes } 
            }
            animation = personality_compassionate
        }

        #male
        animation = personality_zealous
    }

    trigger = {  }

    ########################
    # AI is the king (failsafe)
    ########################

    option = { 
        name = agot_coronation_event_option_1_label
        trigger = { is_ai = yes }
        scope:the_new_king = { agot_coronation_give_nickname_effect = yes }
        ai_chance = { base = 100 }        
    }


    ##############################
    # PLAYER IS KING (normal)
    ##############################


    # Remain quiet and bow 
    option = { 
        name = agot_coronation_event_option_k_1_label
        trigger = {  
            is_ai = no 
            has_title = title:e_the_iron_throne 
        }
        custom_tooltip = agot_coronation_event_tooltip_will_get_nickname
        scope:the_new_king = { 
            agot_coronation_give_nickname_effect = yes 
            add_prestige = 150         
        }
        every_vassal = {
            limit = {
                highest_held_title_tier >= tier_kingdom
                NOT = { has_title = title:k_the_most_devout }
            }
            add_opinion = {
                modifier = agot_coronation_king_was_humble
                target = root
            }               
        } 
    }


    # Is that the loudest you can cheer? 
    option = { 
        name = agot_coronation_event_option_k_2_label      
        trigger = {  
            is_ai = no 
            has_title = title:e_the_iron_throne 
        }
        custom_tooltip = agot_coronation_event_tooltip_will_get_nickname
        scope:the_new_king = { 
            agot_coronation_give_nickname_effect = yes 
            add_dread = 10
            stress_impact = {
                calm = 30
                humble = 30
                shy = 30
                content = 30
            }           
        }
        every_vassal = {
            limit = {
                highest_held_title_tier >= tier_kingdom
                NOT = { has_title = title:k_the_most_devout }
            }
            add_opinion = {
                modifier = agot_coronation_king_was_cocky
                target = root
            }               
        }         
    }

    ########################
    # PLAYER IS NOT KING 
    ########################

    #Long may he reign
    option = { 
        name = agot_coronation_event_option_nk_1_label
        trigger = {  
            is_ai = no 
            NOT = { has_title = title:e_the_iron_throne }   
        }
        custom_tooltip = agot_coronation_event_tooltip_ai_will_get_nickname
        scope:the_new_king = { agot_coronation_give_nickname_effect = yes }
        root = {
            scope:the_new_king = {
                add_opinion = {
                    modifier = agot_coronation_cheered_for_me_opinion
                    target = root
                }
            }
            add_prestige = 100
        }
    }

    #Who cares
    option = { 
        name = agot_coronation_event_option_nk_2_label
        trigger = {  
            is_ai = no
            NOT = { has_title = title:e_the_iron_throne }    
        }
        custom_tooltip = agot_coronation_event_tooltip_ai_will_get_nickname
        scope:the_new_king = { agot_coronation_give_nickname_effect = yes }
        root = {
            scope:the_new_king = {
                add_opinion = {
                    modifier = agot_coronation_booed_me_opinion
                    target = root
                }
            }
            add_dread = 10
        }        
    }

    #Remain silent
    option = { 
        name = agot_coronation_event_option_nk_3_label
        trigger = {  
            is_ai = no
            NOT = { has_title = title:e_the_iron_throne }    
        }
        custom_tooltip = agot_coronation_event_tooltip_ai_will_get_nickname
        scope:the_new_king = { agot_coronation_give_nickname_effect = yes }
    }
}


###########################
# Arrogant Coronation Event
###########################

agot_coronation.1001 = {  
    type = character_event

    theme = crown
    override_background = agot_iron_throne

    immediate = {
        play_music_cue = "agot_coronation_001"
        title:e_the_iron_throne.holder = { save_scope_as = the_new_king }
        if = {
            limit = {
                NOT = { has_global_variable = agot_coronation_debug }
            }
            set_global_variable = {
                name = agot_coronation_debug
                value = 0
            }           
        }        
    }

    title = agot_coronation_event_title    

    desc = {
        desc = agot_coronation_event_desc
        desc = agot_coronation_event_desc_arrogant
    }

    left_portrait = {
        character = character:Targaryen_27.faith.religious_head
        animation = throne_room_applaud_1
    }
    
    right_portrait = {
        character = scope:the_new_king
        animation = celebrate_sword
    }

    trigger = {  }

    ########################
    # AI is the king (failsafe)
    ########################

    option = { 
        name = agot_coronation_event_option_1_label
        trigger = { is_ai = yes }
        scope:the_new_king = { agot_coronation_give_nickname_effect = yes }
        ai_chance = { base = 100 }        
    }


    ##############################
    # PLAYER IS KING (arrogant)
    ##############################

    # Long may I reign 
    option = { 
        name = agot_coronation_event_option_k_3_label       
        trigger = {  
            is_ai = no 
            has_title = title:e_the_iron_throne 
        }
        trait = arrogant
        custom_tooltip = agot_coronation_event_tooltip_will_get_nickname
        scope:the_new_king = { 
            agot_coronation_give_nickname_effect = yes 
            add_dread = 10
            stress_impact = {
                arrogant = -30
            }  
            every_vassal = {
                limit = {
                    highest_held_title_tier >= tier_kingdom
                    NOT = { has_title = title:k_the_most_devout }
                }
                add_opinion = {
                    modifier = agot_coronation_king_was_cocky
                    target = root
                }               
            }       
        }
    }


    # Put down the sword and bow
    option = { 
        name = agot_coronation_event_option_k_4_label
        trigger = {  
            is_ai = no 
            has_title = title:e_the_iron_throne 
        }
        custom_tooltip = agot_coronation_event_tooltip_will_get_nickname
        scope:the_new_king = { 
            agot_coronation_give_nickname_effect = yes 
            add_piety = 150   
            stress_impact = {
                arrogant = 100
            }
        }
    }



    ########################
    # PLAYER IS NOT KING 
    ########################

    #Long may he reign
    option = { 
        name = agot_coronation_event_option_nk_1_label
        trigger = {  
            is_ai = no 
            NOT = { has_title = title:e_the_iron_throne }   
        }
        custom_tooltip = agot_coronation_event_tooltip_ai_will_get_nickname
        scope:the_new_king = { agot_coronation_give_nickname_effect = yes }
        root = {
            scope:the_new_king = {
                add_opinion = {
                    modifier = agot_coronation_cheered_for_me_opinion
                    target = root
                }
            }
            add_prestige = 100
        }
    }

    #Who cares
    option = { 
        name = agot_coronation_event_option_nk_2_label
        trigger = {  
            is_ai = no
            NOT = { has_title = title:e_the_iron_throne }    
        }
        custom_tooltip = agot_coronation_event_tooltip_ai_will_get_nickname
        scope:the_new_king = { agot_coronation_give_nickname_effect = yes }
        root = {
            scope:the_new_king = {
                add_opinion = {
                    modifier = agot_coronation_booed_me_opinion
                    target = root
                }
            }
            add_dread = 10
        }        
    }

    #Remain silent
    option = { 
        name = agot_coronation_event_option_nk_3_label
        trigger = {  
            is_ai = no
            NOT = { has_title = title:e_the_iron_throne }    
        }
        custom_tooltip = agot_coronation_event_tooltip_ai_will_get_nickname
        scope:the_new_king = { agot_coronation_give_nickname_effect = yes }
    }

}
