﻿# reclaim capital
ottoman_set_capital_constantinople_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds"
	}

	desc = ottoman_set_capital_constantinople_decision_desc
	selection_tooltip = ottoman_set_capital_constantinople_decision_tooltip
	decision_group_type = major

	ai_check_interval = 12

	is_shown = {
		is_ruler = yes
		is_landed = yes
		exists = dynasty
		exists = title:e_ottoman
		has_title = title:e_ottoman
		NOT = { capital_county = { this = title:c_byzantion } }
		OR = {
			title:c_byzantion.holder = { 	
				any_liege_or_above = { this = root }
			}
			title:c_byzantion.holder = { this = root }
		}
	}

	is_valid_showing_failures_only = {
		NOT = { has_trait = incapable }
		is_imprisoned = no
		is_independent_ruler = yes
	}

	effect = {
		if = { #Usurp if not held personally.
			limit = {
				NOT = { title:c_byzantion.holder = { this = root } }
			}
			title:c_byzantion.holder = { save_scope_as = target_for_denunciation }
			create_title_and_vassal_change = {
				type = returned
				save_scope_as = change
				add_claim_on_loss = no
			}
			title:c_byzantion = {
				change_title_holder = {
					holder = root
					change = scope:change
				}
			}
			resolve_title_and_vassal_change = scope:change

		}
		set_realm_capital = title:c_byzantion
		if = {
			limit = {
				exists = scope:target_for_denunciation
			}
			scope:target_for_denunciation = {
				trigger_event = {
					id = ottoman_invasion.1201
				}
			}
		}
	}

	ai_potential = {
		primary_title.tier = tier_empire
		has_primary_title = title:e_ottoman
	}

	ai_will_do = { #Do it always, for coherence.
		base = 100
		modifier = {
			title:c_byzantion.holder = {
				is_ai = no
				any_realm_county = {
					count < 2
					holder = title:c_byzantion.holder
				}
			}
			factor = 0
		}
	}
}

ottoman_renovate_constantinople_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_golden_age.dds"
	}

	desc = ottoman_renovate_constantinople_decision_desc
	selection_tooltip = ottoman_renovate_constantinople_decision_tooltip
	decision_group_type = major

	ai_check_interval = 36

	is_shown = {
		is_ruler = yes
		is_landed = yes
		exists = dynasty
		exists = title:e_ottoman
		has_title = title:e_ottoman
		NOT = {	# only once
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:ottoman_renovate_constantinople_decision
			}
		}
	}

	is_valid = {
		has_primary_title = title:e_ottoman
		custom_tooltip = {
			text = you_or_vassal_constantinople
			OR = {
				title:c_byzantion.holder = { any_liege_or_above = { this = root } }
				title:c_byzantion.holder = { this = root }
			}
		}
	}

	is_valid_showing_failures_only = {
		NOT = { has_trait = incapable }
		is_imprisoned = no
		is_independent_ruler = yes
	}

	effect = {
		# only once
		add_to_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:ottoman_renovate_constantinople_decision
		}

		# reward
		title:c_byzantion = {
			add_county_modifier = {
				modifier = historicinvasions_county_tier_two_modifier
				years = 150
			}
			set_county_culture = root.culture
			set_county_faith = root.faith
		}
	}

	ai_potential = {
		primary_title.tier = tier_empire
		has_primary_title = title:e_ottoman
	}

	ai_will_do = { base = 100 }
}