﻿olympia_has_congenital_traits = {
	OR = {
		has_trait = beauty_bad
		has_trait = beauty_good
		has_trait = physique_bad
		has_trait = physique_good
		has_trait = intellect_bad
		has_trait = intellect_good
	}
}

olympia_has_good_congenital_traits = {
	OR = {
		has_trait = beauty_good
		has_trait = physique_good
		has_trait = intellect_good
	}
}

olympia_has_bad_congenital_traits = {
	OR = {
		has_trait = beauty_bad
		has_trait = physique_bad
		has_trait = intellect_bad
	}
}

olympia_has_congenital_trait_flags = {
	OR = {
		has_character_flag = beauty_bad_1
		has_character_flag = beauty_bad_2
		has_character_flag = beauty_bad_3
		has_character_flag = beauty_good_1
		has_character_flag = beauty_good_2
		has_character_flag = beauty_good_3
		
		has_character_flag = intellect_bad_1
		has_character_flag = intellect_bad_2
		has_character_flag = intellect_bad_3
		has_character_flag = intellect_good_1
		has_character_flag = intellect_good_2
		has_character_flag = intellect_good_3
		
		has_character_flag = physique_bad_1
		has_character_flag = physique_bad_2
		has_character_flag = physique_bad_3
		has_character_flag = physique_good_1
		has_character_flag = physique_good_2
		has_character_flag = physique_good_3
	}
}

is_low_class = {
	is_lowborn = yes
}

is_middle_class = {
	AND = {
		is_lowborn = no
		NOR = {
			any_close_or_extended_family_member = {
				is_ruler = no
			}
			is_ruler = yes
		}
	}
}

is_knight_class = {
	AND = {
		is_lowborn = no
		OR = {
			is_knight = yes
			any_close_family_member = {
				is_knight = yes
			}
			highest_held_title_tier = tier_barony
			any_close_family_member = {
				highest_held_title_tier = tier_barony
			}
		}
	}
}

is_noble_class = {
	AND = {
		is_lowborn = no
		OR = {
			highest_held_title_tier = tier_county
			any_close_family_member = {
				highest_held_title_tier = tier_county
			}
		}
	}
}

is_high_noble_class = {
	AND = {
		is_lowborn = no
		OR = {
			highest_held_title_tier = tier_duchy
			any_close_family_member = {
				highest_held_title_tier = tier_duchy
			}
		}
	}
}

is_royalty_class = {
	AND = {
		is_lowborn = no
		OR = {
			highest_held_title_tier = tier_kingdom
			any_close_family_member = {
				highest_held_title_tier = tier_kingdom
			}
		}
	}
}

is_imperial_class = {
	AND = {
		is_lowborn = no
		OR = {
			highest_held_title_tier >= tier_empire
			any_close_family_member = {
				highest_held_title_tier >= tier_empire
			}
		}
	}
}

is_low_class_group = {
	OR = {
		has_character_flag = abomab_low_class
		has_character_flag = abomab_middle_class
	}
}

is_noble_class_group = {
	OR = {
		has_character_flag = abomab_knight_class
		has_character_flag = abomab_noble_class
	}
}

is_elite_class_group = {
	OR = {
		has_character_flag = abomab_imperial_class
		has_character_flag = abomab_royalty_class
		has_character_flag = abomab_high_noble_class
	}
}

abomab_higher_beastly = {
	OR = {
		is_low_class_group = yes
		
		has_trait = callous
		has_trait = sadistic
	}
}

abomab_lower_beastly = {
	OR = {
		has_trait = education_intrigue
		has_focus = education_intrigue
		
		has_trait = charming
		has_trait = compassionate
	}
}

abomab_higher_repulsive = {
	OR = {
	
		has_trait = arrogant
		has_trait = bossy
		has_trait = wrathful
	
	}
}

abomab_lower_repulsive = {
	OR = {
	
		has_trait = education_diplomacy
		has_focus = education_diplomacy
	
		has_trait = humble
		has_trait = calm
		has_trait = gregarious
	
	}
}

