################################ # # Federations DLC Events # # Written by Pierre du Plessis # ############################### namespace = federations2 ### Anomaly - Shakespeare broadcast from the planet! ship_event = { id = federations2.1 title = federations2.1.name desc = federations2.1.desc picture = GFX_evt_warm_barren show_sound = event_radio_chatter location = FROM is_triggered_only = yes auto_opens = yes immediate = { owner = { if = { limit = { NOT = { owner = { OR = { has_country_flag = human_1 has_country_flag = human_2 has_country_flag = human_plantoid is_human_species = yes } } } } create_leader = { class = scientist species = owner_main_species effect = { save_event_target_as = shakespeare exile_leader_as = shakespeare } } } else = { create_leader = { class = scientist name = "NAME_William_Shakespeare" species = owner_main_species effect = { save_event_target_as = shakespeare exile_leader_as = shakespeare } } } } } option = { name = federations2.1.A trigger = { owner = { is_xenophile = no } } owner = { add_modifier = { modifier = supremacy_reaffirmed_by_gift years = 5 } } } option = { name = federations2.1.B trigger = { owner = { is_xenophobe = yes } } if = { limit = { owner = { OR = { is_dictatorial_authority = yes is_imperial_authority = yes } } } custom_tooltip = federations2.1.B.tooltip owner = { add_monthly_resource_mult = { resource = influence value = @tier3influencereward min = @tier3influencemin max = @tier3influencemax } } } else = { owner = { add_monthly_resource_mult = { resource = influence value = @tier2influencereward min = @tier2influencemin max = @tier2influencemax } } } } option = { name = federations2.1.C trigger = { owner = { is_xenophobe = no } } owner = { add_monthly_resource_mult = { resource = unity value = @tier2unityreward min = @tier2unitymin max = @tier2unitymax } } } option = { name = federations2.1.D trigger = { owner = { is_xenophile = yes } } owner = { add_modifier = { modifier = gift_from_mysterious_benefactors years = 5 } } } } # Arc Site - Ruined Starsystem ship_event = { id = federations2.20 title = federations2.20.name desc = federations2.20.desc picture = GFX_evt_ruined_system show_sound = event_default location = from is_triggered_only = yes trigger = { owner = { is_ai = no } from = { has_star_flag = planet_with_too_many_moons_system any_fleet_in_system = { has_fleet_flag = too_many_moons_warder } } } option = { name = BATTLESTATIONS } } # Stage 1 - The Ruins of Shallash fleet_event = { id = federations2.2 title = federations2.2.name desc = federations2.2.desc picture = GFX_evt_city_ruins show_sound = event_ghost_town archaeology = yes is_triggered_only = yes immediate = { from = { set_site_progress_locked = yes } } after = { from = { set_site_progress_locked = no } } option = { name = SEARCH small_artifact_reward = yes } } # Stage 2 - Records of the Lost fleet_event = { id = federations2.3 title = federations2.3.name desc = federations2.3.desc picture = GFX_evt_busy_spaceport show_sound = event_cityscape archaeology = yes is_triggered_only = yes immediate = { from = { set_site_progress_locked = yes } } after = { from = { set_site_progress_locked = no } } option = { name = federations2.3.A small_artifact_reward = yes } } # Stage 3 - The Shallarian Peace fleet_event = { id = federations2.4 title = federations2.4.name desc = federations2.4.desc picture = GFX_evt_diplomatic_visit show_sound = event_conversation archaeology = yes is_triggered_only = yes immediate = { from = { set_site_progress_locked = yes } } after = { from = { set_site_progress_locked = no } } option = { name = federations2.4.A trigger = { owner = { is_pacifist = no } } small_artifact_reward = yes } option = { name = federations2.4.B trigger = { owner = { is_pacifist = yes } } small_artifact_reward = yes } } # Stage 4 (gatekeeper) fleet_event = { id = federations2.5 hide_window = yes archaeology = yes is_triggered_only = yes immediate = { if = { limit = { any_country = { OR = { is_country_type = fallen_empire is_country_type = awakened_fallen_empire } has_ethic = ethic_fanatic_xenophobe has_communications = root.owner } } random_list = { 1 = { fleet_event = { id = federations2.7 } } 4 = { random_country = { limit = { OR = { is_country_type = fallen_empire is_country_type = awakened_fallen_empire } has_ethic = ethic_fanatic_xenophobe } save_event_target_as = fanatic_xenophobe_fe } fleet_event = { id = federations2.6 } } } } else = { fleet_event = { id = federations2.7 } } } after = { from = { expire_site_event = federations2.5 } } } # Stage 4.A - Wiped out by the Xenophobe FE fleet_event = { id = federations2.6 title = federations2.6.name desc = { trigger = { event_target:fanatic_xenophobe_fe = { is_country_type = fallen_empire } } text = federations2.6.desc.fe } desc = { trigger = { event_target:fanatic_xenophobe_fe = { is_country_type = awakened_fallen_empire } } text = federations2.6.desc.afe } picture = GFX_evt_exploding_planet show_sound = event_screams archaeology = yes is_triggered_only = yes specimen = shallarian_data_core immediate = { fromfrom = { set_site_progress_locked = yes } } option = { #A sad tale name = federations2.6.A trigger = { owner = { NOR = { is_militarist = yes has_civic = civic_fanatic_purifiers is_machine_empire = yes has_civic = civic_hive_devouring_swarm } } } } option = { name = federations2.6.B trigger = { owner = { is_militarist = yes } } } option = { name = federations2.6.C trigger = { owner = { is_machine_empire = yes NOT = { has_civic = civic_machine_terminator } } } } option = { name = federations2.6.D trigger = { owner = { has_civic = civic_machine_terminator } } } option = { name = federations2.6.E trigger = { owner = { has_civic = civic_hive_devouring_swarm } } } after = { fromfrom = { set_site_progress_locked = no } large_artifact_reward = yes owner = { give_next_terraforming_tech_option_effect = yes add_modifier = { modifier = shallarian_terraforming_knowledge } } } } # Stage 4.B - Wiped out by their own smartness fleet_event = { id = federations2.7 title = federations2.7.name desc = { trigger = { owner = { is_machine_empire = no NOT = { has_country_flag = synthetic_empire } } } text = federations2.7.desc } desc = { trigger = { owner = { is_machine_empire = yes } } text = federations2.7.desc.synth } desc = { trigger = { owner = { has_country_flag = synthetic_empire } } text = federations2.7.desc.machine } picture = GFX_evt_exploding_planet show_sound = event_screams archaeology = yes is_triggered_only = yes immediate = { fromfrom = { set_site_progress_locked = yes } } option = { #A sad tale name = federations2.6.A trigger = { owner = { NOR = { is_militarist = yes has_civic = civic_fanatic_purifiers is_machine_empire = yes has_civic = civic_hive_devouring_swarm } } } } option = { name = federations2.7.B trigger = { owner = { is_machine_empire = yes NOT = { has_civic = civic_machine_terminator } } } } option = { name = federations2.7.C trigger = { owner = { has_civic = civic_machine_terminator } } } option = { name = federations2.7.D trigger = { owner = { has_civic = civic_hive_devouring_swarm } } } after = { fromfrom = { set_site_progress_locked = no } large_artifact_reward = yes owner = { add_resource = { influence = 100 } if = { limit = { is_machine_empire = no NOT = { has_country_flag = synthetic_empire } } give_next_ai_tech_option_effect = yes } else = { add_monthly_resource_mult = { resource = unity value = @tier4unityreward min = @tier4unitymin max = @tier4unitymax } } } } } ##Random Events # Radiation Leak fleet_event = { id = federations2.701 title = "federations2.701.name" desc = "federations2.701.desc" picture = GFX_evt_generator_powerup show_sound = event_power_down archaeology = yes is_triggered_only = yes immediate = { fromfrom = { set_site_progress_locked = yes } } after = { fromfrom = { set_site_progress_locked = no } } option = { name = UNFORTUNATE fromfrom = { add_stage_clues = -3 } } } # Sentinel Ship Activated fleet_event = { id = federations2.702 title = "federations2.702.name" desc = "federations2.702.desc" picture = GFX_evt_ship_in_orbit_2 show_sound = event_red_alert archaeology = yes is_triggered_only = yes immediate = { fromfrom = { set_site_progress_locked = yes } solar_system = { random_system_planet = { limit = { is_asteroid = yes } save_event_target_as = system_asteroid } } } after = { fromfrom = { set_site_progress_locked = no } } option = { name = federations2.702.A hidden_effect = { create_country = { name = "NAME_Warder_of_the_Ruins" type = faction flag = { icon = { category = "pointy" file = "flag_pointy_21.dds" } background= { category = "backgrounds" file = "00_solid.dds" } colors={ "black" "black" "null" "null" } } } last_created_country = { set_graphical_culture = fallen_empire_04 save_global_event_target_as = ancient_warden_country } } event_target:ancient_warden_country = { create_fleet = { name = "NAME_Warder_of_the_Ruins" settings = { spawn_debris = no } effect = { set_owner = event_target:ancient_warden_country create_ship = { name = "NAME_Warder_of_the_Ruins" design = "NAME_Warder_of_the_Ruins" } set_location = { target = event_target:system_asteroid distance = 5 angle = random } } } } } } ##Dancing Plague colony event chain #Intro event planet_event = { id = federations2.8 title = federations2.8.name desc = federations2.8.desc location = root inline_script = { script = events/biogenesis_event_art OWNER = owner REGULAR_PICTURE = GFX_evt_big_landing_ship BIOSHIP_PICTURE = GFX_evt_bioship_landing } show_sound = event_default is_triggered_only = yes pre_triggers = { has_owner = yes is_homeworld = no original_owner = yes has_ground_combat = no is_capital = no is_occupied_flag = no } trigger = { owner = { is_country_type = default NOT = { has_ethic = ethic_gestalt_consciousness } NOT = { has_country_flag = dancing_fever_colony_event } is_individual_machine = no } any_owned_pop_group = { is_same_species = root.owner } NOR = { has_planet_flag = colony_event is_planet_class = pc_habitat is_planet_class = pc_ringworld_habitable is_planet_class = pc_shattered_ring_habitable is_planet_class = pc_cybrex is_planet_class = pc_city } } immediate = { set_planet_flag = colony_event owner = { set_country_flag = dancing_fever_colony_event } } option = { name = federations2.8.A hidden_effect = { planet_event = { id = federations2.9 days = 45 random = 60 } } } } #This may be an issue - research it? planet_event = { id = federations2.9 title = federations2.9.name desc = federations2.9.desc picture = GFX_evt_tradestation_interior location = root show_sound = event_celebration is_triggered_only = yes pre_triggers = { has_owner = yes original_owner = yes has_ground_combat = no is_occupied_flag = no } option = { name = federations2.9.A enable_special_project = { name = DANCING_PLAGUE_PROJECT location = THIS owner = root } } option = { name = federations2.9.B add_modifier = { modifier = dancing_fad days = 180 } hidden_effect = { random_list = { 2 = { planet_event = { id = federations2.12 days = 60 random = 60 } modifier = { factor = 0 pop_amount < 200 } } 2 = { planet_event = { id = federations2.13 days = 60 random = 60 } } 1 = { planet_event = { id = federations2.14 days = 60 random = 60 } } } } } } #research - best outcome planet_event = { id = federations2.10 title = federations2.10.name desc = federations2.10.desc picture = GFX_evt_tradestation_interior location = root show_sound = event_laboratory_sound is_triggered_only = yes option = { name = federations2.10.A add_deposit = d_disco_planet ai_chance = { factor = 3 } } option = { name = federations2.10.B add_deposit = d_fuming_bog owner = { add_monthly_resource_mult = { resource = unity value = @tier1unityreward min = @tier1unitymin max = @tier1unitymax } } } } #research - not quite as good outcome planet_event = { id = federations2.11 title = federations2.11.name desc = federations2.11.desc picture = GFX_evt_society_research location = root show_sound = event_laboratory_sound is_triggered_only = yes option = { name = federations2.11.A add_deposit = d_fuming_bog owner = { add_monthly_resource_mult = { resource = unity value = @tier1unityreward min = @tier1unitymin max = @tier1unitymax } } } } #no research - bad outcome planet_event = { id = federations2.12 title = federations2.12.name desc = federations2.12.desc picture = GFX_evt_disease_outbreak location = root show_sound = event_screams is_triggered_only = yes pre_triggers = { has_owner = yes original_owner = yes has_ground_combat = no is_occupied_flag = no } immediate = { remove_modifier = dancing_fad } option = { name = federations2.12.A random_owned_pop_group = { limit = { is_same_species = root.owner } kill_single_pop = yes } add_modifier = { modifier = dancing_to_death_modifier } enable_special_project = { name = DANCING_PLAGUE_PROJECT2 location = THIS owner = root } } } #no research - neutral outcome planet_event = { id = federations2.13 title = federations2.13.name desc = federations2.13.desc picture = GFX_evt_news_room location = root show_sound = event_default is_triggered_only = yes pre_triggers = { has_owner = yes original_owner = yes has_ground_combat = no is_occupied_flag = no } option = { name = INTERESTING remove_modifier = dancing_fad } } #no research - good outcome planet_event = { id = federations2.14 title = federations2.14.name desc = federations2.14.desc picture = GFX_evt_tradestation_interior location = root show_sound = event_celebration is_triggered_only = yes pre_triggers = { has_owner = yes original_owner = yes has_ground_combat = no is_occupied_flag = no } immediate = { remove_modifier = dancing_fad } option = { name = federations2.14.A add_deposit = d_disco_planet2 } } #had to remove the gases planet_event = { id = federations2.15 title = federations2.15.name desc = federations2.15.desc picture = GFX_evt_society_research location = root show_sound = event_laboratory_sound is_triggered_only = yes option = { name = federations2.15.A remove_modifier = dancing_to_death_modifier add_deposit = d_fuming_bog } } ############################## # JOINT OPERATIONS ############################## ### Hegemony #Starting event country_event = { id = federations2.50 title = federations2.50.name desc = federations2.50.desc picture = GFX_evt_diplomatic_visit show_sound = event_default is_triggered_only = yes trigger = { years_passed > 60 exists = federation has_federation = yes is_federation_leader = yes NOT = { has_country_flag = hegemony_joint_operation_monument } federation = { has_federation_type = hegemony_federation federation_level >= 2 NOT = { has_federation_flag = had_successful_hegemony_joint_operation } count_member = { count >= 2 limit = { NOT = { is_same_value = root } exists = capital_scope.solar_system #just in case... if = { limit = { any_controlled_fleet = { is_ship_class = shipclass_constructor } } any_controlled_fleet = { is_ship_class = shipclass_constructor can_access_system = root.capital_scope.solar_system #never overuse this trigger } } else = { any_controlled_fleet = { NOT = { is_ship_class = shipclass_military_station } NOT = { is_ship_class = shipclass_mining_station } NOT = { is_ship_class = shipclass_research_station } NOT = { is_ship_class = shipclass_observation_station } is_inside_border = owner can_access_system = root.capital_scope.solar_system } } } } NOT = { has_federation_flag = federation_recent_hegemony_joint_operation } } } immediate = { hidden_effect = { remove_country_flag = hegemony_ethos_militarist remove_country_flag = hegemony_ethos_pacifist remove_country_flag = hegemony_ethos_xenophobe remove_country_flag = hegemony_ethos_xenophile remove_country_flag = hegemony_ethos_materialist remove_country_flag = hegemony_ethos_spiritualist remove_country_flag = hegemony_ethos_egalitarian remove_country_flag = hegemony_ethos_authoritarian federation = { every_member = { remove_country_flag = hegemony_joint_operation_yes remove_country_flag = hegemony_joint_operation_no remove_country_flag = hegemony_joint_operation_invalid_participant } remove_federation_flag = hegemony_joint_operation_complete_success remove_federation_flag = hegemony_joint_operation_complete_failure remove_federation_flag = hegemony_joint_operation_partial_success remove_federation_flag = hegemony_joint_operation_partial_failure set_variable = { which = hegemony_joint_operation_succeed value = 0 } set_variable = { which = hegemony_joint_operation_fail value = 0 } set_variable = { which = hegemony_joint_operation_yes value = 0 } set_variable = { which = hegemony_joint_operation_no value = 0 } } #And set them again :D if = { limit = { has_ethic = ethic_fanatic_militarist } set_country_flag = hegemony_ethos_militarist } else_if = { limit = { is_fanatic_pacifist = yes } set_country_flag = hegemony_ethos_pacifist } else_if = { limit = { has_ethic = ethic_fanatic_xenophobe } set_country_flag = hegemony_ethos_xenophobe } else_if = { limit = { is_fanatic_xenophile = yes } set_country_flag = hegemony_ethos_xenophile } else_if = { limit = { is_fanatic_materialist = yes } set_country_flag = hegemony_ethos_materialist } else_if = { limit = { is_fanatic_spiritualist = yes } set_country_flag = hegemony_ethos_spiritualist } else_if = { #hopefully never limit = { is_fanatic_egalitarian = yes } set_country_flag = hegemony_ethos_egalitarian } else = { set_country_flag = hegemony_ethos_authoritarian } } federation = { set_timed_federation_flag = { flag = federation_recent_hegemony_joint_operation days = 18000 #50 years cooldown } } } option = { name = federations2.50.A #sounds like a spiffing idea custom_tooltip = federations2.50.A.tooltip hidden_effect = { every_federation_ally = { if = { limit = { exists = capital_scope.solar_system if = { limit = { any_controlled_fleet = { is_ship_class = shipclass_constructor } } any_controlled_fleet = { is_ship_class = shipclass_constructor can_access_system = root.capital_scope.solar_system } } else = { any_controlled_fleet = { NOT = { is_ship_class = shipclass_military_station } NOT = { is_ship_class = shipclass_mining_station } NOT = { is_ship_class = shipclass_research_station } NOT = { is_ship_class = shipclass_observation_station } is_inside_border = owner can_access_system = root.capital_scope.solar_system } } } country_event = { id = federations2.51 } } else = { set_country_flag = hegemony_joint_operation_invalid_participant } } } hidden_effect = { country_event = { id = federations2.52 days = 90 } } ai_chance = { factor = 1 modifier = { factor = 0 has_country_flag = hegemony_ethos_authoritarian is_authoritarian = no } } } option = { name = federations2.50.B #actually, let's not hidden_effect = { remove_country_flag = hegemony_ethos_militarist remove_country_flag = hegemony_ethos_pacifist remove_country_flag = hegemony_ethos_xenophobe remove_country_flag = hegemony_ethos_xenophile remove_country_flag = hegemony_ethos_materialist remove_country_flag = hegemony_ethos_spiritualist remove_country_flag = hegemony_ethos_egalitarian remove_country_flag = hegemony_ethos_authoritarian } ai_chance = { factor = 1 modifier = { factor = 0 federation = { federation_cohesion >= 0 } NAND = { has_country_flag = hegemony_ethos_authoritarian is_authoritarian = no } } } } } #All members asked whether to join country_event = { id = federations2.51 title = federations2.51.name desc = federations2.51.desc show_sound = event_default diplomatic = yes picture_event_data = { portrait = from planet_background = from graphical_culture = from city_level = from room = from.ruler } is_triggered_only = yes trigger = { from = { is_federation_leader = yes } } option = { name = federations2.51.A #let's do this from = { add_opinion_modifier = { who = root modifier = opinion_hegemony_joint_action_agreed } } custom_tooltip = federations2.51.A.tooltip custom_tooltip = federations2.51.A.tooltip2 hidden_effect = { set_country_flag = hegemony_joint_operation_yes federation = { change_variable = { which = hegemony_joint_operation_yes value = 1 } } } ai_chance = { factor = 1 modifier = { factor = 0.5 federation = { federation_cohesion <= -50 } } modifier = { factor = 0.75 federation = { federation_cohesion <= 0 } } modifier = { factor = 1.5 federation = { federation_cohesion >= 50 } } modifier = { factor = 2 federation = { federation_cohesion >= 90 } } modifier = { factor = 1.5 opinion_level = { who = from level >= good } } modifier = { factor = 1.5 opinion_level = { who = from level = excellent } } modifier = { factor = 0.5 opinion_level = { who = from level <= poor } } modifier = { factor = 0.5 opinion_level = { who = from level = terrible } } modifier = { factor = 1.5 is_authoritarian = yes } } } option = { name = federations2.51.B #haha no from = { add_opinion_modifier = { who = root modifier = opinion_hegemony_joint_action_refused } } custom_tooltip = federations2.51.B.tooltip hidden_effect = { set_country_flag = hegemony_joint_operation_no federation = { change_variable = { which = hegemony_joint_operation_no value = 1 } } } ai_chance = { factor = 1 modifier = { factor = 0.5 relative_power = { who = from value <= inferior } } modifier = { factor = 1.5 relative_power = { who = from value >= superior } } modifier = { factor = 2 is_egalitarian = yes } } } } #Setup event: The answers are in, will it happen or not? country_event = { id = federations2.52 is_triggered_only = yes hide_window = yes trigger = { is_federation_leader = yes federation = { has_federation_flag = federation_recent_hegemony_joint_operation } } immediate = { save_event_target_as = federation_leader if = { limit = { federation = { check_variable = { which = hegemony_joint_operation_yes value >= 2 } check_variable = { which = hegemony_joint_operation_yes value >= hegemony_joint_operation_no } } } country_event = { id = federations2.55 } every_federation_ally = { country_event = { id = federations2.56 } if = { limit = { has_country_flag = hegemony_joint_operation_no } federation = { change_variable = { which = hegemony_joint_operation_fail value = 1 } } } } } else = { country_event = { id = federations2.53 days = 2 } every_federation_ally = { limit = { NOT = { has_country_flag = hegemony_joint_operation_invalid_participant } } country_event = { id = federations2.54 } } } } } #Question fails: President country_event = { id = federations2.53 title = federations2.53.name desc = federations2.53.desc picture = GFX_evt_arguing_senate show_sound = event_ghost_town is_triggered_only = yes option = { name = federations2.53.A federation = { add_cohesion = -100 } add_resource = { influence = -50 } if = { limit = { any_federation_ally = { has_country_flag = hegemony_joint_operation_yes } } custom_tooltip = the_following_nations_said_yes country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = hegemony_joint_operation_yes } } } else = { custom_tooltip = no_following_nations_said_yes } custom_tooltip = the_following_nations_said_no country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = hegemony_joint_operation_no } } } after = { hidden_effect = { remove_country_flag = hegemony_ethos_militarist remove_country_flag = hegemony_ethos_pacifist remove_country_flag = hegemony_ethos_xenophobe remove_country_flag = hegemony_ethos_xenophile remove_country_flag = hegemony_ethos_materialist remove_country_flag = hegemony_ethos_spiritualist remove_country_flag = hegemony_ethos_egalitarian remove_country_flag = hegemony_ethos_authoritarian federation = { every_member = { remove_country_flag = hegemony_joint_operation_yes remove_country_flag = hegemony_joint_operation_no remove_country_flag = hegemony_joint_operation_invalid_participant } set_variable = { which = hegemony_joint_operation_fail value = 0 } set_variable = { which = hegemony_joint_operation_succeed value = 0 } set_variable = { which = hegemony_joint_operation_yes value = 0 } set_variable = { which = hegemony_joint_operation_no value = 0 } } } } } #Question fails: Member country_event = { id = federations2.54 title = federations2.54.name desc = { text = federations2.54.desc.said_yes trigger = { has_country_flag = hegemony_joint_operation_yes } } desc = { text = federations2.54.desc.said_no trigger = { has_country_flag = hegemony_joint_operation_no } } picture = GFX_evt_arguing_senate show_sound = event_ghost_town is_triggered_only = yes option = { name = { text = federations2.54.A.yes trigger = { has_country_flag = hegemony_joint_operation_yes } } name = { text = federations2.54.A.no trigger = { has_country_flag = hegemony_joint_operation_no } } tooltip = { federation = { add_cohesion = -100 } } } } #Question succeeds: President country_event = { id = federations2.55 title = federations2.55.name desc = federations2.55.desc picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes option = { name = federations2.55.A custom_tooltip = hegemon_join_operation_happens_tooltip custom_tooltip = the_following_nations_will_participate country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = hegemony_joint_operation_yes } } hidden_effect = { begin_event_chain = { event_chain = hegemony_joint_project_chain } } hidden_effect = { every_federation_ally = { limit = { has_country_flag = hegemony_joint_operation_yes } root = { if = { limit = { prev = { is_gestalt = no } } prev.capital_scope = { enable_special_project = { #on every capital, but only two can be done name = hegemony_joint_project_leader location = this owner = root } } } } } } if = { limit = { any_federation_ally = { has_country_flag = hegemony_joint_operation_no } } custom_tooltip = the_following_nations_said_no country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = hegemony_joint_operation_no } } } else = { custom_tooltip = no_following_nations_said_no } } } #Question succeeds: Member country_event = { id = federations2.56 title = federations2.56.name desc = { text = federations2.56.desc.said_yes trigger = { has_country_flag = hegemony_joint_operation_yes } } desc = { text = federations2.56.desc.said_no trigger = { has_country_flag = hegemony_joint_operation_no } } desc = { text = federations2.56.desc.invalid trigger = { has_country_flag = hegemony_joint_operation_invalid_participant } } picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes option = { name = federations2.56.A trigger = { has_country_flag = hegemony_joint_operation_yes } custom_tooltip = hegemon_join_operation_happens_tooltip custom_tooltip = the_following_nations_will_participate country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = hegemony_joint_operation_yes } } hidden_effect = { begin_event_chain = { event_chain = hegemony_joint_project_chain } } from.capital_scope = { enable_special_project = { name = hegemony_joint_project_member location = this owner = root } } } option = { name = { text = federations2.56.B.no trigger = { has_country_flag = hegemony_joint_operation_no } } name = { text = INTERESTING trigger = { has_country_flag = hegemony_joint_operation_invalid_participant } } trigger = { NOT = { has_country_flag = hegemony_joint_operation_yes } } custom_tooltip = hegemon_join_operation_happens_tooltip } } #The Hegemon has completed the special project on a member (hegemon scope) country_event = { id = federations2.57 title = federations2.57.name desc = federations2.57.desc picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes location = fromfrom option = { name = EXCELLENT tooltip = { switch = { trigger = has_country_flag hegemony_ethos_militarist = { fromfrom.owner = { add_modifier = { modifier = hegemony_propaganda_militarist days = 7200 } } } hegemony_ethos_pacifist = { fromfrom.owner = { add_modifier = { modifier = hegemony_propaganda_pacifist days = 7200 } } } hegemony_ethos_xenophobe = { fromfrom.owner = { add_modifier = { modifier = hegemony_propaganda_xenophobe days = 7200 } } } hegemony_ethos_xenophile = { fromfrom.owner = { add_modifier = { modifier = hegemony_propaganda_xenophile days = 7200 } } } hegemony_ethos_materialist = { fromfrom.owner = { add_modifier = { modifier = hegemony_propaganda_materialist days = 7200 } } } hegemony_ethos_spiritualist = { fromfrom.owner = { add_modifier = { modifier = hegemony_propaganda_spiritualist days = 7200 } } } hegemony_ethos_egalitarian = { fromfrom.owner = { add_modifier = { modifier = hegemony_propaganda_egalitarian days = 7200 } } } hegemony_ethos_authoritarian = { fromfrom.owner = { add_modifier = { modifier = hegemony_propaganda_authoritarian days = 7200 } } } } } } after = { if = { limit = { NOT = { has_country_flag = hegemony_joint_project_leader_first_done } } hidden_effect = { set_country_flag = hegemony_joint_project_leader_first_done } } else = { hidden_effect = { remove_country_flag = hegemony_joint_project_leader_first_done while = { limit = { has_special_project = hegemony_joint_project_leader } abort_special_project = { type = hegemony_joint_project_leader } } } } } } #The Hegemon has completed the special project on a member (member scope) country_event = { id = federations2.58 title = federations2.58.name desc = { text = federations2.58.desc trigger = { NOT = { from.owner = { switch = { trigger = has_country_flag hegemony_ethos_militarist = { root = { is_militarist = yes } } hegemony_ethos_pacifist = { root = { is_pacifist = yes } } hegemony_ethos_xenophobe = { root = { is_xenophobe = yes } } hegemony_ethos_xenophile = { root = { is_xenophile = yes } } hegemony_ethos_materialist = { root = { is_materialist = yes } } hegemony_ethos_spiritualist = { root = { is_spiritualist = yes } } hegemony_ethos_egalitarian = { root = { is_egalitarian = yes } } hegemony_ethos_authoritarian = { root = { is_authoritarian = yes } } } } } } } desc = { text = federations2.58.desc.good trigger = { from.owner = { switch = { trigger = has_country_flag hegemony_ethos_militarist = { root = { is_militarist = yes } } hegemony_ethos_pacifist = { root = { is_pacifist = yes } } hegemony_ethos_xenophobe = { root = { is_xenophobe = yes } } hegemony_ethos_xenophile = { root = { is_xenophile = yes } } hegemony_ethos_materialist = { root = { is_materialist = yes } } hegemony_ethos_spiritualist = { root = { is_spiritualist = yes } } hegemony_ethos_egalitarian = { root = { is_egalitarian = yes } } hegemony_ethos_authoritarian = { root = { is_authoritarian = yes } } } } } } picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes location = fromfrom option = { name = { text = federations2.58.A.good trigger = { from.owner = { switch = { trigger = has_country_flag hegemony_ethos_militarist = { root = { is_militarist = yes } } hegemony_ethos_pacifist = { root = { is_pacifist = yes } } hegemony_ethos_xenophobe = { root = { is_xenophobe = yes } } hegemony_ethos_xenophile = { root = { is_xenophile = yes } } hegemony_ethos_materialist = { root = { is_materialist = yes } } hegemony_ethos_spiritualist = { root = { is_spiritualist = yes } } hegemony_ethos_egalitarian = { root = { is_egalitarian = yes } } hegemony_ethos_authoritarian = { root = { is_authoritarian = yes } } } } } } name = { text = WORRYING trigger = { from.owner = { switch = { trigger = has_country_flag hegemony_ethos_militarist = { root = { is_pacifist = yes } } hegemony_ethos_pacifist = { root = { is_militarist = yes } } hegemony_ethos_xenophobe = { root = { is_xenophile = yes } } hegemony_ethos_xenophile = { root = { is_xenophobe = yes } } hegemony_ethos_materialist = { root = { is_spiritualist = yes } } hegemony_ethos_spiritualist = { root = { is_materialist = yes } } hegemony_ethos_egalitarian = { root = { is_authoritarian = yes } } hegemony_ethos_authoritarian = { root = { is_egalitarian = yes } } } } } } name = { text = federations2.58.A.neutral trigger = { from.owner = { switch = { trigger = has_country_flag hegemony_ethos_militarist = { root = { is_pacifist = no is_militarist = no } } hegemony_ethos_pacifist = { root = { is_pacifist = no is_militarist = no } } hegemony_ethos_xenophobe = { root = { is_xenophile = no is_xenophobe = no } } hegemony_ethos_xenophile = { root = { is_xenophile = no is_xenophobe = no } } hegemony_ethos_materialist = { root = { is_spiritualist = no is_materialist = no } } hegemony_ethos_spiritualist = { root = { is_spiritualist = no is_materialist = no } } hegemony_ethos_egalitarian = { root = { is_authoritarian = no is_egalitarian = no } } hegemony_ethos_authoritarian = { root = { is_authoritarian = no is_egalitarian = no } } } } } } from.owner = { switch = { trigger = has_country_flag hegemony_ethos_militarist = { root = { add_modifier = { modifier = hegemony_propaganda_militarist days = 7200 } } } hegemony_ethos_pacifist = { root = { add_modifier = { modifier = hegemony_propaganda_pacifist days = 7200 } } } hegemony_ethos_xenophobe = { root = { add_modifier = { modifier = hegemony_propaganda_xenophobe days = 7200 } } } hegemony_ethos_xenophile = { root = { add_modifier = { modifier = hegemony_propaganda_xenophile days = 7200 } } } hegemony_ethos_materialist = { root = { add_modifier = { modifier = hegemony_propaganda_materialist days = 7200 } } } hegemony_ethos_spiritualist = { root = { add_modifier = { modifier = hegemony_propaganda_spiritualist days = 7200 } } } hegemony_ethos_egalitarian = { root = { add_modifier = { modifier = hegemony_propaganda_egalitarian days = 7200 } } } hegemony_ethos_authoritarian = { root = { add_modifier = { modifier = hegemony_propaganda_authoritarian days = 7200 } } } } } } } #A member has completed the special project on the Hegemon, others still need to do it though (member scope) country_event = { id = federations2.59 title = federations2.59.name desc = federations2.59.desc picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes location = fromfrom option = { name = EXCELLENT fromfrom.owner = { add_opinion_modifier = { who = root modifier = opinion_hegemony_joint_action_completed } hidden_effect = { change_variable = { which = hegemony_joint_action_member_completed value = 1 } } } custom_tooltip = federations2.59.A.tooltip } } #A member has completed the special project on the Hegemon, all are now done (member scope) country_event = { id = federations2.60 title = federations2.60.name desc = { trigger = { federation = { OR = { has_federation_flag = hegemony_joint_operation_complete_success AND = { has_federation_flag = hegemony_joint_operation_partial_success count_member = { count = 2 limit = { NOT = { has_country_flag = hegemony_joint_operation_invalid_participant } } } } } } } text = federations2.60.desc.complete_success } desc = { trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_success count_member = { count > 2 limit = { NOT = { has_country_flag = hegemony_joint_operation_invalid_participant } } } } } text = federations2.60.desc.partial_success } desc = { trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_failure } } text = federations2.60.desc.partial_failure } picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes location = fromfrom option = { name = { text = EXCELLENT trigger = { NOT = { federation = { has_federation_flag = hegemony_joint_operation_partial_failure } } } } name = { text = federations2.60.A.oh_well trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_failure } } } tooltip = { hegemony_join_operation_reward = yes } add_favors = { target = fromfrom.owner value = 1 } fromfrom.owner = { add_opinion_modifier = { who = root modifier = opinion_hegemony_joint_action_completed } } } after = { hidden_effect = { remove_country_flag = hegemony_joint_operation_yes } end_event_chain = hegemony_joint_project_chain } } #A member has completed or the last one has failed the special project on the Hegemon, all are now done (event for all other members except hegemon) country_event = { id = federations2.61 title = federations2.61.name desc = { trigger = { federation = { OR = { has_federation_flag = hegemony_joint_operation_complete_success AND = { has_federation_flag = hegemony_joint_operation_partial_success count_member = { count = 2 limit = { NOT = { has_country_flag = hegemony_joint_operation_invalid_participant } } } } } } } text = federations2.61.desc.complete_success } desc = { trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_success count_member = { count > 2 limit = { NOT = { has_country_flag = hegemony_joint_operation_invalid_participant } } } } } text = federations2.61.desc.partial_success } desc = { trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_failure } has_completed_special_project_in_log = hegemony_joint_project_member } text = federations2.61.desc.partial_failure.but_I_did_it } desc = { trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_failure } NOT = { has_completed_special_project_in_log = hegemony_joint_project_member } } text = federations2.61.desc.partial_failure.haha_no } desc = { trigger = { federation = { has_federation_flag = hegemony_joint_operation_complete_failure } } text = federations2.61.desc.complete_failure } picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes location = fromfrom option = { name = { text = federations2.61.A.good trigger = { federation = { OR = { has_federation_flag = hegemony_joint_operation_complete_success has_federation_flag = hegemony_joint_operation_partial_success } } } } name = { text = federations2.61.A.but_I_did_it trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_failure } has_completed_special_project_in_log = hegemony_joint_project_member } } name = { text = federations2.61.A.neutral trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_failure } NOT = { has_completed_special_project_in_log = hegemony_joint_project_member } } } name = { text = federations2.61.A.oh_dear trigger = { federation = { has_federation_flag = hegemony_joint_operation_complete_failure } } } tooltip = { hegemony_join_operation_reward = yes } } after = { hidden_effect = { remove_country_flag = hegemony_joint_operation_no remove_country_flag = hegemony_joint_operation_yes remove_country_flag = hegemony_joint_operation_invalid_participant } end_event_chain = hegemony_joint_project_chain } } #A member has completed the special project on the Hegemon, all are now done (event for hegemon) country_event = { id = federations2.62 title = federations2.62.name desc = { trigger = { federation = { OR = { has_federation_flag = hegemony_joint_operation_complete_success AND = { has_federation_flag = hegemony_joint_operation_partial_success count_member = { count = 2 limit = { NOT = { has_country_flag = hegemony_joint_operation_invalid_participant } } } } } } } text = federations2.62.desc.complete_success } desc = { trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_success count_member = { count > 2 limit = { NOT = { has_country_flag = hegemony_joint_operation_invalid_participant } } } } } text = federations2.62.desc.partial_success } desc = { trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_failure } } text = federations2.62.desc.partial_failure } desc = { trigger = { federation = { has_federation_flag = hegemony_joint_operation_complete_failure } } text = federations2.62.desc.complete_failure } picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes location = fromfrom immediate = { set_country_flag = hegemony_joint_operation_monument } option = { name = { text = federations2.62.A.good trigger = { federation = { OR = { has_federation_flag = hegemony_joint_operation_complete_success has_federation_flag = hegemony_joint_operation_partial_success } } } } name = { text = federations2.62.A.neutral trigger = { federation = { has_federation_flag = hegemony_joint_operation_partial_failure } } } name = { text = federations2.62.A.oh_dear trigger = { federation = { has_federation_flag = hegemony_joint_operation_complete_failure } } } hegemony_join_operation_reward = yes if = { limit = { any_federation_ally = { has_country_flag = hegemony_challenge_failed } } custom_tooltip = the_following_nations_failed2 country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = hegemony_challenge_failed } } } } after = { end_event_chain = hegemony_joint_project_chain hidden_effect = { federation = { set_variable = { which = hegemony_joint_operation_fail value = 0 } set_variable = { which = hegemony_joint_operation_succeed value = 0 } set_variable = { which = hegemony_joint_operation_yes value = 0 } set_variable = { which = hegemony_joint_operation_no value = 0 } } } } } #Fail event 1: Federation leader changes (all members) country_event = { id = federations2.70 title = federations2.70.name desc = federations2.70.desc picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes trigger = { #duplicate popup protection NOT = { has_country_flag = federations2.70 } } immediate = { set_timed_country_flag = { flag = federations2.70 days = 5 } } option = { name = federations2.70.A end_event_chain = hegemony_joint_project_chain hidden_effect = { remove_country_flag = hegemony_joint_operation_no remove_country_flag = hegemony_joint_operation_yes remove_country_flag = hegemony_joint_operation_invalid_participant remove_country_flag = hegemony_ethos_militarist remove_country_flag = hegemony_ethos_pacifist remove_country_flag = hegemony_ethos_xenophobe remove_country_flag = hegemony_ethos_xenophile remove_country_flag = hegemony_ethos_materialist remove_country_flag = hegemony_ethos_spiritualist remove_country_flag = hegemony_ethos_egalitarian remove_country_flag = hegemony_ethos_authoritarian federation = { set_variable = { which = hegemony_joint_operation_fail value = 0 } set_variable = { which = hegemony_joint_operation_succeed value = 0 } set_variable = { which = hegemony_joint_operation_yes value = 0 } set_variable = { which = hegemony_joint_operation_no value = 0 } } } } } #Fail event 2: No longer in federation (leaving member) country_event = { id = federations2.71 title = federations2.71.name desc = federations2.71.desc picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes trigger = { #duplicate popup protection NOT = { has_country_flag = federations2.71 } } immediate = { set_timed_country_flag = { flag = federations2.71 days = 5 } } option = { name = ACKNOWLEDGED end_event_chain = hegemony_joint_project_chain hidden_effect = { remove_country_flag = hegemony_joint_operation_no remove_country_flag = hegemony_joint_operation_yes remove_country_flag = hegemony_joint_operation_invalid_participant remove_country_flag = hegemony_ethos_militarist remove_country_flag = hegemony_ethos_pacifist remove_country_flag = hegemony_ethos_xenophobe remove_country_flag = hegemony_ethos_xenophile remove_country_flag = hegemony_ethos_materialist remove_country_flag = hegemony_ethos_spiritualist remove_country_flag = hegemony_ethos_egalitarian remove_country_flag = hegemony_ethos_authoritarian } } } #Fail event 3: Federation leader leaves (all members but former leader) country_event = { id = federations2.72 title = federations2.72.name desc = federations2.72.desc picture = GFX_evt_diplomatic_visit show_sound = event_announcement is_triggered_only = yes trigger = { #duplicate popup protection NOT = { has_country_flag = federations2.72 } } immediate = { set_timed_country_flag = { flag = federations2.72 days = 5 } } option = { name = federations2.72.A end_event_chain = hegemony_joint_project_chain hidden_effect = { remove_country_flag = hegemony_joint_operation_no remove_country_flag = hegemony_joint_operation_yes remove_country_flag = hegemony_joint_operation_invalid_participant federation = { set_variable = { which = hegemony_joint_operation_fail value = 0 } set_variable = { which = hegemony_joint_operation_succeed value = 0 } set_variable = { which = hegemony_joint_operation_yes value = 0 } set_variable = { which = hegemony_joint_operation_no value = 0 } } } } } #################################### ##### Military Joint Operation ##### #################################### #Starting event country_event = { id = federations2.100 title = federations2.100.name desc = federations2.100.desc picture = GFX_evt_fleet_from_surface show_sound = event_default is_triggered_only = yes trigger = { years_passed > 60 exists = federation has_federation = yes is_federation_leader = yes is_at_war = no NOT = { any_country = { is_crisis_faction = yes } } num_ships > 30 federation = { has_federation_type = military_federation federation_level >= 2 NOT = { has_federation_flag = federation_recent_militarist_joint_operation } count_member = { count >= 3 limit = { num_ships > 30 } } } } immediate = { federation = { set_timed_federation_flag = { flag = federation_recent_militarist_joint_operation days = 18000 #50 years cooldown } every_member = { remove_country_flag = militarist_joint_operation_yes remove_country_flag = militarist_joint_operation_no } remove_federation_flag = militarist_joint_operation_complete_success remove_federation_flag = militarist_joint_operation_complete_failure remove_federation_flag = militarist_joint_operation_partial_success remove_federation_flag = militarist_joint_operation_partial_failure set_variable = { which = militarist_joint_operation_succeed value = 0 } set_variable = { which = militarist_joint_operation_fail value = 0 } set_variable = { which = militarist_joint_operation_yes value = 0 } set_variable = { which = militarist_joint_operation_no value = 0 } } } option = { name = federations2.100.A #sounds like a spiffing idea custom_tooltip = federations2.100.A.tooltip custom_tooltip = military_joint_exercise_potential_tooltip hidden_effect = { set_country_flag = militarist_joint_operation_yes every_federation_ally = { country_event = { id = federations2.101 } } } hidden_effect = { country_event = { id = federations2.102 days = 90 } } ai_chance = { factor = 1 modifier = { factor = 4 is_militarist = yes } } } option = { name = federations2.100.B #actually, let's not ai_chance = { factor = 1 modifier = { factor = 0 federation = { federation_cohesion >= 0 } is_militarist = yes } } } } #All members asked whether to join country_event = { id = federations2.101 title = federations2.101.name desc = federations2.101.desc show_sound = event_default diplomatic = yes picture_event_data = { portrait = from planet_background = from graphical_culture = from city_level = from room = from.ruler } is_triggered_only = yes trigger = { from = { is_federation_leader = yes } } option = { name = federations2.101.A #let's do this from = { add_opinion_modifier = { who = root modifier = opinion_military_joint_action_agreed } } custom_tooltip = military_joint_exercise_potential_tooltip hidden_effect = { set_country_flag = militarist_joint_operation_yes federation = { change_variable = { which = militarist_joint_operation_yes value = 1 } } } ai_chance = { factor = 1 modifier = { factor = 0.5 federation = { federation_cohesion <= -50 } } modifier = { factor = 0.75 federation = { federation_cohesion <= 0 } } modifier = { factor = 1.5 federation = { federation_cohesion >= 50 } } modifier = { factor = 2 federation = { federation_cohesion >= 90 } } modifier = { factor = 1.5 opinion_level = { who = from level >= good } } modifier = { factor = 1.5 opinion_level = { who = from level = excellent } } modifier = { factor = 0.5 opinion_level = { who = from level <= poor } } modifier = { factor = 0.5 opinion_level = { who = from level = terrible } } modifier = { factor = 1.5 is_militarist = yes } modifier = { factor = 0 NOT = { any_controlled_fleet = { num_ships >= 15 } } } } } option = { name = federations2.101.B #haha no from = { add_opinion_modifier = { who = root modifier = opinion_military_joint_action_refused } } custom_tooltip = federations2.101.B.tooltip hidden_effect = { set_country_flag = militarist_joint_operation_no federation = { change_variable = { which = militarist_joint_operation_no value = 1 } } } ai_chance = { factor = 1 modifier = { factor = 0.75 num_ships > 80 } modifier = { factor = 1.5 num_ships < 50 } modifier = { factor = 1.5 num_ships < 30 } modifier = { factor = 2 num_ships < 20 } modifier = { factor = 2 NOT = { any_controlled_fleet = { num_ships >= 20 } } } modifier = { factor = 2 is_pacifist = yes } } } } #Setup event: The answers are in, will it happen or not? country_event = { id = federations2.102 is_triggered_only = yes hide_window = yes trigger = { is_federation_leader = yes federation = { has_federation_flag = federation_recent_militarist_joint_operation } } immediate = { save_event_target_as = federation_leader if = { limit = { federation = { check_variable = { which = militarist_joint_operation_yes value >= 2 } check_variable = { which = militarist_joint_operation_yes value >= militarist_joint_operation_no } } } country_event = { id = federations2.105 days = 2 } every_federation_ally = { country_event = { id = federations2.106 } if = { limit = { has_country_flag = militarist_joint_operation_no } federation = { change_variable = { which = militarist_joint_operation_fail value = 1 } } } } } else = { country_event = { id = federations2.103 days = 2 } every_federation_ally = { country_event = { id = federations2.104 } } } } } #Question fails: President country_event = { id = federations2.103 title = federations2.103.name desc = federations2.103.desc picture = GFX_evt_arguing_senate show_sound = event_ghost_town is_triggered_only = yes option = { name = federations2.103.A federation = { add_cohesion = -100 } add_resource = { influence = -50 } if = { limit = { any_federation_ally = { has_country_flag = militarist_joint_operation_yes } } custom_tooltip = the_following_nations_said_yes country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = militarist_joint_operation_yes } } } else = { custom_tooltip = no_following_nations_said_yes } custom_tooltip = the_following_nations_said_no country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = militarist_joint_operation_no } } } after = { hidden_effect = { federation = { every_member = { remove_country_flag = militarist_joint_operation_yes remove_country_flag = militarist_joint_operation_no } set_variable = { which = militarist_joint_operation_fail value = 0 } set_variable = { which = militarist_joint_operation_succeed value = 0 } set_variable = { which = militarist_joint_operation_yes value = 0 } set_variable = { which = militarist_joint_operation_no value = 0 } } } } } #Question fails: Member country_event = { id = federations2.104 title = federations2.104.name desc = { text = federations2.104.desc.said_yes trigger = { has_country_flag = militarist_joint_operation_yes } } desc = { text = federations2.104.desc.said_no trigger = { has_country_flag = militarist_joint_operation_no } } picture = GFX_evt_arguing_senate show_sound = event_ghost_town is_triggered_only = yes option = { name = { text = federations2.104.A.yes trigger = { has_country_flag = militarist_joint_operation_yes } } name = { text = federations2.104.A.no trigger = { has_country_flag = militarist_joint_operation_no } } tooltip = { federation = { add_cohesion = -100 } } } } #Question succeeds: President country_event = { id = federations2.105 title = federations2.105.name desc = federations2.105.desc picture = GFX_evt_fleet_from_surface location = event_target:military_exercises_target show_sound = event_announcement is_triggered_only = yes immediate = { #pick target system while = { limit = { NOT = { has_country_flag = military_exercises_site_picked } } federation = { random_member = { random_system_within_border = { limit = { NOT = { has_star_flag = no_more_military_projects_here } any_system_planet = { is_colony = no } root = { any_controlled_fleet = { is_ship_class = shipclass_military can_access_system = prevprev } } } random_system_planet = { limit = { is_colony = no } #would seem weird save_event_target_as = military_exercises_target prev = { set_timed_star_flag = { flag = no_more_military_projects_here days = 10 } } root = { set_timed_country_flag = { flag = military_exercises_site_picked days = 10 } } } } } } } #fallback fail-safe - capital system should always be valid here if = { limit = { NOT = { has_country_flag = military_exercises_site_picked } } federation = { random_member = { limit = { any_system_within_border = { any_system_planet = { is_colony = no } root = { any_controlled_fleet = { is_ship_class = shipclass_military can_access_system = prevprev } } } } random_system_within_border = { limit = { any_system_planet = { is_colony = no } root = { any_controlled_fleet = { is_ship_class = shipclass_military can_access_system = prevprev } } } random_system_planet = { limit = { is_colony = no } #would seem weird save_event_target_as = military_exercises_target } } } } } } option = { name = federations2.105.A event_target:military_exercises_target = { enable_special_project = { name = military_joint_project location = this owner = root } } custom_tooltip = military_join_operation_happens_tooltip custom_tooltip = the_following_nations_will_participate country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = militarist_joint_operation_yes } } if = { limit = { any_federation_ally = { has_country_flag = militarist_joint_operation_no } } custom_tooltip = the_following_nations_said_no country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = militarist_joint_operation_no } } } else = { custom_tooltip = no_following_nations_said_no } } after = { if = { limit = { is_ai = yes } random_controlled_fleet = { limit = { is_ship_class = shipclass_military num_ships >= 15 } fleet_action_research_special_project = { special_project = military_joint_project target = event_target:military_exercises_target } } } } } #Question succeeds: Member country_event = { id = federations2.106 title = federations2.106.name desc = { text = federations2.106.desc.said_yes trigger = { has_country_flag = militarist_joint_operation_yes } } desc = { text = federations2.106.desc.said_no trigger = { has_country_flag = militarist_joint_operation_no } } picture = GFX_evt_fleet_from_surface location = event_target:military_exercises_target show_sound = event_announcement is_triggered_only = yes immediate = { #pick target system while = { limit = { NOT = { has_country_flag = military_exercises_site_picked } } federation = { random_member = { random_system_within_border = { limit = { any_system_planet = { is_colony = no } NOT = { has_star_flag = no_more_military_projects_here } root = { any_controlled_fleet = { is_ship_class = shipclass_military can_access_system = prevprev } } } random_system_planet = { limit = { is_colony = no } #would seem weird save_event_target_as = military_exercises_target prev = { set_timed_star_flag = { flag = no_more_military_projects_here days = 10 } } root = { set_timed_country_flag = { flag = military_exercises_site_picked days = 10 } } } } } } } #fallback fail-safe - capital system should always be valid here if = { limit = { NOT = { has_country_flag = military_exercises_site_picked } } federation = { random_member = { limit = { any_system_within_border = { any_system_planet = { is_colony = no } root = { any_controlled_fleet = { is_ship_class = shipclass_military can_access_system = prevprev } } } } random_system_within_border = { limit = { any_system_planet = { is_colony = no } root = { any_controlled_fleet = { is_ship_class = shipclass_military can_access_system = prevprev } } } random_system_planet = { limit = { is_colony = no } #would seem weird save_event_target_as = military_exercises_target } } } } } } option = { name = federations2.106.A trigger = { has_country_flag = militarist_joint_operation_yes } event_target:military_exercises_target = { enable_special_project = { name = military_joint_project location = this owner = root } } custom_tooltip = military_join_operation_happens_tooltip custom_tooltip = the_following_nations_will_participate country_list_tooltip = { limit = { is_in_federation_with = root has_country_flag = militarist_joint_operation_yes } } } option = { name = federations2.106.B.no trigger = { NOT = { has_country_flag = militarist_joint_operation_yes } } custom_tooltip = military_join_operation_happens_tooltip } after = { if = { limit = { is_ai = yes } random_controlled_fleet = { limit = { is_ship_class = shipclass_military num_ships >= 15 } fleet_action_research_special_project = { special_project = military_joint_project target = event_target:military_exercises_target } } } } } # Notification: You are ready, your allies aren't yet country_event = { id = federations2.108 title = federations2.108.name desc = federations2.108.desc picture = GFX_evt_fleet_from_surface show_sound = event_announcement location = fromfrom is_triggered_only = yes option = { name = federations2.108.A custom_tooltip = federations2.108.tt } } # Let the games begin! ship_event = { id = federations2.109 title = federations2.109.name desc = federations2.109.desc picture = GFX_evt_federation_fleet show_sound = event_announcement location = root is_triggered_only = yes immediate = { owner.federation = { random_member = { limit = { is_federation_leader = yes } country_event = { id = federations2.114 days = 31 } #hidden event on leader scope to check results } } create_country = { type = faction name = "NAME_training_adversary" effect = { set_faction_hostility = { target = root.owner set_hostile = yes set_neutral = no set_friendly = no } create_fleet = { name = "NAME_Training_Targets" effect = { set_owner = prev while = { count = 5 create_ship = { name = "NAME_Elusive_Craft" design = "NAME_Elusive_Craft" prefix = no upgradable = no } } if = { limit = { years_passed >= 125 } while = { count = 2 create_ship = { name = "NAME_Elusive_Craft" design = "NAME_Elusive_Craft" prefix = no upgradable = no } } } if = { limit = { years_passed >= 175 } while = { count = 2 create_ship = { name = "NAME_Elusive_Craft" design = "NAME_Elusive_Craft" prefix = no upgradable = no } } } set_location = { target = fromfrom distance = 25 angle = random } set_fleet_stance = passive set_fleet_flag = militarist_federation_training_target@root.owner save_event_target_as = militarist_federation_training_target } settings = { spawn_debris = no } } } } owner = { country_event = { id = federations2.113 days = 30 } } #check if failed } option = { name = federations2.109.A } } # Destroyed the training fleet you had to eliminate # on_fleet_destroyed_perp # This = owner of fleet 1 (combatant) # From = owner of fleet 2 (destroyed) # FromFrom = fleet 1 # FromFromFrom = fleet 2 country_event = { id = federations2.112 title = federations2.112.name desc = federations2.112.desc picture = GFX_evt_federation_fleet show_sound = event_announcement location = fromfrom trigger = { fromfromfrom = { has_fleet_flag = militarist_federation_training_target@root } NOT = { has_country_flag = militarist_joint_operation_fail } } is_triggered_only = yes immediate = { set_timed_country_flag = { flag = militarist_joint_operation_succeed days = 360 } if = { limit = { exists = federation } federation = { change_variable = { which = militarist_joint_operation_succeed value = 1 } } } } option = { name = EXCELLENT } } # You failed country_event = { id = federations2.113 title = federations2.113.name desc = federations2.113.desc picture = GFX_evt_federation_fleet show_sound = event_announcement location = fromfromfrom is_triggered_only = yes trigger = { exists = event_target:militarist_federation_training_target NOT = { has_country_flag = militarist_joint_operation_succeed } } immediate = { set_timed_country_flag = { flag = militarist_joint_operation_fail days = 360 } if = { limit = { exists = federation } federation = { change_variable = { which = militarist_joint_operation_fail value = 1 } } } event_target:militarist_federation_training_target = { delete_fleet = this } } option = { name = UNFORTUNATE } } # Event on leader scope: Check results country_event = { id = federations2.114 is_triggered_only = yes hide_window = yes trigger = { NOT = { has_country_flag = militarist_federation_chain_result_calculated } } immediate = { set_timed_country_flag = { flag = militarist_federation_chain_result_calculated days = 15 } federation = { if = { limit = { check_variable = { which = militarist_joint_operation_fail value = 0 } count_member = { count > 2 limit = { has_country_flag = militarist_joint_operation_yes } } } set_federation_flag = militarist_joint_operation_complete_success } else_if = { limit = { check_variable = { which = militarist_joint_operation_succeed value = 0 } } set_federation_flag = militarist_joint_operation_complete_failure } else = { subtract_variable = { which = militarist_joint_operation_succeed value = militarist_joint_operation_fail } if = { limit = { check_variable = { which = militarist_joint_operation_succeed value >= 0 } } set_federation_flag = militarist_joint_operation_partial_success } else = { set_federation_flag = militarist_joint_operation_partial_failure } } every_member = { limit = { has_country_flag = militarist_joint_operation_yes } country_event = { id = federations2.115 } } switch = { trigger = has_federation_flag militarist_joint_operation_complete_success = { if = { limit = { NOT = { federation_level = 5 } } add_federation_experience = 1000 } else = { add_cohesion = 100 } } militarist_joint_operation_partial_success = { if = { limit = { NOT = { federation_level = 5 } } add_federation_experience = 500 } else = { add_cohesion = 50 } } militarist_joint_operation_partial_failure = { add_cohesion = -25 } militarist_joint_operation_complete_failure = { add_cohesion = -50 } } } country_event = { id = federations2.119 days = 360 } #clean-up } } # Results announced, event for all members country_event = { id = federations2.115 title = federations2.115.name desc = { trigger = { federation = { has_federation_flag = militarist_joint_operation_complete_success } } text = federations2.115.desc.complete_success } desc = { trigger = { federation = { has_federation_flag = militarist_joint_operation_partial_success } } text = federations2.115.desc.partial_success } desc = { trigger = { federation = { has_federation_flag = militarist_joint_operation_partial_failure } } text = federations2.115.desc.partial_failure } desc = { trigger = { federation = { has_federation_flag = militarist_joint_operation_complete_failure } } text = federations2.115.desc.complete_failure } picture = GFX_evt_federation_fleet is_triggered_only = yes immediate = { save_event_target_as = root_scope } option = { name = { text = federations2.115.A trigger = { has_country_flag = militarist_joint_operation_succeed federation = { OR = { has_federation_flag = militarist_joint_operation_partial_success has_federation_flag = militarist_joint_operation_complete_success } } } } name = { text = federations2.115.A.haha trigger = { has_country_flag = militarist_joint_operation_fail federation = { OR = { has_federation_flag = militarist_joint_operation_partial_success has_federation_flag = militarist_joint_operation_complete_success } } } } name = { text = federations2.115.B.oh_well trigger = { has_country_flag = militarist_joint_operation_succeed federation = { OR = { has_federation_flag = militarist_joint_operation_partial_failure has_federation_flag = militarist_joint_operation_complete_failure } } } } name = { text = federations2.115.B.oh_dear trigger = { has_country_flag = militarist_joint_operation_fail federation = { OR = { has_federation_flag = militarist_joint_operation_partial_failure has_federation_flag = militarist_joint_operation_complete_failure } } } } federation = { switch = { trigger = has_federation_flag militarist_joint_operation_complete_success = { tooltip = { if = { limit = { NOT = { federation_level = 5 } } add_federation_experience = 1000 } else = { add_cohesion = 100 } } event_target:root_scope = { add_modifier = { modifier = military_federation_success_modifier days = 9000 } } } militarist_joint_operation_partial_success = { tooltip = { if = { limit = { NOT = { federation_level = 5 } } add_federation_experience = 500 } else = { add_cohesion = 50 } } if = { limit = { event_target:root_scope = { has_country_flag = militarist_joint_operation_succeed } } event_target:root_scope = { add_modifier = { modifier = military_federation_success_modifier days = 9000 } } } } militarist_joint_operation_partial_failure = { tooltip = { add_cohesion = -25 } if = { limit = { event_target:root_scope = { has_country_flag = militarist_joint_operation_fail } } event_target:root_scope = { add_modifier = { modifier = military_federation_failure_modifier days = 9000 } } } } militarist_joint_operation_complete_failure = { tooltip = { add_cohesion = -50 } event_target:root_scope = { add_modifier = { modifier = military_federation_failure_modifier days = 9000 } } } } } if = { limit = { federation = { any_member = { has_country_flag = militarist_joint_operation_fail } } } custom_tooltip = the_following_nations_failed country_list_tooltip = { limit = { OR = { is_same_value = root is_in_federation_with = root } has_country_flag = militarist_joint_operation_fail } } } } } # Cleanup country_event = { id = federations2.119 is_triggered_only = yes hide_window = yes trigger = { exists = federation } immediate = { federation = { remove_federation_flag = militarist_joint_operation_complete_failure remove_federation_flag = militarist_joint_operation_partial_failure remove_federation_flag = militarist_joint_operation_partial_success remove_federation_flag = militarist_joint_operation_complete_success set_variable = { which = militarist_joint_operation_fail value = 0 } set_variable = { which = militarist_joint_operation_succeed value = 0 } set_variable = { which = militarist_joint_operation_yes value = 0 } set_variable = { which = militarist_joint_operation_no value = 0 } every_member = { remove_country_flag = militarist_joint_operation_yes remove_country_flag = militarist_joint_operation_no } } } } # Fallback events # Fail event 1: No longer in federation country_event = { id = federations2.120 title = federations2.120.name desc = federations2.120.desc picture = GFX_evt_federation_fleet show_sound = event_announcement is_triggered_only = yes option = { name = ACKNOWLEDGED hidden_effect = { remove_country_flag = militarist_joint_operation_no remove_country_flag = militarist_joint_operation_yes remove_country_flag = militarist_joint_operation_fail } } } # Fail event 2: War or crisis happens, fleet needed elsewhere country_event = { id = federations2.121 title = federations2.121.name desc = federations2.121.desc picture = GFX_evt_fleet_from_surface show_sound = event_announcement is_triggered_only = yes option = { name = ACKNOWLEDGED hidden_effect = { remove_country_flag = militarist_joint_operation_no remove_country_flag = militarist_joint_operation_yes remove_country_flag = militarist_joint_operation_fail } } }