﻿### Coronation Intents
# Host Intents #
coronation_impress_attendees = {
	icon = extoll_reign_intent
	scripted_animation = {
		triggered_animation = {
			trigger = {
				OR = {
					faith.religion = religion:eastern_orthodox_religion
					faith.religion = religion:catholic_religion
					faith.religion = religion:protestant_religion
				}
			}
			animation = acknowledging
		}
		animation = storyteller
	}

	auto_complete = yes
}

coronation_weaken_detractors = {
	icon = isolate_opponents_intent
	scripted_animation = { animation = scheme }

	auto_complete = yes
}

coronation_embrace_supporters = {
	icon = empower_loyalists_intent
	scripted_animation = { animation = admiration }

	auto_complete = yes
}

coronation_exalt_crown = {
	icon = support_liege_intent
	scripted_animation = {
		triggered_animation = {
			trigger = {
				coronation_proper_artifact_crown_trigger = yes
			}
			animation = crowning
		}
		triggered_animation = {
			trigger = {
				OR = {
					faith.religion = religion:eastern_orthodox_religion
					faith.religion = religion:catholic_religion
					faith.religion = religion:protestant_religion
				}
			}
			animation = prayer
		}
		triggered_animation = {
			trigger = {
				drinks_alcohol_trigger = yes
			}
			animation = toast_goblet
		}
		animation = personality_zealous
	}

	auto_complete = yes
}

# Guest Intents
coronation_bear_witness = {
	icon = bear_witness_intent
	scripted_animation = { animation = admiration }

	auto_complete = yes

	ai_will_do = {
		value = 25
		if = {
			limit = {
				stress_level >= 1
			}
			add = 25
		}
		if = {
			limit = {
				exists = involved_activity.activity_host
				opinion = {
					target = involved_activity.activity_host
					value < 0
				}
				is_landed = yes
			}
			subtract = 50
		}
	}
}

coronation_seize_advantages = {
	icon = seize_advantages_intent
	scripted_animation = { animation = interested }

	auto_complete = yes

	ai_will_do = {
		value = 0
		if = {
			limit = {
				OR = {
					has_trait = ambitious
					intrigue >= high_skill_rating
				}
			}
			add = 50
		}
		if = {
			limit = {
				OR = {
					has_trait = content
					intrigue <= low_skill_rating
				}
			}
			subtract = 50
		}
	}
}

coronation_offer_support = {
	icon = altruism_intent
	scripted_animation = { animation = obsequious_bow }

	auto_complete = yes

	is_valid = {
		trigger_if = {
			limit = {
				is_ai = yes
			}
			NOT = {
				is_in_guest_subset = {
					name = detractor
				}
			}
		}
	}

	ai_will_do = {
		value = 0
		if = {
			limit = {
				opinion = {
					target = involved_activity.activity_host
					value > 0
				}
			}
			add = "opinion(involved_activity.activity_host)"
		}
		if = {
			limit = {
				has_any_moderate_good_relationship_with_character_trigger = {
					CHARACTER = involved_activity.activity_host
				}
			}
			add = 50
		}
		else_if = {
			limit = {
				has_any_mild_good_relationship_with_character_trigger = {
					CHARACTER = involved_activity.activity_host
				}
			}
			add = 25
		}
	}
}

coronation_advocate_domain = {
	icon = advocate_domain_intent
	scripted_animation = { animation = chancellor }

	is_shown = {
		any_liege_or_above = {
			this = root.involved_activity.activity_host
		}
		is_landed = yes
	}

	auto_complete = yes

	ai_will_do = {
		value = 0
		if = {
			limit = {
				OR = {
					has_trait = diligent
					stewardship >= high_skill_rating
				}
			}
			add = 50
		}
		if = {
			limit = {
				OR = {
					has_trait = lazy
					stewardship <= low_skill_rating
				}
			}
			subtract = 50
		}
	}
}

coronation_profess_rights = {
	icon = profess_rights_intent
	scripted_animation = { animation = debating }

	is_shown = {
		liege ?= {
			this = root.involved_activity.activity_host
		}
	}

	auto_complete = yes

	ai_will_do = {
		value = 0
		if = {
			limit = {
				OR = {
					has_trait = arrogant
					diplomacy >= high_skill_rating
				}
			}
			add = 50
		}
		if = {
			limit = {
				OR = {
					has_trait = humble
					diplomacy <= low_skill_rating
				}
			}
			subtract = 50
		}
	}
}

coronation_disrupt_loyalists = {
	icon = disrupt_loyalists_intent
	scripted_animation = { animation = spymaster }

	auto_complete = yes

	is_valid = {
		trigger_if = {
			limit = {
				is_ai = yes
			}
			NOT = {
				is_in_guest_subset = {
					name = supporter
				}
			}
		}
	}

	ai_will_do = {
		value = 0
		if = {
			limit = {
				opinion = {
					target = involved_activity.activity_host
					value < 0
				}
			}
			add = {
				value = "opinion(involved_activity.activity_host)"
				multiply = -1
			}
		}
		if = {
			limit = {
				has_any_moderate_bad_relationship_with_character_trigger = {
					CHARACTER = involved_activity.activity_host
				}
			}
			add = 50
		}
		else_if = {
			limit = {
				has_any_mild_bad_relationship_with_character_trigger = {
					CHARACTER = involved_activity.activity_host
				}
			}
			add = 25
		}
	}
}
