province_decisions = {
	
	join_hre = {
		potential = {
			hre = no
			owner = { is_emperor = no }
			religion_group = christian
			owner = {
				religion_group = christian
			}
			any_neighbor_province = {
				hre = yes
			}
		}
		allow = {
			OR = {
				is_emperor = yes
				emperor = { relation = { who = THIS value = 100 } }
			}
			owner = {
				officials = 1
			}
		}
		effect = {
			owner = { 
				prestige = 0.02 
				officials = -1
			}
			emperor = { 
				country_event = 9493
				set_province_flag = asked_join_hre
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				has_province_flag = asked_join_hre
				emperor = { ai = no }
				NOT = {
					had_province_flag = { 
						flag = asked_join_hre
						days = 3650
					}
				}
			}
			modifier = {
				factor = 0
				owner = {
					tag = PAP
				}
			}
			modifier = {
				factor = 0
				owner = {
					NOT = {
						emperor = {
							religion = this
						}
					}
				}
			}
			modifier = {
				factor = 0
				NOT = {
					emperor = {
						relation = {
							who = THIS
							value = 150
						}
					}
				}
			}
			modifier = {
				factor = 0
				has_global_flag = Privileges_Revoked
			}
			modifier = {
				factor = 0
				emperor = {
					badboy = 8
				}
			}
		}
	}
	
	join_hre_emp = {
		potential = {
			hre = no
			owner = { is_emperor = yes }
			religion_group = christian
			owner = {
				religion_group = christian
			}
			any_neighbor_province = {
				hre = yes
			}
		}
		allow = {
			owner = {
				officials = 1
			}
		}
		effect = {
			owner = { 
				prestige = 0.02
				officials = -1
				add_imperial_influence = 1
			}
			hre = yes
		}
		ai_will_do = {
			factor = 1
		}
	}

	leave_hre = {
		potential = {
			hre = yes
			owner = {
				is_emperor = no
				elector = no
			}
		}
		allow = {
			emperor = { 
				NOT = { relation = { who = THIS value = 0 } }
			}
			owner = {
				officials = 1
			}
		}
		effect = {
			hre = no
			owner = { 
				prestige = -0.02 
				officials = -1
			}
			add_imperial_influence = -1
			emperor = { relation = { who = THIS value = -100 } }
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				OR = {
					NOT = {
						has_global_flag = Privileges_Revoked
					}
					owner = { relation = { who = emperor value = 0 } }
				}
			}
		}
	}
}

hre_decisions = {

	vote_on_reichsreform = {
		potential = {
			is_emperor = yes
			NOT = { has_global_flag = reichsreform }
		}
		allow = {
			imperial_influence = 50
			NOT = { 
				had_global_flag = { 
					flag = Voting
					days = 30
				}
			}
			
		}
		effect = {
			set_global_flag = Voting
			add_imperial_influence = -30
			any_country = {
				limit = {
					AND = {
						hre = yes
						is_emperor = no
						num_of_cities = 1
					}
				}
				country_event = 9057
			}

			possible_province_event = 9058
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	vote_on_reichsregiment = {
		potential = {
			is_emperor = yes
			NOT = { has_global_flag = reichsregiment }
		}
		allow = {
			has_global_flag = Reichsreform
			imperial_influence = 50
			NOT = { 
				had_global_flag = { 
					flag = Voting
					days = 30
				}
			}
		}
		effect = {
			set_global_flag = Voting
			add_imperial_influence = -30
			any_country = {
				limit = {
					AND = {
						hre = yes
						is_emperor = no
						num_of_cities = 1
					}
				}
				country_event = 9059
			}
			possible_province_event = 9060
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	vote_on_hofgericht = {
		potential = {
			is_emperor = yes
			NOT = { has_global_flag = Hofgericht }
		}
		allow = {
			has_global_flag = Reichsregiment
			imperial_influence = 50
			NOT = { 
				had_global_flag = { 
					flag = Voting
					days = 30
				}
			}
		}
		effect = {
			set_global_flag = Voting
			add_imperial_influence = -30
			any_country = {
				limit = {
					AND = {
						hre = yes
						is_emperor = no
						num_of_cities = 1
					}
				}
				country_event = 9061
			}
			possible_province_event = 9062
		}
		ai_will_do = {
			factor = 1
		}
	}
	vote_on_gemeinerpfennig = {
		potential = {
			is_emperor = yes
			NOT = { has_global_flag = Gemeinerpfennig }
		}
		allow = {
			has_global_flag = Hofgericht
			imperial_influence = 50
			NOT = { 
				had_global_flag = { 
					flag = Voting
					days = 30
				}
			}
		}
		effect = {
			set_global_flag = Voting
			add_imperial_influence = -30
			any_country = {
				limit = {
					AND = {
						hre = yes
						is_emperor = no
						num_of_cities = 1
					}
				}
				country_event = 9063
			}
			possible_province_event = 9064
		}
		ai_will_do = {
			factor = 1
		}
	}

	vote_on_landfriede = {
		potential = {
			is_emperor = yes
			NOT = { has_global_flag = Landfriede }
		}
		allow = {
			has_global_flag = Gemeinerpfennig
			imperial_influence = 50
			NOT = { 
				had_global_flag = { 
					flag = Voting
					days = 30
				}
			}
		}
		effect = {
			set_global_flag = Voting
			add_imperial_influence = -30
			any_country = {
				limit = {
					AND = {
						hre = yes
						is_emperor = no
						num_of_cities = 1
					}
				}
				country_event = 9065
			}
			possible_province_event = 9066
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	vote_on_erbkaisertum = {
		potential = {
			is_emperor = yes
			NOT = { has_global_flag = Erbkaisertum }
		}
		allow = {
			has_global_flag = Landfriede
			imperial_influence = 50
			NOT = { 
				had_global_flag = { 
					flag = Voting
					days = 30
				}
			}
		}
		effect = {
			set_global_flag = Voting
			add_imperial_influence = -30
			any_country = {
				limit = {
					AND = {
						hre = yes
						is_emperor = no
						num_of_cities = 1
					}
				}
				country_event = 9069
			}
			possible_province_event = 9070
		}
		ai_will_do = {
			factor = 1
		}
	}

	
	vote_on_privilegia_de_non_appelando = {
		potential = {
			is_emperor = yes
			NOT = { has_global_flag = Privileges_Revoked }
		}
		allow = {
			has_global_flag = Erbkaisertum
			imperial_influence = 50
			NOT = { 
				had_global_flag = { 
					flag = Voting
					days = 30
				}
			}
		}
		effect = {
			set_global_flag = Voting
			add_imperial_influence = -30
			any_country = {
				limit = {
					AND = {
						hre = yes
						is_emperor = no
						num_of_cities = 1
					}
				}
				country_event = 9067
			}
			possible_province_event = 9068
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	vote_on_renovatio = {
		potential = {
			is_emperor = yes
			NOT = { has_global_flag = Renovatio }
		}
		allow = {
			has_global_flag = Privileges_Revoked
			imperial_influence = 50
			NOT = { 
				had_global_flag = { 
					flag = Voting
					days = 30
				}
			}
		}
		effect = {
			set_global_flag = Voting
			add_imperial_influence = -30
			any_country = {
				limit = {
					AND = {
						hre = yes
						is_emperor = no
						num_of_cities = 1
					}
				}
				country_event = 9071
			}
			possible_province_event = 9072
		}
		ai_will_do = {
			factor = 1
		}
	}
}

