﻿###
# Regula Traits
#	Magister Trait
#	Compeditae Traits
#	Special Regula Traits
#	Regula Consecrated Blood Traits
###

# Trait Index Reservation System
# ================================
# Reserved index range: 6564–6573 (currently allocated)
#
# Why explicit indices are needed:
#   Save game compatibility — changing indices breaks existing saves that reference traits by index.
#   Traits with explicit indices must keep them stable across mod versions.
#
# Traits with explicit indices:
#   6564: orba
#   6565: contubernalis
#   6566: regula_undying
#   6567: sigillum
#   6568: (skipped — regula_virus has no explicit index)
#   6569: retired_paelex
#   6570: regula_gossip
#   6571: regula_child_of_the_book
#   6572: regula_privignus_of_the_magister
#   6573: regula_blessed_pregnancy
#
# Traits WITHOUT explicit indices (intentional):
#   magister, domina, familia_paelex, paelex, tropaeum, mulsa (the Compeditae hierarchy)
#   regula_virus
#   All Consecrated Blood traits (regula_bloodline_traits.txt)
#
# Note: regula_bloodline_traits.txt does not use explicit indices. This is intentional —
# bloodline traits don't need save-stable indices as they are added dynamically.
#
# Next available index: 6574

# Standard Values
@pos_compat_high = 30
@pos_compat_medium = 15
@pos_compat_low = 5

@neg_compat_high = -30
@neg_compat_medium = -15
@neg_compat_low = -5

# Magister trait

# The Magister trait is the primary player trait for the Regula Magistri.
# It consists of four tracks, Control, Sculpting, Breeding and Knowledge.

# Each track is advanced separately, and XP is gained generally through the use of the Regula Magistri mechanics.
# Control - Mind control actions, mainly decides power of charming.
# Sculpting - Main track used for Mutare Corpus.
# Breeding - Decides fertility and passing on good traits/creating new ones, also provides stacking piety.
# Knowledge - General track which shows your total knowledge over the Regula Magistri.

# The first three tracks have 4 levels each, while Knowledge has 8 levels.
magister = {
	category = lifestyle
	opposites = {
		devoted_trait_group
	}

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	minimum_age = 16

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_magister_desc
			}
			desc = trait_magister_character_desc
		}
	}

	# Basic Effects
	monthly_lifestyle_xp_gain_mult = 0.05

	# Tracks
	tracks = {
		# Domination
		# Increased via Charming
		# Bonuses are mainly dread and opinion modifiers
		domination = {
			25 = {
				dread_baseline_add = 5
				general_opinion = 20
			}
			50 = {
				dread_baseline_add = 5
				general_opinion = 20
			}
			75 = {
				dread_baseline_add = 5
				general_opinion = 5
			}
			100 = {
				dread_baseline_add = 5
				general_opinion = 15
			}
		}

		# Sculpting
		# Increased via Mutare Corpus
		# Bonuses are mainly health related
		sculpting = {
			25 = {
				learning = 1
				health = minor_health_bonus
			}
			50 = {
				learning = 1
				health = minor_health_bonus
			}
			75 = {
				learning = 1
				prowess = 3
			}
			100 = {
				learning_per_piety_level = 1
			}
		}

		# Breeding
		# Increased via having children, and some interactions
		# Main gains are piety increase, small fertility increases
		breeding = {
			25 = {
				monthly_piety = 0.5
			}
			50 = {
				monthly_piety = 0.5
			}
			75 = {
				monthly_piety = 1
			}
			100 = {
				levy_size = 0.1
				levy_reinforcement_rate = 0.25
				monthly_piety = 1
			}
		}

		# Knowledge
		# Increased via various interactions, main track for overall progression
		# Bonuses are mainly learning modifiers, plus grants you access to Regula interactions
		knowledge = {
			25 = {
				learning = 1
			}
			50 = {
				learning = 1
			}
			75 = {
				learning = 1
			}
			100 = {
				learning_per_piety_level = 1
			}
		}
	}
}

# Compeditae traits, aka the Magisters charmed consorts
# Order of increasing "rank"
# Mulsa - > Tropaum -> Paelex = Familia Paelex -> Domina
domina = {
	category = lifestyle
	group = devoted_trait_group
	level = 5
	opposites = {
		magister
	}

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
    stewardship = 5
	learning = 5
	diplomacy = 5
	intrigue = 3
	prowess = 4
	fertility = 0.1

	same_faith_opinion = 10
	same_opinion = 50
	opposite_opinion = 80

	health = minor_health_bonus
	stress_gain_mult = -0.25
	genetic_constraint_all = beauty_3
	flag = can_not_marry

	# AI Values
	ai_honor = dominant_positive_ai_value  # Should shut down seduce schemes.

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_domina_desc
			}
			desc = trait_domina_character_desc
		}
	}
}

