country_decisions = {
	make_constantinople_capital = {
		potential = {
			OR = {
				tag = TUR
				tag = RUM
			}
			owns = 151
			NOT = { capital = 151 }
			NOT = { has_country_flag = relocated_capital_constantinople }
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
		}
		allow = {
			is_at_war = no
			OR = {
				primary_culture = turkish
				primary_culture = oghuz_culture # Religions & Cultures Expanded
			}
			religion_group = muslim
			controls = 151
			owns = 149		# Edirne
			owns = 316		# Bithnyia
			owns = 317		# Bursa
			owns = 1764		# Burgas
			151 = {
				is_state = yes
			}
		}
		effect = {
			set_country_flag = relocated_capital_constantinople
			set_global_flag = greek_need_restore_constantinople
			add_stability = 1
			add_core = 151
			151 = {
				move_capital_effect = yes
				change_culture = ROOT # Religions & Cultures Expanded
				change_religion = ROOT
				rename_capital = Kostantiniyye
			}
			if = {
				limit = {
					NOT = { has_global_flag = constantinople_restored }
				}
				151 = {
					add_base_tax = 4
					add_base_production = 4
					add_base_manpower = 3
				}
				set_global_flag = constantinople_restored
			}
			set_government_rank = 3
		}
		ai_will_do = {
			factor = 1
		}
		do_not_core = 151 # Constantinople
	}

	#provincial_system = {
	#	potential = {
	#		tag = TUR
	#		NOT = { has_country_modifier = the_provincial_system }
	#		normal_or_historical_nations = yes
	#		OR = {
	#			ai = no
	#			is_playing_custom_nation = no
	#		}
	#	}
	#	allow = {
	#		adm_tech = 5
	#		ADM = 4
	#		adm_power = 50
	#	}
	#	effect = {
	#		add_country_modifier = {
	#			name = "the_provincial_system"
	#			duration = -1
	#		}
	#		add_adm_power = -50
	#		set_country_flag = the_provincial_system
	#	}
	#	ai_will_do = {
	#		factor = 1
	#		modifier = {
	#			factor = 0
	#			NOT = { mil_power = 100 }
	#		}
	#	}
	#}

	devshirme_system = {
		potential = {
			NOT = { has_dlc = "Domination" }
			OR = {
				has_reform = ottoman_government
				has_reform = sultanate_of_rum_reform
			}
			NOT = { has_disaster = janissary_decadence }
			NOT = { has_country_modifier = the_devshirme_system }
			NOT = { has_country_flag = lapse_of_devshirme }
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
		}
		allow = {
			mil_power = 100
		}
		effect = {
			add_mil_power = -100
			add_country_modifier = {
				name = "the_devshirme_system"
				duration = -1
			}
			if = {
				limit = {
					NOT = { has_dlc = "Cradle of Civilization" }
				}
				custom_tooltip = janissary_event_tooltip_devs
				hidden_effect = {
					country_event = { id = flavor_tur.100 days = 4380 }
				}
			}
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOT = { mil_power = 200 }
			}
		}
	}

	restore_devshirme_system = {
		potential = {
			has_dlc = "Domination"
			has_country_flag = lapse_of_devshirme
			has_reform = ottoman_government
			NOT = { has_disaster = janissary_decadence }
			NOT = { has_disaster = tur_disaster_janissary_coup }
			NOT = { has_reform = devshirme_system_reform }
			NOT = { has_country_flag = tur_abolished_devshirme_for_good }
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
		}
		allow = {
			NOT = { has_estate_privilege = estate_janissary_janissaries_from_muslims }
			if = {
				limit = { has_estate = estate_janissaries }
				NOT = {
					estate_influence = {
						estate = estate_janissaries
						influence = 50
					}
				}
				estate_loyalty = {
					estate = estate_janissaries
					loyalty = 60
				}
			}
			mil_power_cost = 300
			stability = 1
		}
		effect = {
			mil_power_cost = 300
			add_stability = -1
			clr_country_flag = lapse_of_devshirme
			add_government_reform = devshirme_system_reform
		}
		ai_will_do = {
			factor = 1
		}
	}

	disband_the_janissaries = {
		major = yes
		potential = {
			has_disaster = janissary_decadence
			normal_or_historical_nations = yes
		}
		allow = {
			has_disaster = janissary_decadence
			if = {
				limit = { has_dlc = "Cradle of Civilization" }
				OR = {
					NOT = { janissary_percentage = 0.05 }
					NOT = { num_of_janissaries = 3 }
				}
			}
		}
		effect = {
			if = {
				limit = {
					has_country_modifier = tur_janissary
				}
				remove_country_modifier = tur_janissary
			}
			else = {
				set_country_flag = yoklama
				custom_tooltip = yoklama_effect_tooltip
			}
			end_disaster = janissary_decadence
			country_event = { id = janissary_decadence.100 }
		}
		ai_will_do = {
			factor = 1
		}
	}

	second_islamic_golden_era_descision = {
		potential = {
			has_country_flag = tur_enable_second_golden_era_decision
			religion_group = muslim
		}
		allow = {
			OR = {
				in_golden_age = yes
				has_had_golden_age = yes
			}
		}
		effect = {
			if = {
				limit = {
					in_golden_age = no
				}
				reset_golden_age = yes
			}
			else = {
				extend_golden_age = 600
			}
			clr_country_flag = tur_enable_second_golden_era_decision
		}
		ai_will_do = {
			factor = 1
		}
	}

	face_the_janissaries_1 = {
		potential = {
			has_country_flag = tur_unlocked_first_janissary_slaughter
			has_disaster = tur_disaster_janissary_coup
			NOT = { has_country_flag = tur_fight_against_the_janissaries_1_flag }
		}
		allow = {
			stability = 0
			num_of_owned_provinces_with = {
				region = balkan_region
				value = 10
			}
		}
		effect = {
			hidden_effect = { change_variable = { tur_num_of_janissary_decisions = 1 } }
			country_event = {
				id = janissary_coup_events.3
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	face_the_janissaries_2 = {
		potential = {
			has_country_flag = tur_unlocked_second_janissary_slaughter
			has_disaster = tur_disaster_janissary_coup
			NOT = { has_country_flag = tur_fight_against_the_janissaries_2_flag }
		}
		allow = {
			stability = 0
			num_of_owned_provinces_with = {
				region = anatolia_region
				value = 10
			}
		}
		effect = {
			hidden_effect = { change_variable = { tur_num_of_janissary_decisions = 1 } }
			country_event = {
				id = janissary_coup_events.4
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	face_the_janissaries_3 = {
		potential = {
			has_country_flag = tur_unlocked_third_janissary_slaughter
			has_disaster = tur_disaster_janissary_coup
			NOT = { has_country_flag = tur_fight_against_the_janissaries_3_flag }
		}
		allow = {
			stability = 0
			capital_scope = {
				controlled_by = ROOT
			}
		}
		effect = {
			hidden_effect = { change_variable = { tur_num_of_janissary_decisions = 1 } }
			country_event = {
				id = janissary_coup_events.5
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	negotiate_with_the_janissaries = {
		potential = {
			has_country_flag = tur_unlocked_janissary_negotiations
			has_disaster = tur_disaster_janissary_coup
			OR = {
				has_estate_privilege = estate_janissary_self_appointed_aghas
				has_estate_privilege = estate_janissary_hereditary_ranks
				has_estate_privilege = estate_janissary_allow_other_professions
				has_estate_privilege = estate_janissary_allow_marriages
				has_estate_privilege = estate_janissary_toprak_payment
				has_estate_privilege = estate_janissary_janissary_officers
				has_estate_privilege = estate_janissary_guarantee_privileges
				has_estate_privilege = estate_janissary_janissaries_from_muslims
				has_estate_privilege = estate_janissary_coup_detat
				has_estate_privilege = estate_janissary_military_reactionaries
				has_estate_privilege = estate_janissary_puppet_sultan
			}
		}
		allow = {
			adm_power_cost = 100
			dip_power_cost = 100
			mil_power_cost = 100
			stability = 0
		}
		effect = {
			adm_power_cost = 100
			dip_power_cost = 100
			mil_power_cost = 100
			add_stability = -3
			country_event = {
				id = janissary_coup_events.12
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
}
