﻿# Ambitions - Vows - scripted triggers (new in 1.3)
# Scope: character

amb_vow_can_swear_trigger = {
	is_adult = yes
	is_imprisoned = no
	NOT = { has_variable = amb_vow_active }
	NOT = { has_variable = amb_vow_cooldown }
}

amb_vow_any_valid_trigger = {
	OR = {
		amb_vow_peace_valid_trigger = yes
		amb_vow_poverty_valid_trigger = yes
		amb_vow_vengeance_valid_trigger = yes
		amb_vow_charity_valid_trigger = yes
		amb_vow_chastity_valid_trigger = yes
	}
}

#############################################
# Who can swear each vow
#############################################

# Vow of Peace: start no war for 5 years
amb_vow_peace_valid_trigger = {
	is_landed = yes
	is_at_war = no
	OR = {
		has_trait = compassionate
		has_trait = content
		has_trait = forgiving
		has_trait = calm
	}
}

# Vow of Poverty: never hold more than 300 gold for 5 years
amb_vow_poverty_valid_trigger = {
	gold <= 300
	OR = {
		has_trait = humble
		has_trait = zealous
		has_trait = generous
	}
}

# Vow of Vengeance: be at war with a rival within 10 years
amb_vow_vengeance_valid_trigger = {
	is_landed = yes
	any_relation = { type = rival }
	OR = {
		has_trait = vengeful
		has_trait = wrathful
		has_trait = brave
	}
}

# Vow of Charity: give 50 gold to the poor each year for 5 years
amb_vow_charity_valid_trigger = {
	gold >= 100
	OR = {
		has_trait = generous
		has_trait = compassionate
		has_trait = zealous
	}
}

# Vow of Chastity: no new children for 5 years
amb_vow_chastity_valid_trigger = {
	NOT = { any_child = { age < 1 } }
	is_pregnant = no
	NOT = { any_spouse = { is_pregnant = yes } }
	OR = {
		has_trait = chaste
		has_trait = temperate
		has_trait = zealous
	}
}

#############################################
# Kept, broken, fulfilled
#############################################

amb_vow_broken_trigger = {
	OR = {
		AND = {
			var:amb_vow_active = flag:peace
			is_at_war_as_attacker = yes
		}
		AND = {
			var:amb_vow_active = flag:poverty
			gold > 300
		}
		AND = {
			var:amb_vow_active = flag:charity
			gold < 50
		}
		AND = {
			var:amb_vow_active = flag:chastity
			any_child = { age < 1 }
		}
	}
}

# Vengeance is the one vow you fulfil by acting
amb_vow_vengeance_met_trigger = {
	var:amb_vow_active = flag:vengeance
	any_relation = {
		type = rival
		is_at_war_with = root
	}
}