familia_paelex = {
	# Grouping
	category = lifestyle
	group = devoted_trait_group
	level = 4
	opposites = {
		magister
	}
	
	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	culture_modifier = {
		parameter = familia_paelex_give_renown
		monthly_dynasty_prestige = 0.2
	}
	
	# Effects (same as Paelex)
    stewardship = 3
	learning = 3
	diplomacy = 3
	prowess = 2
	fertility = 0.05
	health = miniscule_health_bonus
	attraction_opinion = 10
	same_opinion = 25
	opposite_opinion = 50
	stress_gain_mult = -0.2
	genetic_constraint_all = beauty_3
	flag = can_not_marry

	# Bonus effects
	inbreeding_chance = -0.25
	
	# AI Values
	ai_honor = dominant_positive_ai_value  # Should shut down seduce schemes.
	
	# Name
	name = {
		first_valid = {
			# Fallback - No Character
			triggered_desc = {
				trigger = { NOT = { exists = this } }
				desc = trait_familia_paelex
			}
			# Daughter
			triggered_desc = {
				trigger = { regula_is_filia_eligible = yes }
				desc = trait_familia_paelex_filia
			}
			# Granddaughter
			triggered_desc = {
				trigger = { regula_is_neptis_eligible = yes }
				desc = trait_familia_paelex_neptis
			}
			# Great Granddaughter
			triggered_desc = {
				trigger = { regula_is_proneptis_eligible = yes }
				desc = trait_familia_paelex_proneptis
			}
			# Default
			desc = trait_familia_paelex
		}
	}
	# Description
	desc = {
		first_valid = {
			# Fallback - No Character
			triggered_desc = {
				trigger = { NOT = { exists = this } }
				desc = trait_familia_paelex_desc
			}
			# Daughter
			triggered_desc = {
				trigger = { regula_is_filia_eligible = yes }
				desc = trait_familia_paelex_filia_desc
			}
			# Granddaughter
			triggered_desc = {
				trigger = { regula_is_neptis_eligible = yes }
				desc = trait_familia_paelex_neptis_desc
			}
			# Great Granddaughter
			triggered_desc = {
				trigger = { regula_is_proneptis_eligible = yes }
				desc = trait_familia_paelex_proneptis_desc
			}
			# Default
			desc = trait_familia_paelex_character_desc
		}
	}
}

paelex = {
	# Grouping
	category = lifestyle
	group = devoted_trait_group
	level = 3
	opposites = {
		magister
	}

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
    stewardship = 3
	learning = 3
	diplomacy = 3
	prowess = 2
	fertility = 0.05
	health = miniscule_health_bonus
	attraction_opinion = 10
	same_opinion = 25
	opposite_opinion = 50
	stress_gain_mult = -0.2
	genetic_constraint_all = beauty_3
	flag = can_not_marry

	# AI Values
	ai_honor = dominant_positive_ai_value  # Should shut down seduce schemes.

	# Name
	name = {
		first_valid = {
			# Fallback - No Character
			triggered_desc = {
				trigger = { NOT = { exists = this } }
				desc = trait_paelex
			}
			# Queen
			triggered_desc = {
				trigger = { highest_held_title_tier = tier_kingdom }
				desc = trait_paelex_regina
			}
			# Duchess
			triggered_desc = {
				trigger = { highest_held_title_tier = tier_duchy }
				desc = trait_paelex_ducissa
			}
			# Countess
			triggered_desc = {
				trigger = { highest_held_title_tier = tier_county }
				desc = trait_paelex_comitissa
			}
			# Default
			desc = trait_paelex
		}
	}
	# Description
	desc = {
		first_valid = {
			# Fallback - No Character
			triggered_desc = {
				trigger = { NOT = { exists = this } }
				desc = trait_paelex_desc
			}
			# Queen
			triggered_desc = {
				trigger = { highest_held_title_tier = tier_kingdom }
				desc = trait_paelex_regina_desc
			}
			# Duchess
			triggered_desc = {
				trigger = { highest_held_title_tier = tier_duchy }
				desc = trait_paelex_ducissa_desc
			}
			# Countess
			triggered_desc = {
				trigger = { highest_held_title_tier = tier_county }
				desc = trait_paelex_comitissa_desc
			}
			# Default
			desc = trait_paelex_character_desc
		}
		first_valid = {
			# Add Economical archtype
			# Fallback - No Character
			triggered_desc = {
				trigger = { NOT = { exists = this } }
				desc = trait_paelex_ruling_style_none
			}
			# Warlike
			triggered_desc = {
				trigger = { ai_has_warlike_personality = yes }
				desc = trait_paelex_ruling_style_warlike
			}
			# Cautious
			triggered_desc = {
				trigger = { ai_has_cautious_personality = yes }
				desc = trait_paelex_ruling_style_cautious
			}
			# Builder
			triggered_desc = {
				trigger = { ai_has_economical_boom_personality = yes }
				desc = trait_paelex_ruling_style_builder
			}
			# Unpredictable
			triggered_desc = {
				trigger = { is_landed = yes }
				desc = trait_paelex_ruling_style_unpredictable
			}
		}
	}
}

