﻿# this = a character; can they be the ruler on one side of an AI marriage bond?
nmt_ai_side_ruler_trigger = {
	is_alive = yes
	is_ruler = yes
	is_landless_ruler = no
	highest_held_title_tier >= tier_county
}

# this = one side's ruler, $OTHER$ = the other side's ruler. Both must be AI, in different
# realms, not at war, and not close family (same rules as for players). An alliance they
# had before this wedding is left alone; one made in the last few days counts as this
# wedding's (see nmt_on_alliance_added).
nmt_ai_bond_pair_trigger = {
	is_ai = yes
	$OTHER$ = { is_ai = yes }
	NOT = { this = $OTHER$ }
	NOT = { is_close_family_of = $OTHER$ }
	NOT = { top_liege = $OTHER$.top_liege }
	NOT = { is_at_war_with = $OTHER$ }
	OR = {
		NOT = { is_allied_to = $OTHER$ }
		AND = {
			exists = var:nmt_ai_fresh_alliance_with
			var:nmt_ai_fresh_alliance_with = $OTHER$
		}
	}
}

# this = a spouse/betrothed; true if the mod remembers $RULER$ as their in-law ruler.
nmt_partner_tied_to_trigger = {
	exists = var:nmt_tie_ruler
	var:nmt_tie_ruler = $RULER$
}
