
country_decisions = {

	#institute_prussian_republic = {
	#	major = yes
	#	potential = {
	#		always = no
	#		NOT = {
	#			OR = {
	#				has_dlc = "Dharma" 
	#				has_dlc = "Emperor"
	#			}
	#		}
	#		normal_or_historical_nations = yes
	#		tag = PRU
	#		government = republic
	#		NOT = { has_reform = prussian_republic }
	#	}
	#
	#	allow = {
	#		is_revolutionary = no
	#		OR = {
	#			religion = protestant
	#			religion = reformed
	#			religion = hussite
	#			religion = anglican
	#		}
	#	}
	#
	#	effect = {
	#		add_government_reform = prussian_republic
	#	}
	#}
	#
	#institute_prussian_monarchy = {
	#	major = yes
	#	potential = {
	#		always = no
	#		NOT = {
	#			OR = {
	#				has_dlc = "Dharma" 
	#				has_dlc = "Emperor"
	#			}
	#		}
	#		normal_or_historical_nations = yes
	#		tag = PRU
	#		government = monarchy
	#		NOT = { has_reform = prussian_monarchy_legacy }
	#	}
	#
	#	allow = {
	#		is_revolutionary = no
	#		OR = {
	#			religion = protestant
	#			religion = reformed
	#			religion = hussite
	#			religion = anglican
	#		}
	#	}
	#
	#	effect = {
	#		add_government_reform = prussian_monarchy
	#	}
	#}

	form_kingdom_of_prussia = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			was_never_end_game_tag_trigger = yes
			NOT = { has_country_flag = formed_prussia_flag }
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			NOT = { has_reform = celestial_empire } 
			tag = BRA
			NOT = { tag = PRU }
			OR = {
				NOT = { exists = PRU }
				ai = no
			}
			OR = {
				ai = no
				is_religion_enabled = protestant
				is_religion_enabled = reformed
				is_religion_enabled = anglican
			}
		}
		provinces_to_highlight = {
			OR = {
				province_id = 41	# Königsberg
				AND = {
					province_id = 43	# Danzig
					ROOT = { NOT = { owns_core_province = 2995 } }
				}
				AND = {
					province_id = 2995
					ROOT = { NOT = { owns_core_province = 2995 } }
				}
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { is_core = ROOT }
			}
		}
		allow = {
			NOT = { exists = PRU }
			adm_tech = 55
			OR = {
				religion = protestant
				religion = reformed
				religion = hussite
				religion = anglican
				religion = cathar
			}
			owns_core_province = 41			# Königsberg
			OR = {
				owns_core_province = 43		# Danzig
				owns_core_province = 2995	# Stolp
			}
			is_at_war = no
		}
		effect = {
			change_tag = PRU
			on_change_tag_effect = yes
			restore_country_name_effect = yes
			swap_non_generic_missions = yes
			if = {
				limit = {
					OR = {
						NOT = { has_dlc = "Emperor" }
						NOT = { hre_size = 1 }
					}
					NOT = { government_rank = 2 }
				}
				set_government_rank = 2
			}
			if = {
				limit = {
					has_custom_ideas = no
					NOT = { has_idea_group = PRU_ideas }
				}
				country_event = { id = ideagroups.1 } #Swap Ideas
			}
			random_owned_province = {
				limit = {
					OR = {
						culture = pommeranian
						culture = saxon
						culture = prussian
					}
				}
				add_base_tax = 1
			}
			add_country_modifier = {
				name = "centralization_modifier"
				duration = 3650
			}
			if =  {
				limit = {
					NOT = {
						government = republic
					}
					is_revolutionary = no
					NOT = { government = republic }
					NOT = { government = theocracy }
					has_dlc = "Domination"
				}
				change_government = monarchy
				add_government_reform = prussian_monarchy
			}
			else_if =  {
				limit = {
					is_revolutionary = no
					NOT = { government = republic }
					NOT = { government = theocracy }
					NOT = { has_dlc = "Domination" }
				}
				change_government = monarchy
				add_government_reform = prussian_monarchy_base
			}
			else_if = {
				limit = {
					government = republic
					is_revolutionary = no
				}
				add_government_reform = prussian_republic_reform
			}
			else_if = {
				limit = {
					government = theocracy
					is_revolutionary = no
				}
				add_government_reform = prussian_theocratic_reform
			}
			if = {
				limit = {
					has_reform = states_general_reform
				}
				remove_government_reform = states_general_reform
			}
			add_prestige = 5
			change_primary_culture = prussian
			PRU = {
				random_owned_province = {
					limit = { 
						is_capital = no 
						OR = {
							culture = saxon
							culture = pommeranian
						}
					} 
					change_culture = prussian
				}
			}
			pomerelia_area = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = PRU
			}
			west_prussia_area = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = PRU
			}
			east_prussia_area = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = PRU
			}
			capital_scope = {
				change_culture = prussian
			}
			set_country_flag = formed_prussia_flag
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOT = { num_of_cities = 10 }
				NOT = { owns_core_province = 41 }
			}
		}

		ai_importance = 1000
	}
	
	prussian_nation = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			was_never_end_game_tag_trigger = yes
			NOT = { has_country_flag = formed_prussia_flag }
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			tag = TEU
			NOT = { tag = PRU }
			NOT = { has_reform = celestial_empire } 
			OR = {
				NOT = { exists = PRU }
				ai = no
			}
			OR = {
				ai = no
				is_religion_enabled = protestant
				is_religion_enabled = reformed
				is_religion_enabled = anglican
			}
			is_colonial_nation = no
			OR = {
				is_former_colonial_nation = no
				AND = {
					is_former_colonial_nation = yes
					ai = no
				}
			}
		}
		provinces_to_highlight = {
			province_id = 41	# Königsberg
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { is_core = ROOT }
			}
		}
		allow = {
			NOT = { exists = PRU }
			adm_tech = 55
			is_at_war = no
			OR = {
				religion = protestant
				religion = reformed
				religion = hussite
				religion = anglican
				religion = cathar
				if = {
					limit = { has_dlc = "Lions of the North" }
					custom_trigger_tooltip = {
						tooltip = teu_kingdom_prussia_path_ct
						has_country_flag = teu_prussian_path
					}
				}
			}
			owns_core_province = 41 # Königsberg
			41 = { 					# Königsberg
				is_state = yes
			}
		}
		effect = {
			41 = {
				move_capital_effect = yes
			}
			change_tag = PRU
			on_change_tag_effect = yes
			restore_country_name_effect = yes
			swap_non_generic_missions = yes
			pomerelia_area = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = PRU
			}
			east_prussia_area = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = PRU
			}
			west_prussia_area = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = PRU
			}
			add_prestige = 25
			hidden_effect = {
				if = {
					limit = {
						has_dlc = "Lions of the North"
						has_country_flag = teu_prussian_path
					}
					unlock_government_reform = {
						government_reform = prussian_monarchy_base
					}
					unlock_government_reform = {
						government_reform = prussian_republic_reform
					}
					unlock_government_reform = {
						government_reform = prussian_theocratic_reform
					}
				}
			}
			if =  {
				limit = {
					is_revolutionary = no
					NOT = { government = republic }
				}
				change_government = monarchy
				if = {
					limit = { 
						has_dlc = "Lions of the North"
						has_country_flag = teu_prussian_path
					}
					unlock_government_reform = {
						government_reform = prussian_monarchy_base
					}
				}
				add_government_reform = prussian_monarchy_base
			}
			else_if = {
				limit = {
					government = republic
					is_revolutionary = no
				}
				if = {
					limit = { 
						has_dlc = "Lions of the North"
						has_country_flag = teu_prussian_path
					}
					unlock_government_reform = {
						government_reform = prussian_republic_reform
					}
				}
				add_government_reform = prussian_republic_reform
			}
			if = {
				limit = {
					has_reform = states_general_reform
				}
				remove_government_reform = states_general_reform
			}
			every_neighbor_country = {
				limit = { government = monarchy }
				add_opinion = { who = ROOT modifier = secularized_monastic_order }
			}
			if = {
				limit = {
					has_custom_ideas = no
					NOT = { has_idea_group = PRU_ideas }
				}
				country_event = { id = ideagroups.1 } #Swap Ideas
			}
			add_country_modifier = {
				name = "centralization_modifier"
				duration = 3650
			}
			if = {
				limit = {
					OR = {
						is_part_of_hre = no
						is_elector = yes
					}
					is_free_or_tributary_trigger = yes
					NOT = { government_rank = 2 }
				}
				set_government_rank = 2
			}
			set_country_flag = formed_prussia_flag
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOT = { num_of_cities = 10 }
				NOT = { owns_core_province = 41 }
			}
		}

		ai_importance = 1000
	}
	
	prussian_nation_general = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			was_never_end_game_tag_trigger = yes
			NOT = { has_country_flag = formed_prussia_flag }
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			OR = {
				ai = no
				is_religion_enabled = protestant
				is_religion_enabled = reformed
				is_religion_enabled = anglican
			}
			OR = {
				primary_culture = pommeranian
				primary_culture = saxon
				primary_culture = prussian
			}
			NOT = { tag = PRU }
			OR = {
				NOT = { exists = PRU }
				ai = no
			}
			NOT = { tag = GER }
			NOT = { tag = HLR }
			NOT = { tag = BRA }
			NOT = { has_reform = celestial_empire } 
			NOT = {
				tag = TEU
				government = theocracy
			}
		}
		provinces_to_highlight = {
			OR = {
				province_id = 41	# Königsberg
				AND = {
					OR = {
						area = west_prussia_area
						area = east_prussia_area
					}
					ROOT = {
						NOT = {
							num_of_owned_provinces_with = {
								value = 5
								OR = {
									area = west_prussia_area
									area = east_prussia_area
								}
							}
						}
					}
				}
			}
			OR = {
				NOT = { owned_by = ROOT }
				NOT = { is_core = ROOT }
			}
		}
		allow = {
			NOT = { exists = PRU }
			adm_tech = 55
			is_free_or_tributary_trigger = yes
			is_nomad = no
			is_at_war = no
			OR = {
				religion = protestant
				religion = reformed
				religion = hussite
				religion = anglican
				religion = cathar
			}
			owns_core_province = 41			# Königsberg
			owns_core_province = 42			# Warmia
			owns_core_province = 43			# Danzig
		}
		effect = {
			change_tag = PRU
			on_change_tag_effect = yes
			restore_country_name_effect = yes
			swap_non_generic_missions = yes
			if = {
				limit = {
					OR = {
						NOT = { has_dlc = "Emperor" }
						NOT = { hre_size = 1 }
					}
					NOT = { government_rank = 2 }
				}
				set_government_rank = 2
			}
			east_prussia_area = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = PRU
			}
			pomerelia_area = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = PRU
			}
			west_prussia_area = {
				limit = {
					NOT = { owned_by = ROOT }
				}
				add_permanent_claim = PRU
			}
			if =  {
				limit = {
					is_revolutionary = no
					NOT = { government = republic }
					NOT = { government = theocracy }
					has_dlc = "Domination"
				}
				change_government = monarchy
				add_government_reform = prussian_monarchy
			}
			else_if =  {
				limit = {
					is_revolutionary = no
					NOT = { government = republic }
					NOT = { government = theocracy }
					NOT = { has_dlc = "Domination" }
				}
				change_government = monarchy
				add_government_reform = prussian_monarchy_base
			}
			else_if = {
				limit = {
					government = republic
					is_revolutionary = no
				}
				add_government_reform = prussian_republic_reform
			}
			else_if = {
				limit = {
					government = theocracy
					is_revolutionary = no
				}
				add_government_reform = prussian_theocratic_reform
			}
			if = {
				limit = {
					has_reform = states_general_reform
				}
				remove_government_reform = states_general_reform
			}
			add_prestige = 25
			change_primary_culture = prussian
			capital_scope = {
				change_culture = prussian
			}
			random_owned_province = {
				limit = { 
					is_capital = no 
					OR = {
						culture = saxon
						culture = pommeranian
					}
				} 
				change_culture = prussian
			}
			if = {
				limit = {
					has_custom_ideas = no
					NOT = { has_idea_group = PRU_ideas }
				}
				country_event = { id = ideagroups.1 } #Swap Ideas
			}
			add_country_modifier = {
				name = "centralization_modifier"
				duration = 3650
			}
			set_country_flag = formed_prussia_flag
		}
		ai_will_do = {
			factor = 10
			modifier = {
				factor = 0
				NOT = { is_religion_enabled = protestant }
			}
			modifier = {
				factor = 0
				NOT = { num_of_cities = 10 }
			}
			modifier = {
				factor = 0.1
				any_ally = {
					OR = {
						owns = 41
						owns = 42
						owns = 43
					}
				}
			}
		}

		ai_importance = 100
	}
}
