﻿#
#### Find a New Faith for Persia ###
#adopt_a_new_faith_for_persia_decision = {
#	ai_check_interval_by_tier = {
#		barony = 0
#		county = 36
#		duchy = 12
#		kingdom = 12
#		empire = 12
#		hegemony = 12
#	}
#	picture = {
#		reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_foundation.dds"
#	}
#	sort_order = -20
#	decision_group_type = major
#	
#	cooldown = { years = 30 }
#
#	is_shown = {
#		any_character_struggle = { is_struggle_type = persian_struggle }
#		is_landed = yes
#		has_trait = fp3_struggle_detractor
#	}
#	
#	is_valid_showing_failures_only = {
#		faith.religion = religion:islam_religion
#	}
#
#	is_valid = {
#		
#	}
#	
#	widget = {
#		gui = "decision_view_widget_generic_multichoice_with_effects"
#		controller = decision_option_list_controller
#		decision_to_second_step_button = "CHOOSE_PERSIAN_FAITH"
#		show_from_start = yes
#		
#		### imami
#		item = {
#			value = choose_imami
#			is_valid = {
#				NOT = { faith = faith:imami }
#			}
#			current_description = choose_imami_desc
#			localization = choose_imami_name
#			icon = "gfx/interface/icons/faith/imami.dds"
#			ai_chance = {
#				value = 0
#				if = {
#					limit = {
#						highest_held_title_tier >= tier_kingdom
#						ai_boldness >= 25
#					}
#					add = 20
#				}
#				if = {
#					limit = {
#						any_sub_realm_county = {
#							faith = faith:imami
#						}
#					}
#					add = 10
#				}
#				if = {
#					limit = {
#						exists = title:d_sunni.holder
#						opinion = {
#							target = title:d_sunni.holder
#							value < -20
#						}
#					}
#					add = 20
#				}
#				if = {
#					limit = {
#						any_independent_ruler = {
#							any_character_struggle = { is_struggle_type = persian_struggle }
#							faith = faith:imami
#						}
#					}
#					multiply = 4
#				}
#			}
#		}
#		### alevi
#		item = {
#			value = choose_alevi
#			is_valid = {
#				NOT = { faith = faith:alevi }
#			}
#			current_description = choose_alevi_desc
#			localization = choose_alevi_name
#			icon = "gfx/interface/icons/faith/alevi.dds"
#			ai_chance = {
#				value = 0
#				if = {
#					limit = {
#						any_sub_realm_county = {
#							faith = faith:alevi
#						}
#					}
#					add = 10
#				}
#				if = {
#					limit = {
#						exists = title:d_sunni.holder
#						opinion = {
#							target = title:d_sunni.holder
#							value < -20
#						}
#						culture = { has_cultural_pillar = heritage_turkic }
#					}
#					add = 50
#				}
#				if = {
#					limit = {
#						any_independent_ruler = {
#							any_character_struggle = { is_struggle_type = persian_struggle }
#							faith = faith:alevi
#						}
#						culture = { has_cultural_pillar = heritage_turkic }
#					}
#					multiply = 4
#				}
#			}
#		}
#		### nizari
#		item = {
#			value = choose_nizari
#			is_valid = {
#				NOT = { faith = faith:nizari }
#			}
#			current_description = choose_nizari_desc
#			localization = choose_nizari_name
#			icon = "gfx/interface/icons/faith/nizari.dds"
#			ai_chance = {
#				value = 0
#				if = {
#					limit = {
#						any_sub_realm_county = {
#							faith = faith:nizari
#						}
#					}
#					add = 10
#				}
#				if = {
#					limit = {
#						highest_held_title_tier >= tier_kingdom
#						ai_boldness >= 25
#					}
#					add = 10
#				}
#				if = {
#					limit = {
#						exists = title:d_sunni.holder
#						opinion = {
#							target = title:d_sunni.holder
#							value < -20
#						}
#					}
#					add = 20
#				}
#				if = {
#					limit = {
#						any_independent_ruler = {
#							any_character_struggle = { is_struggle_type = persian_struggle }
#							faith = faith:nizari
#						}
#					}
#					multiply = 4
#				}
#			}
#		}
#		### zayidi
#		item = {
#			value = choose_zayidi
#			is_valid = {
#				NOT = { faith = faith:zayidi }
#			}
#			current_description = choose_zayidi_desc
#			localization = choose_zayidi_name
#			icon = "gfx/interface/icons/faith/zayidi.dds"
#			ai_chance = {
#				value = 0
#				if = {
#					limit = {
#						any_sub_realm_county = {
#							faith = faith:zayidi
#						}
#					}
#					add = 10
#				}
#				if = {
#					limit = {
#						any_independent_ruler = {
#							any_character_struggle = { is_struggle_type = persian_struggle }
#							faith = faith:zayidi
#							piety_level >= 3
#						}
#					}
#					add = 100
#				}
#				if = {
#					limit = {
#						OR = {
#							culture = culture:daylamite
#							culture = { any_parent_culture_or_above = { this = culture:daylamite } }
#						}
#					}
#					add = 50
#				}
#				if = {
#					limit = {
#						any_independent_ruler = {
#							any_character_struggle = { is_struggle_type = persian_struggle }
#							faith = faith:zayidi
#							root = {
#								opinion = {
#									target = prev
#									value >= 20
#								}
#							}
#						}
#					}
#					add = 20
#				}
#			}
#		}
#
#		### Maturidi
#		item = {
#			value = choose_maturidi
#			is_valid = {
#				NOT = { faith = faith:maturidi }
#			}
#			current_description = choose_maturidi_desc
#			localization = choose_maturidi_name
#			icon = "gfx/interface/icons/faith/maturidi.dds"
#			ai_chance = {
#				value = 0
#				if = {
#					limit = {
#						any_sub_realm_county = {
#							count >= 4
#							faith = faith:maturidi
#						}
#					}
#					add = 5
#				}
#				if = {
#					limit = {
#						exists = title:d_sunni.holder
#						opinion = {
#							target = title:d_sunni.holder
#							value >= -20
#						}
#					}
#					add = 10
#				}
#				if = {
#					limit = {
#						any_independent_ruler = {
#							any_character_struggle = { is_struggle_type = persian_struggle }
#							faith = faith:maturidi
#						}
#					}
#					multiply = 2
#				}
#				if = {
#					limit = {
#						title:d_sunni.holder.faith ?= faith:maturidi
#					}
#					multiply = 0
#				}
#			}
#		}
#		### Mutazili
#		item = {
#			value = choose_mutazila
#			is_valid = {
#				NOT = { faith = faith:mutazila }
#			}
#			current_description = choose_mutazila_desc
#			localization = choose_mutazila_name
#			icon = "gfx/interface/icons/faith/mutazila.dds"
#			ai_chance = {
#				value = 0
#				if = {
#					limit = {
#						any_sub_realm_county = {
#							count >= 4
#							faith = faith:mutazila
#						}
#					}
#					add = 5
#				}
#				if = {
#					limit = {
#						exists = title:d_sunni.holder
#						opinion = {
#							target = title:d_sunni.holder
#							value >= -20
#						}
#					}
#					add = 10
#				}
#				if = {
#					limit = {
#						any_independent_ruler = {
#							any_character_struggle = { is_struggle_type = persian_struggle }
#							faith = faith:mutazila
#						}
#					}
#					multiply = 2
#				}
#				if = {
#					limit = {
#						title:d_sunni.holder.faith ?= faith:mutazila
#					}
#					multiply = 0
#				}
#			}
#		}
#		### azariqa
#		item = {
#			value = choose_azariqa
#			is_valid = {
#				NOT = { faith = faith:azariqa }
#			}
#			current_description = choose_azariqa_desc
#			localization = choose_azariqa_name
#			icon = "gfx/interface/icons/faith/azariqa.dds"
#			ai_chance = {
#				value = 0
#				if = { # If the Azariqa revolt is successful, then Azariqa will start to dominate!
#					limit = {
#						exists = faith:azariqa.religious_head
#					}
#					add = 100
#				}
#				if = { # Or if someone _truly_ fits the bill...
#					limit = {
#						ai_zeal >= 50
#						ai_boldness >= 75
#						OR = {
#							has_trait = vengeful
#							has_trait = peasant_leader
#						}
#					}
#					add = 10
#				}
#			}
#		}
#		### zurvanism (behafaridism)
#		item = {
#			value = choose_zurvanism
#			is_valid = {
#				NOT = { faith = faith:zurvanism }
#				has_trait = eccentric
#			}
#			current_description = choose_zurvanism_desc
#			localization = choose_zurvanism_name
#			icon = "gfx/interface/icons/faith/zurvanism.dds"
#			ai_chance = {
#				value = 100
#			}
#		}
#	}
#
#	effect = {
#		if = {
#			limit = { scope:choose_maturidi = yes }
#			
#			if = {
#				limit = {
#					capital_county.faith = faith
#				}
#				capital_county = { set_county_faith = faith:maturidi }
#			}
#			show_as_tooltip = { set_character_faith = faith:maturidi }
#			hidden_effect = {
#				set_character_faith_with_conversion = faith:maturidi
#			}
#			faith:maturidi = {
#				change_fervor = {
#					value = 15
#					desc = fervor_gain_persian_fervor
#				}
#			}
#		}
#		else_if = {
#			limit = { scope:choose_mutazila = yes  }
#			
#			if = {
#				limit = {
#					capital_county.faith = faith
#				}
#				capital_county = { set_county_faith = faith:mutazila }
#			}
#			show_as_tooltip = { set_character_faith = faith:mutazila }
#			hidden_effect = {
#				set_character_faith_with_conversion = faith:mutazila
#			}
#			faith:mutazila = {
#				change_fervor = {
#					value = 15
#					desc = fervor_gain_persian_fervor
#				}
#			}
#		}
#		else_if = {
#			limit = { scope:choose_imami = yes  }
#			
#			if = {
#				limit = {
#					capital_county.faith = faith
#				}
#				capital_county = { set_county_faith = faith:imami }
#			}
#			show_as_tooltip = { set_character_faith = faith:imami }
#			hidden_effect = {
#				set_character_faith_with_conversion = faith:imami
#			}
#			faith:imami = {
#				change_fervor = {
#					value = 15
#					desc = fervor_gain_persian_fervor
#				}
#			}
#		}
#		else_if = {
#			limit = { scope:choose_alevi = yes  }
#			
#			if = {
#				limit = {
#					capital_county.faith = faith
#				}
#				capital_county = { set_county_faith = faith:alevi }
#			}
#			show_as_tooltip = { set_character_faith = faith:alevi }
#			hidden_effect = {
#				set_character_faith_with_conversion = faith:alevi
#			}
#			faith:alevi = {
#				change_fervor = {
#					value = 15
#					desc = fervor_gain_persian_fervor
#				}
#			}
#		}
#		else_if = {
#			limit = { scope:choose_nizari = yes  }
#			
#			if = {
#				limit = {
#					capital_county.faith = faith
#				}
#				capital_county = { set_county_faith = faith:nizari }
#			}
#			show_as_tooltip = { set_character_faith = faith:nizari }
#			hidden_effect = {
#				set_character_faith_with_conversion = faith:nizari
#			}
#			faith:nizari = {
#				change_fervor = {
#					value = 15
#					desc = fervor_gain_persian_fervor
#				}
#			}
#		}
#		else_if = {
#			limit = { scope:choose_zayidi = yes  }
#			
#			if = {
#				limit = {
#					capital_county.faith = faith
#				}
#				capital_county = { set_county_faith = faith:zayidi }
#			}
#			show_as_tooltip = { set_character_faith = faith:zayidi }
#			hidden_effect = {
#				set_character_faith_with_conversion = faith:zayidi
#			}
#			faith:zayidi = {
#				change_fervor = {
#					value = 15
#					desc = fervor_gain_persian_fervor
#				}
#			}
#		}
#		else_if = {
#			limit = { scope:choose_azariqa = yes  }
#			
#			if = {
#				limit = {
#					capital_county.faith = faith
#				}
#				capital_county = { set_county_faith = faith:azariqa }
#			}
#			show_as_tooltip = { set_character_faith = faith:azariqa }
#			hidden_effect = {
#				set_character_faith_with_conversion = faith:azariqa
#			}
#			faith:azariqa = {
#				change_fervor = {
#					value = 15
#					desc = fervor_gain_persian_fervor
#				}
#			}
#		}
#		else_if = {
#			limit = { scope:choose_zurvanism = yes  }
#			
#			if = {
#				limit = {
#					capital_county.faith = faith
#				}
#				capital_county = { set_county_faith = faith:zurvanism }
#			}
#			show_as_tooltip = { set_character_faith = faith:zurvanism }
#			hidden_effect = {
#				set_character_faith_with_conversion = faith:zurvanism
#			}
#			faith:zurvanism = {
#				change_fervor = {
#					value = 15
#					desc = fervor_gain_persian_fervor
#				}
#			}
#		}
#		capital_county = {
#			add_county_modifier = {
#				modifier = religious_settler_influx
#				years = 25
#			}
#		}
#		if = {
#			limit = {
#				any_character_struggle = {
#					involvement = involved
#					phase_has_catalyst = catalyst_ruler_chooses_persian_faith
#				}
#			}
#			every_character_struggle = {
#				involvement = involved
#				limit = {
#					phase_has_catalyst = catalyst_ruler_chooses_persian_faith
#				}
#				activate_struggle_catalyst = {
#					catalyst = catalyst_ruler_chooses_persian_faith
#					character = root
#				}
#			}
#		}
#	}
#	
#	cost = {
#		piety = {
#			value = major_piety_value
#		}
#	}
#	
#	ai_potential = {
#		highest_held_title_tier >= tier_county
#		title:d_sunni.holder.faith ?= faith
#		is_landed = yes
#		is_at_war = no
#	}
#
#	ai_will_do = {
#		base = 20
#		
#		modifier = {
#			add = {
#				value = ai_zeal
#				multiply = -0.5
#			}
#		}
#		
#		modifier = {
#			add = -20
#			has_trait = craven
#		}
#		
#		modifier = {
#			add = 20
#			has_trait = ambitious
#		}
#		
#		modifier = {
#			add = -20
#			NOT = {
#				any_character_struggle = {
#					involvement = involved
#					phase_has_catalyst = catalyst_ruler_chooses_persian_faith
#				}
#			}
#		}
#		
#		modifier = {
#			add = 20
#			any_character_struggle = {
#				involvement = involved
#				phase_has_catalyst = catalyst_ruler_chooses_persian_faith
#			}
#		}
#		
#		modifier = {
#			add = 40
#			top_liege = this
#			any_character_struggle = {
#				involvement = involved
#				phase_has_catalyst = catalyst_ruler_chooses_persian_faith
#			}
#		}
#	}
#}
#