tropaeum = {
	# Grouping
	category = lifestyle
	group = devoted_trait_group
	level = 2
	opposites = {
		magister
	}

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
	stewardship = 2
	learning = 2
	diplomacy = 2
	attraction_opinion = 10
	same_opinion = 25
	opposite_opinion = 35
	stress_gain_mult = -0.15
	genetic_constraint_all = beauty_2

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_tropaeum_desc
			}
			desc = trait_tropaeum_character_desc
		}
	}
}

mulsa = {
	# Grouping
	category = lifestyle
	group = devoted_trait_group
	level = 1
	opposites = {
		magister
	}

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
    stewardship = 2
	learning = 2
	diplomacy = 2
	attraction_opinion = 10
	same_opinion = 15
	opposite_opinion = 25
	stress_gain_mult = -0.1
	genetic_constraint_all = beauty_2

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_mulsa_desc
			}
			desc = trait_mulsa_character_desc
		}
	}
}

# Special Regula Traits
# Orba are Paelex or higher that have lost their Magister, either through divorce or death
# They can be reclaimed via marriage to a Magister
# They slowly lose a stacking amount of health each year
orba = {
	# Index and Grouping
	index = 6564
	category = lifestyle
	opposites = {
		magister
		devoted_trait_group
	}

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
	diplomacy = -5
	martial = -5
	stewardship = -5
	learning = -5
	intrigue = -5
	health = monumental_health_penalty	# Have a starting health loss, plus stacking -1 health loss each year.
	opposite_opinion = 50
	stress_gain_mult = 0.50
	flag = can_not_marry
	can_have_children = no

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_orba_desc
			}
			desc = trait_orba_character_desc
		}
	}
}

contubernalis = {
	# Index and Grouping
	index = 6565
	category = lifestyle
	opposites = {
		devoted_trait_group
		magister
	}

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
	diplomacy = 15
	stewardship = -10
	martial = -10
	intrigue = -10
	learning = -10
	prowess = 15
	immortal = yes # Grants immortality. The effect regula_turn_into_contubernalis also calls set_immortal_age = 20 to lock visual age and fertility at 20. See: common/scripted_effects/regula_contubernalis_effects.txt
	# Dummy flags — just here for loc really.
	flag = is_immortal
	flag = immortal_visuals
	flag = immortal_incapability
	stress_gain_mult = -1 # Ignorance is bliss, as they say.
	stress_loss_mult = 1
	dread_baseline_add = -25
	dread_loss_mult = 1
	can_have_children = no # Cant have children if you have no soul ;_;
	disables_combat_leadership = yes
	inheritance_blocker = all
	claim_inheritance_blocker = all
	flag = can_not_be_granted_titles
	flag = blocked_from_leaving	# Cannot leave player court
	flag = can_not_marry
	flag = is_naked

	faith_modifier = {
		parameter = regula_contubernalis_realm_benefits
		health = 1
		prowess = 10
	}

	# AI Values
	ai_honor = dominant_positive_ai_value
	ai_energy = -100

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_contubernalis_desc
			}
			desc = trait_contubernalis_character_desc
		}
	}
}

