add_namespace = scandinavian_votes

#Vote on Ratification of the Monetary Union Treaty
country_event = {
	id = scandinavian_votes.1
	title = scandinavian_votes.1.t
	desc = scandinavian_votes.1.d
	#picture = GFX_report_event_prussian_parliament_king

	is_triggered_only = yes

	immediate = {
		set_variable = {
			var = current_reform_id
			value = 27.1
		}

		reset_approval_arrays = yes
		set_1_approval_highly_agree = yes
		set_2_approval_agree = yes
		set_3_approval_agree = yes
		set_4_approval_disagree = yes

		set_vote_eco = yes
		compute_voting_approval = yes

		compute_number_seats_tot = yes
		compute_number_seats_approve_est = yes
	}

	option = { # Let's vote in a month
		name = scandinavian_votes.1.a
		ai_chance = { base = 100 }
		
		country_event = {
			id = scandinavian_votes.2
			days = 31 
		}
	}

	option = { # Abandon the idea
		name = scandinavian_votes.1.b
		ai_chance = { base = 0 }
		
		add_political_power = -50
		add_stability = -0.05
		if = {
			limit = {
				has_government = traditional_conservatism
			}
			add_popularity = { ideology = traditional_conservatism popularity = -0.05 }
		}
		if = {
			limit = {
				has_government = centrism
			}
			add_popularity = { ideology = centrism popularity = -0.05 }
		}
		
		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}

#Results of Vote on Ratification of the Monetary Union Treaty
country_event = {
	id = scandinavian_votes.2
	title = scandinavian_votes.2.t
	desc = scandinavian_votes.2.d
	#picture = GFX_report_event_prussian_parliament_king

	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			calculate_vote_result = yes
		}
	}

	option = { # It's a success !
		name = scandinavian_votes.2.a
		trigger = {
			has_country_flag = eoanb_reform_vote_success
		}
		clr_country_flag = eoanb_reform_vote_success
		set_country_flag = SDN_smu_ratification_successful_flag
		
		add_political_power = 50
		if = {
			limit = {
				has_government = traditional_conservatism
			}
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = {
				has_government = centrism
			}
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		hidden_effect = {
			country_event = { id = scan_monetary_union.27 days = 7 }
		}
		
		set_variable = { 
			var = current_reform_id
			value = 0
		}
    }

	option = { # It's a failure...
		name = scandinavian_votes.2.b
		trigger = {
			has_country_flag = eoanb_reform_vote_failure
		}
		clr_country_flag = eoanb_reform_vote_failure
		set_country_flag = SDN_smu_ratification_unsuccessful_flag

		add_political_power = -50
		if = {
			limit = {
				has_government = traditional_conservatism
			}
			add_popularity = { ideology = traditional_conservatism popularity = -0.01 }
			add_popularity = { ideology = centrism popularity = 0.01 }
		}
		if = {
			limit = {
				has_government = centrism
			}
			add_popularity = { ideology = traditional_conservatism popularity = 0.01 }
			add_popularity = { ideology = centrism popularity = -0.01 }
		}
		custom_effect_tooltip = SDN_smu_ratification_failed_effect_tt
		
		set_variable = { 
			var = current_reform_id
			value = 0
		}
    }

	option = { # It's a tie...
		name = scandinavian_votes.2.c
		trigger = {
			has_country_flag = eoanb_reform_vote_tie
		}
		clr_country_flag = eoanb_reform_vote_tie
		
		add_political_power = -25
		custom_effect_tooltip = SDN_smu_ratification_failed_effect_tt
		
		set_variable = { 
			var = current_reform_id
			value = 0
		}
	}
}