# Author(s): Captain Gen, Angriest Bird, Amtoj
add_namespace = canada
add_namespace = canada_news
add_namespace = canada_md_politics
add_namespace = keystonepipeline_can
add_namespace = keystonepipeline_usa

##French Canadian Events
#Very Low French Canadian Happiness
country_event = {
	id = canada.5
	immediate = {
		log = "[GetDateText]: [Root.GetName]: event canada.5"
		set_country_flag = { flag = angry_french_canadians value = 1 days = 90 } #Just in case that this is called again
	}
	title = canada.5.t
	desc = canada.5.d
	picture = GFX_politics_protest
	is_triggered_only = yes
	trigger = {
		NOT = { has_country_flag = angry_french_canadians }
		tag = CAN
	}

	option = { #try to fix the situation
		name = canada.5.a
		log = "[GetDateText]: [This.GetName]: canada.5.a executed"
		ai_chance = { base = 100 }
		add_political_power = -100
		add_stability = 0.03
		custom_effect_tooltip = CAN_try_fix_happiness_tt
		hidden_effect = {
			#country_event = { id = canada.x days = 7 }
			random_list = {
				5 = {
					modifier = {
						factor = 2.5
						has_idea = recession
					}
					modifier = {
						factor = 5
						has_idea = depression
					}
					set_temp_variable = { modify_que_happy = 2 }
					CAN_modify_french_happiness = yes
				}
				55 = {
					modifier = {
						factor = 5
						has_idea = stagnation
					}
					set_temp_variable = { modify_que_happy = 6 }
					CAN_modify_french_happiness = yes
				}
				35 = {
					set_temp_variable = { modify_que_happy = 9 }
					CAN_modify_french_happiness = yes
				}
				5 = {
					set_temp_variable = { modify_que_happy = 12 }
					CAN_modify_french_happiness = yes
				}
			}
		}
	}

	option = { #do nothing
		name = canada.5.b
		log = "[GetDateText]: [This.GetName]: canada.5.b executed"
		ai_chance = { base = 1 }
		add_political_power = 20
		custom_effect_tooltip = CAN_did_nothing_happiness_tt
		hidden_effect = {
			if = {
				limit = {
					check_variable = {
						var = french_happiness_var
						value = 11
						compare = greater_than_or_equals
					}
					check_variable = {
						var = french_happiness_var
						value = 20
						compare = less_than_or_equals
					}
				}
				country_event = { id = canada.6 days = 7 }
			}
			if = {
				limit = {
					check_variable = {
						var = french_happiness_var
						value = 0
						compare = greater_than_or_equals
					}
					check_variable = {
						var = french_happiness_var
						value = 10
						compare = less_than_or_equals
					}
				}
				country_event = { id = canada.7 days = 7 }
			}
			random_list = {
				5 = {
					set_temp_variable = { modify_que_happy = 0 }
					CAN_modify_french_happiness = yes
				}
				55 = {
					set_temp_variable = { modify_que_happy = -1 }
					CAN_modify_french_happiness = yes
				}
				35 = {
					set_temp_variable = { modify_que_happy = -3 }
					CAN_modify_french_happiness = yes
				}
				5 = {
					set_temp_variable = { modify_que_happy = -6 }
					CAN_modify_french_happiness = yes
				}
			}
		}
	}
}

#French Canadians Protest
country_event = {
	id = canada.6
	title = canada.6.t
	desc = canada.6.d
	picture = GFX_Canadian_elections

	is_triggered_only = yes

	trigger = {
		tag = CAN
	}

	option = { #Protect the Protesters
		name = canada.6.a
		log = "[GetDateText]: [This.GetName]: canada.6.a executed"
		ai_chance = { base = 100 }
		hidden_effect = {
			country_event = canada.8
			random_list = {
					25 = {
						add_to_variable = { french_happiness_var = 2 }
					}
					25 = {
						add_to_variable = { french_happiness_var = 4 }
					}
					25 = {
						add_to_variable = { french_happiness_var = 6 }
					}
					25 = {
						add_to_variable = { french_happiness_var = 8 }
					}
			}
			CAN_update_french_happiness = yes
		}
	}

	option = { #Disallow the protest
		name = canada.6.b
		log = "[GetDateText]: [This.GetName]: canada.6.b executed"
		ai_chance = { base = 1 }
		hidden_effect = {
			random_list = {
					25 = {
						add_to_variable = { french_happiness_var = -2 }
					}
					25 = {
						add_to_variable = { french_happiness_var = -4 }
					}
					25 = {
						add_to_variable = { french_happiness_var = -6 }
					}
					25 = {
						add_to_variable = { french_happiness_var = -8 }
					}
			}
		CAN_update_french_happiness = yes
		}
	}
}

#French Canadians Revolt
country_event = {
	id = canada.7
	title = canada.7.t
	desc = canada.7.d
	picture = GFX_Canadian_elections

	is_triggered_only = yes

	trigger = {
		tag = CAN
	}

	option = { #Try to stop it
		name = canada.7.a
		log = "[GetDateText]: [This.GetName]: canada.7.a executed"
		ai_chance = { base = 100 }
		trigger = {
			has_political_power > 100
			has_stability > 0.5
			NOT = {
				has_country_flag = CAN_rejected_quebec_proposal_flag
			}
		}
		country_event = canada.8
		hidden_effect = {
			random_list = {
					25 = {
						add_to_variable = { french_happiness_var = 2 }
					}
					25 = {
						add_to_variable = { french_happiness_var = 4 }
					}
					25 = {
						add_to_variable = { french_happiness_var = 6 }
					}
					25 = {
						add_to_variable = { french_happiness_var = 8 }
					}
			}
			CAN_update_french_happiness = yes
		}
	}

	option = { #Open constitutional talks
		name = canada.7.c
		log = "[GetDateText]: [This.GetName]: canada.7.c executed"
		ai_chance = { base = 50 }
		add_political_power = -50
		add_stability = -0.05
		clr_country_flag = CAN_rejected_quebec_proposal_flag
		custom_effect_tooltip = CAN_quebec_talks_tt
		hidden_effect = {
			set_temp_variable = { modify_que_happy = 12 }
			CAN_modify_french_happiness = yes
		}
	}

	option = { #War
		name = canada.7.b
		log = "[GetDateText]: [This.GetName]: canada.7.b executed"
		ai_chance = { base = 0 }
		custom_effect_tooltip = CAN_quebec_revolts_tt
		hidden_effect = {
			release = QUE
			QUE = {
				set_province_controller = 10621
				set_province_controller = 4784
				load_oob = QUE_revolt
			}
			CAN = {
				declare_war_on = {
					target = QUE
					type = annex_everything
				}
			}
		}
	}
}

#French Canadians Ask for autonomy
country_event = {
	id = canada.8
	title = canada.8.t
	desc = canada.8.d
	picture = GFX_Canadian_elections

	is_triggered_only = yes

	trigger = {
		tag = CAN
	}

	option = { #Yes
		name = canada.8.a
		log = "[GetDateText]: [This.GetName]: canada.8.a executed"
		ai_chance = { base = 0 }
		release_puppet = QUE
		custom_effect_tooltip = CAN_quebec_autonomous_tt
		hidden_effect = {
			if = {
				limit = {
					has_global_flag = GAME_RULE_allow_colored_puppets
				}
				set_autonomy = {
					target = QUE
					autonomy_state = autonomy_autonomous_state_colored
					end_wars = yes
					end_civil_wars = yes
				}
			}
			else = {
				set_autonomy = {
					target = QUE
					autonomy_state = autonomy_autonomous_state
					end_wars = yes
					end_civil_wars = yes
				}
			}
			set_variable = { french_happiness_var = 90 }
			CAN_update_french_happiness = yes
		}
	}

	option = { #No
		name = canada.8.b
		log = "[GetDateText]: [This.GetName]: canada.8.b executed"
		ai_chance = { base = 100 }
		if = {
			limit = {
				check_variable = {
					var = french_happiness_var
					value = 0
					compare = greater_than_or_equals
				}
				check_variable = {
					var = french_happiness_var
					value = 10
					compare = less_than_or_equals
				}
			}
			country_event = { id = canada.7 days = 7 }
		}
		hidden_effect = {
			set_country_flag = CAN_rejected_quebec_proposal_flag
			random_list = {
				25 = {
					add_to_variable = { french_happiness_var = -2 }
				}
				25 = {
					add_to_variable = { french_happiness_var = -4 }
				}
				25 = {
					add_to_variable = { french_happiness_var = -6 }
				}
				25 = {
					add_to_variable = { french_happiness_var = -8 }
				}
			}
			CAN_update_french_happiness = yes
		}
	}
}