regula_undying = {
	# Index and Grouping
	index = 6566
	category = lifestyle
	opposites = {
		incapable
	}

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
	religious_head_opinion = 200
	stress_gain_mult = -1
	stress_loss_mult = 1
	negate_health_penalty_add = 1
	can_have_children = no
	dread_baseline_add = 25

	# Immortal effects
	immortal = yes
	# Dummy flags — just here for loc really.
	flag = is_immortal
	flag = immortal_visuals
	flag = immortal_incapability
	long_reign_bonus_mult = -1000
	no_prowess_loss_from_age = yes

	# AI Values
	ai_honor = dominant_positive_ai_value  # Should shut down seduce schemes.

	# Dynamic Icon — changes based on goddess type
	icon = {
		first_valid = {
			triggered_desc = {
				trigger = { NOT = { exists = this } }
				desc = "regula_undying.dds"
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_diplomacy_trait }
				desc = "regula_undying_diplomacy.dds"
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_martial_trait }
				desc = "regula_undying_martial.dds"
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_stewardship_trait }
				desc = "regula_undying_stewardship.dds"
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_intrigue_trait }
				desc = "regula_undying_intrigue.dds"
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_learning_trait }
				desc = "regula_undying_learning.dds"
			}
			desc = "regula_undying.dds"
		}
	}

	# Dynamic Name — changes based on goddess type
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { NOT = { exists = this } }
				desc = trait_regula_undying
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_diplomacy_trait }
				desc = trait_regula_undying_diplomacy
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_martial_trait }
				desc = trait_regula_undying_martial
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_stewardship_trait }
				desc = trait_regula_undying_stewardship
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_intrigue_trait }
				desc = trait_regula_undying_intrigue
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_learning_trait }
				desc = trait_regula_undying_learning
			}
			desc = trait_regula_undying
		}
	}

	# Dynamic Description — changes based on goddess type
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { NOT = { exists = this } }
				desc = trait_regula_undying_desc
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_diplomacy_trait }
				desc = trait_regula_undying_diplomacy_desc
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_martial_trait }
				desc = trait_regula_undying_martial_desc
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_stewardship_trait }
				desc = trait_regula_undying_stewardship_desc
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_intrigue_trait }
				desc = trait_regula_undying_intrigue_desc
			}
			triggered_desc = {
				trigger = { has_character_flag = regula_goddess_learning_trait }
				desc = trait_regula_undying_learning_desc
			}
			desc = trait_regula_undying_character_desc
		}
	}
}

sigillum = {
	# Index and Grouping
	index = 6567
	category = health

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
	health = medium_health_penalty
	intrigue = -2
	fertility = -0.2

	# AI Values
	ai_energy = -100

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_sigillum_desc
			}
			desc = trait_sigillum_character_desc
		}
	}
}

regula_virus = {
	# Grouping
	category = health

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
	diplomacy = -1
	intrigue = -1
	stewardship = -1
	martial = -1
	learning = -1

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_regula_virus_desc
			}
			desc = trait_regula_virus_character_desc
		}
	}
}

retired_paelex = {
	# Index and Grouping
	index = 6569
	category = lifestyle
	opposites = {
		devoted_trait_group
		magister
	}

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
	same_faith_opinion = 10
	opposite_opinion = 20
	flag = can_not_marry
	flag = can_not_be_granted_titles
	can_have_children = no
	inheritance_blocker = all

	# AI Values
	ai_energy = -50

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_retired_paelex_desc
			}
			desc = trait_retired_paelex_character_desc
		}
	}
}

regula_gossip = {
	# Index and Grouping
	index = 6570
	category = lifestyle

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
	diplomacy = 3
	intrigue = -1
	same_opinion = 10
	liege_opinion = -5

	# AI Values
	ai_energy = 20
	ai_sociability = 20
	ai_boldness = 20

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_regula_gossip_desc
			}
			desc = trait_regula_gossip_character_desc
		}
	}
}

regula_child_of_the_book = {
	# Index and Grouping
	index = 6571
	category = fame

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female

	# Effects
	diplomacy = 2
	martial = 2
	stewardship = 2
	intrigue = 2
	learning = 2
	prowess = 3
	opinion_of_liege = 20
	same_faith_opinion = 30
	monthly_lifestyle_xp_gain_mult = 0.25
	monthly_piety = 2
	stress_gain_mult = -0.25
	stress_loss_mult = 0.25

	# AI Values
	ai_energy = 50
	ai_honor = dominant_positive_ai_value

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_regula_child_of_the_book_desc
			}
			desc = trait_regula_child_of_the_book_character_desc
		}
	}
}

regula_privignus_of_the_magister = {
	# Index and Grouping
	index = 6572
	category = fame
	
	# Creation
	shown_in_ruler_designer = no
	inherit_chance = 0
	birth = 0
	random_creation = 0

	# Effects
	stewardship = 1
	learning = 1
	liege_opinion = 10
	same_faith_opinion = 10
	monthly_prestige = 0.05
	
	# AI Values
	ai_energy = 20
	ai_zeal = high_positive_ai_value

	# Description
	name = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_regula_privignus_of_the_magister
			}
			triggered_desc = {
				trigger = { is_female = yes }
				desc = trait_regula_privigna_of_the_magister
			}
			desc = trait_regula_privignus_of_the_magister
		}
	}
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_regula_privignus_of_the_magister_desc
			}
			desc = trait_regula_privignus_of_the_magister_character_desc
		}
	}
}

