﻿# Holy Conquest - Sanctify and Exile Holy Sites 1.1.0
# Prefix: hcq. Every key and file of this mod starts with hcq / zz_hcq_.
# Both decisions are for players. AI rulers use a yearly pulse instead
# (see zz_hcq_on_actions.txt and the "AI" game rule).

###########################
# SANCTIFY A HOLY SITE    #
###########################
hcq_sanctify_holy_site_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/pam_decision_mentor_sp.dds"
	}
	decision_group_type = religious
	sort_order = 95
	ai_check_interval = 0

	desc = hcq_sanctify_holy_site_decision_desc
	selection_tooltip = hcq_sanctify_holy_site_decision_tooltip

	cooldown = { years = hcq_decision_cooldown_years }

	is_shown = {
		is_ai = no
		is_landed = yes
		exists = faith
	}

	is_valid_showing_failures_only = {
		is_imprisoned = no
		exists = scope:selected_item
	}

	is_valid = {
		exists = scope:selected_item
		hcq_can_sanctify_site_trigger = { SITE = scope:selected_item }
	}

	cost = {
		piety = hcq_sanctify_piety_cost
	}

	widget = {
		gui = "decision_view_widget_select_holy_site"
		controller = select_scope_object
		show_from_start = yes
		decision_to_second_step_button = "hcq_select_holy_site"

		setup_items = {
			scope:actor = {
				every_realm_county = {
					every_county_holy_site = {
						limit = {
							scope:actor.faith = { NOT = { is_faith_holy_site = prev } }
						}
						add_to_list = item_list
					}
				}
			}
		}

		is_item_valid = {
			scope:actor.faith = { NOT = { is_faith_holy_site = root } }
			holy_site_county.holder = { faith = scope:actor.faith }
		}

		ai_item_will_do = { value = 0 }
	}

	effect = {
		custom_tooltip = hcq_sanctify_holy_site_decision_effect_tt
		hcq_sanctify_site_effect = { SITE = scope:selected_item }
	}

	ai_potential = { always = no }
	ai_will_do = { base = 0 }
}

###########################
# EXILE RIVAL FAITHS      #
###########################
hcq_exile_rival_faiths_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/pam_decision_demote_holy_site.dds"
	}
	decision_group_type = religious
	sort_order = 94
	ai_check_interval = 0

	desc = hcq_exile_rival_faiths_decision_desc
	selection_tooltip = hcq_exile_rival_faiths_decision_tooltip

	cooldown = { years = hcq_decision_cooldown_years }

	is_shown = {
		is_ai = no
		is_landed = yes
		exists = faith
	}

	is_valid_showing_failures_only = {
		is_imprisoned = no
		exists = scope:selected_item
	}

	is_valid = {
		exists = scope:selected_item
		hcq_can_exile_site_trigger = { SITE = scope:selected_item }
	}

	cost = {
		piety = hcq_exile_piety_cost
		prestige = hcq_exile_prestige_cost
	}

	widget = {
		gui = "decision_view_widget_select_holy_site"
		controller = select_scope_object
		show_from_start = yes
		decision_to_second_step_button = "hcq_select_holy_site"

		setup_items = {
			scope:actor = {
				every_realm_county = {
					every_county_holy_site = {
						limit = {
							any_holy_site_faith = { NOT = { this = scope:actor.faith } }
						}
						add_to_list = item_list
					}
				}
			}
		}

		is_item_valid = {
			any_holy_site_faith = { NOT = { this = scope:actor.faith } }
			holy_site_county.faith = scope:actor.faith
		}

		ai_item_will_do = { value = 0 }
	}

	effect = {
		custom_tooltip = hcq_exile_rival_faiths_decision_effect_tt
		hcq_exile_rivals_effect = { SITE = scope:selected_item }
	}

	ai_potential = { always = no }
	ai_will_do = { base = 0 }
}
