﻿get_hold_court_8001_flaw = { # Flavor for reasons they are a bad mayor
	type = character
	random_valid = yes

	text = {
		trigger = { has_trait = lazy }
		localization_key = hold_court_8001.desc_lazy
	}

	text = {
		trigger = { has_trait = greedy }
		localization_key = hold_court_8001.desc_greedy
	}

	text = {
		trigger = { has_trait = arbitrary }
		localization_key = hold_court_8001.desc_arbitrary
	}

	text = {
		trigger = { has_trait = deceitful }
		localization_key = hold_court_8001.desc_deceitful
	}

	text = {
		trigger = { stewardship <= 6 }
		localization_key = hold_court_8001.desc_incompetent
	}

	text = {
		trigger = { age < 25 }
		localization_key = hold_court_8001.desc_young
	}

	text = {
		trigger = { has_trait = infirm }
		localization_key = hold_court_8001.desc_infirm
	}

	text = {
		trigger = { has_trait = incapable }
		localization_key = hold_court_8001.desc_incapable
	}

	text = {
		trigger = { age > 60 }
		localization_key = hold_court_8001.desc_old
	}

	text = {
		trigger = { always = yes }
		localization_key = hold_court_8001.desc_fallback
	}
}

get_hold_court_8010_stake = { # Flavor for government type of worried vassal
	type = character

	text = {
		trigger = { government_has_flag = government_is_republic }
		localization_key = hold_court_8010.desc_republic
	}

	text = {
		trigger = { government_has_flag = government_is_theocracy }
		localization_key = hold_court_8010.desc_theocratic
	}

	text = {
		trigger = { always = yes }
		localization_key = hold_court_8010.desc_family
	}
}

get_hold_court_8020_holiness_1 = { # Describe the holiness of the target county
	type = character

	text = {
		trigger = {
			exists = var:holy_site_var
			var:holy_site_var = {
				any_county_province = {
					barony = {
						is_holy_site_of = ROOT.faith
						title_province = { has_special_building = yes }
					}
				}
			}
		}
		localization_key = holiness_cathedral_1
	}

	text = {
		trigger = {
			exists = var:holy_site_var
			var:holy_site_var = {
				any_county_province = {
					barony = { is_holy_site_of = ROOT.faith }
				}
			}
		}
		localization_key = holiness_holy_site_1
	}

	text = {
		trigger = { always = yes }
		localization_key = holiness_fallback_1
	}
}

get_hold_court_8020_holiness_2 = { # Describe the holiness of the target county
	type = character

	text = {
		trigger = {
			exists = var:holy_site_var
			var:holy_site_var = {
				any_county_province = {
					barony = {
						is_holy_site_of = ROOT.faith
						title_province = { has_special_building = yes }
					}
				}
			}
		}
		localization_key = holiness_cathedral_2
	}

	text = {
		trigger = {
			exists = var:holy_site_var
			var:holy_site_var = {
				any_county_province = {
					barony = { is_holy_site_of = ROOT.faith }
				}
			}
		}
		localization_key = holiness_holy_site_2
	}

	text = {
		trigger = { always = yes }
		localization_key = holiness_fallback_2
	}
}

get_hold_court_8020_holiness_3 = { # Describe the holiness of the target county
	type = character

	text = {
		trigger = {
			exists = var:holy_site_var
			var:holy_site_var = {
				any_county_province = {
					barony = {
						is_holy_site_of = ROOT.faith
						title_province = { has_special_building = yes }
					}
				}
			}
		}
		localization_key = holiness_cathedral_3
	}

	text = {
		trigger = {
			exists = var:holy_site_var
			var:holy_site_var = {
				any_county_province = {
					barony = { is_holy_site_of = ROOT.faith }
				}
			}
		}
		localization_key = holiness_holy_site_3
	}

	text = {
		trigger = {
			always = yes
		}
		localization_key = holiness_fallback_3
	}
}

get_hold_court_8100_parent = {
	type = character 

	text = {
		trigger = { # If male dominated
			faith = {
				NOT = { has_doctrine = doctrine_gender_male_dominated } 
			}
		}
		localization_key = mama
	}

	text = {
		trigger = { # If female dominated
			faith = {
				NOT = { has_doctrine = doctrine_gender_female_dominated }
			}
		}
		localization_key = papa
	}

	text = {
		trigger = { always = yes }
		localization_key = hold_court_8100_parent_general
	}
}

get_hold_court_8100_situation = {
	type = character 
	random_valid = yes

	text = {
		trigger = {
			OR = {
				AND = {
					faith = {
						NOT = { has_doctrine = doctrine_gender_male_dominated } 
					}
					mother ?= { is_alive = no }
				}
				AND = {
					faith = {
						NOT = { has_doctrine = doctrine_gender_female_dominated } 
					}
					father ?= { is_alive = no }
				}
			}
		}
		localization_key = hold_court_8100_situation_dead
	}

	text = {
		trigger = {
			OR = {
				AND = {
					faith = {
						NOT = { has_doctrine = doctrine_gender_male_dominated } 
					}
					mother ?= { is_imprisoned = yes }
				}
				AND = {
					faith = {
						NOT = { has_doctrine = doctrine_gender_female_dominated } 
					}
					father ?= { is_imprisoned = yes }
				}
			}
		}
		localization_key = hold_court_8100_situation_jailed
	}

	text = {
		trigger = { always = yes }
		localization_key = hold_court_8100_situation_unknown
	}
}

get_hold_court_8190_ethos = {
	type = character 
	random_valid = yes

	text = {
		trigger = {
			culture = { has_cultural_pillar = ethos_bellicose }
		}
		localization_key = hold_court_8190_bellicose
	}

	text = {
		trigger = {
			culture = { has_cultural_pillar = ethos_stoic }
		}
		localization_key = hold_court_8190_stoic
	}

	text = {
		trigger = {
			culture = { has_cultural_pillar = ethos_bureaucratic }
		}
		localization_key = hold_court_8190_bureaucratic
	}

	text = {
		trigger = {
			culture = { has_cultural_pillar = ethos_spiritual }
		}
		localization_key = hold_court_8190_spiritual
	}

	text = {
		trigger = {
			culture = { has_cultural_pillar = ethos_courtly }
		}
		localization_key = hold_court_8190_courtly
	}

	text = {
		trigger = {
			culture = { has_cultural_pillar = ethos_egalitarian }
		}
		localization_key = hold_court_8190_egalitarian
	}

	text = {
		trigger = {
			culture = { has_cultural_pillar = ethos_communal }
		}
		localization_key = hold_court_8190_communal
	}
}