#French Canadian Events
country_event = { #Riots in Quebec
	id = canada.700
	title = canada.700.t
	desc = canada.700.d
	picture = GFX_CAN_g20_riots_toronto
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = { #Crack down on the protestors. Jail them beat them!
		name = canada.700.a
		log = "[GetDateText]: [This.GetName]: canada.700.a executed"
		ai_chance = {
			base = 0
			modifier = {
				add = 10
				has_global_flag = CAN_NATIONALIST_FOCUS_PATH
			}
		}
		trigger = {
			OR = {
				has_completed_focus = CAN_English_Government
				has_government = nationalist
				has_idea = police_04
				has_idea = police_05
				has_stability < 0.25
			}
		}
		set_temp_variable = { modify_que_happy = -2 }
		CAN_modify_french_happiness = yes
		762 = {
			if = {
				limit = { industrial_complex > 0 }
				damage_building = {
					type = industrial_complex
					damage = 3
				}
			}
			if = {
				limit = { infrastructure > 0 }
				damage_building = {
					type = infrastructure
					damage = 2
				}
			}
		}
		set_temp_variable = { party_index = 20 }
		set_temp_variable = { party_popularity_increase = 0.05 }
		set_temp_variable = { temp_outlook_increase = 0.10 }
		change_relative_party_popularity = yes
		set_temp_variable = { party_index = 21 }
		set_temp_variable = { party_popularity_increase = 0.03 }
		change_relative_party_popularity = yes
	}

	option = { #Pay Concessions
		name = canada.700.b
		trigger = {
			check_variable = { treasury > 0.500 }
		}
		log = "[GetDateText]: [This.GetName]: canada.700.b executed"
		set_temp_variable = { treasury_change = -0.5 }
		modify_treasury_effect = yes
		set_temp_variable = { modify_que_happy = 2 }
		CAN_modify_french_happiness = yes
		762 = {
			if = {
				limit = { industrial_complex > 0 }
				damage_building = {
					type = industrial_complex
					damage = 2
				}
			}
			if = {
				limit = { infrastructure > 0 }
				damage_building = {
					type = infrastructure
					damage = 1
				}
			}
		}

		ai_chance = {
			base = 1
		}
	}

	option = { #Political Concessions
		name = canada.700.c
		log = "[GetDateText]: [This.GetName]: canada.700.c executed"
		add_political_power = -150
		set_temp_variable = { modify_que_happy = 1 }
		CAN_modify_french_happiness = yes
		762 = {
			if = {
				limit = { industrial_complex > 0 }
				damage_building = {
					type = industrial_complex
					damage = 1
				}
			}
			if = {
				limit = { infrastructure > 0 }
				damage_building = {
					type = infrastructure
					damage = 0.5
				}
			}
		}
	}
}

country_event = { #Peaceful Protests
	id = canada.701
	title = canada.701.t
	desc = canada.701.d
	picture = GFX_CAN_generic
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada.701.a
		trigger = {
			OR = {
				has_completed_focus = CAN_English_Government
				has_government = nationalist
				has_idea = police_04
				has_idea = police_05
				has_stability < 0.25
			}
		}
		log = "[GetDateText]: [Root.GetName]: event canada.701.a"
		ai_chance = {
			base = 0
			modifier = {
				add = 10
				has_global_flag = CAN_NATIONALIST_FOCUS_PATH
			}
		}
		set_temp_variable = { modify_que_happy = -5 }
		CAN_modify_french_happiness = yes
		set_temp_variable = { party_popularity_increase = 0.05 }
		set_temp_variable = { temp_outlook_increase = 0.05 }
		change_relative_party_popularity = yes
	}

	option = {
		name = canada.701.b
		trigger = {
			check_variable = { treasury > 0.1 }
		}
		log = "[GetDateText]: [Root.GetName]: event canada.701.b"
		set_temp_variable = { modify_que_happy = 3 }
		CAN_modify_french_happiness = yes
		set_temp_variable = { treasury_change = -0.1 }
		modify_treasury_effect = yes
	}

	option = {
		name = canada.701.c
		log = "[GetDateText]: [Root.GetName]: event canada.701.c"
		set_temp_variable = { modify_que_happy = 2 }
		CAN_modify_french_happiness = yes
		add_political_power = -50
	}
}

country_event = { #Anti-Government Speaker
	id = canada.702
	title = canada.702.t
	desc = canada.702.d
	picture = GFX_CAN_generic
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	option = { #Let him speak, hes kinda funny
		name = canada.702.a
		log = "[GetDateText]: [Root.GetName]: event canada.702.a"
		ai_chance = { base = 10 }
		set_temp_variable = { modify_que_happy = 1 }
		CAN_modify_french_happiness = yes
		add_stability = 0.01 ##Simulate the right to free speech
	}

	option = { #Arrest hin
		name = canada.702.b
		log = "[GetDateText]: [Root.GetName]: event canada.702.b"
		ai_chance = {
			base = 0
			modifier = {
				add = 10
				has_global_flag = CAN_NATIONALIST_FOCUS_PATH
			}
		}
		set_temp_variable = { modify_que_happy = -2 }
		CAN_modify_french_happiness = yes
		set_temp_variable = { party_index = 20 }
		set_temp_variable = { party_popularity_increase = 0.02 }
		set_temp_variable = { temp_outlook_increase = 0.02 }
		change_relative_party_popularity = yes
	}

}

country_event = { #Pro-Government Speaker
	id = canada.703
	title = canada.703.t
	desc = canada.703.d
	picture = GFX_CAN_generic
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada.703.a

	}

	option = {
		name = canada.703.b
	}

	option = {
		name = canada.703.c
	}
}

country_event = { #Quebec Supports the Government
	id = canada.704
	title = canada.704.t
	desc = canada.704.d
	picture = GFX_CAN_generic
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada.704.a
	}
}

#Air Canada acquires Canadian Airlines
country_event = {
	id = canada.100
	title = canada.100.t
	desc = canada.100.d
	picture = GFX_passenger_plane
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	#Excellent!
	option = {
		name = canada.100.a
		log = "[GetDateText]: [This.GetName]: canada.100.a executed"
		air_experience = 25
		set_temp_variable = { party_index = 1 }
		set_temp_variable = { party_popularity_increase = 0.02 }
		set_temp_variable = { temp_outlook_increase = 0.02 }
		change_relative_party_popularity = yes
		ai_chance = { base = 95 }
	}

	#We should probably stop monopolies in their wake.
	option = {
		name = canada.100.b
		log = "[GetDateText]: [This.GetName]: canada.100.b executed"
		add_stability = 0.01
		add_political_power = -30

		set_temp_variable = { party_index = 3 }
		set_temp_variable = { party_popularity_increase = 0.02 }
		set_temp_variable = { temp_outlook_increase = 0.02 }
		change_relative_party_popularity = yes
		set_temp_variable = { party_index = 18 }
		set_temp_variable = { party_popularity_increase = 0.02 }
		set_temp_variable = { temp_outlook_increase = 0.02 }
		change_relative_party_popularity = yes
		ai_chance = { base = 5 }
	}
}

############################################
##########Focus Tree Events 501-1000#########
############################################
#Ministry of Culture
country_event = {
	id = canada.501
	title = canada.501.t
	desc = canada.501.d
	picture = GFX_CAN_generic
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada.501.a
		log = "[GetDateText]: [This.GetName]: canada.501.a executed"

		add_stability = 0.05
		custom_effect_tooltip = CAN_culture_divide_event_tt

		ai_chance = {
			base = 1
		}
	}
}

#Oil Subsidies
country_event = {
	id = canada.502
	title = canada.502.t
	desc = canada.502.d
	picture = GFX_CAN_generic
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	option = { #now?
		name = canada.502.a
		log = "[GetDateText]: [This.GetName]: canada.502.a executed"
		hidden_effect = {
			random_list = {
				20 = {
					set_temp_variable = { treasury_change = -0.1 }
					modify_treasury_effect = yes
					set_temp_variable = { subsidy_change_tmp = 0.1 }
					CAN_modify_subsidy_changes = yes
				}
				20 = {
					set_temp_variable = { treasury_change = -0.2 }
					modify_treasury_effect = yes
					set_temp_variable = { subsidy_change_tmp = 0.2 }
					CAN_modify_subsidy_changes = yes
				}
				20 = {
					modifier = {
						factor = 1.5
						always = yes
					}
					set_temp_variable = { treasury_change = -0.25 }
					modify_treasury_effect = yes
					set_temp_variable = { subsidy_change_tmp = 0.25 }
					CAN_modify_subsidy_changes = yes
				}
				20 = {
					set_temp_variable = { treasury_change = -0.3 }
					modify_treasury_effect = yes
					set_temp_variable = { subsidy_change_tmp = 0.3 }
					CAN_modify_subsidy_changes = yes
				}
				20 = {
					set_temp_variable = { treasury_change = -0.5 }
					modify_treasury_effect = yes
					set_temp_variable = { subsidy_change_tmp = 0.5 }
					CAN_modify_subsidy_changes = yes
				}
			}
		}
		custom_effect_tooltip = CAN_oil_subsidies_tt

		set_temp_variable = { temp_opinion = 10 }
		change_fossil_fuel_industry_opinion = yes
	}

	option = {
		name = canada.502.b
		log = "[GetDateText]: [This.GetName]: canada.502.n executed"
		custom_effect_tooltip = CAN_refuse_oil_company_event_tt
		set_temp_variable = { temp_opinion = -10 }
		change_fossil_fuel_industry_opinion = yes
	}
}