abomab_higher_ungainly = {
	OR = {
	
		has_trait = gluttonous
		has_trait = honest
		has_trait = lazy
	
	}
}

abomab_lower_ungainly = {
	OR = {
	
		has_trait = education_martial
		has_focus = education_martial
	
		has_trait = deceitful
		has_trait = rowdy
		has_trait = vengeful
	}
}

abomab_higher_absentminded = {
	OR = {
		is_low_class_group = yes
		has_trait = arbitrary
		has_trait = fickle
		has_trait = content
	}
}

abomab_lower_absentminded = {
	OR = {
		has_trait = education_learning
		has_focus = education_learning
		
		has_trait = ambitious
		has_trait = curious
		has_trait = just
		has_trait = pensive
	}
}

abomab_higher_rigid = {
	OR = {
	
		has_trait = ambitious
		has_trait = arrogant
		has_trait = bossy
		has_trait = greedy
		has_trait = wrathful
	
	}
}

abomab_lower_rigid = {
	OR = {
	
		has_trait = education_martial
		has_focus = education_martial
	
		has_trait = charming
		has_trait = content
		has_trait = rowdy

	}
}

abomab_higher_scattered = {
	OR = {
	
		is_low_class_group = yes
	
		has_trait = curious
		has_trait = lazy
	}
}

abomab_lower_scattered = {
	OR = {
		
		has_trait = education_stewardship
		has_focus = education_stewardship
		
		has_trait = bossy
		has_trait = diligent
		
	}
}

abomab_higher_brittle = {
	OR = {
		is_low_class_group = yes
		has_any_disease_trigger = yes
		has_trait = fickle
		has_trait = gluttonous
		has_trait = lazy
	}
}

abomab_lower_brittle = {
	OR = {

		has_trait = education_learning
		has_focus = education_learning
		has_trait = diligent
		has_trait = rowdy
		has_trait = temperate
	}
}

abomab_higher_inept = {
	OR = {
	
		has_trait = craven
		has_trait = pensive
		has_trait = shy
	
	}
}

abomab_lower_inept = {
	OR = {
		is_low_class_group = yes
	
		has_trait = education_intrigue
		has_focus = education_intrigue
	
		has_trait = brave
		has_trait = rowdy
	}
}

abomab_higher_withered = {
	OR = {
		is_low_class_group = yes
		
		has_trait = content
		has_trait = gluttonous
		has_trait = lazy
	}
}

abomab_lower_withered = {
	OR = {
	
		has_trait = education_martial
		has_focus = education_martial
		
		has_trait = ambitious
		has_trait = diligent
		has_trait = rowdy
		has_trait = temperate
	}
}


abomab_higher_grace = {	#Intrigue
	OR = {
		has_trait = education_intrigue
		has_focus = education_intrigue
		
		has_trait = deceitful
		has_trait = calm
		has_trait = compassionate
		has_trait = chaste
	}
}

abomab_lower_grace = {
	OR = {
		is_low_class_group = yes
		has_trait = rowdy
		has_trait = lazy
		has_trait = gluttonous
	}
}

abomab_higher_magnetism = {
	OR = {
		has_trait = education_diplomacy
		has_focus = education_diplomacy
		has_trait = education_martial
		has_focus = education_martial
		
		has_trait = charming
		has_trait = gregarious
		has_trait = trusting
		has_trait = zealous
		has_trait = ambitious
	}
}

abomab_lower_magnetism = {
	OR = {
		has_trait = shy
		has_trait = paranoid
		has_trait = sadistic
		has_trait = arrogant
		has_trait = pensive
	}
}

abomab_higher_visage = {
	OR = {
		has_trait = education_diplomacy
		has_focus = education_diplomacy
		has_trait = education_intrigue
		has_focus = education_intrigue
		
		has_trait = lustful
		has_trait = temperate
		has_trait = arrogant
		has_trait = charming
		has_trait = physique_good
	}
}

abomab_lower_visage = {
	OR = {
		is_low_class_group = yes
		
		has_trait = physique_bad
		has_trait = humble
		has_trait = eccentric
	}
}

