convert_to_local_culture_decision = {
	picture = "gfx/interface/illustrations/decisions/convert_to_local_cultur.dds"

	desc = convert_to_local_culture_decision_desc
	selection_tooltip = convert_to_local_culture_decision_tooltip

	is_shown = {
		is_landed = yes
		primary_title.tier > tier_barony
		NOT = { culture = capital_province.culture }
		NAND = {
			is_ai = yes
			OR = {
				has_character_flag = converted_culture_this_lifetime
				has_character_flag = converted_culture_this_lifetime_ai
			}
		}
	}

	is_valid_showing_failures_only = {
		is_available_adult = yes
		is_at_war = no
		custom_description = {
			text = can_only_change_culture_once
			NOT = { has_character_flag = converted_culture_this_lifetime }
		}
	}

	cost = {
		prestige = convert_to_local_culture_base_cost
	}

	effect = {
		convert_family_culture_and_notify_vassals_effect = {
			CONVERTER = root
			OLD_CULTURE = root.culture
			NEW_CULTURE = capital_province.culture
		}
	}
	
	ai_check_interval = 60

	ai_potential = {
		is_landed = yes
		NOT = { culture = capital_province.culture }
	}

	ai_will_do = {
		base = 3
		
		modifier = { # If your liege is the same culture as your capital, better get on with it! This should combat scattered wrong-culture Counts and such.
			add = 77
			capital_province.culture = liege.culture
		}
		
		modifier = { # Motivate vassals to assimilate if they are different culture from their liege. If they can't curry their liege's favor, better get the peasants on your side at least...
			add = 27
			NOR = {
				culture = capital_province.culture
				culture = liege.culture
			}
		}

		# Reduced chance for every vassal who has your old culture
		modifier = {
			factor = {
				value = 1
				every_vassal = {
					limit = {
						OR = {
							highest_held_title_tier = tier_kingdom
							highest_held_title_tier = tier_duchy
							AND = {
								root = {
									highest_held_title_tier = tier_duchy
								}
								primary_title.tier = tier_county
							}
						}
						culture = root.culture
					}
					add = -0.3
				}
			}
		}
		
		modifier = { # If you're the same culture as your liege, and your Capital is in a Duchy with your culture in it, never convert
			factor = 0
			exists = liege
			culture = liege.culture
			capital_province.duchy = {
				any_in_de_jure_hierarchy = {
					tier = tier_county
					any_county_province = {
						culture = root.culture
					}
				}
			}
		}
		
		modifier = { # If your capital borders a province with the correct culture, do not convert
			factor = 0
			exists = liege
			culture = liege.culture
			capital_province.county = {
				any_neighboring_county = {
					any_county_province = {
						culture = root.culture
					}
				}
			}
		}
		
		modifier = { # If your liege is your parent, do not convert
			factor = 0
			exists = liege
			culture = liege.culture
			OR = {
				liege = root.mother
				liege = root.father
			}
		}
		
		# Some cultures should not assimilate to certain others
		modifier = {
			factor = 0
			has_culture = culture:andalusian
			capital_province.culture_group = culture_group:iberian_group
		}
		modifier = {
			factor = 0
			has_culture_group = culture_group:iberian_group
			capital_province.culture = culture:andalusian
		}

		# Don't overwrite historically scripted developments
		modifier = {
			factor = 0
			OR = {
				has_culture = culture:norman
				has_culture = culture:english
			}
			capital_province.culture = culture:anglo_saxon
		}
		modifier = {
			factor = 0
			has_culture = culture:turkish
			capital_province.culture_group = culture_group:byzantine_group
		}
		modifier = {
			factor = 0
			has_culture = culture:turkish
			primary_title.tier >= tier_empire
		}
		modifier = {
			factor = 0
			OR = {
				has_title = title:k_jerusalem
				has_title = title:e_outremer
				any_liege_or_above = {
					OR = {
						has_title = title:k_jerusalem
						has_title = title:e_outremer
					}
				}
			}
		}
		modifier = {
			factor = 0
			has_title = title:e_latin_empire
		}

		# Scots needs a bit of help to dominate as it did historically
		modifier = {
			factor = 0
			has_culture = culture:scottish
			capital_province.culture = culture:gaelic
		}

		# Pictish should usually disappear
		modifier = {
			factor = 0
			has_culture = culture:gaelic
			capital_province.culture = culture:pictish
		}
		
		# Don't go back on a previous conversion
		modifier = {
			factor = 0
			has_character_flag = converted_culture_this_lifetime
		}
	}
}

