﻿# Holy Conquest - Sanctify and Exile Holy Sites 1.1.0
namespace = hcq

# A player gains a county that holds a holy site of another faith
hcq.0001 = {
	type = character_event
	title = hcq.0001.t
	desc = hcq.0001.desc
	theme = faith
	override_background = { reference = holy_site_generic }
	left_portrait = {
		character = root
		animation = personality_zealous
	}

	trigger = {
		exists = scope:title
		scope:title = { holder = root }
	}

	immediate = {
		scope:title = {
			random_county_holy_site = {
				limit = {
					OR = {
						root.faith = { NOT = { is_faith_holy_site = prev } }
						any_holy_site_faith = { NOT = { this = root.faith } }
					}
				}
				save_scope_as = hcq_site
			}
		}
	}

	# Sanctify it for our faith
	option = {
		name = hcq.0001.a
		trigger = {
			exists = scope:hcq_site
			hcq_can_sanctify_site_trigger = { SITE = scope:hcq_site }
			piety >= hcq_sanctify_piety_cost
		}
		show_as_unavailable = { always = yes }
		add_piety = {
			value = hcq_sanctify_piety_cost
			multiply = -1
		}
		hcq_sanctify_site_effect = { SITE = scope:hcq_site }
		ai_chance = { base = 100 }
	}

	# Exile the other faiths
	option = {
		name = hcq.0001.b
		trigger = {
			exists = scope:hcq_site
			hcq_can_exile_site_trigger = { SITE = scope:hcq_site }
			piety >= hcq_exile_piety_cost
			prestige >= hcq_exile_prestige_cost
		}
		show_as_unavailable = { always = yes }
		add_piety = {
			value = hcq_exile_piety_cost
			multiply = -1
		}
		add_prestige = {
			value = hcq_exile_prestige_cost
			multiply = -1
		}
		hcq_exile_rivals_effect = { SITE = scope:hcq_site }
		ai_chance = { base = 50 }
	}

	# Later
	option = {
		name = hcq.0001.c
		custom_tooltip = hcq.0001.c.tt
		ai_chance = { base = 10 }
	}
}

# The player sanctified a great holy site
hcq.0010 = {
	type = character_event
	title = hcq.0010.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:hcq_sanctified_site = { is_holy_site_type = jerusalem } }
				desc = hcq.0010.desc.jerusalem
			}
			triggered_desc = {
				trigger = { scope:hcq_sanctified_site = { is_holy_site_type = rome } }
				desc = hcq.0010.desc.rome
			}
			triggered_desc = {
				trigger = { scope:hcq_sanctified_site = { is_holy_site_type = mecca } }
				desc = hcq.0010.desc.mecca
			}
			triggered_desc = {
				trigger = { scope:hcq_sanctified_site = { is_holy_site_type = constantinople } }
				desc = hcq.0010.desc.constantinople
			}
			desc = hcq.0010.desc.generic
		}
	}
	theme = faith
	override_background = { reference = holy_site_generic }
	left_portrait = {
		character = root
		animation = personality_zealous
	}

	option = {
		name = hcq.0010.a
		custom_tooltip = hcq.0010.a.tt
	}
}

# A great holy site of our faith was claimed by another faith
hcq.0020 = {
	type = character_event
	title = hcq.0020.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:hcq_sanctified_site = { is_holy_site_type = jerusalem } }
				desc = hcq.0020.desc.jerusalem
			}
			triggered_desc = {
				trigger = { scope:hcq_sanctified_site = { is_holy_site_type = rome } }
				desc = hcq.0020.desc.rome
			}
			triggered_desc = {
				trigger = { scope:hcq_sanctified_site = { is_holy_site_type = mecca } }
				desc = hcq.0020.desc.mecca
			}
			triggered_desc = {
				trigger = { scope:hcq_sanctified_site = { is_holy_site_type = constantinople } }
				desc = hcq.0020.desc.constantinople
			}
			desc = hcq.0020.desc.generic
		}
	}
	theme = faith
	override_background = { reference = holy_site_generic }
	left_portrait = {
		character = root
		animation = worry
	}
	right_portrait = {
		character = scope:hcq_actor
		animation = personality_zealous
	}

	option = {
		name = hcq.0020.a
		add_opinion = {
			modifier = hcq_claimed_our_holy_city_opinion
			target = scope:hcq_actor
		}
	}
}

# Our faith was exiled from a holy site
hcq.0021 = {
	type = character_event
	title = hcq.0021.t
	desc = hcq.0021.desc
	theme = faith
	override_background = { reference = holy_site_generic }
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:hcq_actor
		animation = personality_zealous
	}

	option = {
		name = hcq.0021.a
		add_opinion = {
			modifier = hcq_exiled_our_holy_site_opinion
			target = scope:hcq_actor
		}
	}
}