abomab_higher_adaptability = {
	OR = {
		has_trait = education_martial
		has_focus = education_martial
		
		has_trait = arbitrary
		has_trait = curious
		has_trait = fickle
		has_trait = rowdy
	}
}

abomab_lower_adaptability = {
	OR = {
		has_trait = lazy
		has_trait = pensive
		has_trait = stubborn
	}
}

abomab_higher_focus = {
	OR = {
		has_trait = education_stewardship
		has_focus = education_stewardship
		has_trait = education_intrigue
		has_focus = education_intrigue

		has_trait = bossy
		has_trait = diligent
		has_trait = just
		has_trait = stubborn
	}
}

abomab_lower_focus = {
	OR = {
		is_low_class_group = yes
		
		has_trait = arbitrary
		has_trait = fickle
		has_trait = impatient
		has_trait = lazy
		has_trait = rowdy
	}
}

abomab_higher_memory = {
	OR = {
		has_trait = education_learning
		has_focus = education_learning

		has_trait = curious
		has_trait = cynical
		has_trait = eccentric
		has_trait = patient
	}
}

abomab_lower_memory = {
	OR = {
		is_low_class_group = yes
		
		has_trait = wrathful
	}
}

abomab_higher_endurance = {
	OR = {
		has_trait = education_learning
		has_focus = education_learning
		
		has_trait = calm
		has_trait = stubborn
		has_trait = temperate
	}
}

abomab_lower_endurance = {
	OR = {
		is_low_class_group = yes
		
		has_trait = gluttonous
	}
}

abomab_higher_brawn = {
	OR = {
		has_trait = education_martial
		has_focus = education_martial
		
		has_trait = brave
		has_trait = rowdy
		has_trait = wrathful
		
		has_trait = intellect_bad
	}
}

abomab_lower_brawn = {
	OR = {
		has_trait = craven
		has_trait = lazy
		has_trait = pensive
	}
}

abomab_higher_instincts = {
	OR = {
		has_trait = education_martial
		has_focus = education_martial
		has_trait = education_intrigue
		has_focus = education_intrigue
		
		has_trait = brave
	}
}

abomab_lower_instincts = {
	OR = {
	
		has_trait = lazy
		has_trait = pensive
		has_trait = intellect_bad
	
	}
}

####################################
# BEAUTY: BAD (Beastly / Repulsive / Ungainly)
####################################

olympia_has_high_beastly_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_bad_1
			track = abomab_beastly
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_bad_2
			track = abomab_beastly
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_bad_3
			track = abomab_beastly
			value >= 65
		}
	}
}

olympia_has_exceptional_beastly_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_bad_1
			track = abomab_beastly
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_bad_2
			track = abomab_beastly
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_bad_3
			track = abomab_beastly
			value >= 90
		}
	}
}

olympia_has_high_repulsive_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_bad_1
			track = abomab_repulsive
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_bad_2
			track = abomab_repulsive
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_bad_3
			track = abomab_repulsive
			value >= 65
		}
	}
}

olympia_has_exceptional_repulsive_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_bad_1
			track = abomab_repulsive
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_bad_2
			track = abomab_repulsive
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_bad_3
			track = abomab_repulsive
			value >= 90
		}
	}
}

olympia_has_high_ungainly_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_bad_1
			track = abomab_ungainly
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_bad_2
			track = abomab_ungainly
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_bad_3
			track = abomab_ungainly
			value >= 65
		}
	}
}

olympia_has_exceptional_ungainly_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_bad_1
			track = abomab_ungainly
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_bad_2
			track = abomab_ungainly
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_bad_3
			track = abomab_ungainly
			value >= 90
		}
	}
}



####################################
# BEAUTY: GOOD (Visage / Magnetism / Grace)
####################################

olympia_has_high_visage_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_good_1
			track = abomab_visage
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_good_2
			track = abomab_visage
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_good_3
			track = abomab_visage
			value >= 65
		}
	}
}

olympia_has_exceptional_visage_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_good_1
			track = abomab_visage
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_good_2
			track = abomab_visage
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_good_3
			track = abomab_visage
			value >= 90
		}
	}
}

