
# this = crisis country

add_fe_building_research_1 = {
    add_research_option = tech_fe_nourishment_1
    add_research_option = tech_fe_singularity_1
    add_research_option = tech_fe_mine_1
    add_research_option = tech_fe_dome_1
    add_research_option = tech_fe_silo_1
}
add_fe_building_research_2 = {
    add_research_option = tech_fe_affluence_1
    add_research_option = tech_fe_forge_1
    add_research_option = tech_fe_market_1
    add_research_option = tech_fe_fortress_1
    add_research_option = tech_fe_security_1
}
add_fe_building_research_3 = {
    add_research_option = tech_fe_fabricator_1
    add_research_option = tech_fe_administration_1
    add_research_option = tech_fe_assembly_1
    add_research_option = tech_fe_clinic_1
    add_research_option = tech_fe_entertainment_1
    add_research_option = tech_fe_lab_1
}

add_dark_matter_ship_research = {
    # this = country
    # shield
    if = {
        limit = { not = { has_technology = tech_shields_5 } }
        give_technology = { tech = tech_shields_1 message = no }
        give_technology = { tech = tech_shields_2 message = no }
        give_technology = { tech = tech_shields_3 message = no }
        give_technology = { tech = tech_shields_4 message = no }
        give_technology = { tech = tech_shields_5 message = no }
    }
    add_research_option = tech_dark_matter_deflector
    # reactor
    if = {
        limit = { not = { has_technology = tech_zero_point_power } }
        give_technology = { tech = tech_fission_power message = no }
        give_technology = { tech = tech_fusion_power message = no }
        give_technology = { tech = tech_cold_fusion_power message = no }
        give_technology = { tech = tech_antimatter_power message = no }
        give_technology = { tech = tech_zero_point_power message = no }
    }
    add_research_option = tech_dark_matter_power_core
    # thruster
    if = {
        limit = { not = { has_technology = tech_thrusters_4 } }
        give_technology = { tech = tech_thrusters_1 message = no }
        give_technology = { tech = tech_thrusters_2 message = no }
        give_technology = { tech = tech_thrusters_3 message = no }
        give_technology = { tech = tech_thrusters_4 message = no }
    }
    add_research_option = tech_dark_matter_propulsion
}

begin_war_like_crisis_level_5 = {
    #root.owner must be player crisis empire
    if = {
        limit = { has_federation = yes }
        leave_alliance = { override_requirements = yes }
    }
    tooltip = {
        if = {
            limit = {
                is_galactic_community_formed = yes
                is_galactic_community_member = yes
            }
            remove_from_galactic_community = yes
        }
    }
    custom_tooltip = resolution_declare_crisis_tooltip
    hidden_effect = { declare_crisis_effect = yes }
}

begin_war_like_crisis_cosmogenesis_level_5 = {
    every_country = {
        limit = {
            is_country_type = fallen_empire
            NOT = { is_at_war_with = prev }
        }
        declare_war = {
            target = prev
            name = cosmogenesis_materialist_war
            attacker_war_goal = wg_end_threat
        }
    }
}

begin_war_like_crisis_behemoth_level_5 = {
    #root.owner must be player crisis empire
    custom_tooltip = resolution_declare_crisis_tooltip
    hidden_effect = {
        declare_crisis_effect = yes
        every_playable_country = {
            limit = {
                is_galactic_community_member = no
                NOT = {
                    is_same_value = owner
                    is_at_war_with = owner
                }
            }
            join_war_on_side = {
                war = event_target:crisis_war
                side = event_target:community_war_leader
            }
        }
    }
}