#Canadian Infrastructure --Finished
country_event = {
	id = canada.504
	title = canada.504.t
	desc = canada.504.d
	picture = GFX_Canadian_elections
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	##Heavy Investment into it
	option = {
		name = canada.504.a
		log = "[GetDateText]: [This.GetName]: canada.504.a executed"
		set_temp_variable = { treasury_change = -15 }
		modify_treasury_effect = yes
		custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CAN_canadian_economy_dynamic_modifier }
		add_to_variable = { CAN_production_speed_infrastructure_factor_var = 0.15 tooltip = production_speed_infrastructure_factor_tt }
		add_to_variable = { CAN_stability_factor_var = -0.05 tooltip = stability_factor_tt }

		ai_chance = {
			base = 100
		}
	}

	#Medium Investment
	option = {
		name = canada.504.b
		log = "[GetDateText]: [This.GetName]: canada.504.b executed"
		set_temp_variable = { treasury_change = -10 }
		modify_treasury_effect = yes
		custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CAN_canadian_economy_dynamic_modifier }
		add_to_variable = { CAN_production_speed_infrastructure_factor_var = 0.10 tooltip = production_speed_infrastructure_factor_tt }
		add_to_variable = { CAN_stability_factor_var = -0.03 tooltip = stability_factor_tt }

		ai_chance = {
			base = 0
		}
	}

	option = {
		name = canada.504.c
		log = "[GetDateText]: [This.GetName]: canada.504.c executed"
		set_temp_variable = { treasury_change = -5 }
		modify_treasury_effect = yes
		custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = CAN_canadian_economy_dynamic_modifier }
		add_to_variable = { CAN_production_speed_infrastructure_factor_var = 0.05 tooltip = production_speed_infrastructure_factor_tt }
		add_to_variable = { CAN_stability_factor_var = -0.01 tooltip = stability_factor_tt }

		ai_chance = {
			base = 0
		}
	}
}

#The move towards a two language state
country_event = {
	id = canada.520
	title = canada.520.t
	desc = canada.520.d
	picture = GFX_CAN_generic
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	#The Move
	option = {
		name = canada.520.a
		log = "[GetDateText]: [This.GetName]: canada.520.a executed"
		add_stability = 0.03
	}
}

#A Move for a English Government
country_event = {
	id = canada.521
	title = canada.521.t
	desc = canada.521.d
	picture = GFX_CAN_generic
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	#The Move
	option = {
		name = canada.521.a
		log = "[GetDateText]: [This.GetName]: canada.521.a executed"
		set_temp_variable = { modify_que_happy = -10 }
		CAN_modify_french_happiness = yes
		add_popularity = { ideology = nationalist popularity = 0.05 }
		recalculate_party = yes
	}
}

#A Move for a French GOvernment
country_event = {
	id = canada.522
	title = canada.522.t
	desc = canada.522.d
	picture = GFX_CAN_generic
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	#The Move
	option = {
		name = canada.522.a
		log = "[GetDateText]: [This.GetName]: canada.522.a executed"
		set_temp_variable = { modify_que_happy = 5 }
		CAN_modify_french_happiness = yes

		add_popularity = { ideology = nationalist popularity = 0.05 }
		recalculate_party = yes
	}
}



###Canadian Recession Events
country_event = { #The American Recession Ripples through Canada
	id = canada.600
	title = canada.600.t
	desc = canada.600.d
	picture = GFX_foreclosure
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada.600.a
		log = "[GetDateText]: [This.GetName]: canada.600.a executed"
		decrease_economic_growth = yes

		hidden_effect = {
			country_event = { id = canada.601 days = 500 random_days = 120 }
		}
		ai_chance = {
			base = 1
		}
	}
}


country_event = { ###End of the Great Recession in Canada --Needs Finished
	id = canada.601
	title = canada.601.t
	desc = canada.601.d
	picture = GFX_CAN_end_great_recession
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada.601.a
		log = "[GetDateText]: [This.GetName]: canada.601.a executed"
		if = {
			limit = {
				NOT = {
					OR = {
						has_idea = stable_growth
						has_idea = economic_boom
						has_idea = fast_growth
					}
				}
			}
			increase_economic_growth = yes
		}
		set_temp_variable = { percent_change = 2 }
		change_domestic_influence_percentage = yes
		ai_chance = {
			base = 1
		}
	}
}

country_event = { #Investor Event
	id = canada.800
	immediate = {
		log = "[GetDateText]: [Root.GetName]: event canada.800"
		CAN = {
			random_owned_state = {
				invest_cic = yes
			}
		}
	}
	hidden = yes
	is_triggered_only = yes
}

country_event = { ###Operation Yellow Ribbon
	id = canada_md_politics.2
	title = canada_md_politics.2.t
	desc = canada_md_politics.2.d
	picture = GFX_CAN_operation_yellow_ribbon
	fire_only_once = yes
	is_triggered_only = yes ##Referenced by the War on Terror Events

	option = {
		name = canada_md_politics.2.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.2.a executed"
		USA = {
			add_opinion_modifier = {
				target = ROOT
				modifier = nine_eleven_loyalty
			}
		}
	}
	option = {
		name = canada_md_politics.2.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.2.b executed"
		set_temp_variable = { treasury_change = -8 }
		modify_treasury_effect = yes
		add_war_support = 0.05
		USA = {
			add_opinion_modifier = {
				target = ROOT
				modifier = nine_eleven_total_loyalty
			}
		}
	}
}

country_event = { ###Softwood Lumber Dispute
	id = canada_md_politics.3
	title = canada_md_politics.3.t
	desc = canada_md_politics.3.d
	picture = GFX_CAN_softwood_lumber_dispute
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.3.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.3.a executed"
		add_opinion_modifier = { target = USA modifier = softwood_lumber_dispute }
		reverse_add_opinion_modifier = { target = USA modifier = softwood_lumber_dispute }
		set_temp_variable = { treasury_change = 4 }
		modify_treasury_effect = yes
		set_temp_variable = { percent_change = 1 }
		set_temp_variable = { tag_index = USA.id }
		change_influence_percentage = yes

		ai_chance = {
			base = 0
		}
	}
	option = {
		name = canada_md_politics.3.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.3.b executed"
		add_opinion_modifier = { target = USA modifier = softwood_lumber_dispute_renegoitate }
		reverse_add_opinion_modifier = { target = USA modifier = softwood_lumber_dispute_renegoitate }
		set_temp_variable = { treasury_change = 5.5 }
		modify_treasury_effect = yes
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = USA.id }
		change_influence_percentage = yes

		ai_chance = {
			base = 1
		}
	}
}

country_event = { ###Ontario Goes Dark
	id = canada_md_politics.4
	title = canada_md_politics.4.t
	desc = canada_md_politics.4.d
	picture = GFX_CAN_ontario_goes_dark
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.4.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.4.a executed"
		set_temp_variable = { treasury_change = -10 }
		modify_treasury_effect = yes
		763 = {
			if = {
				limit = { industrial_complex > 0 }
				damage_building = {
					type = industrial_complex
					damage = 5
				}
			}
			if = {
				limit = { infrastructure > 0 }
				damage_building = {
					type = infrastructure
					damage = 2
				}
			}
		}

		ai_chance = {
			base = 1
		}
	}

	option = {
		name = canada_md_politics.4.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.4.b executed"
		USA = {
			set_temp_variable = { treasury_change = -6 }
			modify_treasury_effect = yes
			set_temp_variable = { percent_change = 2 }
			set_temp_variable = { tag_index = CAN.id }
			change_influence_percentage = yes
		}

		763 = {
			if = {
				limit = { industrial_complex > 0 }
				damage_building = {
					type = industrial_complex
					damage = 2.5
				}
			}
			if = {
				limit = { infrastructure > 0 }
				damage_building = {
					type = infrastructure
					damage = 1
				}
			}
		}

		ai_chance = {
			base = 0
		}
	}
}

country_event = { ###The Sponsorship Scandal
	id = canada_md_politics.5
	title = canada_md_politics.5.t
	desc = canada_md_politics.5.d
	picture = GFX_CAN_the_sponsorship_scandal
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.5.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.5.a executed"
		add_political_power = -75
		ai_chance = {
			base = 0
		}
	}
	option = {
		name = canada_md_politics.5.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.5.b executed"
		set_temp_variable = { party_index = 2 }
		set_temp_variable = { party_popularity_increase = -0.05 }
		change_relative_party_popularity = yes

		ai_chance = {
			base = 1
		}
	}
}

country_event = { ###American Submarines in the Northwest Passage
	id = canada_md_politics.6
	title = canada_md_politics.6.t
	desc = canada_md_politics.6.d
	picture = GFX_CAN_american_submarine_northwest
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.6.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.6.a executed"
		add_political_power = 150
		add_opinion_modifier = { target = USA modifier = trespassing }
		diplomatic_relation = { country = USA relation = military_access active = no }
	}
	option = {
		name = canada_md_politics.6.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.6.b executed"
		add_opinion_modifier = { target = USA modifier = turned_the_other_cheek }
	}
}

country_event = { ###The Toronto 18
	id = canada_md_politics.7
	title = canada_md_politics.7.t
	desc = canada_md_politics.7.d
	picture = GFX_CAN_the_toronto_18
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.7.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.7.a executed"
		add_stability = -0.05
		add_war_support = 0.05
	}

	option = {
		name = canada_md_politics.7.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.7.b executed"
		add_war_support = -0.05
	}
}

country_event = { ##Operation Medusa
	id = canada_md_politics.8
	title = canada_md_politics.8.t
	desc = canada_md_politics.8.d
	picture = GFX_CAN_operation_medusa_commences
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
		OR = {
			USA = {
				has_war_with = TAL
			}
			AFG = { has_volunteers_amount_from = { tag = USA count > 0 } }
		}
	}

	option = {
		name = canada_md_politics.8.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.8.a executed"
		add_stability = -0.05
		add_war_support = 0.05
	}
	option = {
		name = canada_md_politics.8.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.8.b executed"
		add_war_support = -0.05
	}
}

