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

# 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 traits
# Each Magister trait is for each level of devotion
# Poenitens
# Exarch
magister_6 = {
	# Grouping
	category = lifestyle
	group = magister_trait_group
	level = 6

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

	# Effects
	diplomacy = 5
	learning = 5
    intrigue = 3
	martial = 3
	stewardship = 3
	fertility = 0.25
	prowess = 12

	attraction_opinion = 30
	same_faith_opinion = 25

	stress_gain_mult = -0.25
	dread_gain_mult = 0.5
	dread_decay_mult = -0.5
	monthly_piety = 3
	health = medium_health_bonus

	max_regula_fascinare_schemes_add = 1

	flag = carn_no_consequences_for_extramarital_sex_with_others

	# Compatible traits
	compatibility = {
		# Positive
		seducer = @pos_compat_high
		humble = @pos_compat_high
		lustful = @pos_compat_high
		trusting = @pos_compat_high
		humble = @pos_compat_medium
		zealous = @pos_compat_medium
		craven = @pos_compat_medium
		honest = @pos_compat_low

		# Negative
		chaste = @neg_compat_high
		arrogant = @neg_compat_high
		paranoid = @neg_compat_high
		ambitious = @neg_compat_medium
		cynical = @neg_compat_medium
		stubborn = @neg_compat_medium
		greedy = @neg_compat_low
		brave = @neg_compat_low
	}

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_magister_6_desc
			}
			desc = trait_magister_6_character_desc
		}
	}
}

# Synkellos
magister_5 = {
	# Grouping
	category = lifestyle
	group = magister_trait_group
	level = 5

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

	# Effects
	diplomacy = 5
	learning = 5
	intrigue = 3
	martial = 1
	stewardship = 1
	fertility = 0.2
	prowess = 10

	attraction_opinion = 25
	same_faith_opinion = 20

	stress_gain_mult = -0.20
	dread_gain_mult = 0.5
	dread_decay_mult = -0.25
	monthly_piety = 2
	health = minor_health_bonus

	max_regula_fascinare_schemes_add = 1

	flag = carn_no_consequences_for_extramarital_sex_with_others

	# Compatible traits
	compatibility = {
		# Positive
		seducer = @pos_compat_high
		humble = @pos_compat_high
		lustful = @pos_compat_high
		trusting = @pos_compat_high
		humble = @pos_compat_medium
		zealous = @pos_compat_medium
		craven = @pos_compat_medium
		honest = @pos_compat_low

		# Negative
		chaste = @neg_compat_high
		arrogant = @neg_compat_high
		paranoid = @neg_compat_high
		ambitious = @neg_compat_medium
		cynical = @neg_compat_medium
		stubborn = @neg_compat_medium
		greedy = @neg_compat_low
		brave = @neg_compat_low
	}

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_magister_5_desc
			}
			desc = trait_magister_5_character_desc
		}
	}
}

# Skeuophylax
magister_4 = {
	# Grouping
	category = lifestyle
	group = magister_trait_group
	level = 4

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

	# Effects
	diplomacy = 4
	learning = 4
	intrigue = 2
	fertility = 0.15
	prowess = 8

	attraction_opinion = 20
	same_faith_opinion = 15

	stress_gain_mult = -0.15
	dread_gain_mult = 0.25
	monthly_piety = 1.5
	health = miniscule_health_bonus

	max_regula_fascinare_schemes_add = 1

	flag = carn_no_consequences_for_extramarital_sex_with_others

	# Compatible traits
	compatibility = {
		# Positive
		seducer = @pos_compat_high
		humble = @pos_compat_high
		lustful = @pos_compat_high
		trusting = @pos_compat_high
		humble = @pos_compat_medium
		zealous = @pos_compat_medium
		craven = @pos_compat_medium
		honest = @pos_compat_low

		# Negative
		chaste = @neg_compat_high
		arrogant = @neg_compat_high
		paranoid = @neg_compat_high
		ambitious = @neg_compat_medium
		cynical = @neg_compat_medium
		stubborn = @neg_compat_medium
		greedy = @neg_compat_low
		brave = @neg_compat_low
	}

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_magister_4_desc
			}
			desc = trait_magister_4_character_desc
		}
	}
}

# Zelator
magister_3 = {
	# Grouping
	category = lifestyle
	group = magister_trait_group
	level = 3

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

	# Effects
	diplomacy = 3
	learning = 3
	intrigue = 1
	fertility = 0.1
	prowess = 5
	attraction_opinion = 10
	same_faith_opinion = 10

	stress_gain_mult = -0.10
	monthly_piety = 1
	flag = carn_no_consequences_for_extramarital_sex_with_others

	# Compatible traits
	compatibility = {
		# Positive
		seducer = @pos_compat_high
		humble = @pos_compat_high
		lustful = @pos_compat_high
		trusting = @pos_compat_high
		humble = @pos_compat_medium
		zealous = @pos_compat_medium
		craven = @pos_compat_medium
		honest = @pos_compat_low

		# Negative
		chaste = @neg_compat_high
		arrogant = @neg_compat_high
		paranoid = @neg_compat_high
		ambitious = @neg_compat_medium
		cynical = @neg_compat_medium
		stubborn = @neg_compat_medium
		greedy = @neg_compat_low
		brave = @neg_compat_low
	}

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_magister_3_desc
			}
			desc = trait_magister_3_character_desc
		}
	}
}

