﻿add_namespace = crystalemp

add_namespace = cryscr

add_namespace = crysom

add_namespace = crycom

############################################################
############################################################
############### Scroup Rudely Interrupts ######################
############################################################
############################################################

country_event = {
        id = cryscr.1
        title = cryscr.1.t
        desc = cryscr.1.d
        picture = GFX_event_winter_sun

        is_triggered_only = yes

        option = {
            name = cryscr.1.a
            add_political_power = 10
            set_country_flag = winter_solstice_planned
        }
    }
country_event = {
        id = cryscr.2
        title = cryscr.2.t
        desc = cryscr.2.d
        picture = GFX_event_winter_sun

        is_triggered_only = yes

        option = {
            name = cryscr.2.a
            add_political_power = 10
            add_popularity = { ideology = fascism popularity = 0.03 }
            add_popularity = { ideology = communism popularity = 0.05 }
            swap_ideas = { remove_idea = royal_family add_idea = royal_family2 }
        }
    }
country_event = {
        id = cryscr.3
        title = cryscr.3.t
        desc = cryscr.3.d
        picture = GFX_event_winter_sun

        trigger = {
            tag = CRY
            has_country_flag = winter_solstice_planned
            date > 1007.12.20
        }
        mean_time_to_happen =  { days = 1 }
        fire_only_once = yes

        option = {
            name = cryscr.3.a
            add_political_power = 250
            add_national_unity = 0.03
        }
    }
country_event = {
        id = cryscr.4
        title = cryscr.4.t
        desc = cryscr.4.d
        picture = GFX_event_winter_sun

        is_triggered_only = yes

        option = {
            name = cryscr.4.a
            add_political_power = 16
        }
    }
country_event = { ## Crysal Empire asks Equestria for Crysal Fair
        id = cryscr.5
        title = cryscr.5.t
        desc = cryscr.5.d
        picture = GFX_event_crystal_fair

        is_triggered_only = yes

        option = {
            name = cryscr.5.a
            EQS = {
                country_event = { id = cryscr.6 days = 1 }
            }
        }
    }
country_event = { ## Equestrian event from above
        id = cryscr.6
        title = cryscr.6.t
        desc = cryscr.6.d
        picture = GFX_event_crystal_fair

        is_triggered_only = yes

        option = {
            name = cryscr.6.a
            ai_chance = {
            base = 50
            modifier = {
                factor = 100
                is_historical_focus_on = yes
                }
            }
            CRY = {
                country_event = { id = cryscr.7 days = 1 }
            }
            add_political_power = -50
        }
        option = {
            name = cryscr.6.b
            ai_chance = {
            base = 50
            modifier = {
                factor = 0
                is_historical_focus_on = yes
                }
            }
            CRY = {
                country_event = { id = cryscr.8 days = 1 }
                add_opinion_modifier = { target = EQS modifier = eqs_refused_holding_games }
            }
        }
    }
country_event = { ## Equestria agrees
        id = cryscr.7
        title = cryscr.7.t
        desc = cryscr.7.d
        picture = GFX_event_crystal_fair

        is_triggered_only = yes

        option = {
            name = cryscr.7.a
            add_popularity = { ideology = democratic popularity = 0.1 }
            add_political_power = 50
            hidden_effect = {
                news_event = { id = news.4 days = 10 }
            }
        }
    }
country_event = { ## Equestria disagrees
        id = cryscr.8
        title = cryscr.8.t
        desc = cryscr.8.d
        picture = GFX_event_crystal_fair

        is_triggered_only = yes

        option = {
            name = cryscr.8.a
            trigger = { NOT = { has_dlc = "Together for Victory"} }
            add_political_power = -50
            add_national_unity = -0.05
            add_popularity = { ideology = fascism popularity = 0.05 }
            add_popularity = { ideology = communism popularity = 0.05 }
            add_popularity = { ideology = neutrality popularity = 0.05 }
        }
        option = {
            name = cryscr.8.a
            trigger = { has_dlc = "Together for Victory"}
            CRY = {
                add_autonomy_ratio = { value = -0.1 } }
            add_political_power = -50
            add_national_unity = -0.05
            add_popularity = { ideology = fascism popularity = 0.05 }
            add_popularity = { ideology = communism popularity = 0.05 }
            add_popularity = { ideology = neutrality popularity = 0.05 }
        }
    }
country_event = { ## Mi Amore Family Story
        id = cryscr.9
        title = cryscr.9.t
        desc = cryscr.9.d
        picture = GFX_event_mi_amore

        is_triggered_only = yes

        option = {
            name = cryscr.9.a
            trigger = {
                has_idea = royal_family2
            }
            swap_ideas = { remove_idea = royal_family2 add_idea = royal_family3 }
        }
        option = {
            name = cryscr.9.a
            trigger = {
                has_idea = royal_family
            }
            swap_ideas = { remove_idea = royal_family add_idea = royal_family2 }
        }
    }
country_event = { ## GrandFestival
        id = cryscr.10
        title = cryscr.10.t
        desc = cryscr.10.d
        picture = GFX_event_crystal_fair

        is_triggered_only = yes

        option = {
            name = cryscr.10.a
        }
    }
    ######################################################
country_event = { ## The Return of Sombra event chain
        id = cryscr.11
        title = cryscr.11.t
        desc = cryscr.11.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_completed_focus = CRY_crystallinganniversary
        }
        mean_time_to_happen = { days = 30 }
        fire_only_once = yes
        option = {
            name = cryscr.11.a
            hidden_effect = {
                country_event = { id = cryscr.12 days = 16 }
            }
        }
    }
country_event = { ## The Return of Sombra event chain
        id = cryscr.12
        title = cryscr.12.t
        desc = cryscr.12.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = cryscr.12.a
            custom_effect_tooltip = invitation_taken
            ai_chance = {
            base = 30
            modifier = {
                factor = 0
                is_historical_focus_on = yes
            }
        }
        hidden_effect = {
            country_event = {
                id = cryscr.13 hours = 1
                }
            }
        }
        option = {
            name = cryscr.12.b
            custom_effect_tooltip = invitation_decline
            ai_chance = {
            base = 70
            modifier = {
                factor = 100
                is_historical_focus_on = yes
            }
        }
        hidden_effect = {
            country_event = {
                id = cryscr.14 hours = 1
                }
            }
        }
        option = {
            name = cryscr.12.c
            custom_effect_tooltip = support_the_club
            ai_chance = {
            base = 0
            modifier = {
                factor = 0
                is_historical_focus_on = yes
            }
        }
        hidden_effect = {
            country_event = {
                id = crystalemp.14 hours = 1
                }
            }
        }
    }
country_event = { ## Take the invitation
        id = cryscr.13
        title = cryscr.13.t
        desc = cryscr.13.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = cryscr.13.a
            custom_effect_tooltip = invitation_saved
            set_country_flag = invitation_to_join_the_club
            ai_chance = {
            base = 70
            modifier = {
                factor = 0
                is_historical_focus_on = yes
                }
            }
        }
        option = {
            name = cryscr.13.b
            custom_effect_tooltip = invitation_thrown_away
            ai_chance = {
            base = 30
            modifier = {
                factor = 100
                is_historical_focus_on = yes
                }
            }
        }
    }
country_event = { ## Decline the invitation
        id = cryscr.14
        title = cryscr.14.t
        desc = cryscr.14.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = cryscr.14.a
        }
    }
country_event = { ## Walk to the club place
        id = cryscr.15
        title = cryscr.15.t
        desc = cryscr.15.d
        picture = GFX_event_apartment_club

        is_triggered_only = yes

        option = {
            name = cryscr.15.a
            custom_effect_tooltip = walk_into_the_club
            hidden_effect = {
                country_event = { id = cryscr.16 hours = 1 }
            }
            ai_chance = { factor = 100 }
        }
        option = {
            name = cryscr.15.b
            custom_effect_tooltip = walk_away
            ai_chance = { factor = 0 }
        }
    }
country_event = { ## Into the club
        id = cryscr.16
        title = cryscr.16.t
        desc = cryscr.16.d
        picture = GFX_event_apartment_club

        is_triggered_only = yes

        option = {
            name = cryscr.16.a
            hidden_effect = {
                country_event = { id = cryscr.17 hours = 1 }
            }
        }
    }
country_event = { ## Inside the club
        id = cryscr.17
        title = cryscr.17.t
        desc = cryscr.17.d
        picture = GFX_event_apartment_club

        is_triggered_only = yes

        option = {
            name = cryscr.17.a
            hidden_effect = {
                country_event = { id = cryscr.18 hours = 1 }
            }
        }
    }
country_event = { ## The Story
        id = cryscr.18
        title = cryscr.18.t
        desc = cryscr.18.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = cryscr.18.a
            hidden_effect = {
                country_event = { id = cryscr.19 hours = 1 }
            }
            ai_chance = { factor = 100 }
        }
    }
country_event = { ## Post-Story
        id = cryscr.19
        title = cryscr.19.t
        desc = cryscr.19.d
        picture = GFX_event_apartment_club

        is_triggered_only = yes

        option = {
            name = cryscr.19.a
            hidden_effect = {
                country_event = { id = cryscr.20 hours = 2 }
            }
        }
    }
country_event = { ## Out of the club
        id = cryscr.20
        title = cryscr.20.t
        desc = cryscr.20.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = cryscr.20.a
            custom_effect_tooltip = join_the_club_tlp
            set_country_flag = joined_the_club
            ai_chance = { factor = 100 }
        }
        option = {
            name = cryscr.20.b
            custom_effect_tooltip = reported_sombras
            ai_chance = { factor = 0 }
            hidden_effect = {
                country_event = {
                    id = cryscr.21 hours = 10
                }
            }
        }
        option = {
            name = cryscr.20.c
            custom_effect_tooltip = not_reported_sombras
            set_country_flag = club_not_arrested
            hidden_effect = {
                swap_ideas = { remove_idea = sombra_threat add_idea = sombra_threat2 }
            }
            ai_chance = { factor = 0 }
        }
    }