regula_blessed_pregnancy = {
	# Index and Grouping
	index = 6573
	category = health

	# Creation
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no
	valid_sex = female
	minimum_age = 16

	# Effects
	health = 2
	monthly_piety = 3
	stress_gain_mult = -0.25
	stress_loss_mult = 0.25

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_regula_blessed_pregnancy_desc
			}
			desc = trait_regula_blessed_pregnancy_character_desc
		}
	}
}
################ Regula Consecrated Blood ###################

# Consecrate Bloodline decision gives this to Magister and his children
# Sacrutus Genus means "Sacred Race"
# Magister is called "Prime" while his kids are called "Sanguis"
regula_sacrutus_genus_prime = {
	# Grouping
	category = fame
	opposites = {
		regula_sacrutus_genus_dimidium
	}

	# Creation
	# We add this on birth via on_action
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no

	# Effects
	regula_devoted_opinion = 10
	dynasty_opinion = 10 # The game forces +5 for same dynasty. This nets it to +15
	opposite_opinion = -15 # The game forces +5 for same dynasty. This nets it to -10

	# AI Values
	ai_zeal = 100

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_regula_sacrutus_genus_prime_desc
			}
			desc = trait_regula_sacrutus_genus_prime_character_desc
		}
	}
}

# Magisters children are called "Sanguis"
regula_sacrutus_genus_sanguis = {
	# Grouping
	category = fame
	opposites = {
		regula_sacrutus_genus_dimidium
	}

	# Creation
	# We add this on birth via on_action
	random_creation = 0
	birth = 0
	genetic = no
	shown_in_ruler_designer = no

	# Effects
	regula_devoted_opinion = 10
	dynasty_opinion = 10 # The game forces +5 for same dynasty. This nets it to +15
	opposite_opinion = -15 # The game forces +5 for same dynasty. This nets it to -10

	# AI Values
	ai_zeal = 20

	# Description
	# Formed of three parts
		# 1. This persons relation to Magister
		# 2. The mothers RM "rank" (Their devoted trait)
		# 3. Flavour ending description
	# Also has fallbacks that should never have be used, hopefully.
	desc = {
		# Fallback - No Character
		triggered_desc = {
			trigger = {
				NOT = { exists = this }
			}
			desc = trait_trait_regula_sacrutus_genus_sanguis_desc_default
		}
		# Other Fallback - With Character (but no Magister!)
		triggered_desc = {
			trigger = {
				exists = this
				NOT = { exists = global_var:magister_character }
			}
			desc = trait_trait_regula_sacrutus_genus_sanguis_desc_default_character
		}
		# Otherwise we build the proper desc
		# Relationship to Magister
		triggered_desc = {
			trigger = {
				exists = this
				exists = global_var:magister_character
			}
			desc = trait_regula_sacrutus_genus_sanguis_relation_child_desc
		}
		# Mothers Devoted rank
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = domina }
					real_father ?= { regula_is_magister = yes }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_domina
			}
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = paelex }
					real_father ?= { regula_is_magister = yes }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_paelex
			}
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = familia_paelex }
					real_father ?= { regula_is_magister = yes }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_familia_paelex
			}
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = tropaeum }
					real_father ?= { regula_is_magister = yes }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_tropaeum
			}
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = mulsa }
					real_father ?= { regula_is_magister = yes }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_mulsa
			}
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = retired_paelex }
					real_father ?= { regula_is_magister = yes }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_retired_paelex
			}
		}
		# Flavor description
		triggered_desc = {
			trigger = {
				exists = this
				exists = global_var:magister_character
			}
			desc = trait_regula_sacrutus_genus_sanguis_flavour_ending
		}
	}
}

# If the Magister has children with uncharmed women, the children become "Dimidium", meaning "half-(blood)"
# This trait is an opposite to Sacrutus Genus, giving a slight relation malus
regula_sacrutus_genus_dimidium = {
	# Grouping
	category = fame
	opposites = {
		regula_sacrutus_genus_prime
		regula_sacrutus_genus_sanguis
	}
	
	# Creation
	inherit_chance = 0
	birth = 0
	random_creation = 0
	shown_in_ruler_designer = no
	
	# Effects	
	regula_devoted_opinion = 10
	zealot_opinion = 10
	same_opinion = 5 #The game forces +5 for same dynasty. This nets it to +10
	opposite_opinion = -15 #The game forces +5 for same dynasty. This nets it to -10
	
	# AI Values
	ai_zeal = 15
	
	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_regula_sacrutus_genus_dimidium_desc
			}
			desc = trait_regula_sacrutus_genus_dimidium_character_desc
		}
	}
}