﻿add_namespace = european_union

#A country applies for EU membership
country_event = {
	id = european_union.1
	title = european_union.1.t
	desc = european_union.1.d
	picture = GFX_report_event_european_union
	
	is_triggered_only = yes
	
	option = {	#Okay
		name = european_union.1.o1
		
		ai_chance = {
			factor = 100
		}
	}
	
	option = {	#Veto!
		name = european_union.1.o2
		
		FROM = { country_event = { id = european_union.2 } }
		FROM = { add_opinion_modifier = { target = ROOT modifier = recent_actions_negative } }
		
		ai_chance = {
			factor = 0
		}
	}
}

#We have been vetoed!
country_event = {
	id = european_union.2
	title = european_union.2.t
	desc = european_union.2.d
	picture = GFX_report_event_european_union
	
	is_triggered_only = yes
	
	option = {	#It was worth a try.
		name = european_union.2.o1
		remove_ideas = idea_eu_member
		add_political_power = -25
	}
}

#Unite the Union
country_event = {
	id = european_union.3
	title = european_union.3.t
	desc = european_union.3.d
	picture = GFX_report_event_european_union
	
	is_triggered_only = yes
	
	option = {
		name = european_union.3.o1
		add_political_power = 150
		set_country_flag = tried_to_unite_the_EU
		every_country = {
			limit = {
				NOT = { has_country_flag = tried_to_unite_the_EU }
				has_idea = idea_eu_member
			}
			country_event = european_union.4
		}
		
		load_oob = "EUUspawn"
		set_global_flag = EU_united
		set_cosmetic_tag = EUU
		hidden_effect = { remove_ideas = idea_eu_member }
	}
}

#Call to join the Union!
country_event = {
	id = european_union.4
	title = european_union.4.t
	desc = european_union.4.d
	picture = GFX_report_event_european_union
	
	is_triggered_only = yes 
	
	option = {
		name = european_union.4.o1
		
		random_country = {
			limit = {
				has_country_flag = tried_to_unite_the_EU
			}
			country_event = { id = diplomatic_response.1 }
			country_event = { id = european_union.9 }
			annex_country = { 
				target = ROOT 
				transfer_troops = yes
			}
		}
		
		ai_chance = {
			factor = 95
			modifier = {
				factor = 0
				OR = {
					has_government = islamist
					has_government = fascist
					has_government = nationalist
					has_government = reactionary
					has_government = communist
				}
			}
			modifier = {
				add = 40
				OR = {
					has_government = progressive
					has_government = social_democrat
					has_government = social_liberal
				}
			}
		}
	}
	
	option = {
		name = european_union.4.o2
		
		random_country = {
			limit = {
				has_country_flag = tried_to_unite_the_EU
			}
			country_event = { id = diplomatic_response.2 }
		}
		
		remove_ideas = idea_eu_member
		add_political_power = 25
		
		ai_chance = {
			factor = 5
			modifier = {
				add = 75
				OR = {	#Countries that are more careful about unification
					tag = DEN
					tag = SWE
					tag = ENG
				}
			}
			modifier = {
				add = 75
				has_government = reactionary
			}
		}
	}
}

#Invited to the European Union (Primarily for historical expansion)
country_event = {
	id = european_union.5
	title = european_union.5.t
	desc = european_union.5.d
	picture = GFX_report_event_european_union
	
	is_triggered_only = yes
	
	option = {	#Sure thing
		name = european_union.5.o1
		add_ideas = idea_eu_member
		news_event = { id = european_union.7 }
		
		ai_chance = {
			factor = 70
		}
	}
	
	option = {	#Aint nobody got time for that
		name = european_union.5.o2
		add_political_power = 15
		every_country = {
			limit = {
				has_idea = idea_eu_member
			}
			news_event = { id = european_union.8 }
		}
		
		ai_chance = {
			factor = 30
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
	}
}

#ROOT European Union Cooperation
country_event = {
	id = european_union.6
	title = european_union.6.t
	desc = european_union.6.d
	picture = GFX_report_event_european_union
	
	is_triggered_only = yes
	
	option = {
		name = european_union.6.o1
		add_political_power = 10
		random_owned_state = {
			limit = {
				free_building_slots = {
					building = industrial_complex
					size > 0
					include_locked = yes
				}
			}
			add_building_construction = {
				type = industrial_complex
				level = 1
				instant_build = yes
			}
		}
	}
}

#News Event: Country joins EU
news_event = {
	id = european_union.7
	title = european_union.7.t
	desc = european_union.7.d
	picture = GFX_news_event_european_union
	
	is_triggered_only = yes
	major = yes
	
	option = {
		name = european_union.7.o1
		trigger = {
			has_idea = idea_eu_member
		}
	}
	
	option = {
		name = european_union.7.o2
		trigger = {
			NOT = { has_idea = idea_eu_member }
		}
	}
}

#News Event: Country has rejected the EU invitation
news_event = {
	id = european_union.8
	title = european_union.8.t
	desc = european_union.8.d
	picture = GFX_news_event_european_union
	
	is_triggered_only = yes
	
	option = {
		name = european_union.8.o1
	}
}

#Help Event to add cores by joining new-EU states
country_event = {
	id = european_union.9
	hidden = yes
	
	is_triggered_only = yes
	
	option = {
		every_state = {
			limit = { is_owned_by = ROOT }
			add_core_of = THIS
		}
	}
}