country_event = { ## Organization Arrested
        id = cryscr.21
        title = cryscr.21.t
        desc = cryscr.21.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = cryscr.21.a
            add_political_power = 20
            ai_chance = { factor = 100 }
            custom_effect_tooltip = less_sombra_tlp
            hidden_effect = {
                swap_ideas = { remove_idea = sombra_threat add_idea = sombra_threat_reported }
            }
        }
    }
country_event = { ## Sombra Civil War if fascism support is high enough after not reporting the club
        id = cryscr.22
        title = cryscr.22.t
        desc = cryscr.22.d
        picture = GFX_event_sombra_return

        trigger = {
            tag = CRY
            fascism > 0.5
            has_country_flag = club_not_arrested
        }
        mean_time_to_happen = { days = 5 }
        fire_only_once = yes
        option = {
            name = cryscr.22.a
            start_civil_war = {
                ideology = fascism
                ruling_party = democratic
                size = 0.5
            }
        }
    }
country_event = { ## Library Work Focus
        id = cryscr.23
        title = cryscr.23.t
        desc = cryscr.23.d
        picture = GFX_event_apartment_club

        is_triggered_only = yes

        option = {
            name = cryscr.23.a
            hidden_effect = {
                country_event = { id = cryscr.24 hours = 5 }
            }
        }
    }
country_event = { ## Into the library
        id = cryscr.24
        title = cryscr.24.t
        desc = cryscr.24.d
        picture = GFX_event_apartment_club

        is_triggered_only = yes

        option = {
            name = cryscr.24.a
            hidden_effect = {
                country_event = { id = cryscr.25 hours = 23 }
            }
        }
    }
country_event = { ## On the way
        id = cryscr.25
        title = cryscr.25.t
        desc = cryscr.25.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = cryscr.25.a
            hidden_effect = {
                country_event = { id = cryscr.26 hours = 1 }
            }
        }
    }
country_event = { ## Into the library
        id = cryscr.26
        title = cryscr.26.t
        desc = cryscr.26.d
        picture = GFX_event_crystal_university

        is_triggered_only = yes

        option = {
            name = cryscr.26.a
            hidden_effect = {
                country_event = { id = cryscr.27 hours = 1 }
            }
        }
    }
country_event = { ## Into the library
        id = cryscr.27
        title = cryscr.27.t
        desc = cryscr.27.d
        picture = GFX_event_crystal_library

        is_triggered_only = yes

        option = {
            name = cryscr.27.a
            set_country_flag = learned_about_the_crystals
        }
    }
country_event = { ## Into the library
        id = cryscr.30
        title = cryscr.30.t
        desc = cryscr.30.d
        picture = GFX_event_apartment_club

        is_triggered_only = yes

        option = {
            name = cryscr.30.a
            hidden_effect = {
                country_event = { id = cryscr.31 days = 5 }
            }
        }
        option = {
            name = cryscr.30.b
            hidden_effect = {
                country_event = { id = cryscr.32 days = 2 }
                goto_province = 11109
            }
        }
    }
country_event = { ## Umbrum Cage
        id = cryscr.31
        title = cryscr.31.t
        desc = cryscr.31.d
        picture = GFX_event_green_mountain

        is_triggered_only = yes

        option = {
            name = cryscr.31.a
            hidden_effect = {
                country_event = { id = cryscr.41 hours = 1 }
            }
        }
    }
country_event = { ## The Crystal Mountains
        id = cryscr.32
        title = cryscr.32.t
        desc = cryscr.32.d
        picture = GFX_event_crystal_mountain

        is_triggered_only = yes

        option = {
            name = cryscr.32.a
            add_political_power = 2
            hidden_effect = {
                country_event = { id = cryscr.33 days = 1 }
            }
        }
    }
country_event = { ## The Crystal Mountains Caves
        id = cryscr.33
        title = cryscr.33.t
        desc = cryscr.33.d
        picture = GFX_event_cave

        is_triggered_only = yes

        option = {
            name = cryscr.33.a
            hidden_effect = {
                country_event = { id = cryscr.34 days = 1 }
            }
        }
    }
country_event = { ## The Crystal Mountains Caves, Somepony has to dive
        id = cryscr.34
        title = cryscr.34.t
        desc = cryscr.34.d
        picture = GFX_event_cave

        is_triggered_only = yes

        option = {
            name = cryscr.34.a
            hidden_effect = {
                country_event = { id = cryscr.35 hours = 1 }
            }
        }
        option = {
            name = cryscr.34.b
            hidden_effect = {
                country_event = { id = cryscr.36 hours = 1 }
            }
        }
        option = {
            name = cryscr.34.c
            hidden_effect = {
                country_event = { id = cryscr.37 hours = 1 }
            }
        }
        option = {
            name = cryscr.34.e
            hidden_effect = {
                country_event = { id = cryscr.38 hours = 1 }
            }
        }
    }
country_event = { ## The Crystal Mountains Caves, You dive
        id = cryscr.35
        title = cryscr.35.t
        desc = cryscr.35.d
        picture = GFX_event_cave

        is_triggered_only = yes

        option = {
            name = cryscr.35.a
            set_country_flag = player_sick
            hidden_effect = {
                country_event = { id = cryscr.39 days = 1 }
            }
        }
    }
country_event = { ## The Crystal Mountains Caves, Sakira dives
        id = cryscr.36
        title = cryscr.36.t
        desc = cryscr.36.d
        picture = GFX_event_cave

        is_triggered_only = yes

        option = {
            name = cryscr.36.a
            set_country_flag = sakira_sick
            hidden_effect = {
                country_event = { id = cryscr.39 days = 1 }
            }
        }
    }
country_event = { ## The Crystal Mountains Caves, Dust Dives
        id = cryscr.37
        title = cryscr.37.t
        desc = cryscr.37.d
        picture = GFX_event_cave

        is_triggered_only = yes

        option = {
            name = cryscr.37.a
            set_country_flag = dust_sick
            hidden_effect = {
                country_event = { id = cryscr.39 days = 1 }
            }
        }
    }
country_event = { ## The Crystal Mountains Caves, Dust Dives
        id = cryscr.38
        title = cryscr.38.t
        desc = cryscr.38.d
        picture = GFX_event_cave

        is_triggered_only = yes

        option = {
            name = cryscr.38.a
            set_country_flag = sakira_sick
            set_country_flag = player_sick
            set_country_flag = sick_together
            hidden_effect = {
                country_event = { id = cryscr.39 days = 1 }
            }
        }
    }
country_event = { ## The Crystal Mountains Caves, Got the Crystal
        id = cryscr.39
        title = cryscr.39.t
        desc = { 
            text = cryscr.39.d_sakira
            trigger = {
                has_country_flag = sakira_sick
            }
        }
        desc = { 
            text = cryscr.39.d_player
            trigger = {
                has_country_flag = player_sick
            }
        }
        desc = { 
            text = cryscr.39.d_sakira_and_player
            trigger = {
                has_country_flag = sick_together
            }
        }
        desc = { 
            text = cryscr.39.d_dust
            trigger = {
                has_country_flag = dust_sick
            }
        }
        picture = GFX_event_crystal_mountain

        is_triggered_only = yes

        option = {
            name = cryscr.39.a
            trigger = {
                NOT = { has_country_flag = sakira_sick }
            }
            hidden_effect = {
                country_event = { id = cryscr.40 days = 5 }
            }
        }
        option = {
            name = cryscr.39.b
            trigger = {
                has_country_flag = sakira_sick
            }
            hidden_effect = {
                country_event = { id = cryscr.40 days = 5 }
            }
        }
    }
country_event = { ## The Crystal Mountains Caves, Dust Dives
        id = cryscr.40
        title = cryscr.40.t
        desc = cryscr.40.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = cryscr.40.a
            set_country_flag = umbrum_planted
            custom_effect_tooltip = heart_will_grow
            trigger = {
                has_country_flag = sick_together
            }
            clr_country_flag = dark_heart_in_progress
        }
        option = {
            name = cryscr.40.b
            set_country_flag = umbrum_planted
            custom_effect_tooltip = heart_will_grow
            trigger = {
                has_country_flag = sakira_sick
                NOT = { has_country_flag = sick_together }
            }
            clr_country_flag = dark_heart_in_progress
        }
        option = {
            name = cryscr.40.c
            set_country_flag = umbrum_planted
            custom_effect_tooltip = heart_will_grow
            trigger = {
                has_country_flag = player_sick
                NOT = { has_country_flag = sick_together }
            }
            clr_country_flag = dark_heart_in_progress
        }
        option = {
            name = cryscr.40.dust
            set_country_flag = umbrum_planted
            custom_effect_tooltip = heart_will_grow
            trigger = {
                has_country_flag = dust_sick
            }
            clr_country_flag = dark_heart_in_progress
        }
        option = {
            name = cryscr.40.e
            trigger = {
                has_country_flag = lake_sick
            }
            set_country_flag = umbrum_planted
            custom_effect_tooltip = heart_will_grow
            clr_country_flag = dark_heart_in_progress
        }
    }
country_event = { ## Meet the foals
        id = cryscr.41
        title = cryscr.41.t
        desc = cryscr.41.d
        picture = GFX_event_green_mountain

        is_triggered_only = yes

        option = {
            name = cryscr.41.a
            hidden_effect = {
                country_event = { id = cryscr.43 hours = 1 }
            }
        }
        option = {
            name = cryscr.41.b
            hidden_effect = {
                country_event = { id = cryscr.42 hours = 1 }
            }
        }
    }