country_event = { ###Quebecois Nation Motion
	id = canada_md_politics.9
	title = canada_md_politics.9.t
	desc = canada_md_politics.9.d
	picture = GFX_CAN_quebecois_nation_motion
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.9.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.9.a executed"
		add_war_support = 0.025
		add_to_variable = { french_happiness_var = -2 }
		CAN_update_french_happiness = yes
	}
	option = {
		name = canada_md_politics.9.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.9.b executed"
		add_stability = 0.025
		add_to_variable = { french_happiness_var = 2 }
		CAN_update_french_happiness = yes
	}
}

country_event = { ###Indigenous Day of Action
	id = canada_md_politics.10
	title = canada_md_politics.10.t
	desc = canada_md_politics.10.d
	picture = GFX_CAN_indigenous_day_action
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.10.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.10.a executed"
		set_temp_variable = { treasury_change = -5 }
		modify_treasury_effect = yes
		add_stability = 0.05
	}
	option = {
		name = canada_md_politics.10.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.10.b executed"
		add_stability = -0.025
	}
}

country_event = { ###RCMP Raid on Conservative Headquarters
	id = canada_md_politics.11
	title = canada_md_politics.11.t
	desc = canada_md_politics.11.d
	picture = GFX_CAN_rcmp_raid_conservative
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.11.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.11.a executed"
		USA = {
			set_temp_variable = { percent_change = 5 }
			set_temp_variable = { tag_index = CAN.id }
			change_influence_percentage = yes
		}
	}
	option = {
		name = canada_md_politics.11.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.11.b executed"
		set_temp_variable = { party_index = 1 }
		set_temp_variable = { party_popularity_increase = -0.05 }
		change_relative_party_popularity = yes
	}
}

country_event = { ###The Golden Goal
	id = canada_md_politics.13
	title = canada_md_politics.13.t
	desc = canada_md_politics.13.d
	picture = GFX_CAN_the_golden_goal
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.13.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.13.a executed"
		add_stability = 0.025
	}
	option = {
		name = canada_md_politics.13.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.13.b executed"
		add_political_power = 25
	}
}

country_event = { ###G20 Summit Riots in Toronto
	id = canada_md_politics.14
	title = canada_md_politics.14.t
	desc = canada_md_politics.14.d
	picture = GFX_CAN_g20_riots_toronto
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.14.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.14.a executed"
		add_stability = -0.05
	}
	option = {
		name = canada_md_politics.14.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.14.b executed"
		set_temp_variable = { treasury_change = -1.5 }
		modify_treasury_effect = yes
	}
}

country_event = { ###Withdrawing the Security Council Bid
	id = canada_md_politics.15
	title = canada_md_politics.15.t
	desc = canada_md_politics.15.d
	picture = GFX_CAN_withdraw_security_bid
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.15.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.15.a executed"
		add_war_support = 0.04
		if = {
			limit = {
				OR = {
					NOT = { has_idea = intervention_global_interventionism }
					NOT = { has_idea = intervention_neo_imperialism }
				}
			}
			increase_intervention_law_effect = yes
		}

	}
	option = {
		name = canada_md_politics.15.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.15.b executed"
		decrease_intervention_law_effect = yes
		add_stability = 0.025
	}
}

country_event = { ###An Orange Wave
	id = canada_md_politics.16
	title = canada_md_politics.16.t
	desc = canada_md_politics.16.d
	picture = GFX_CAN_an_orange_wave
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.16.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.16.a executed"
		hidden_effect = {
			add_popularity = { ideology = democratic popularity = 0.10 }
		}

		set_temp_variable = { party_index = 2 }
		set_temp_variable = { party_popularity_increase = 0.05 }
		change_relative_party_popularity = yes
		set_temp_variable = { party_index = 3 }
		set_temp_variable = { party_popularity_increase = 0.05 }
		change_relative_party_popularity = yes
	}
	option = {
		name = canada_md_politics.16.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.16.b executed"
		set_temp_variable = { party_index = 3 }
		set_temp_variable = { party_popularity_increase = -0.05 }
		set_temp_variable = { temp_outlook_increase = -0.05 }
		change_relative_party_popularity = yes
	}
}

country_event = { ###War of 1812 Bicentennial
	id = canada_md_politics.17
	title = canada_md_politics.17.t
	desc = canada_md_politics.17.d
	picture = GFX_CAN_war_1812_bicentennial
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.17.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.17.a executed"
		add_war_support = 0.01
	}
	option = {
		name = canada_md_politics.17.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.17.b executed"
		add_political_power = 10
	}
}

country_event = { ###International Space Station Expedition 35
	id = canada_md_politics.18
	title = canada_md_politics.18.t
	desc = canada_md_politics.18.d
	picture = GFX_CAN_space_expedition_35
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.18.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.18.a executed"
		add_timed_idea = {
			idea = scientific_advances
			days = 60
		}
		add_political_power = 50
	}
	option = {
		name = canada_md_politics.18.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.18.b executed"
		add_timed_idea = {
			idea = scientific_advances2
			days = 30
		}
		add_political_power = 25
	}
}

country_event = { ###Negotiations with the European Union on CETA Conclude
	id = canada_md_politics.19
	title = canada_md_politics.19.t
	desc = canada_md_politics.19.d
	picture = GFX_CAN_negotiations_ceta_conclude
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.19.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.19.a executed"
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = GER.id }
		change_influence_percentage = yes
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = FRA.id }
		change_influence_percentage = yes
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = ITA.id }
		change_influence_percentage = yes
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = ENG.id }
		change_influence_percentage = yes
		set_temp_variable = { treasury_change = 6.25 }
		modify_treasury_effect = yes
	}
	option = {
		name = canada_md_politics.19.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.19.b executed"
		ENG = {
			set_temp_variable = { percent_change = 2 }
			set_temp_variable = { tag_index = CAN.id }
			change_influence_percentage = yes
		}
		FRA = {
			set_temp_variable = { percent_change = 2 }
			set_temp_variable = { tag_index = CAN.id }
			change_influence_percentage = yes
		}
		GER = {
			set_temp_variable = { percent_change = 2 }
			set_temp_variable = { tag_index = CAN.id }
			change_influence_percentage = yes
		}
		ITA = {
			set_temp_variable = { percent_change = 2 }
			set_temp_variable = { tag_index = CAN.id }
			change_influence_percentage = yes
		}
		set_temp_variable = { treasury_change = 5.25 }
		modify_treasury_effect = yes
	}
}

country_event = { ###Terror in the Capital
	id = canada_md_politics.20
	title = canada_md_politics.20.t
	desc = canada_md_politics.20.d
	picture = GFX_CAN_terror_in_capital
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = {
		name = canada_md_politics.20.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.20.a executed"
		add_political_power = 50
		add_war_support = 0.05
	}
	option = {
		name = canada_md_politics.20.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.20.b executed"
		increase_policing_budget = yes
	}
}

country_event = { ###Airstrikes in Syria and Iraq
	id = canada_md_politics.21
	title = canada_md_politics.21.t
	desc = canada_md_politics.21.d
	picture = GFX_CAN_airstrikes_iraq_syria
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		country_exists = ISI
		tag = CAN
	}

	option = { ##Supported Strikes
		name = canada_md_politics.21.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.21.a executed"
		add_opinion_modifier = { target = USA modifier = supported_airstrikes }
		reverse_add_opinion_modifier = { target = USA modifier = supported_airstrikes }
	}

	option = { ##Didn't Support
		name = canada_md_politics.21.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.21.b executed"
		USA = { add_opinion_modifier = { target = CAN modifier = stupid_canadians } }
		KUR = { add_opinion_modifier = { target = CAN modifier = did_not_support_airstrikes } }
	}
}

country_event = { ##The Case of Omar Khadr
	id = canada_md_politics.22
	title = canada_md_politics.22.t
	desc = canada_md_politics.22.d
	picture = GFX_CAN_case_omar_khadr
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = { ##He was Just a Boy
		name = canada_md_politics.22.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.22.a executed"
		add_war_support = -0.05
		set_temp_variable = { party_index = 2 }
		set_temp_variable = { party_popularity_increase = -0.05 }
		change_relative_party_popularity = yes
	}

	option = { ##We Cannot Allow Him to Walk
		name = canada_md_politics.22.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.22.b executed "
		add_stability = -0.05
		set_temp_variable = { party_index = 1 }
		set_temp_variable = { party_popularity_increase = -0.05 }
		change_relative_party_popularity = yes
	}
}

country_event = { ###Fate of the Bombardier CSeries
	id = canada_md_politics.23
	title = canada_md_politics.23.t
	desc = canada_md_politics.23.d
	picture = GFX_CAN_fate_bombardier_cseries
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = { ###Better Europeans then Americans
		name = canada_md_politics.23.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.23.a executed"
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = FRA.id }
		change_influence_percentage = yes
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = GER.id }
		change_influence_percentage = yes
		set_temp_variable = { percent_change = -3 }
		set_temp_variable = { tag_index = USA.id }
		change_influence_percentage = yes
		set_temp_variable = { treasury_change = 1 }
		modify_treasury_effect = yes
	}

	option = { ###Why Sell Out?
		name = canada_md_politics.23.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.23.b executed"
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = USA.id }
		change_influence_percentage = yes
	}
}


