elections_reworked__elections = {
	allow_elections1 = {
		icon = decision_icon_allow_elections
		cost = 15
		#days_re_enable = 1
		available = {
			has_idea = elections_banned
		}
		visible = {
			always = yes
		}
		ai_will_do = {
			base = 0
			modifier = {
				has_government = neutrality
				add = 1
			}
			modifier = {
				has_government = democratic
				add = 2
			}
			modifier = {
				add = 2
				has_stability < 0.4
			}
		}
		remove_effect = {
			add_stability = 0.1
			remove_ideas = elections_banned
			add_ideas = elections_enabled
		}
	}
	ban_elections = {
		icon = decision_icon_ban_elections
		cost = 15
		days_remove = 30
		#days_re_enable = 1
		available = {
			has_idea = elections_enabled
		}
		visible = {
			always = yes
		}
		ai_will_do = {
			base = -1
			modifier = {
				has_government = democratic
				add = -2
			}
			modifier = {
				has_stability > 0.55
				add = 2
			}
		}
		remove_effect = {
			add_stability = -0.1
			remove_ideas = elections_enabled
			add_ideas = elections_banned
		}
	}
	elections = {
		icon = decision_icon_elections
		#fire_only_once = no
		allowed = {
			always = yes
		}
		available = {
			has_idea = elections_banned
		}
		activation = {
			has_idea = elections_enabled
			NOT = {
				check_variable = { ROOT.elections_days = 0 }
			}
		}
		is_good = yes
		days_mission_timeout = ROOT.elections_days
		complete_effect = {
			
		}
		timeout_effect = {
			if = {
				limit = {
					has_war = no
				}
				country_event = { id = erevents.1 }
				set_country_flag = ROOT.on_going_elections
			}
			if = {
				limit = {
					has_war = yes
					any_war_score > 20
				}
				country_event = { id = erevents.5 }
			}
			if = {
				limit = {
					has_war = yes
					any_war_score < 20
				}
				country_event = { id = erevents.6 }
			}
			hidden_effect = {
				activate_mission = elections
			}
		}
	}
	er_ban_democratic_party = {
		icon = decision_icon_ban_democratic_party
		cost = 50
		days_remove = 0
		days_re_enable = 4
		allowed = {
			always = yes
		}
		available = {
			NOT = {
				has_country_flag = has_democratic_banned
				has_government = democratic
			}
		custom_trigger_tooltip = {
           tooltip = tt_d_rban	
           check_variable = { ROOT.Dem_inf > 19.99 }		  
         }
		}
		visible = {
			always = yes
		}
		complete_effect = {
			hidden_effect = {
				set_temp_variable = {
					var = democratic_party_popularity
					value = party_popularity@democratic
				}
				multiply_temp_variable = {
					var = democratic_party_popularity
					value = -1
				}
			}
			if = {
				limit = {
					AND = {
						democratic > 0.4
						check_variable = { ROOT.Dem_inf > 40 }
					}
				}
				random_list = {
					40 = {
						start_civil_war = {
							ruling_party = has_government
							ideology = democratic
							size = 0.4
						}
						country_event = { id = partiesinfluence.13 }
					}
					40 = {
						set_politics = {
							ruling_party = democratic
						}
						add_popularity = {
							ideology = democratic
							popularity = 0.2
						}
						country_event = { id = partiesinfluence.12 }
					}
					20 = { }
				}
			}
			else = {
				set_variable = {
					ROOT.Dem_inf = 0
				}
				set_country_flag = has_democratic_banned
				add_popularity = {
					ideology = democratic
					popularity = democratic_party_popularity
				}
				add_stability = democratic_party_popularity
			}
		}
		remove_effect = {
			
		}
	}
	er_democratic_banned = {
		icon = decision_icon_democratic_banned
		allowed = {
			always = yes
		}
		available = {
			NOT = {
				has_country_flag = has_democratic_banned
				has_government = democratic
			}
		}
		activation = {
			has_country_flag = has_democratic_banned
		}
		is_good = yes
		days_mission_timeout = 90
		#modifier = {
		#	democratic_drift = -0.1
		#}
		timeout_effect = {
			clr_country_flag = has_democratic_banned
		}
		cancel_effect = {
			clr_country_flag = has_democratic_banned
		}
	}
	er_ban_communism_party = {
		icon = decision_icon_ban_communism_party
		cost = 50
		days_remove = 0
		days_re_enable = 4
		allowed = {
			always = yes
		}
		available = {
			NOT = {
				has_country_flag = has_communism_banned
				has_government = communism
			}
			custom_trigger_tooltip = {
           tooltip = tt_c_rban	
           check_variable = { ROOT.Com_inf > 19.99 }		  
         }
		}
		visible = {
			always = yes
		}
		complete_effect = {
			hidden_effect = {
				set_temp_variable = {
					var = communism_party_popularity
					value = party_popularity@communism
				}
				multiply_temp_variable = {
					var = communism_party_popularity
					value = -1
				}
			}
			if = {
				limit = {
					AND = {
						communism > 0.4
						check_variable = { ROOT.Com_inf > 40 }
					}
				}
				random_list = {
					40 = {
						start_civil_war = {
							ruling_party = has_government
							ideology = communism
							size = 0.4
						}
						country_event = { id = partiesinfluence.13 }
					}
					40 = {
						set_politics = {
							ruling_party = communism
						}
						add_popularity = {
							ideology = communism
							popularity = 0.2
						}
						country_event = { id = partiesinfluence.12 }
					}
					20 = { }
				}
			}
			else = {
				set_country_flag = has_communism_banned
				add_popularity = {
					ideology = communism
					popularity = communism_party_popularity
				}
				add_stability = communism_party_popularity
			}
		}
		remove_effect = {
			
		}
	}
	er_communism_banned = {
		icon = decision_icon_democratic_banned
		allowed = {
			always = yes
		}
		available = {
			NOT = {
				has_country_flag = has_communism_banned
				has_government = communism
			}
		}
		activation = {
			has_country_flag = has_communism_banned
		}
		is_good = yes
		days_mission_timeout = 90
		#modifier = {
		#	communism_drift = -0.1
		#}
		timeout_effect = {
			clr_country_flag = has_communism_banned
		}
		cancel_effect = {
			clr_country_flag = has_communism_banned
		}
	}
	er_ban_fascism_party = {
		icon = decision_icon_ban_fascism_party
		cost = 50
		days_remove = 0
		days_re_enable = 4
		allowed = {
			always = yes
		}
		available = {
			NOT = {
				has_country_flag = has_fascism_banned
				has_government = fascism
			}
			custom_trigger_tooltip = {
           tooltip = tt_f_rban	
           check_variable = { ROOT.Fas_inf > 19.99 }		  
         }
		}
		visible = {
			always = yes
		}
		complete_effect = {
			hidden_effect = {
				set_temp_variable = {
					var = fascism_party_popularity
					value = party_popularity@fascism
				}
				multiply_temp_variable = {
					var = fascism_party_popularity
					value = -1
				}
			}
			if = {
				limit = {
					AND = {
						fascism > 0.4
						check_variable = { ROOT.Fas_inf > 40 }
					}
				}
				random_list = {
					40 = {
						start_civil_war = {
							ruling_party = has_government
							ideology = fascism
							size = 0.4
						}
						country_event = { id = partiesinfluence.13 }
					}
					40 = {
						set_politics = {
							ruling_party = fascism
						}
						add_popularity = {
							ideology = fascism
							popularity = 0.2
						}
						country_event = { id = partiesinfluence.12 }
					}
					20 = { }
				}
			}
			else = {
				set_country_flag = has_fascism_banned
				add_popularity = {
					ideology = fascism
					popularity = fascism_party_popularity
				}
				add_stability = fascism_party_popularity
			}
		}
		remove_effect = {
			
		}
	}
	er_fascism_banned = {
		icon = decision_icon_democratic_banned
		allowed = {
			always = yes
		}
		available = {
			NOT = {
				has_country_flag = has_fascism_banned
				has_government = fascism
			}
		}
		activation = {
			has_country_flag = has_fascism_banned
		}
		is_good = yes
		days_mission_timeout = 90
		#modifier = {
		#	fascism_drift = -0.1
		#}
		timeout_effect = {
			clr_country_flag = has_fascism_banned
		}
		cancel_effect = {
			clr_country_flag = has_fascism_banned
		}
	}
	er_ban_neutrality_party = {
		icon = decision_icon_ban_neutrality_party
		cost = 50
		days_remove = 0
		days_re_enable = 4
		allowed = {
			always = yes
		}
		available = {
			NOT = {
				has_country_flag = has_neutrality_banned
				has_government = neutrality
			}
			custom_trigger_tooltip = {
           tooltip = tt_n_rban	
           check_variable = { ROOT.Neu_inf > 19.99 }		  
         }
		}
		visible = {
			always = yes
		}
		complete_effect = {
	hidden_effect = {
				set_temp_variable = {
					var = neutrality_party_popularity
					value = party_popularity@neutrality
				}
				multiply_temp_variable = {
					var = neutrality_party_popularity
					value = -1
				}
			}
			if = {
				limit = {
					AND = {
						neutrality > 0.4
						check_variable = { ROOT.Neu_inf > 40 }
					}
				}
				random_list = {
					40 = {
						start_civil_war = {
							ruling_party = has_government
							ideology = neutrality
							size = 0.4
						}
						country_event = { id = partiesinfluence.13 }
					}
					40 = {
						set_politics = {
							ruling_party = neutrality
						}
						add_popularity = {
							ideology = neutrality
							popularity = 0.2
						}
						country_event = { id = partiesinfluence.12 }
					}
					20 = { }
				}
	         }
			else = {
				set_country_flag = has_neutrality_banned
				add_popularity = {
					ideology = neutrality
					popularity = neutrality_party_popularity
				}
				add_stability = neutrality_party_popularity
		 }
		}
		remove_effect = {
			
		}
	}
	er_neutrality_banned = {
		icon = decision_icon_democratic_banned
		allowed = {
			always = yes
		}
		available = {
			NOT = {
				has_country_flag = has_neutrality_banned
				has_government = neutrality
			}
		}
		activation = {
			has_country_flag = has_neutrality_banned
		}
		is_good = yes
		days_mission_timeout = 90
		#modifier = {
		#	neutrality_drift = -0.1
		#}
		timeout_effect = {
			clr_country_flag = has_neutrality_banned
		}
		cancel_effect = {
			clr_country_flag = has_neutrality_banned
		}
	}
}