country_event = { ## Story of the foals
        id = cryscr.42
        title = cryscr.42.t
        desc = cryscr.42.d
        picture = GFX_event_green_mountain

        is_triggered_only = yes

        option = {
            name = cryscr.42.a
            hidden_effect = {
                country_event = { id = cryscr.44 hours = 13 }
            }
        }
    }
country_event = { ## Skip the story of the foals
        id = cryscr.43
        title = cryscr.43.t
        desc = cryscr.43.d
        picture = GFX_event_green_mountain

        is_triggered_only = yes

        option = {
            name = cryscr.43.a
            add_political_power = -5
            hidden_effect = {
                country_event = { id = cryscr.44 hours = 13 }
            }
        }
    }
country_event = { ## Into the mines
        id = cryscr.44
        title = cryscr.44.t
        desc = cryscr.44.d
        picture = GFX_event_old_mine

        is_triggered_only = yes

        option = {
            name = cryscr.44.a
            hidden_effect = {
                country_event = { id = cryscr.45 hours = 1 }
            }
        }
    }
country_event = { ## Into the mines
        id = cryscr.45
        title = cryscr.45.t
        desc = cryscr.45.d
        picture = GFX_event_old_mine

        is_triggered_only = yes

        option = {
            name = cryscr.45.a
            hidden_effect = {
                country_event = { id = cryscr.46 hours = 1 }
            }
        }
    }
country_event = { ## Into the mines
        id = cryscr.46
        title = cryscr.46.t
        desc = cryscr.46.d
        picture = GFX_event_old_mine

        is_triggered_only = yes

        option = {
            name = cryscr.46.a
            hidden_effect = {
                country_event = { id = cryscr.47 hours = 1 }
            }
        }
    }
country_event = { ## Into the mines
        id = cryscr.47
        title = cryscr.47.t
        desc = cryscr.47.d
        picture = GFX_event_old_mine

        is_triggered_only = yes

        option = {
            name = cryscr.47.a
            set_country_flag = lake_sick
            hidden_effect = {
                country_event = { id = cryscr.40 days = 7 }
            }
        }
    }
country_event = { ## Activated Crystals
        id = cryscr.48
        title = cryscr.48.t
        desc = cryscr.48.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = cryscr.48.a
            add_political_power = 15
            set_country_flag = crystals_activated
        }
    }
country_event = { ## Activated Crystals
        id = cryscr.49
        title = cryscr.49.t
        desc = cryscr.49.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = umbrum_planted
        }
        mean_time_to_happen = { days = 70 }
        fire_only_once = yes
        option = {
            name = cryscr.49.a
            add_political_power = 5
            set_country_flag = dark_heart_is_ready
        }
    }
    ## Skipping fanfiction ###
    country_event = { # Support the club
        id = crystalemp.14
        title = crystalemp.14.t
        desc = crystalemp.14.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crystalemp.14.a
            add_political_power = -20
            hidden_effect = {
                country_event = {
                    id = crystalemp.15 days = 10
                }
            }
        }
    }
    country_event = { # The club information
        id = crystalemp.15
        title = crystalemp.15.t
        desc = crystalemp.15.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crystalemp.15.a
            set_country_flag = support_the_club
        }
    }
     country_event = { # The club information
        id = crystalemp.16
        title = crystalemp.16.t
        desc = crystalemp.16.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = help_the_club
        }
        mean_time_to_happen = { days = 250 }
        fire_only_once = yes
        option = {
            name = crystalemp.16.a
            set_country_flag = dark_heart_is_ready

        }
    }
############################################################
############################################################
############### Scroup Finishes ##############################
############################################################
############################################################
############################################################
############################################################
############### Sombra Starts ##############################
############################################################
############################################################
country_event = { ## Final Act - Club Member / no crystals
        id = cryscr.1111
        title = cryscr.1111.t
        desc = cryscr.1111.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_completed_focus = CRY_crystalheartstolen
            has_country_flag = joined_the_club
            NOT = { has_country_flag = crystals_activated }
        }
        mean_time_to_happen = { days = 10 }
        fire_only_once = yes
        option = {
            name = cryscr.1111.a
            hidden_effect = {
            country_event = {
                 id = crysom.01 days = 1
                }
            random_list = { 20 = { set_country_flag = larger_civil_war } 35 = { set_country_flag = medium_civil_war } 30 = { set_country_flag = small_civil_war } 15 = { set_country_flag = giant_civil_war } }
            }
        }
    }
country_event = { ## Final Act - Club Member / has crystals
        id = crysom.11111
        title = crysom.11111.t
        desc = crysom.11111.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_completed_focus = CRY_crystalheartstolen
            has_country_flag = joined_the_club
            has_country_flag = crystals_activated
        }
        mean_time_to_happen = { days = 10 }
        fire_only_once = yes
        option = {
            name = crysom.11111.a
            hidden_effect = {
            country_event = {
                 id = crysom.01 days = 1
                }
            random_list = { 60 = { set_country_flag = larger_civil_war } 20 = { set_country_flag = medium_civil_war } 5 = { set_country_flag = small_civil_war } 15 = { set_country_flag = giant_civil_war } }
            }
        }
    }
country_event = { # Final Act - NOT A MEMBER
        id = crysom.0
        title = crysom.0.t
        desc = crysom.0.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_completed_focus = CRY_crystalheartstolen
            has_country_flag = support_the_club
        }
        mean_time_to_happen = { days = 10 }
        fire_only_once = yes
        option = {
            name = crysom.0.a
            country_event = {
                 id = crysom.2 days = 1
                }
            hidden_effect = {
            random_list = { 30 = { set_country_flag = larger_civil_war } 50 = { set_country_flag = medium_civil_war } 20 = { set_country_flag = small_civil_war } }
            random_list = { 30 = { set_country_flag = ghosts_bonus } 50 = { set_country_flag = power_bonus } 20 = { set_country_flag = strength_bonus } }
            }
        }
    }
country_event = { ## Spell casting
        id = crysom.1
        title = crysom.1.t
        desc = crysom.1.d
        picture = GFX_event_sombra_return

        is_triggered_only = yes

        option = {
            name = crysom.1.a
            set_country_flag = ghosts_bonus
            country_event = {
                id = crysom.2 hours = 1
            }
        }
        option = {
            name = crysom.1.b
            set_country_flag = strength_bonus
            country_event = {
                id = crysom.2 hours = 1
            }
        }
        option = {
            name = crysom.1.c
            set_country_flag = power_bonus
            country_event = {
                id = crysom.2 hours = 1
            }
        }
    }
country_event = { ## ACTUAL SOMBRA RETURN HERE AYY LMAOOOOOOOOO
        id = crysom.2
        title = crysom.2.t
        desc = crysom.2.d
        picture = GFX_event_sombra_return

        is_triggered_only = yes

        option = {
            name = crysom.2.a
            trigger = {
                has_country_flag = larger_civil_war
            }
            start_civil_war = {
                ruling_party = fascism
                ideology = democratic
                size = 0.37
                capital = 344
                states = { 318 139 77 140 343 143 324 141 236 339 345 }
            }
            add_popularity = { ideology = fascism popularity = 0.2 }
            random_other_country = {
                limit = { original_tag = CRY 
                has_government = democratic }
                set_cosmetic_tag = CRY_DEM
                add_popularity = { ideology = democratic popularity = 0.3 }
            }
            set_cosmetic_tag = CRY_SOM
            set_country_flag = sombra_returned
            news_event = {
                id = news.35 hours = 6
            }
            create_corps_commander = {
                    name = "Sqeeky Hooves"
                    portrait_path = "gfx/leaders/CRY/SombraGeneral.tga"
                    traits = { ranger }
                    skill = 2
                }
        }
        option = {
            name = crysom.2.b
            trigger = {
                has_country_flag = small_civil_war
            }
            start_civil_war = {
                ruling_party = fascism
                ideology = democratic
                size = 0.70
                capital = 344
                states = { 318 139 77 140 343 143 324 146 142 141 144 147 148 149 236 339 98 152 151 145 53 345 }
            }
            random_other_country = {
                limit = { original_tag = CRY 
                has_government = democratic }
                set_cosmetic_tag = CRY_DEM
                add_popularity = { ideology = democratic popularity = 0.3 }
            }
            add_popularity = { ideology = fascism popularity = 0.3 }
            set_cosmetic_tag = CRY_SOM
            set_country_flag = sombra_returned
            news_event = {
                id = news.35 hours = 6
            }
            create_corps_commander = {
                    name = "Sqeeky Hooves"
                    portrait_path = "gfx/leaders/CRY/SombraGeneral.tga"
                    traits = { ranger }
                    skill = 2
                }
        }
        option = {
            name = crysom.2.c
            trigger = {
                has_country_flag = medium_civil_war
            }
            start_civil_war = {
                ruling_party = fascism
                ideology = democratic
                size = 0.50
                capital = 344
                states = { 318 139 77 140 343 143 324 146 142 141 144 147 236 339 345 }
            }
            random_other_country = {
                limit = { original_tag = CRY 
                has_government = democratic }
                set_cosmetic_tag = CRY_DEM
                add_popularity = { ideology = democratic popularity = 0.3 }
            }
            add_popularity = { ideology = fascism popularity = 0.3 }
            set_country_flag = sombra_returned
            set_cosmetic_tag = CRY_SOM
            news_event = {
                id = news.35 hours = 6
            }
            create_corps_commander = {
                    name = "Sqeeky Hooves"
                    portrait_path = "gfx/leaders/CRY/SombraGeneral.tga"
                    traits = { ranger }
                    skill = 2
                }
        }
        option = {
            name = crysom.2.e
            trigger = {
                has_country_flag = giant_civil_war
            }
            start_civil_war = {
                ruling_party = fascism
                ideology = democratic
                size = 0.15
                capital = 344
                states = { 139 343 324 236 339 345 }
            }
            random_other_country = {
                limit = { original_tag = CRY 
                has_government = democratic }
                set_cosmetic_tag = CRY_DEM
                add_popularity = { ideology = democratic popularity = 0.3 }
            }
            add_popularity = { ideology = fascism popularity = 0.3 }
            set_cosmetic_tag = CRY_SOM
            set_country_flag = sombra_returned
            news_event = {
                id = news.35 hours = 6
            }
            create_corps_commander = {
                    name = "Sqeeky Hooves"
                    portrait_path = "gfx/leaders/CRY/SombraGeneral.tga"
                    traits = { ranger }
                    skill = 2
                }
        }
    }