country_event = { ###Plans to Increase Military Spending
	id = canada_md_politics.25
	title = canada_md_politics.25.t
	desc = canada_md_politics.25.d
	picture = GFX_CAN_increase_military_spending
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = { ###Canada Must Do More
		name = canada_md_politics.25.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.25.a executed"
		increase_military_spending = yes
		add_political_power = 100
	}

	option = { ###The Military is Good Enough
		name = canada_md_politics.25.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.25.b executed"
		add_political_power = -50
	}
}

country_event = { ###Canada Celebrates 150 Years
	id = canada_md_politics.26
	title = canada_md_politics.26.t
	desc = canada_md_politics.26.d
	picture = GFX_CAN_canada_150_celebrations
	is_triggered_only = yes
	fire_only_once = yes
	trigger = {
		tag = CAN
	}

	option = { ###Glorious Day for Canada
		name = canada_md_politics.26.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.26.a executed"
		add_stability = 0.05
		add_political_power = -50
	}

	option = { ###Forget the Past!
		name = canada_md_politics.26.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.26.b executed"
		add_political_power = 25
	}
}

# Jean Chretien's resignation question
country_event = {
	id = canada_md_politics.27
	title = canada_md_politics.27.t
	desc = canada_md_politics.27.d
	picture = GFX_CAN_withdraw_security_bid
	is_triggered_only = yes

	trigger = {
		tag = CAN
		western_liberals_are_in_power = yes
	}

	option = { ### Chretien resigns, Paul Martin elected
		name = canada_md_politics.27.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.27.a executed"
		hidden_effect = { kill_country_leader = yes }
		create_country_leader = {
			name = "Paul Martin"
			picture = "Paul_Martin.dds"
			desc = "PAUL_MARTIN_LEADER_DESC"
			ideology = liberalism
			traits = {
				western_liberalism
				geopolitical_thinker
			}
		}
		add_political_power = 150
		add_stability = 0.05
		ai_chance = {
			base = 1
		}
	}

	option = { ### Chretien holds on
		name = canada_md_politics.27.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.27.b executed"
		add_political_power = -100
		add_stability = -0.1
		ai_chance = {
			base = 0
		}
	}
}

# Stephen Harper conservative election
country_event = {
	id = canada_md_politics.28
	title = canada_md_politics.28.t
	desc = canada_md_politics.28.d
	picture = GFX_CAN_negotiations_ceta_conclude
	is_triggered_only = yes

	trigger = {
		tag = CAN
		western_conservatism_are_in_power = yes
	}

	option = { ### Stephen Harper elected
		name = canada_md_politics.28.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.28.a executed"
		hidden_effect = { kill_country_leader = yes }
		create_country_leader = {
			name = "Stephen Harper"
			picture = "Stephen_Harper.dds"
			desc = "STEPHEN_HARPER_LEADER_DESC"
			ideology = conservatism
			traits = {
				western_conservatism
				rational
				cautious
			}
		}
		add_political_power = 100
		ai_chance = {
			base = 1
		}
	}

	option = { ### No change in leadership
		name = canada_md_politics.28.b
		ai_chance = {
			base = 0
		}
	}
}

# Justin Trudeau liberal election
country_event = {
	id = canada_md_politics.29
	title = canada_md_politics.29.t
	desc = canada_md_politics.29.d
	picture = GFX_Canadian_elections
	is_triggered_only = yes

	trigger = {
		tag = CAN
		western_liberals_are_in_power = yes
	}

	option = { ### Justin Trudeau elected
		name = canada_md_politics.29.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.29.a executed"
		hidden_effect = { kill_country_leader = yes }
		create_country_leader = {
			name = "Justin Trudeau"
			picture = "Justin_Trudeau.dds"
			desc = "JUSTIN_TRUDEAU_LEADER_DESC"
			ideology = liberalism
			traits = {
				western_liberalism
				skilled_lobbyist
				polished
				likeable
				emotional
			}
		}
		add_political_power = 150
		add_stability = 0.05
		ai_chance = {
			base = 1
		}
	}

	option = { ### No change in leadership
		name = canada_md_politics.29.b
		ai_chance = {
			base = 0
		}
	}
}

# Justin Trudeau's resignation
country_event = {
	id = canada_md_politics.30
	title = canada_md_politics.30.t
	desc = canada_md_politics.30.d
	picture = GFX_CAN_chogm_meeting_2018
	is_triggered_only = yes

	trigger = {
		tag = CAN
		western_liberals_are_in_power = yes
	}

	option = { ### Justin Trudeau resigns, Mark Carney elected
		name = canada_md_politics.30.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.30.a executed"
		hidden_effect = { kill_country_leader = yes }
		create_country_leader = {
			name = "Mark Carney"
			picture = "Mark_Carney.dds"
			desc = "MARK_CARNEY_LEADER_DESC"
			ideology = liberalism
			traits = {
				economist
				western_technocrat
				rational
			}
		}
		add_political_power = 100
		add_stability = 0.05
		ai_chance = {
			base = 1
		}
	}

	option = { ### Trudeau holds on to power
		name = canada_md_politics.30.b
		log = "[GetDateText]: [This.GetName]: canada_md_politics.30.b executed"
		add_political_power = -150
		add_stability = -0.05
		ai_chance = {
			base = 0
		}
	}
}

country_event = {
	id = canada_md_politics.31
	title = canada_md_politics.31.t
	desc = canada_md_politics.31.d
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = CAN
	}

	option = {
		name = canada_md_politics.31.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.31.a executed"
		set_country_flag = CAN_canadian_alliance_formed
		update_party_name = yes
	}
}

country_event = {
	id = canada_md_politics.32
	title = canada_md_politics.32.t
	desc = canada_md_politics.32.d
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = CAN
	}

	option = {
		name = canada_md_politics.32.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.32.a executed"
		set_country_flag = CAN_conservative_party_formed
		set_temp_variable = { var = tmp_alliance value = var:party_pop_array^14 }
		set_temp_variable = { party_index = 1 }
		set_temp_variable = { party_popularity_increase = tmp_alliance }
		set_temp_variable = { temp_outlook_increase = tmp_alliance }
		change_relative_party_popularity = yes
		set_temp_variable = { var = tmp_alliance value = var:party_pop_array^14 }
		multiply_temp_variable = { var = tmp_alliance value = -1 }
		set_temp_variable = { party_index = 14 }
		set_temp_variable = { party_popularity_increase = tmp_alliance }
		set_temp_variable = { temp_outlook_increase = tmp_alliance }
		change_relative_party_popularity = yes
		update_party_name = yes
	}
}

country_event = {
	id = canada_md_politics.33
	title = canada_md_politics.33.t
	desc = canada_md_politics.33.d
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = CAN
	}

	option = {
		name = canada_md_politics.33.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.33.a executed"
		set_country_flag = CAN_ccce_renamed
		update_party_name = yes
	}
}

country_event = {
	id = canada_md_politics.34
	title = canada_md_politics.34.t
	desc = canada_md_politics.34.d
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = CAN
	}

	option = {
		name = canada_md_politics.34.a
		log = "[GetDateText]: [This.GetName]: canada_md_politics.34.a executed"
		set_country_flag = CAN_business_council_renamed
		update_party_name = yes
	}
}

### Keystone Pipeline events ###

##################CANADA#######################

#Canada begins planning the pipeline
country_event = {
	id = keystonepipeline_can.0
	title = keystonepipeline_can.0.t
	desc = keystonepipeline_can.0.d
	picture = GFX_CAN_keystone_pipeline

	fire_only_once = yes

	is_triggered_only = yes

	trigger = {
		tag = CAN
	}

	option = { #American Plans
		name = keystonepipeline_can.0.a
			trigger = {
				USA = {
					has_decision = USA_finish_keystone_and_dakota_pipelines
				}
			}
		log = "[GetDateText]: [This.GetName]: keystonepipeline_can.0.a executed"
		hidden_effect = {
			country_event = { id = keystonepipeline_can.2 days = 7 }
		}
		custom_effect_tooltip = keystonepipeline_can_0_tt
	}

	option = { #We should do it alone
		name = keystonepipeline_can.0.b
		log = "[GetDateText]: [This.GetName]: keystonepipeline_can.0.b executed"
		hidden_effect = {
			country_event = { id = keystonepipeline_can.1 days = 14 }
			random_list = {
					5 = {
						add_to_variable = { french_happiness_var = 0 }
					}
					55 = {
						add_to_variable = { french_happiness_var = -1 }
					}
					35 = {
						add_to_variable = { french_happiness_var = -2 }
					}
					5 = {
						add_to_variable = { french_happiness_var = -3 }
					}
				}
			CAN_update_french_happiness = yes
		}
		custom_effect_tooltip = keystonepipeline_can_1_tt
		custom_effect_tooltip = CAN_keystone_pipeline_alone_happiness_tt
	}

	option = { #Ask america to join planning efforts
		name = keystonepipeline_can.0.c
		log = "[GetDateText]: [This.GetName]: keystonepipeline_can.0.c executed"
		hidden_effect = {
			random_list = {
					5 = {
						add_to_variable = { french_happiness_var = 0 }
					}
					55 = {
						add_to_variable = { french_happiness_var = -4 }
					}
					35 = {
						add_to_variable = { french_happiness_var = -6 }
					}
					5 = {
						add_to_variable = { french_happiness_var = -8 }
					}
				}
			CAN_update_french_happiness = yes
		}
		USA = {
			country_event = { id = keystonepipeline_usa.0 days = 1 }
		}
		custom_effect_tooltip = CAN_keystone_pipeline_usa_happiness_tt
	}
}