olympia_has_high_magnetism_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_good_1
			track = abomab_magnetism
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_good_2
			track = abomab_magnetism
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_good_3
			track = abomab_magnetism
			value >= 65
		}
	}
}

olympia_has_exceptional_magnetism_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_good_1
			track = abomab_magnetism
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_good_2
			track = abomab_magnetism
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_good_3
			track = abomab_magnetism
			value >= 90
		}
	}
}

olympia_has_high_grace_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_good_1
			track = abomab_grace
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_good_2
			track = abomab_grace
			value >= 65
		}
		has_trait_xp = {
			trait = beauty_good_3
			track = abomab_grace
			value >= 65
		}
	}
}

olympia_has_exceptional_grace_XP = {
	OR = {
		has_trait_xp = {
			trait = beauty_good_1
			track = abomab_grace
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_good_2
			track = abomab_grace
			value >= 90
		}
		has_trait_xp = {
			trait = beauty_good_3
			track = abomab_grace
			value >= 90
		}
	}
}



####################################
# INTELLECT: BAD (Absentminded / Rigid / Scattered)
####################################

olympia_has_high_absentminded_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_bad_1
			track = abomab_absentminded
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_bad_2
			track = abomab_absentminded
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_bad_3
			track = abomab_absentminded
			value >= 65
		}
	}
}

olympia_has_exceptional_absentminded_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_bad_1
			track = abomab_absentminded
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_bad_2
			track = abomab_absentminded
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_bad_3
			track = abomab_absentminded
			value >= 90
		}
	}
}

olympia_has_high_rigid_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_bad_1
			track = abomab_rigid
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_bad_2
			track = abomab_rigid
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_bad_3
			track = abomab_rigid
			value >= 65
		}
	}
}

olympia_has_exceptional_rigid_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_bad_1
			track = abomab_rigid
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_bad_2
			track = abomab_rigid
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_bad_3
			track = abomab_rigid
			value >= 90
		}
	}
}

olympia_has_high_scattered_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_bad_1
			track = abomab_scattered
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_bad_2
			track = abomab_scattered
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_bad_3
			track = abomab_scattered
			value >= 65
		}
	}
}

olympia_has_exceptional_scattered_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_bad_1
			track = abomab_scattered
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_bad_2
			track = abomab_scattered
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_bad_3
			track = abomab_scattered
			value >= 90
		}
	}
}



####################################
# INTELLECT: GOOD (Adaptability / Memory / Focus)
####################################

olympia_has_high_adaptability_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_good_1
			track = abomab_adaptability
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_good_2
			track = abomab_adaptability
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_good_3
			track = abomab_adaptability
			value >= 65
		}
	}
}

olympia_has_exceptional_adaptability_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_good_1
			track = abomab_adaptability
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_good_2
			track = abomab_adaptability
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_good_3
			track = abomab_adaptability
			value >= 90
		}
	}
}

olympia_has_high_memory_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_good_1
			track = abomab_memory
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_good_2
			track = abomab_memory
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_good_3
			track = abomab_memory
			value >= 65
		}
	}
}

olympia_has_exceptional_memory_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_good_1
			track = abomab_memory
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_good_2
			track = abomab_memory
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_good_3
			track = abomab_memory
			value >= 90
		}
	}
}

olympia_has_high_focus_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_good_1
			track = abomab_focus
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_good_2
			track = abomab_focus
			value >= 65
		}
		has_trait_xp = {
			trait = intellect_good_3
			track = abomab_focus
			value >= 65
		}
	}
}

olympia_has_exceptional_focus_XP = {
	OR = {
		has_trait_xp = {
			trait = intellect_good_1
			track = abomab_focus
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_good_2
			track = abomab_focus
			value >= 90
		}
		has_trait_xp = {
			trait = intellect_good_3
			track = abomab_focus
			value >= 90
		}
	}
}



####################################
# PHYSIQUE: BAD (Brittle / Inept / Withered)
####################################