country_event = { ## Royal Guard
        id = crysom.3
        title = crysom.3.t
        desc = crysom.3.d
        picture = GFX_event_sombra_return

        trigger = {
            tag = CRY
            has_country_flag = ghosts_bonus
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 10 }
        fire_only_once = yes
        option = {
        trigger = {
              NOT = {  has_country_flag = crystals_activated }
            }
            name = crysom.3.a
            add_timed_idea = { idea = CRY_old_guard days = 128 }
            add_manpower = 25000
            load_oob = "CRY_sombra_ghosts"
        }
        option = {
            name = crysom.3.b
            trigger = {
                has_country_flag = crystals_activated
            }
            add_timed_idea = { idea = CRY_old_guard days = 188 }
            add_manpower = 55000
            load_oob = "CRY_sombra_ghosts"
        }
    }
country_event = { ## Strength
        id = crysom.4
        title = crysom.4.t
        desc = crysom.4.d
        picture = GFX_event_sombra_return

        trigger = {
            tag = CRY
            has_country_flag = strength_bonus
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 10 }
        fire_only_once = yes
        option = {
            name = crysom.4.a
            trigger = { has_country_flag = crystals_activated }
            add_timed_idea = { idea = sombra_strength_CRY days = 300 }
        }
        option = {
            name = crysom.4.a
            trigger = { NOT = { has_country_flag = crystals_activated } }
            add_timed_idea = { idea = sombra_strength_CRY days = 180 }
        }
    }
country_event = { ## Power bonus
        id = crysom.5
        title = crysom.5.t
        desc = crysom.5.d
        picture = GFX_event_sombra_return

        trigger = {
            tag = CRY
            has_country_flag = power_bonus
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 10 }
        fire_only_once = yes
        option = {
            name = crysom.5.a
            trigger = { NOT = { has_country_flag = crystals_activated } }
            add_timed_idea = { idea = CRY_sombra_power_bonus days = 180 }
        }
        option = {
            name = crysom.5.a
            trigger = { has_country_flag = crystals_activated }
            add_timed_idea = { idea = CRY_sombra_power_bonus days = 250 }
        }
    }
country_event = { ## Lake getting Blind
        id = crysom.6
        title = crysom.6.t
        desc = crysom.6.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = lake_sick
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 500 }
        fire_only_once = yes
        option = {
            name = crysom.6.a
            add_political_power = -20
            set_country_flag = lake_blind_0
        }
    }
country_event = { ## Lake is Blind ;v;
        id = crysom.7
        title = crysom.7.t
        desc = crysom.7.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = lake_sick
            has_country_flag = sombra_returned
            has_country_flag = lake_blind_0
        }
        mean_time_to_happen = { days = 1200 }
        fire_only_once = yes
        option = {
            name = crysom.7.a
            set_country_flag = lake_blind
        }
    }
country_event = { ## You're sick you dip
        id = crysom.8
        title = crysom.8.t
        desc = { 
            text = crysom.8.d
            trigger = { has_country_flag = player_sick
            NOT = { has_country_flag = sick_together } }
        }
        desc = { 
            text = crysom.8.d_sick_together
            trigger = { has_country_flag = sick_together }
        }
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = player_sick
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 500 }
        fire_only_once = yes
        option = {
            name = crysom.8.a
            trigger = { has_country_flag = player_sick
            NOT = { has_country_flag = sick_together } }
            add_political_power = -440
        }
        option = {
            name = crysom.8.b
            trigger = { has_country_flag = sick_together }
            add_political_power = -100
            set_country_flag = sakira_and_you
        }
    }
country_event = { ## Dust's sick
        id = crysom.9
        title = crysom.9.t
        desc = crysom.9.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = dust_sick
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 300 }
        fire_only_once = yes
        option = {
            name = crysom.9.a
            set_country_flag = dust_sick_1
        }
    }
country_event = { ## Dust's sick
        id = crysom.10
        title = crysom.10.t
        desc = crysom.10.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = dust_sick_1
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 400 }
        fire_only_once = yes
        option = {
            name = crysom.10.a
            clr_country_flag = dust_sick_1
            set_country_flag = dust_will_die
        }
    }
country_event = { ## Dust's sick
        id = crysom.11
        title = crysom.11.t
        desc = crysom.11.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = dust_will_die
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 200 }
        fire_only_once = yes
        option = {
            name = crysom.11.a
            set_country_flag = dust_dead
        }
    }
country_event = { ## Sakira's sick
        id = crysom.1222
        title = crysom.1222.t
        desc = crysom.1222.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = sakira_sick
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 20 }
        fire_only_once = yes
        option = {
            name = crysom.1222.a
            add_political_power = -10
        }
    }
country_event = { ## Sakira's sick
        id = crysom.12
        title = crysom.12.t
        desc = crysom.12.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = sakira_sick
            has_country_flag = sombra_returned
            NOT = { has_country_flag = sick_together }
        }
        mean_time_to_happen = { days = 300 }
        fire_only_once = yes
        option = {
            name = crysom.12.a
            add_political_power = 5
            set_country_flag = sakira_getting_better
        }
    }
country_event = { ## Sakira is better
        id = crysom.13
        title = crysom.13.t
        desc = crysom.13.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = sakira_sick
            has_country_flag = sombra_returned
            has_country_flag = sakira_getting_better
            NOT = { has_country_flag = sick_together }
        }
        mean_time_to_happen = { days = 340 }
        fire_only_once = yes
        option = {
            name = crysom.13.a
            clr_country_flag = sakira_sick
        }
    }
country_event = { ##Militarization
        id = crysom.14
        title = crysom.14.t
        desc = crysom.14.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.14.a
            random_list = { 20 = { add_political_power = -40 } 35 = { add_political_power = -20 } 30 = { add_political_power = -15 } 15 = { add_political_power = -5 } }
        }
    }
country_event = { ##Army training
        id = crysom.15
        title = crysom.15.t
        desc = crysom.15.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.15.a
            random_list = { 20 = { add_political_power = -57 } 35 = { add_political_power = -100 } 30 = { add_political_power = -139 } 15 = { add_political_power = -30 } }
        }
    }
country_event = { ##End of Crystal Civil War against Sombra, obviously
        id = crysom.16
        title = crysom.16.t
        desc = crysom.16.d
        picture = GFX_event_crystal_city

        trigger = {
            original_tag = CRY
            has_government = fascism
            has_country_flag = sombra_returned
            has_civil_war = no
        }
        mean_time_to_happen = { days = 7 }
        fire_only_once = yes
        option = {
            name = crysom.16.a
            add_political_power = 30
            set_global_flag = return_of_sombra
            add_opinion_modifier = { target = EQS modifier = mortal_enemies }
            EQS = {
                add_opinion_modifier = { target = CRY modifier = mortal_enemies }
            }
        }
    }
country_event = { ## Sakira is better
        id = crysom.17
        title = crysom.17.t
        desc = crysom.17.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = sakira_sick
            has_country_flag = sick_together
            has_country_flag = sakira_getting_better
        }
        mean_time_to_happen = { days = 30 }
        fire_only_once = yes
        option = {
            name = crysom.17.a
            clr_country_flag = sakira_sick
            set_country_flag = sakira_recovered_with_you
        }
    }
country_event = { ## Sakira is better
        id = crysom.18
        title = crysom.18.t
        desc = crysom.18.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_country_flag = sakira_sick
            has_country_flag = sick_together
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 100 }
        fire_only_once = yes
        option = {
            name = crysom.18.a
            set_country_flag = sakira_getting_better
        }
    }
country_event = { ## Conquest of Equestria
        id = crysom.19
        title = crysom.19.t
        desc = crysom.19.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.19.a
            create_wargoal = { type = puppet_wargoal_focus target = EQS }
            set_country_flag = prepared_the_attack
        }
    }
country_event = { ## Conquest of Equestria
        id = crysom.20
        title = crysom.20.t
        desc = { 
            text = crysom.20.d_has_war_success
            trigger = {
                has_war_with = EQS
                70 = { is_controlled_by = CRY }
            }
        }
        desc = { 
            text = crysom.20.d_has_war_noluck
            trigger = {
                has_war_with = EQS
                70 = { is_controlled_by = EQS }
            }
        }
        desc = { 
            text = crysom.20.d_not_has_war
            trigger = {
                NOT = { has_war_with = EQS }
            }
        }
        picture = GFX_event_winter_sun

        is_triggered_only = yes
        option = {
            trigger = { NOT = { has_war_with = EQS } }
            name = crysom.20.a
            declare_war_on = { target = EQS type = puppet_wargoal_focus }
        }
        option = {
            trigger = {
                has_war_with = EQS
                70 = { is_controlled_by = CRY }
            }
            name = crysom.20.a
            add_political_power = 20
            army_experience = 15
        }
        option = {
            trigger = {
                has_war_with = EQS
                70 = { is_controlled_by = EQS }
            }
            name = crysom.20.a
            add_political_power = -20
            army_experience = 5
        }
    }