#Pipeline costs projected at 9 billion
country_event = {
	id = keystonepipeline_can.1
	title = keystonepipeline_can.1.t
	desc = keystonepipeline_can.1.d
	picture = GFX_CAN_keystone_pipeline_building

	fire_only_once = yes

	is_triggered_only = yes

	trigger = {
		tag = CAN
	}

	option = { #Do it
		name = keystonepipeline_can.1.a
		log = "[GetDateText]: [This.GetName]: keystonepipeline_can.1.a executed"
		hidden_effect = {
			random_list = {
					5 = {
						add_to_variable = { french_happiness_var = -2 }
					}
					15 = {
						add_to_variable = { french_happiness_var = -3 }
					}
					25 = {
						add_to_variable = { french_happiness_var = -4 }
					}
					30 = {
						add_to_variable = { french_happiness_var = -5 }
					}
					15 = {
						add_to_variable = { french_happiness_var = -6 }
					}
					5 = {
						add_to_variable = { french_happiness_var = -7 }
					}
					5 = {
						add_to_variable = { french_happiness_var = -8 }
					}
				}
			CAN_update_french_happiness = yes
			country_event = { id = keystonepipeline_can.4 days = 730 }
		}
		set_temp_variable = { treasury_change = -9 }
		modify_treasury_effect = yes
		custom_effect_tooltip = start_building_pipeline_tt
		custom_effect_tooltip = CAN_keystone_pipeline_do_it_happiness_tt
		add_stability = -0.03
	}

	option = { #We should instead use the money elsewhere
		name = keystonepipeline_can.1.b
		log = "[GetDateText]: [This.GetName]: keystonepipeline_can.1.b executed"
		hidden_effect = {
			random_list = {
					5 = {
						add_to_variable = { french_happiness_var = 2 }
					}
					55 = {
						add_to_variable = { french_happiness_var = 5 }
					}
					35 = {
						add_to_variable = { french_happiness_var = 6 }
					}
					5 = {
						add_to_variable = { french_happiness_var = 10 }
					}
				}
			CAN_update_french_happiness = yes
		}
		add_stability = 0.07
		custom_effect_tooltip = CAN_keystone_pipeline_use_money_elsewhere_happiness_tt
	}
}

#Pipeline costs projected at 2 billion
country_event = {
	id = keystonepipeline_can.2
	title = keystonepipeline_can.2.t
	desc = keystonepipeline_can.2.d
	picture = GFX_CAN_keystone_pipeline_building

	fire_only_once = yes

	is_triggered_only = yes

	trigger = {
		tag = CAN
	}

	option = { #Do it
		name = keystonepipeline_can.1.a
		log = "[GetDateText]: [This.GetName]: keystonepipeline_can.2.a executed"
		hidden_effect = {
			random_list = {
					50 = {
						add_to_variable = { french_happiness_var = 0 }
					}
					50 = {
						add_to_variable = { french_happiness_var = -1 }
					}
				}
			CAN_update_french_happiness = yes
			country_event = { id = keystonepipeline_can.4 days = 730 }
		}
		set_temp_variable = { treasury_change = -2 }
		modify_treasury_effect = yes
		custom_effect_tooltip = start_building_pipeline_tt
		custom_effect_tooltip = CAN_keystone_pipeline_2_b_happiness_tt
	}

	option = { #We should instead use the money elsewhere
		name = keystonepipeline_can.1.b
		log = "[GetDateText]: [This.GetName]: keystonepipeline_can.2.b executed"
		hidden_effect = {
			random_list = {
					5 = {
						add_to_variable = { french_happiness_var = 2 }
					}
					55 = {
						add_to_variable = { french_happiness_var = 5 }
					}
					35 = {
						add_to_variable = { french_happiness_var = 6 }
					}
					5 = {
						add_to_variable = { french_happiness_var = 10 }
					}
				}
			CAN_update_french_happiness = yes
		}
		add_stability = 0.07
		custom_effect_tooltip = CAN_keystone_pipeline_use_money_elsewhere_happiness_tt
	}
}

#Pipeline costs projected at 5 billion
country_event = {
	id = keystonepipeline_can.3
	title = keystonepipeline_can.3.t
	desc = keystonepipeline_can.3.d
	picture = GFX_CAN_keystone_pipeline_building

	fire_only_once = yes

	is_triggered_only = yes

	trigger = {
		tag = CAN
	}

	option = { #Do it
		name = keystonepipeline_can.1.a
		log = "[GetDateText]: [This.GetName]: keystonepipeline_can.3.a executed"
		hidden_effect = {
			random_list = {
					50 = {
						add_to_variable = { french_happiness_var = 0 }
					}
					50 = {
						add_to_variable = { french_happiness_var = -2 }
					}
				}
			CAN_update_french_happiness = yes
			country_event = { id = keystonepipeline_can.4 days = 730 }
		}
		custom_effect_tooltip = start_building_pipeline_tt
		set_temp_variable = { treasury_change = -5 }
		modify_treasury_effect = yes
		custom_effect_tooltip = CAN_keystone_pipeline_5_b_happiness_tt
	}

	option = { #We should instead use the money elsewhere
		name = keystonepipeline_can.1.b
		log = "[GetDateText]: [This.GetName]: keystonepipeline_can.1.b executed"
		hidden_effect = {
			random_list = {
					5 = {
						add_to_variable = { french_happiness_var = 2 }
					}
					55 = {
						add_to_variable = { french_happiness_var = 5 }
					}
					35 = {
						add_to_variable = { french_happiness_var = 6 }
					}
					5 = {
						add_to_variable = { french_happiness_var = 10 }
					}
				}
			CAN_update_french_happiness = yes
		}
		add_stability = 0.07
		custom_effect_tooltip = CAN_keystone_pipeline_use_money_elsewhere_happiness_tt
	}
}

#Pipeline completed
country_event = {
	id = keystonepipeline_can.4
	title = keystonepipeline_can.4.t
	desc = keystonepipeline_can.4.d
	picture = GFX_CAN_keystone_pipeline_completed
	fire_only_once = yes
	is_triggered_only = yes
	trigger = {
		tag = CAN
	}

	option = { #Finally
		name = keystonepipeline_can.4.a
		log = "[GetDateText]: [This.GetName]: keystonepipeline_can.4.a executed"
		755 = {
			add_extra_state_shared_building_slots = 2
			add_building_construction = {
				type = infrastructure
				level = 3
				instant_build = yes
			}
			add_building_construction = {
				type = renewable_energy_infra
				level = 2
				instant_build = yes
			}
		}
		756 = {
			add_extra_state_shared_building_slots = 2
			add_building_construction = {
				type = infrastructure
				level = 3
				instant_build = yes
			}
			add_building_construction = {
				type = renewable_energy_infra
				level = 2
				instant_build = yes
			}
		}
	}
}

#Canada asks our help in the planning of the pipeline
country_event = {
	id = keystonepipeline_usa.0
	title = keystonepipeline_usa.0.t
	desc = keystonepipeline_usa.0.d
	picture = GFX_CAN_keystone_pipeline_building

	fire_only_once = yes

	is_triggered_only = yes

	trigger = {
		tag = CAN
	}

	option = { #yes
		name = keystonepipeline_usa.0.a
		log = "[GetDateText]: [This.GetName]: keystonepipeline_usa.0.a executed"
		hidden_effect = {
			CAN = {
				add_opinion_modifier = {
					target = USA
					modifier = CAN_PLANNING_ACCEPTED
				}
			}
		}
		set_temp_variable = { treasury_change = -0.9 }
		modify_treasury_effect = yes
		CAN = {
				country_event = { id = keystonepipeline_can.3 days = 3 }
			}
	}

	option = { #no
		name = keystonepipeline_usa.0.b
		log = "[GetDateText]: [This.GetName]: keystonepipeline_usa.0.b executed"
		hidden_effect = {
			CAN = {
				country_event = { id = keystonepipeline_can.1 days = 1 }
				add_opinion_modifier = {
					target = USA
					modifier = CAN_PLANNING_DENIED
				}
			}
		}
		custom_effect_tooltip = keystonepipeline_can_1_tt
	}
}

# The New North American Oil Deal
country_event = {
	id = canada.20
	title = canada.20.t
	desc = canada.20.d
	picture = GFX_CAN_generic
	is_triggered_only = yes
	trigger = {
		original_tag = USA
	}

	# Accept the Deal
	option = {
		name = canada.20.a
		log = "[GetDateText]: [Root.GetName]: event canada.20.a"
		add_ideas = na_oil_treaty_idea
		CAN = {
			add_ideas = na_oil_treaty_idea
		}

		reverse_add_opinion_modifier = { target = CAN modifier = CAN_america_accepts_treaty }
		add_opinion_modifier = { target = CAN modifier = CAN_na_oil_treaty }
		reverse_add_opinion_modifier = { target = CAN modifier = CAN_na_oil_treaty }
		news_event = canada_news.1

		ai_chance = {
			base = 1
		}
	}

	# Reject the Deal
	option = {
		name = canada.20.b
		log = "[GetDateText]: [Root.GetName]: event canada.20.b"

		reverse_add_opinion_modifier = { target = CAN modifier = CAN_america_rejects_treaty }

		CAN = { country_event = diplomatic_response.2 }

		ai_chance = {
			base = 0
		}
	}
}

