﻿# EOTM scripted triggers: inheritance profile compatibility checks
#
# Public names are Focused, Harmonious, and Curious. The numeric variable
# values below are intentionally stable for save compatibility.

eotm_child_has_one_way_profile = {
	has_variable = eotm_inheritance_profile
	var:eotm_inheritance_profile ?= 1
}

eotm_child_has_balanced_profile = {
	has_variable = eotm_inheritance_profile
	var:eotm_inheritance_profile ?= 2
}

eotm_child_has_random_profile = {
	has_variable = eotm_inheritance_profile
	var:eotm_inheritance_profile ?= 3
}

eotm_child_has_inheritance_profile = {
	OR = {
		eotm_child_has_one_way_profile = yes
		eotm_child_has_balanced_profile = yes
		eotm_child_has_random_profile = yes
	}
}

eotm_character_has_any_profile_trigger = {
	OR = {
		eotm_child_has_inheritance_profile = yes
		has_trait = eotm_profile_one_way
		has_trait = eotm_profile_balanced
		has_trait = eotm_profile_random
	}
}

eotm_character_has_multiple_profiles_trigger = {
	OR = {
		AND = {
			has_trait = eotm_profile_one_way
			has_trait = eotm_profile_balanced
		}
		AND = {
			has_trait = eotm_profile_one_way
			has_trait = eotm_profile_random
		}
		AND = {
			has_trait = eotm_profile_balanced
			has_trait = eotm_profile_random
		}
	}
}

eotm_character_has_profile_trait_without_variable_trigger = {
	NOT = { eotm_child_has_inheritance_profile = yes }
	OR = {
		has_trait = eotm_profile_one_way
		has_trait = eotm_profile_balanced
		has_trait = eotm_profile_random
	}
}

eotm_character_has_profile_variable_without_trait_trigger = {
	eotm_child_has_inheritance_profile = yes
	NOT = {
		OR = {
			has_trait = eotm_profile_one_way
			has_trait = eotm_profile_balanced
			has_trait = eotm_profile_random
		}
	}
}

eotm_character_has_profile_variable_trait_desync_trigger = {
	OR = {
		AND = {
			eotm_child_has_one_way_profile = yes
			NOT = { has_trait = eotm_profile_one_way }
		}
		AND = {
			eotm_child_has_balanced_profile = yes
			NOT = { has_trait = eotm_profile_balanced }
		}
		AND = {
			eotm_child_has_random_profile = yes
			NOT = { has_trait = eotm_profile_random }
		}
	}
}

eotm_character_has_confirmed_single_profile_trigger = {
	NOT = { eotm_character_has_multiple_profiles_trigger = yes }
	OR = {
		AND = {
			eotm_child_has_one_way_profile = yes
			has_trait = eotm_profile_one_way
		}
		AND = {
			eotm_child_has_balanced_profile = yes
			has_trait = eotm_profile_balanced
		}
		AND = {
			eotm_child_has_random_profile = yes
			has_trait = eotm_profile_random
		}
	}
}