country_event = { ## Coring the old territories
        id = crysom.21
        title = crysom.21.t
        desc = crysom.21.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.21.a
            custom_effect_tooltip = sombra_cores
            hidden_effect = {
            137 = { add_core_of = CRY }
            138 = { add_core_of = CRY }
            174 = { add_core_of = CRY }
            136 = { add_core_of = CRY }
            131 = { add_core_of = CRY }
            175 = { add_core_of = CRY }
            172 = { add_core_of = CRY }
            173 = { add_core_of = CRY }
            14 = { add_core_of = CRY }
            73 = { add_core_of = CRY }
            72 = { add_core_of = CRY }
            59 = { add_core_of = CRY }
            60 = { add_core_of = CRY }
            61 = { add_core_of = CRY }
            132 = { add_core_of = CRY }
            170 = { add_core_of = CRY }
            169 = { add_core_of = CRY }
            180 = { add_core_of = CRY }
            181 = { add_core_of = CRY }
            174 = { add_core_of = CRY }
            134 = { add_core_of = CRY }
            135 = { add_core_of = CRY }
            178 = { add_core_of = CRY }
            74 = { add_core_of = CRY }
            104 = { add_core_of = CRY }
            183 = { add_core_of = CRY }
            177 = { add_core_of = CRY }
            182 = { add_core_of = CRY }
            155 = { add_core_of = CRY }
            154 = { add_core_of = CRY }
            102 = { add_core_of = CRY }
            157 = { add_core_of = CRY }
            326 = { add_core_of = CRY }
            160 = { add_core_of = CRY }
            164 = { add_core_of = CRY }
            237 = { add_core_of = CRY }
            235 = { add_core_of = CRY }
            163 = { add_core_of = CRY }
            161 = { add_core_of = CRY }
            153 = { add_core_of = CRY }
            334 = { add_core_of = CRY }
            240 = { add_core_of = CRY }
            165 = { add_core_of = CRY }
            225 = { add_core_of = CRY }
            168 = { add_core_of = CRY }
            167 = { add_core_of = CRY }
            166 = { add_core_of = CRY }
            332 = { add_core_of = CRY }
            234 = { add_core_of = CRY }
            57 = { add_core_of = CRY }
            268 = { add_core_of = CRY }
            267 = { add_core_of = CRY }
            11 = { add_core_of = CRY }
            317 = { add_core_of = CRY }
            255 = { add_core_of = CRY }
            273 = { add_core_of = CRY }
            270 = { add_core_of = CRY }
            346 = { add_core_of = CRY }
            256 = { add_core_of = CRY }
            274 = { add_core_of = CRY }
            269 = { add_core_of = CRY }
            253 = { add_core_of = CRY }
            224 = { add_core_of = CRY }
            }
        }
    }
country_event = { ## Fiendship
        id = crysom.22
        title = crysom.22.t
        desc = { text = crysom.22.d_nlr
        trigger = { is_in_faction_with = NLR
        NOT = { is_in_faction_with = CHN is_in_faction_with = STG } } }

        desc = { text = crysom.22.d_chn
        trigger = { is_in_faction_with = CHN
        NOT = { is_in_faction_with = NLR is_in_faction_with = STG } } }

        desc = { text = crysom.22.d_stg
        trigger = { is_in_faction_with = STG 
        NOT = { is_in_faction_with = NLR is_in_faction_with = CHN } } }

        desc = { text = crysom.22.d_stg_n_nlr
        trigger = { is_in_faction_with = STG 
        is_in_faction_with = NLR
        NOT = { is_in_faction_with = CHN } } }

        desc = { text = crysom.22.d_stg_n_chn
        trigger = { is_in_faction_with = STG 
        is_in_faction_with = CHN
        NOT = { is_in_faction_with = NLR } } }

        desc = { text = crysom.22.d_stg_n_chn_n_nlr
        trigger = { is_in_faction_with = STG 
        is_in_faction_with = CHN is_in_faction_with = NLR } }

        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.22.a
            hidden_effect = {
                every_state = {
                limit = {
                    is_owned_by = CRY
                }
                add_core_of = CRY
                }
            }
            drop_cosmetic_tag = yes
            set_cosmetic_tag = CRY_SOMIMP
        }
    }
country_event = { ## Conquest of Changelings
        id = crysom.23
        title = crysom.23.t
        desc = crysom.23.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.23.a
            create_wargoal = {
                target = CHN type = puppet_wargoal_focus
            }
        }
        option = {
            name = crysom.23.b
            add_political_power = -20
            CHN = {
                country_event = {
                     id = changelings.18 days = 1
                }
            }
        }
    }
country_event = { ## Conquest of Changelings
        id = crysom.233
        title = crysom.233.t
        desc = crysom.233.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.233.a
            add_political_power = 30
            create_wargoal = {
                target = CHN type = puppet_wargoal_focus
            }
        }
    }
country_event = { ## Changelings agreed to be puppets
        id = crysom.24
        title = crysom.24.t
        desc = crysom.24.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.24.a
            add_political_power = 300
            transfer_state = 319
            transfer_state = 247
            transfer_state = 246
            transfer_state = 316
            transfer_state = 322
            puppet = CHN
        }
}
country_event = { ## Alliance with Changelings
        id = crysom.25
        title = crysom.25.t
        desc = crysom.25.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.25.a
            add_political_power = -20
            CHN = {
                country_event = {
                     id = changelings.19 days = 1
                }
        }
    }
}
country_event = { ## Alliance with Changelings Declined
        id = crysom.26
        title = crysom.26.t
        desc = crysom.26.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.26.a
            add_political_power = -200
        }
    }
country_event = { ## Alliance with Changelings Accepted
        id = crysom.27
        title = crysom.27.t
        desc = crysom.27.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.27.a
            add_opinion_modifier = {
                target = CHN modifier = besties
            }
            CHN = {
                add_opinion_modifier = {
                target = CRY modifier = besties
                }
            }
            set_global_flag = CHN_for_gray_pact
        }
    }
country_event = { ## Gray Pact Fromed
        id = crysom.28
        title = crysom.28.t
        desc = { text = crysom.28.d_nlr
        trigger = { has_global_flag = NLR_for_gray_pact
        NOT = { has_global_flag = CHN_for_gray_pact has_global_flag = STG_for_gray_pact } } }

        desc = { text = crysom.28.d_chn
        trigger = { has_global_flag = CHN_for_gray_pact
        NOT = { has_global_flag = NLR_for_gray_pact has_global_flag = STG_for_gray_pact } } }

        desc = { text = crysom.28.d_stg
        trigger = { has_global_flag = STG_for_gray_pact 
        NOT = { has_global_flag = NLR_for_gray_pact has_global_flag = CHN_for_gray_pact } } }

        desc = { text = crysom.28.d_stg_n_nlr
        trigger = { has_global_flag = STG_for_gray_pact 
        has_global_flag = NLR_for_gray_pact
        NOT = { has_global_flag = CHN_for_gray_pact } } }

        desc = { text = crysom.28.d_stg_n_chn
        trigger = { has_global_flag = STG_for_gray_pact 
        has_global_flag = CHN_for_gray_pact
        NOT = { has_global_flag = NLR_for_gray_pact } } }

        desc = { text = crysom.28.d_stg_n_chn_n_nlr
        trigger = { has_global_flag = STG_for_gray_pact 
        has_global_flag = CHN_for_gray_pact has_global_flag = NLR_for_gray_pact } }
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.28.a
            trigger = {
                has_global_flag = CHN_for_gray_pact
            }
            add_to_faction = CHN
        }
        option = {
            name = crysom.28.a
            trigger = {
                has_global_flag = CHN_for_gray_pact
                has_war_with = CHN
            }
            white_peace = CHN
            add_to_faction = CHN
        }
        option = {
            name = crysom.28.a
            trigger = {
                has_global_flag = NLR_for_gray_pact
            }
            add_to_faction = NLR
        }
        option = {
            name = crysom.28.a
            trigger = {
                has_global_flag = STG_for_gray_pact
            }
            add_to_faction = STG
        }
        option = {
            name = crysom.28.a
            trigger = {
                has_global_flag = STG_for_gray_pact
                has_global_flag = NLR_for_gray_pact
            }
            add_to_faction = STG
            add_to_faction = NLR
        }
        option = {
            name = crysom.28.a
            trigger = {
                has_global_flag = STG_for_gray_pact
                has_global_flag = CHN_for_gray_pact
            }
            add_to_faction = STG
            add_to_faction = CHN
        }
        option = {
            name = crysom.28.a
            trigger = {
                has_global_flag = CHN_for_gray_pact
                has_global_flag = NLR_for_gray_pact
            }
            add_to_faction = CHN
            add_to_faction = NLR
        }
        option = {
            name = crysom.28.a
            trigger = {
                has_global_flag = CHN_for_gray_pact
                has_global_flag = NLR_for_gray_pact
                has_global_flag = STG_for_gray_pact
            }
            add_to_faction = CHN
            add_to_faction = NLR
            add_to_faction = STG
            add_political_power = 300
        }
    }
country_event = { ## Conquest of Lunar Empire
        id = crysom.29
        title = crysom.29.t
        desc = crysom.29.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.29.a
            create_wargoal = {
                target = NLR type = puppet_wargoal_focus
            }
        }
    }
country_event = { ## Conquest of Stalliongrad
        id = crysom.30
        title = crysom.30.t
        desc = crysom.30.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.30.a
            create_wargoal = {
                target = STG type = puppet_wargoal_focus
            }
        }
    }
country_event = { ## Alliance with NLR
        id = crysom.31
        title = crysom.31.t
        desc = crysom.31.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.31.a
            NLR = {
                country_event = {
                    id = lunas.26 days = 1
                }
            }
        }
    }