# The New North American Oil Deal
news_event = {
	id = canada_news.1
	title = canada_news.1.t
	desc = canada_news.1.d
	picture = GFX_news_trade_agreement
	is_triggered_only = yes
	major = yes

	option = {
		name = canada_news.1.a
		trigger = { tag = CAN }
	}

	option = {
		name = canada_news.1.b
		trigger = { tag = USA }
	}

	option = {
		name = canada_news.1.c
		trigger = {
			NOT = { tag = USA }
			NOT = { tag = CAN }
		}
	}
}

# Burning of the White House
news_event = {
	id = canada_news.2
	title = canada_news.2.t
	desc = canada_news.2.d
	picture = GFX_USA_collapse_riots_global_event
	is_triggered_only = yes
	major = yes

	option = {
		name = canada_news.2.a
		trigger = {
			NOT = { tag = USA }
		}
	}
	option = {
		name = canada_news.2.b
		trigger = { tag = USA }
	}
}

# ATI/AMD corporate history
country_event = {
	id = canada.310
	title = canada.310.t
	desc = canada.310.d
	picture = GFX_computer
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_ati_r300_architecture }
		NOT = { has_country_flag = CAN_ati_r300_volume }
	}

	option = {
		name = canada.310.a
		log = "[GetDateText]: [Root.GetName]: canada.310.a executed"
		add_tech_bonus = {
			name = canada.310.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_ati_r300_architecture
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}

	option = {
		name = canada.310.b
		log = "[GetDateText]: [Root.GetName]: canada.310.b executed"
		add_tech_bonus = {
			name = canada.310.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_ati_r300_volume
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
	}
}

country_event = {
	id = canada.311
	title = canada.311.t
	desc = canada.311.d
	picture = GFX_computer
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_ati_xbox_semicustom }
		NOT = { has_country_flag = CAN_ati_xbox_pc_priority }
	}

	option = {
		name = canada.311.a
		log = "[GetDateText]: [Root.GetName]: canada.311.a executed"
		add_tech_bonus = {
			name = canada.311.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_ati_xbox_semicustom
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}

	option = {
		name = canada.311.b
		log = "[GetDateText]: [Root.GetName]: canada.311.b executed"
		add_tech_bonus = {
			name = canada.311.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_ati_xbox_pc_priority
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
	}
}

country_event = {
	id = canada.312
	title = canada.312.t
	desc = canada.312.d
	picture = GFX_computer
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_ati_amd_integrated }
		NOT = { has_country_flag = CAN_ati_canadian_compact }
	}

	option = {
		name = canada.312.a
		log = "[GetDateText]: [Root.GetName]: canada.312.a executed"
		add_political_power = -20
		add_tech_bonus = {
			name = canada.312.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_ati_amd_integrated
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_active_mission = bankruptcy_incoming_collapse
			}
		}
	}

	option = {
		name = canada.312.b
		log = "[GetDateText]: [Root.GetName]: canada.312.b executed"
		add_tech_bonus = {
			name = canada.312.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_ati_canadian_compact
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
				NOT = { has_active_mission = bankruptcy_incoming_collapse }
			}
		}
	}
}

country_event = {
	id = canada.313
	title = canada.313.t
	desc = canada.313.d
	picture = GFX_computer
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_ati_console_semicustom }
		NOT = { has_country_flag = CAN_ati_pc_architecture_priority }
	}

	option = {
		name = canada.313.a
		log = "[GetDateText]: [Root.GetName]: canada.313.a executed"
		add_tech_bonus = {
			name = canada.313.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_ati_console_semicustom
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}

	option = {
		name = canada.313.b
		log = "[GetDateText]: [Root.GetName]: canada.313.b executed"
		add_tech_bonus = {
			name = canada.313.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_ati_pc_architecture_priority
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
	}
}

country_event = {
	id = canada.314
	title = canada.314.t
	desc = canada.314.d
	picture = GFX_computer
	is_triggered_only = yes

	trigger = {
		NOT = { has_idea = CAN_ati_integrated_amd_compute_engine }
		NOT = { has_idea = CAN_ati_canadian_graphics_research_compact }
	}

	option = {
		name = canada.314.a
		log = "[GetDateText]: [Root.GetName]: canada.314.a executed"
		add_tech_bonus = {
			name = canada.314.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		CAN_ati_apply_integrated_compute_engine = yes
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}

	option = {
		name = canada.314.b
		log = "[GetDateText]: [Root.GetName]: canada.314.b executed"
		add_tech_bonus = {
			name = canada.314.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		CAN_ati_apply_research_compact = yes
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
	}
}
# Matrox corporate history
country_event = {
	id = canada.320
	title = canada.320.t
	desc = canada.320.d
	picture = GFX_computer
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_matrox_consumer_graphics }
		NOT = { has_country_flag = CAN_matrox_professional_niche }
	}

	option = {
		name = canada.320.a
		log = "[GetDateText]: [Root.GetName]: canada.320.a executed"
		add_political_power = 10
		add_tech_bonus = {
			name = canada.320.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_matrox_professional_niche
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}

	option = {
		name = canada.320.b
		log = "[GetDateText]: [Root.GetName]: canada.320.b executed"
		set_temp_variable = { treasury_change = -2.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.320.t
			bonus = 0.15
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_364f0b778e = yes }
		set_country_flag = CAN_matrox_consumer_graphics
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_active_mission = bankruptcy_incoming_collapse
			}
		}
	}
}

country_event = {
	id = canada.321
	title = canada.321.t
	desc = canada.321.d
	picture = GFX_computer
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_matrox_parhelia_funded }
		NOT = { has_country_flag = CAN_matrox_parhelia_cancelled }
	}

	option = {
		name = canada.321.a
		log = "[GetDateText]: [Root.GetName]: canada.321.a executed"
		add_political_power = 10
		add_tech_bonus = {
			name = canada.321.t
			bonus = 0.10
			uses = 1
			category = CAT_command_and_control_equipment
		} hidden_effect = { rq_eb_bff1dcf148 = yes }
		set_country_flag = CAN_matrox_parhelia_cancelled
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}

	option = {
		name = canada.321.b
		log = "[GetDateText]: [Root.GetName]: canada.321.b executed"
		set_temp_variable = { treasury_change = -3.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.321.t
			bonus = 0.15
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_364f0b778e = yes }
		set_country_flag = CAN_matrox_parhelia_funded
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_active_mission = bankruptcy_incoming_collapse
			}
		}
	}
}

country_event = {
	id = canada.322
	title = canada.322.t
	desc = canada.322.d
	picture = GFX_stock_market
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_matrox_independent_path }
		NOT = { has_country_flag = CAN_matrox_foreign_partnership }
	}

	option = {
		name = canada.322.a
		log = "[GetDateText]: [Root.GetName]: canada.322.a executed"
		add_political_power = -15
		add_tech_bonus = {
			name = canada.322.t
			bonus = 0.15
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_364f0b778e = yes }
		set_country_flag = CAN_matrox_independent_path
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_active_mission = bankruptcy_incoming_collapse
			}
		}
	}

	option = {
		name = canada.322.b
		log = "[GetDateText]: [Root.GetName]: canada.322.b executed"
		set_temp_variable = { treasury_change = 2.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.322.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_matrox_foreign_partnership
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
				NOT = { has_active_mission = bankruptcy_incoming_collapse }
			}
		}
	}
}

country_event = {
	id = canada.323
	title = canada.323.t
	desc = canada.323.d
	picture = GFX_generic_factory
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_matrox_vision_pivot }
		NOT = { has_country_flag = CAN_matrox_display_focus }
	}

	option = {
		name = canada.323.a
		log = "[GetDateText]: [Root.GetName]: canada.323.a executed"
		set_temp_variable = { treasury_change = -2.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.323.t
			bonus = 0.15
			uses = 1
			category = CAT_artificial_intelligence
		} hidden_effect = { rq_eb_32b6c303c3 = yes }
		set_country_flag = CAN_matrox_vision_pivot
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_active_mission = bankruptcy_incoming_collapse
			}
		}
	}

	option = {
		name = canada.323.b
		log = "[GetDateText]: [Root.GetName]: canada.323.b executed"
		add_political_power = 10
		add_tech_bonus = {
			name = canada.323.t
			bonus = 0.10
			uses = 1
			category = CAT_command_and_control_equipment
		} hidden_effect = { rq_eb_bff1dcf148 = yes }
		set_country_flag = CAN_matrox_display_focus
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
				NOT = { has_active_mission = bankruptcy_incoming_collapse }
			}
		}
	}
}

country_event = {
	id = canada.324
	title = canada.324.t
	desc = canada.324.d
	picture = GFX_stock_market
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_matrox_divisions_split }
		NOT = { has_country_flag = CAN_matrox_group_intact }
	}

	option = {
		name = canada.324.a
		log = "[GetDateText]: [Root.GetName]: canada.324.a executed"
		set_temp_variable = { treasury_change = 3.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.324.t
			bonus = 0.10
			uses = 1
			category = CAT_artificial_intelligence
		} hidden_effect = { rq_eb_70b9092d7f = yes }
		set_country_flag = CAN_matrox_divisions_split
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}

	option = {
		name = canada.324.b
		log = "[GetDateText]: [Root.GetName]: canada.324.b executed"
		add_political_power = -20
		add_tech_bonus = {
			name = canada.324.t
			bonus = 0.15
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_364f0b778e = yes }
		set_country_flag = CAN_matrox_group_intact
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_active_mission = bankruptcy_incoming_collapse
			}
		}
	}
}