olympia_has_high_brittle_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_bad_1
			track = abomab_brittle
			value >= 65
		}
		has_trait_xp = {
			trait = physique_bad_2
			track = abomab_brittle
			value >= 65
		}
		has_trait_xp = {
			trait = physique_bad_3
			track = abomab_brittle
			value >= 65
		}
	}
}

olympia_has_exceptional_brittle_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_bad_1
			track = abomab_brittle
			value >= 90
		}
		has_trait_xp = {
			trait = physique_bad_2
			track = abomab_brittle
			value >= 90
		}
		has_trait_xp = {
			trait = physique_bad_3
			track = abomab_brittle
			value >= 90
		}
	}
}

olympia_has_high_inept_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_bad_1
			track = abomab_inept
			value >= 65
		}
		has_trait_xp = {
			trait = physique_bad_2
			track = abomab_inept
			value >= 65
		}
		has_trait_xp = {
			trait = physique_bad_3
			track = abomab_inept
			value >= 65
		}
	}
}

olympia_has_exceptional_inept_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_bad_1
			track = abomab_inept
			value >= 90
		}
		has_trait_xp = {
			trait = physique_bad_2
			track = abomab_inept
			value >= 90
		}
		has_trait_xp = {
			trait = physique_bad_3
			track = abomab_inept
			value >= 90
		}
	}
}

olympia_has_high_withered_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_bad_1
			track = abomab_withered
			value >= 65
		}
		has_trait_xp = {
			trait = physique_bad_2
			track = abomab_withered
			value >= 65
		}
		has_trait_xp = {
			trait = physique_bad_3
			track = abomab_withered
			value >= 65
		}
	}
}

olympia_has_exceptional_withered_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_bad_1
			track = abomab_withered
			value >= 90
		}
		has_trait_xp = {
			trait = physique_bad_2
			track = abomab_withered
			value >= 90
		}
		has_trait_xp = {
			trait = physique_bad_3
			track = abomab_withered
			value >= 90
		}
	}
}



####################################
# PHYSIQUE: GOOD (Brawn / Endurance / Instincts)
####################################

olympia_has_high_brawn_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_good_1
			track = abomab_brawn
			value >= 65
		}
		has_trait_xp = {
			trait = physique_good_2
			track = abomab_brawn
			value >= 65
		}
		has_trait_xp = {
			trait = physique_good_3
			track = abomab_brawn
			value >= 65
		}
	}
}

olympia_has_exceptional_brawn_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_good_1
			track = abomab_brawn
			value >= 90
		}
		has_trait_xp = {
			trait = physique_good_2
			track = abomab_brawn
			value >= 90
		}
		has_trait_xp = {
			trait = physique_good_3
			track = abomab_brawn
			value >= 90
		}
	}
}

olympia_has_high_endurance_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_good_1
			track = abomab_endurance
			value >= 65
		}
		has_trait_xp = {
			trait = physique_good_2
			track = abomab_endurance
			value >= 65
		}
		has_trait_xp = {
			trait = physique_good_3
			track = abomab_endurance
			value >= 65
		}
	}
}

olympia_has_exceptional_endurance_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_good_1
			track = abomab_endurance
			value >= 90
		}
		has_trait_xp = {
			trait = physique_good_2
			track = abomab_endurance
			value >= 90
		}
		has_trait_xp = {
			trait = physique_good_3
			track = abomab_endurance
			value >= 90
		}
	}
}

olympia_has_high_instincts_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_good_1
			track = abomab_instincts
			value >= 65
		}
		has_trait_xp = {
			trait = physique_good_2
			track = abomab_instincts
			value >= 65
		}
		has_trait_xp = {
			trait = physique_good_3
			track = abomab_instincts
			value >= 65
		}
	}
}

olympia_has_exceptional_instincts_XP = {
	OR = {
		has_trait_xp = {
			trait = physique_good_1
			track = abomab_instincts
			value >= 90
		}
		has_trait_xp = {
			trait = physique_good_2
			track = abomab_instincts
			value >= 90
		}
		has_trait_xp = {
			trait = physique_good_3
			track = abomab_instincts
			value >= 90
		}
	}
}