country_event = { ## NLR's response
        id = crysom.32
        title = crysom.32.t
        desc = {
            trigger = { has_global_flag = NLR_for_gray_pact }
            text = crysom.32.d_accept }
        desc = {
            trigger = { NOT = { has_global_flag = NLR_for_gray_pact } }
            text = crysom.32.d_decline }
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.32.a
            trigger = {
                has_global_flag = NLR_for_gray_pact
                }
            add_opinion_modifier = {
                target = NLR modifier = besties
            }
            NLR = {
                add_opinion_modifier = {
                target = CRY modifier = besties
                    }
                }
            add_political_power = 20
            }
        option = {
            name = crysom.32.b
            trigger = {
                NOT = { has_global_flag = NLR_for_gray_pact }
                }
            create_wargoal = { target = NLR type = annex_everything
                }
            add_political_power = -35
            }
        }
country_event = { ## Alliance with STG
        id = crysom.33
        title = crysom.33.t
        desc = crysom.33.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.33.a
            STG = { country_event = { id = stalliongrad.98 days = 1 }
            }
        }
    }
country_event = { ## Sinister's response
        id = crysom.34
        title = crysom.34.t
        desc = {
            trigger = { has_global_flag = STG_for_gray_pact }
            text = crysom.34.d_accept }
        desc = {
            trigger = { NOT = { has_global_flag = STG_for_gray_pact } }
            text = crysom.34.d_decline }
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.34.a
            trigger = {
                has_global_flag = STG_for_gray_pact
                }
            add_opinion_modifier = {
                target = STG modifier = besties
            }
            STG = {
                add_opinion_modifier = {
                target = CRY modifier = besties
                    }
                }
            }
        option = {
            name = crysom.34.b
            trigger = {
                NOT = { has_global_flag = STG_for_gray_pact }
                }
            create_wargoal = { target = STG type = puppet_wargoal_focus
                }
            }
        }
country_event = { ## Marriage with Luna
        id = crysom.35
        title = crysom.35.t
        desc = crysom.35.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.35.a
            NLR = {
                country_event = {
                    id = lunas.27 days = 7
                }
            }
            hidden_effect = {
                news_event = { id = news.36 hours = 12 }
            }
        }
    }
country_event = { ## Luna's response
        id = crysom.36
        title = crysom.36.t
        desc = {
            trigger = { has_global_flag = Luna_for_marriage }
            text = crysom.36.d_accept }
        desc = {
            trigger = { NOT = { has_global_flag = Luna_for_marriage } }
            text = crysom.36.d_decline }
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.36.a
            trigger = {
                has_global_flag = Luna_for_marriage
                }
            add_opinion_modifier = {
                target = NLR modifier = leaders_married
            }
            NLR = {
                add_opinion_modifier = {
                target = CRY modifier = leaders_married
                    }
                }
            news_event = {
                id = news.37 days = 16
                }
            }
        option = {
            name = crysom.36.b
            trigger = {
                NOT = { has_global_flag = Luna_for_marriage }
                }
            add_political_power = -150
            }
        }
country_event = { ## Marriage with Chrysalis
        id = crysom.37
        title = crysom.37.t
        desc = crysom.37.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.37.a
            CHN = {
                country_event = {
                    id = changelings.21 days = 1
                }
            }
            hidden_effect = {
                news_event = { id = news.47 hours = 6 }
            }
        }
    }
country_event = { ## Chrysalis's response
        id = crysom.38
        title = crysom.38.t
        desc = {
            trigger = { has_global_flag = Chrysalis_for_marriage }
            text = crysom.38.d_accept }
        desc = {
            trigger = { NOT = { has_global_flag = Chrysalis_for_marriage } }
            text = crysom.38.d_decline }
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.38.a
            trigger = {
                has_global_flag = Chrysalis_for_marriage
                }
            add_opinion_modifier = {
                target = CHN modifier = leaders_married
            }
            CHN = {
                add_opinion_modifier = {
                target = CRY modifier = leaders_married
                    }
                }
            news_event = {
                id = news.44 days = 16
                }
            add_political_power = 50
            }
        option = {
            name = crysom.38.b
            trigger = {
                NOT = { has_global_flag = Chrysalis_for_marriage }
                }
            add_political_power = -150
            }
        }
country_event = { ## New Generals
        id = crysom.39
        title = crysom.39.t
        desc = {
        text = crysom.39.d_civil_war
        trigger = { has_civil_war = yes }
        }
        desc = {
        text = crysom.39.d_regular_war
        trigger = { has_war = yes }
        }
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            OR = {
                has_war = yes
                has_civil_war = yes
            }
        }
        mean_time_to_happen = { days = 1 }
        fire_only_once = yes
        option = {
            name = crysom.39.a
            create_corps_commander = {
                    name = "Daemos"
                    portrait_path = "gfx/leaders/CRY/Damiyan.tga"
                    traits = { winter_specialist }
                    skill = 3
            }
        }
    }
country_event = { ## Bringing Back Cadence
        id = crysom.40
        title = crysom.40.t
        desc = crysom.40.d
        picture = GFX_event_crystal_city

        trigger = {
            original_tag = CRY
            OR = {
                has_government = democratic
                is_puppet_of = EQS
            }
            has_country_flag = sombra_returned
        }
        mean_time_to_happen = { days = 1 }
        fire_only_once = yes
        option = {
            name = crysom.40.a
            trigger = {
            OR = {
                has_country_flag = free_the_old_royalty
                has_country_flag = continue_imprisonment
                NOT = { has_completed_focus = CRY_miamorefate }
                }
            }
            drop_cosmetic_tag = yes
            hidden_effect = {
        retire_country_leader = yes 
        create_country_leader = {
            name = "Miamore Cadenza"
            desc = "CADENCE_DESC"
            picture = "Cadence.tga"
            expire = "1965.1.1"
            ideology = conservatism
                }
                remove_ideas = crystal_buff
                remove_ideas = sombra_dark_magic
                remove_ideas = sombra_dark_magic1
                remove_ideas = sombra_dark_magic2
                remove_ideas = sombra_leader
            }
        }
        option = {
            name = crysom.40.a
            trigger = {
            OR = {
                has_country_flag = royalty_executed
                }
            }
            drop_cosmetic_tag = yes
            hidden_effect = {
        retire_country_leader = yes 
        create_country_leader = {
            name = "Princess Twilight"
            desc = "TWILIGHT_DESC"
            picture = "Twilight.tga"
            expire = "1965.1.1"
            ideology = liberalism
            id = 1000
                }
                remove_ideas = crystal_buff
                remove_ideas = sombra_dark_magic
                remove_ideas = sombra_dark_magic1
                remove_ideas = sombra_dark_magic2
                remove_ideas = sombra_leader
            }
        }
    }
country_event = { ## Royal Family Captured
        id = crysom.41
        title = crysom.41.t
        desc = crysom.41.d
        picture = GFX_event_royal_family_captured

        trigger = {
            original_tag = CRY
            has_country_flag = larger_civil_war
            has_country_flag = sombra_returned
            has_government = fascism
        }
        mean_time_to_happen = { days = 5 }
        fire_only_once = yes
        option = {
            name = crysom.41.a
            set_country_flag = royal_family_captured
            EQS = {
                add_timed_idea = { idea = royal_family_imprisoned days = 1200 }
            }
            random_other_country = {
                limit = { original_tag = CRY
                has_government = democratic }
                add_timed_idea = { idea = royal_family_imprisoned days = 1200 }
            }
        }
    }
country_event = { ## What to do with the royal family
        id = crysom.42
        title = crysom.42.t
        desc = crysom.42.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crysom.42.a
            set_country_flag = royalty_executed
            EQS = {
                add_opinion_modifier = { modifier = executed_royalty target = CRY }
            }
        }
        option = {
            name = crysom.42.b
            set_country_flag = continue_imprisonment
        }
        option = {
            name = crysom.42.c
            set_country_flag = free_the_old_royalty
            EQS = {
                add_opinion_modifier = { modifier = released_royalty target = CRY }
            }
        }
    }
country_event = { ## Coronation of Flurry heart
        id = crysom.43
        title = crysom.43.t
        desc = crysom.43.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_government = democratic
            date > 1020.1.1
            NOT = {
                has_country_leader = { id = 1000 ruling_only = yes name = "Twilight Sparkle" }
            }
        }
        mean_time_to_happen = { days = 1 }
        fire_only_once = yes
        option = {
            name = crysom.43.a
            retire_country_leader = yes
            create_country_leader = {
            name = "Flurry Heart"
            desc = "FLURRYHEART_DESC"
            picture = "FlurryHeart.tga"
            expire = "1965.1.1"
            ideology = conservatism
            }
            news_event = {
                id = news.38 days = 1
            }
            ai_chance = { factor = 50 }
        }
        option = {
            name = crysom.43.b
            add_political_power = 150
            ai_chance = { factor = 50 }
        }
    }
country_event = { ## Coronation of Flurry heart
        id = crysom.44
        title = crysom.44.t
        desc = crysom.44.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_government = democratic
            date > 1020.1.1
            has_country_leader = { id = 1000 ruling_only = yes name = "Twilight Sparkle" }
        }
        mean_time_to_happen = { days = 1 }
        fire_only_once = yes
        option = {
            name = crysom.44.a
            retire_country_leader = yes
            create_country_leader = {
            name = "Flurry Heart"
            desc = "FLURRYHEART_DESC"
            picture = "FlurryHeart.tga"
            expire = "1965.1.1"
            ideology = conservatism
            }
            news_event = {
                id = news.38 days = 1
            }
            ai_chance = { factor = 50 }
        }
    }
############################################################
############################################################
############### Sombra Finishes ##############################
############################################################
############################################################

