﻿# Triggers used in Curo Privignos.

# Trigger which evaluates whether the scoped character is a valid
# curo privignos target. These triggers are essential to show interaction
#
# ACTOR = the actor who would be executing curo privignos on the target
#
# scope = the character being evaluated
character_is_valid_curo_privignos_target_trigger = {
	# Basic sanity checks.
	is_ai = yes
	is_adult = no

	# Must not be 'near descendent' of actor or member of dynasty.
	NOR = { # Must not be a 'near child' of the magister.
		dynasty = $ACTOR$.dynasty
		is_child_of = $ACTOR$
		is_grandchild_of = $ACTOR$
		is_great_grandchild_of = $ACTOR$
	}

	# Make sure the child is not already a special regula child.
	NOT = { has_trait = regula_child_of_the_book}
	NOT = { has_trait = regula_privignus_of_the_magister }

	# Can only curo privignos children of a regula devoted
	# married to the actor.
	any_parent = {
		is_regula_devoted_trigger = yes
		is_consort_of = $ACTOR$
	}
}

# Trigger which evaluates whether the scoped character is a valid
# curo privignos target. These ones show the reason why action is non available.
#
# ACTOR = the actor who would be executing curo privignos on the target
#
# scope = the character being evaluated
character_is_valid_curo_privignos_target_show_failures_trigger = {
	# Basic sanity checks.
	is_landed = no
	in_diplomatic_range = $ACTOR$

	custom_description = {
		text = regula_curo_privignos_not_regula_court_trigger
		# Check that we aren't trying to curo privignos someone out of the
		# court of an enemy leader.
		OR = {
			is_courtier = no
			court_owner ?= {
				OR = {
					is_regula_trigger = yes
					is_regula_devoted_trigger = yes
				}
			}
		}
	}
}