# Cenobite
magister_2 = {
	# Grouping
	category = lifestyle
	group = magister_trait_group
	level = 2

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

	# Effects
	diplomacy = 1
	learning = 1
	fertility = 0.05
	prowess = 3

	attraction_opinion = 5
	same_faith_opinion = 5
	stress_gain_mult = -0.05

	monthly_piety = 0.5
	flag = carn_no_consequences_for_extramarital_sex_with_others

	# Compatible traits
	compatibility = {
		# Positive
		seducer = @pos_compat_high
		humble = @pos_compat_high
		lustful = @pos_compat_high
		trusting = @pos_compat_high
		humble = @pos_compat_medium
		zealous = @pos_compat_medium
		craven = @pos_compat_medium
		honest = @pos_compat_low

		# Negative
		chaste = @neg_compat_high
		arrogant = @neg_compat_high
		paranoid = @neg_compat_high
		ambitious = @neg_compat_medium
		cynical = @neg_compat_medium
		stubborn = @neg_compat_medium
		greedy = @neg_compat_low
		brave = @neg_compat_low
	}

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_magister_2_desc
			}
			desc = trait_magister_2_character_desc
		}
	}
}

magister_1 = {
	# Grouping
	category = lifestyle
	group = magister_trait_group
    level = 1

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

	# Effects
    diplomacy = -3
	learning = -3
	prowess = -2
	stress_gain_mult = 0.25
	same_faith_opinion = -15
	fertility = -0.05
	health = minor_health_penalty
	flag = carn_no_consequences_for_extramarital_sex_with_others

	# Compatible traits
	compatibility = {
		# Positive
		seducer = @pos_compat_high
		humble = @pos_compat_high
		lustful = @pos_compat_high
		trusting = @pos_compat_high
		humble = @pos_compat_medium
		zealous = @pos_compat_medium
		craven = @pos_compat_medium
		honest = @pos_compat_low

		# Negative
		chaste = @neg_compat_high
		arrogant = @neg_compat_high
		paranoid = @neg_compat_high
		ambitious = @neg_compat_medium
		cynical = @neg_compat_medium
		stubborn = @neg_compat_medium
		greedy = @neg_compat_low
		brave = @neg_compat_low
	}

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_magister_1_desc
			}
			desc = trait_magister_1_character_desc
		}
	}
}

# 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_trait_group
	}

	# 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_trait_group
	}
	
	# 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 = { is_filia_eligible = yes }
				desc = trait_familia_paelex_filia
			}
			# Granddaughter
			triggered_desc = {
				trigger = { is_neptis_eligible = yes }
				desc = trait_familia_paelex_neptis
			}
			# Great Granddaughter
			triggered_desc = {
				trigger = { 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 = { is_filia_eligible = yes }
				desc = trait_familia_paelex_filia_desc
			}
			# Granddaughter
			triggered_desc = {
				trigger = { is_neptis_eligible = yes }
				desc = trait_familia_paelex_neptis_desc
			}
			# Great Granddaughter
			triggered_desc = {
				trigger = { 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_trait_group
	}

	# 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_trait_group
	}

	# 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_trait_group
	}

	# 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_trait_group
		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_trait_group
	}

	# 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 # set_immortal_age should be used during the effect to add this trait
	stress_gain_mult = -1 # Ignorance is bliss, as they say.
	stress_loss_mult = 1
	dread_baseline_add = -25
	dread_loss_mult = 1
	incapacitating = yes
	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 = 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.

	# Description
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = { exists = this }
				}
				desc = trait_regula_undying_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_trait_group
	}

	# 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
	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
	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 ?= { has_trait = magister_trait_group }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_domina
			}
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = paelex }
					real_father ?= { has_trait = magister_trait_group }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_paelex
			}
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = familia_paelex }
					real_father ?= { has_trait = magister_trait_group }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_familia_paelex
			}
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = tropaeum }
					real_father ?= { has_trait = magister_trait_group }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_tropaeum
			}
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = mulsa }
					real_father ?= { has_trait = magister_trait_group }
				}
				desc = trait_regula_sacrutus_genus_sanguis_mother_mulsa
			}
			triggered_desc = {
				trigger = {
					exists = this
					mother ?= { has_trait = retired_paelex }
					real_father ?= { has_trait = magister_trait_group }
				}
				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	
	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
		}
	}
}