country_event = {
    id = crystalemp.1
    title = crystalemp.1.t
    desc = crystalemp.1.d
    picture = GFX_event_crystal_fair
 
    trigger = {
        has_global_flag = crystal_fair
        tag = CRY
    }
    mean_time_to_happen = { days = 5 }

    fire_only_once = yes
 
    option = {
    name = crystalemp.1.a
    add_political_power = 300
    add_national_unity = 0.07
    }
}
## Case of Com Civil War in EQS
country_event = {
    id = crystalemp.2
    title = crystalemp.2.t
    desc = crystalemp.2.d
    picture = GFX_event_gardening
 
    trigger = {
        tag = CRY
        EQS = {
            has_civil_war = yes
            has_government = communism
        }
        NOT = { has_country_flag = sombra_returned }
        is_puppet_of = EQS
    }
    mean_time_to_happen = { days = 2 }

    fire_only_once = yes
 
    option = {
    name = crystalemp.2.a
    trigger = { is_ai = no }
    set_cosmetic_tag = CRY_COM
    hidden_effect = {
        set_capital = 152
        start_civil_war = {
                ruling_party = communism
                ideology = democratic
                size = 0.6
                states = { 147 144 142 141 55 77 64 98 236 150 }
                capital = 53
            }
        random_other_country = {
            limit = {
                has_government = democratic
                original_tag = CRY
                has_civil_war = yes
            }
            set_cosmetic_tag = CRY_DEM
            }
        }
    }
    option = {
    name = crystalemp.2.b
    trigger = { is_ai = no }
    hidden_effect = {
        start_civil_war = {
                ruling_party = democratic
                ideology = communism
                size = 0.4
                capital = 152
                states = { 145 152 151 149 146 324 143 140 139 318 }
            }
        random_other_country = {
            limit = {
                has_government = communism
                original_tag = CRY
                has_civil_war = yes
            }
            set_cosmetic_tag = CRY_COM
            }
        }
    }
}
country_event = { ## STG/EQS asks of Union
    id = crystalemp.3
    title = crystalemp.3.t
    desc = crystalemp.3.d
    picture = GFX_event_gardening
 
    is_triggered_only = yes
 
    option = {
    name = crystalemp.3.a
    STG = {
        country_event = {
            id = stalliongrad.63 days = 2
            }
        }
    }
    option = {
    name = crystalemp.3.b
    add_political_power = 150
    add_national_unity = 0.05
    }
}
country_event = { ## STG/EQS asks of Union
    id = crystalemp.4
    title = crystalemp.4.t
    desc = crystalemp.4.d
    picture = GFX_event_gardening
 
    is_triggered_only = yes
 
    option = {
    name = crystalemp.4.a
    ai_chance = { factor = 100 }
    EQS = {
        country_event = { id = eqscom.16 days = 1 }
        }
    }
    option = {
    name = crystalemp.4.b
    ai_chance = { factor = 0 }
    add_political_power = 200
    }
}
###Sombra Events (revolt)
country_event = { #cry_umbruminitial info
	id = crystalemp.5
	title = crystalemp.5.t
	desc = crystalemp.5.d
	picture = GFX_event_gardening

	is_triggered_only = yes

	option = {
	name = crystalemp.5.a 
	country_event = { id = crystalemp.6 days = 7}
	}
}
country_event = { #Possesed ponies. What to do?
	id = crystalemp.6
	title = crystalemp.6.t
	desc = crystalemp.6.d
	picture = GFX_event_gardening

	is_triggered_only = yes
	fire_only_once = yes

	option = { #Look for cure
	name = crystalemp.6.a
	ai_chance = { factor = 100 }
	set_country_flag = cry_cured
	country_event = { id = crystalemp.11 days = 21}
	}

	option = { #Isolate ponies
	name = crystalemp.6.b
	ai_chance = { factor = 0 }
	set_country_flag = cry_isolated
	country_event = { id = crystalemp.7 days = 1}
	}
}
country_event = { #More possesed
	id = crystalemp.7
	title = crystalemp.7.t
	desc = crystalemp.7.d
	picture = GFX_event_gardening

	is_triggered_only = yes
	fire_only_once = yes

	option = {
	name = crystalemp.7.a
	complete_national_focus = cry_umbrummilitia
	add_ideas = sombrish_resistance
	}
}
country_event = {
	id = crystalemp.8
	title = crystalemp.8.t
	desc = crystalemp.8.d
	picture = GFX_event_gardening

	is_triggered_only = yes

	option = {
	name = crystalemp.8.a
	
	}
}

    country_event = { # Revolution
        id = crystalemp.9
        title = crystalemp.9.t
        desc = crystalemp.9.d
        picture = GFX_event_gardening

        is_triggered_only = yes

        option = {
            name = crystalemp.9.a
            set_politics = {
                ruling_party = neutrality 
                elections_allowed = no 
            }
            remove_ideas = political_turmoil
            add_ideas = royalfamily_imprisioned
            swap_ideas = { remove_idea = idea_old_dignity add_idea = idea_old_dignity_restored } 

            remove_unit_leader = 1043

            EQS = { country_event = { id = equestria.45 days = 10 } }
            if = {
               limit = { has_completed_focus = CRY_aristocracy }
               swap_ideas = { remove_idea = royal_family add_idea = aristrocrats_ruling } 
               set_cosmetic_tag = CRY_neutrality 
            }
            if = {
               limit = { has_completed_focus = CRY_militia }
               swap_ideas = { remove_idea = royal_family add_idea = militia_ruling } 
               set_cosmetic_tag = CRY_communism
            }
        }
    }

    country_event = {
        id = crystalemp.10
        title = crystalemp.10.t
        desc = crystalemp.10.d
        picture = GFX_event_gardening

        is_triggered_only = yes

        option = {
            name = crystalemp.10.a
            remove_ideas = royalfamily_imprisioned
            EQS = { add_opinion_modifier  = { target = CRY modifier = cry_accepted_demmands } }
            ai_chance = { factor = 60 }

        }
        option = {
            name = crystalemp.10.b
            EQS = { 
                add_opinion_modifier  = { 
                    target = CRY 
                    modifier = cry_refused_demmands 
                }
            }
            
            custom_effect_tooltip = crystalemp.10.b.tt
            ai_chance = { factor = 40 }
        }
    }

    country_event = {
        id = crystalemp.11
        title = crystalemp.11.t
        desc = crystalemp.11.d
        picture = GFX_event_gardening

        is_triggered_only = yes

        trigger = { has_country_flag = cry_cured}

        option = {
            name = crystalemp.11.a
            complete_national_focus = CRY_umbrumdefeat
        }
    }

    country_event = { #Independence Event / SEND TO EQS!
        id = crystalemp.12
        title = crystalemp.12.t
        desc = crystalemp.12.d
        picture = GFX_event_gardening

        is_triggered_only = yes

        option = {
            name = crystalemp.12.a
            end_puppet = CRY
            set_autonomy = { target = CRY autonomy_state = autonomy_free }
            ai_chance = { factor = 70 }
        }
        option = {
            name = crystalemp.12.b
            end_puppet = CRY
            set_autonomy = { target = CRY autonomy_state = autonomy_free }
            create_wargoal = { type = puppet_wargoal_focus target = CRY }
            ai_chance = { factor = 30 }
        }
    }

    country_event = { # Equestria isolates
        id = crystalemp.13
        title = crystalemp.13.t
        desc = crystalemp.13.d
        picture = GFX_event_gardening

        is_triggered_only = yes

        option = {
            name = crystalemp.13.a
            add_ideas = isolated
        }

        option = {
            name = crystalemp.13.b
            remove_ideas = royalfamily_imprisioned
        }
    }
country_event = { ## Equestria asks to join civil war
        id = crystalemp.17
        title = crystalemp.17.t
        desc = crystalemp.17.d
        picture = GFX_event_sombra_return

        is_triggered_only = yes

        option = {
            name = crystalemp.17.a
            trigger = {
                has_war_with = D01
            }
            add_to_war = { targeted_alliance = EQS enemy = D01 } 
        }
        option = {
            name = crystalemp.17.a
            trigger = {
                has_war_with = D02
            }
            add_to_war = { targeted_alliance = EQS enemy = D02 } 
        }
        option = {
            name = crystalemp.17.a
            trigger = {
                has_war_with = D03
            }
            add_to_war = { targeted_alliance = EQS enemy = D03 } 
        }
        option = {
            name = crystalemp.17.a
            trigger = {
                has_war_with = CRY
            }
            add_to_war = { targeted_alliance = EQS enemy = CRY } 
        }
    }
country_event = { ## Independence
        id = crystalemp.18
        title = crystalemp.18.t
        desc = crystalemp.18.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crystalemp.18.a
            add_ideas = magical_power
        }
    }
country_event = { ## Magical Power!
        id = crystalemp.19
        title = crystalemp.19.t
        desc = crystalemp.19.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crystalemp.19.a
            country_event = {
                id = crystalemp.19 days = 1
            }
        }
    }
country_event = { ## Independence
        id = crystalemp.20
        title = crystalemp.20.t
        desc = crystalemp.20.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = { ## FREE
            name = crystalemp.20.a
            trigger = { has_dlc = "Together for Victory"}
            EQS = {
                country_event = { id = equestria.58 days = 1 }
            }
            EQS = {
            set_autonomy = { target = CRY autonomy_state = autonomy_free }
            }
        }
        option = { ## DOMINION
            name = crystalemp.20.b
            trigger = { has_dlc = "Together for Victory"}
            EQS = {
            set_autonomy = { target = CRY autonomy_state = autonomy_dominion }
            }
        }
        option = { ### FREE NO DLCS
            name = crystalemp.20.a
            trigger = { NOT = { has_dlc = "Together for Victory" } }
            EQS = {
                country_event = { id = equestria.58 days = 1 }
            }
            EQS = {
                end_puppet = CRY
            }
        }
    }