country_event = {
	id = canada.325
	title = canada.325.t
	desc = canada.325.d
	picture = GFX_cyber_attack
	is_triggered_only = yes

	trigger = {
		CAN_matrox_outcome_settled = no
	}

	option = {
		name = canada.325.a
		trigger = {
			has_country_flag = CAN_matrox_vision_pivot
			has_country_flag = CAN_matrox_independent_path
		}
		log = "[GetDateText]: [Root.GetName]: canada.325.a executed"
		effect_tooltip = { add_timed_idea = { idea = CAN_matrox_secure_vision_stack days = 365 } }
		hidden_effect = { CAN_matrox_apply_secure_vision_stack = yes }
		ai_chance = { base = 100 }
	}

	option = {
		name = canada.325.b
		trigger = {
			has_country_flag = CAN_matrox_vision_pivot
			NOT = { has_country_flag = CAN_matrox_independent_path }
		}
		log = "[GetDateText]: [Root.GetName]: canada.325.b executed"
		effect_tooltip = { add_timed_idea = { idea = CAN_matrox_certified_visual_systems days = 365 } }
		hidden_effect = { CAN_matrox_apply_certified_visual_systems = yes }
		ai_chance = { base = 100 }
	}

	option = {
		name = canada.325.c
		trigger = {
			NOT = { has_country_flag = CAN_matrox_vision_pivot }
			has_country_flag = CAN_matrox_independent_path
		}
		log = "[GetDateText]: [Root.GetName]: canada.325.c executed"
		effect_tooltip = { add_ideas = CAN_matrox_sovereign_visual_compute }
		hidden_effect = { CAN_matrox_apply_sovereign_visual_compute = yes }
		ai_chance = { base = 100 }
	}

	option = {
		name = canada.325.e
		trigger = {
			NOT = { has_country_flag = CAN_matrox_vision_pivot }
			NOT = { has_country_flag = CAN_matrox_independent_path }
		}
		log = "[GetDateText]: [Root.GetName]: canada.325.e executed"
		effect_tooltip = { add_timed_idea = { idea = CAN_matrox_open_graphics_commonwealth days = 365 } }
		hidden_effect = { CAN_matrox_apply_open_graphics_commonwealth = yes }
		ai_chance = { base = 100 }
	}
}
# BlackBerry corporate history
country_event = {
	id = canada.330
	title = canada.330.t
	desc = canada.330.d
	picture = GFX_CAN_generic
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_blackberry_private_expansion }
		NOT = { has_country_flag = CAN_blackberry_waterloo_support }
	}

	option = {
		name = canada.330.a
		log = "[GetDateText]: [Root.GetName]: canada.330.a executed"
		add_political_power = 10
		set_country_flag = CAN_blackberry_private_expansion
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}

	option = {
		name = canada.330.b
		log = "[GetDateText]: [Root.GetName]: canada.330.b executed"
		set_temp_variable = { treasury_change = -2.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.330.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_blackberry_waterloo_support
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_active_mission = bankruptcy_incoming_collapse
			}
		}
	}
}

country_event = {
	id = canada.331
	title = canada.331.t
	desc = canada.331.d
	picture = GFX_stock_market
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_blackberry_ntp_settled }
		NOT = { has_country_flag = CAN_blackberry_ntp_contested }
	}

	option = {
		name = canada.331.a
		log = "[GetDateText]: [Root.GetName]: canada.331.a executed"
		set_temp_variable = { treasury_change = -4.00 }
		modify_treasury_effect = yes
		add_political_power = 5
		add_tech_bonus = {
			name = canada.331.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_blackberry_ntp_settled
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_active_mission = bankruptcy_incoming_collapse
			}
		}
	}

	option = {
		name = canada.331.b
		log = "[GetDateText]: [Root.GetName]: canada.331.b executed"
		add_political_power = -10
		add_tech_bonus = {
			name = canada.331.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_blackberry_ntp_contested
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
				NOT = { has_active_mission = bankruptcy_incoming_collapse }
			}
		}
	}
}

country_event = {
	id = canada.332
	title = canada.332.t
	desc = canada.332.d
	picture = GFX_computer
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_blackberry_enterprise_hardware }
		NOT = { has_country_flag = CAN_blackberry_application_ecosystem }
	}

	option = {
		name = canada.332.a
		log = "[GetDateText]: [Root.GetName]: canada.332.a executed"
		set_temp_variable = { treasury_change = -2.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.332.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_blackberry_enterprise_hardware
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}

	option = {
		name = canada.332.b
		log = "[GetDateText]: [Root.GetName]: canada.332.b executed"
		set_temp_variable = { treasury_change = -2.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.332.t
			bonus = 0.10
			uses = 1
			category = CAT_internet
		} hidden_effect = { rq_eb_39db5d2592 = yes }
		set_country_flag = CAN_blackberry_application_ecosystem
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
	}
}

country_event = {
	id = canada.333
	title = canada.333.t
	desc = canada.333.d
	picture = GFX_generic_factory
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_blackberry_qnx_mobile }
		NOT = { has_country_flag = CAN_blackberry_qnx_embedded }
	}

	option = {
		name = canada.333.a
		log = "[GetDateText]: [Root.GetName]: canada.333.a executed"
		set_temp_variable = { treasury_change = -2.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.333.t
			bonus = 0.10
			uses = 1
			category = CAT_information_technology
		} hidden_effect = { rq_eb_dcfbaed803 = yes }
		set_country_flag = CAN_blackberry_qnx_mobile
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
	}

	option = {
		name = canada.333.b
		log = "[GetDateText]: [Root.GetName]: canada.333.b executed"
		set_temp_variable = { treasury_change = -2.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.333.t
			bonus = 0.10
			uses = 1
			category = CAT_industry
		} hidden_effect = { rq_eb_b504394b66 = yes }
		set_country_flag = CAN_blackberry_qnx_embedded
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}
}

country_event = {
	id = canada.334
	title = canada.334.t
	desc = canada.334.d
	picture = GFX_CAN_generic
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = CAN_blackberry_bb10_backed }
		NOT = { has_country_flag = CAN_blackberry_enterprise_services }
	}

	option = {
		name = canada.334.a
		log = "[GetDateText]: [Root.GetName]: canada.334.a executed"
		set_temp_variable = { treasury_change = -3.00 }
		modify_treasury_effect = yes
		add_tech_bonus = {
			name = canada.334.t
			bonus = 0.10
			uses = 1
			category = CAT_internet
		} hidden_effect = { rq_eb_39db5d2592 = yes }
		set_country_flag = CAN_blackberry_bb10_backed
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_active_mission = bankruptcy_incoming_collapse
			}
		}
	}

	option = {
		name = canada.334.b
		log = "[GetDateText]: [Root.GetName]: canada.334.b executed"
		set_temp_variable = { treasury_change = -2.00 }
		modify_treasury_effect = yes
		add_political_power = 5
		add_tech_bonus = {
			name = canada.334.t
			bonus = 0.15
			uses = 1
			category = CAT_encryption
		} hidden_effect = { rq_eb_c5a64f4a26 = yes }
		set_country_flag = CAN_blackberry_enterprise_services
		ai_chance = {
			base = 50
			modifier = {
				factor = 10
				is_historical_focus_on = yes
			}
		}
	}
}

country_event = {
	id = canada.335
	title = canada.335.t
	desc = canada.335.d
	picture = GFX_computer
	is_triggered_only = yes

	trigger = {
		CAN_blackberry_outcome_settled = no
	}

	option = {
		name = canada.335.a
		trigger = {
			has_country_flag = CAN_blackberry_qnx_embedded
			has_country_flag = CAN_blackberry_enterprise_services
		}
		log = "[GetDateText]: [Root.GetName]: canada.335.a executed"
		effect_tooltip = { add_ideas = CAN_blackberry_embedded_sovereign }
		hidden_effect = { CAN_blackberry_apply_embedded_sovereign = yes }
		ai_chance = { base = 100 }
	}

	option = {
		name = canada.335.b
		trigger = {
			has_country_flag = CAN_blackberry_qnx_embedded
			NOT = { has_country_flag = CAN_blackberry_enterprise_services }
		}
		log = "[GetDateText]: [Root.GetName]: canada.335.b executed"
		effect_tooltip = { add_timed_idea = { idea = CAN_blackberry_secure_systems_holding days = 365 } }
		hidden_effect = { CAN_blackberry_apply_secure_systems_holding = yes }
		ai_chance = { base = 100 }
	}

	option = {
		name = canada.335.c
		trigger = {
			NOT = { has_country_flag = CAN_blackberry_qnx_embedded }
			has_country_flag = CAN_blackberry_enterprise_services
		}
		log = "[GetDateText]: [Root.GetName]: canada.335.c executed"
		effect_tooltip = { add_timed_idea = { idea = CAN_blackberry_software_pivot days = 365 } }
		hidden_effect = { CAN_blackberry_apply_software_pivot = yes }
		ai_chance = { base = 100 }
	}

	option = {
		name = canada.335.e
		trigger = {
			NOT = { has_country_flag = CAN_blackberry_qnx_embedded }
			NOT = { has_country_flag = CAN_blackberry_enterprise_services }
		}
		log = "[GetDateText]: [Root.GetName]: canada.335.e executed"
		effect_tooltip = { add_timed_idea = { idea = CAN_blackberry_waterloo_holdout days = 365 } }
		hidden_effect = { CAN_blackberry_apply_waterloo_holdout = yes }
		ai_chance = { base = 100 }
	}
}