country_event = { ## Subordination
        id = crystalemp.21
        title = crystalemp.21.t
        desc = crystalemp.21.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crystalemp.21.a
            trigger = { has_dlc = "Together for Victory"}
            EQS = {
                set_autonomy = { target = CRY autonomy_state = autonomy_puppet }
            }
            ai_chance = { factor = 80 }
        }
        option = {
            name = crystalemp.21.a
            trigger = { NOT = { has_dlc = "Together for Victory"} }
            add_political_power = 100
            ai_chance = { factor = 80 }
        }
        option = { ## get annexed
            name = crystalemp.21.b
            trigger = {
                EQS = { is_ai = no }
                is_ai = no
            }
            ai_chance = { factor = 20 }
            EQS = {
            country_event = { id = equestria.57 days = 1 }
            }
        }
        option = { ## get annexed
            name = crystalemp.21.b
            trigger = {
                EQS = { is_ai = yes }
                is_ai = no
            }
            ai_chance = { factor = 20 }
            custom_effect_tooltip = switching_to_equestria
            EQS = {
            country_event = { id = equestria.57 days = 1 }
            }

            EQS = {
                change_tag_from = CRY
            }
        }
        option = { ## get annexed
            name = crystalemp.21.b
            trigger = {
            OR = {
                EQS = { is_ai = no }
                EQS = { is_ai = yes }
                }
                is_ai = yes
            }
            ai_chance = { factor = 20 }
            EQS = {
            country_event = { id = equestria.57 days = 1 }
            }
        }
    }
country_event = { ## Join Equestrian faction
        id = crystalemp.22
        title = crystalemp.22.t
        desc = crystalemp.22.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crystalemp.22.a
            EQS = {
                add_to_faction = CRY 
                }
            ai_chance = { factor = 100 }
            }
        option = {
            name = crystalemp.22.b
            add_political_power = 50
            ai_chance = { factor = 0 }
            }
    }
#### CRYSTAL COMMUNISTS ####

country_event = { ## Communist Crystal Ponies
        id = crycom.1
        title = crycom.1.t
        desc = crycom.1.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crycom.1.a
            add_ideas = communist_influence
            hidden_effect = {
                country_event = {
                    id = crycom.11 days = 20
                }
            }
        }
    }
country_event = { ## Communist Crystal Ponies # Elections
        id = crycom.2
        title = crycom.2.t
        desc = crycom.2.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crycom.2.a
            country_event = {
                id = crycom.3 days = 14
            }
        }
    }
country_event = { ## Communist Crystal Ponies # Elections
        id = crycom.3
        title = crycom.3.t
        desc = { text = crycom.3.d_yes_com
        trigger = {
            communism > 0.5
            }
        }
        desc = { text = crycom.3.d_no_com
        trigger = {
            communism < 0.5
            }
        }
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            trigger = {
                communism > 0.5
                has_dlc = "Together for Victory"
            }
            name = crycom.3.a
            hidden_effect = {
            set_politics = { ruling_party = communism elections_allowed = no } 
            random_list = { 50 = { add_political_power = 50 } 50 = { add_political_power = 100 } }
            add_ideas = CRY_inexperienced_officers
            remove_ideas = royal_family
            remove_ideas = royal_family3
            remove_ideas = royal_family2
            remove_ideas = equestrian_overlord
            set_autonomy = { target = CRY autonomy_state = autonomy_free } 
            remove_unit_leader = 1043
            set_cosmetic_tag = CRY_COM
            country_event = {
                id = crycom.9 hours = 3
                }
            }
        }
        option = {
            trigger = {
                communism > 0.5
                NOT = { has_dlc = "Together for Victory" }
            }
            name = crycom.3.a
            hidden_effect = {
            set_politics = { ruling_party = communism elections_allowed = no } 
            random_list = { 50 = { add_political_power = 50 } 50 = { add_political_power = 100 } }
            add_ideas = CRY_inexperienced_officers
            remove_ideas = royal_family
            remove_ideas = royal_family3
            remove_ideas = royal_family2
            remove_ideas = equestrian_overlord
            EQS = {
            end_puppet = CRY
            }
             remove_unit_leader = 1043
             set_cosmetic_tag = CRY_COM
             country_event = {
                id = crycom.9 hours = 3
                }
            }
        }
        option = {
            trigger = {
                communism > 0.4
                communism < 0.5
            }
            name = crycom.3.b
            start_civil_war = {
                ruling_party = communism
                ideology = democratic
                size = 0.60
            }
            add_popularity = { ideology = communism popularity = 0.2 }
            random_other_country = {
                limit = { original_tag = CRY 
                has_government = democratic }
                set_cosmetic_tag = CRY_DEM
                add_popularity = { ideology = democratic popularity = 0.3 }
            }
            set_cosmetic_tag = CRY_COM
        }
        option = {
            trigger = {
                communism < 0.35
            }
            name = crycom.3.c
            start_civil_war = {
                ruling_party = communism
                ideology = democratic
                size = 0.50
            }
            add_popularity = { ideology = communism popularity = 0.2 }
            random_other_country = {
                limit = { original_tag = CRY 
                has_government = democratic }
                set_cosmetic_tag = CRY_DEM
                add_popularity = { ideology = democratic popularity = 0.3 }
            }
            set_cosmetic_tag = CRY_COM
        }
    }
country_event = { ## Stalliongrad's advisory
        id = crycom.4
        title = crycom.4.t
        desc = crycom.4.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crycom.4.a
            trigger = {
            NOT = { STG = { has_country_flag = darkwing_elected } }
            }
            STG = {
                country_event = { id = stalliongrad.100 hours = 6 }
            }
        }
        option = {
            name = crycom.4.b
            trigger = {
            NOT = { STG = { has_country_flag = darkwing_elected } }
            }
            add_political_power = 100
        }
        option = {
            name = crycom.4.c
            trigger = {
            STG = { has_country_flag = darkwing_elected }
            }
            add_political_power = 100
        }
    }
country_event = { ## STG agrees
        id = crycom.5
        title = crycom.5.t
        desc = crycom.5.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crycom.5.a
            add_political_power = 50
            add_timed_idea = { idea = stalliongradian_advisors days = 710 }
            set_country_flag = STG_agreed_cooperation
        }
    }
country_event = { ## Stalliongrad's advisory rejected
        id = crycom.6
        title = crycom.6.t
        desc = crycom.6.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crycom.6.a
            add_political_power = -60
        }
    }
country_event = { ## Research Agreement
        id = crycom.7
        title = crycom.7.t
        desc = crycom.7.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes
        option = {
            name = crycom.7.a
            trigger = {
                has_dlc = "Together for Victory"
            }
            add_to_tech_sharing_group = crystalempireresearch
            STG = { add_to_tech_sharing_group = crystalempireresearch }
            add_political_power = 70
            add_tech_bonus = {
                name = armor_bonus
                bonus = 0.47
                uses = 2
                category = armor
            }
            add_tech_bonus = {
                name = industry
                bonus = 0.2
                uses = 1
                category = industry
            }
            STG = {
                add_tech_bonus = {
                name = armor_bonus
                bonus = 0.47
                uses = 2
                category = armor
                }
            }
        }
        option = {
            name = crycom.7.a
            trigger = {
                NOT ={
                has_dlc = "Together for Victory"
                }
            }
            add_political_power = 50
            add_tech_bonus = {
                name = armor_bonus
                bonus = 0.45
                uses = 2
                category = armor
            }
            add_tech_bonus = {
                name = industry_bonus
                bonus = 0.20
                uses = 1
                category = industry
            }
            STG = {
                add_tech_bonus = {
                name = armor_bonus
                bonus = 0.45
                uses = 2
                category = armor
                }
            }
        }
    }
country_event = { ## Remove sombra therat
        id = crycom.8
        title = crycom.8.t
        desc = crycom.8.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crycom.8.a
            remove_ideas = sombra_threat
            hidden_effect = {
                remove_ideas = sombra_threat2
            }
        }
    }
country_event = { ## Independence
        id = crycom.9
        title = crycom.9.t
        desc = crycom.9.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crycom.9.a
            random_list = { 25 = { add_political_power = 50 } 25 = { add_political_power = -50 } 25 = { add_political_power = 1 } 25 = { add_political_power = -60 } }
            news_event = {
                id = news.41 days = 1
            }
        }
    }
country_event = { ## Stalliongrad's advisory rejected
        id = crycom.10
        title = crycom.10.t
        desc = crycom.10.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            has_completed_focus = CRY_neworder
        }
        mean_time_to_happen = { days = 30 }
        fire_only_once = yes
        option = {
            name = crycom.10.a
        }
    }
country_event = { ## Stalliongrad's advisory rejected
        id = crycom.11
        title = crycom.11.t
        desc = crycom.11.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crycom.11.a
            add_popularity = { ideology = communism popularity = 0.1 } 
        }
    }
country_event = { ## Stalliongrad's advisory rejected
        id = crycom.12
        title = crycom.12.t
        desc = crycom.12.d
        picture = GFX_event_crystal_city

        trigger = {
            tag = CRY
            communism > 0.43
            has_completed_focus = CRY_communistideas
        }
        mean_time_to_happen = { days = 1 }
        fire_only_once = yes
        option = {
            name = crycom.12.a
            add_popularity = { ideology = communism popularity = 0.02 } 
        }
    }
country_event = { ## Stalliongrad's advisory rejected
        id = crycom.13
        title = crycom.13.t
        desc = crycom.13.d
        picture = GFX_event_crystal_city

        is_triggered_only = yes

        option = {
            name = crycom.13.a
            add_popularity = { ideology = communism popularity = 0.1 } 
        }
    }