# Passthrough so the single override line isn't unreasonably long
# NB: This data is only shown/evaluated for living characters.

defined_text = {
	name = BCT_Wealth
	use_first_valid = yes
	text = {
		trigger = { is_alive = yes }
		localisation_key = BCT_Wealth_Actual
	}
}










###############################
#                             #
#        Wealth Amount        #
#                             #
###############################



defined_text = {
	name = BCT_Wealth_Amount
	use_first_valid = yes
	text = {
		trigger = { wealth = 2000 }
		localisation_key = BCT_Wealth_GT2000
	}
	text = {
		trigger = { wealth = 500 }
		localisation_key = BCT_Wealth_500_2000
	}
	text = {
		trigger = { wealth = 150 }
		localisation_key = BCT_Wealth_150_500
	}
	text = {
		trigger = { wealth = 50 }
		localisation_key = BCT_Wealth_50_150
	}
	text = {
		trigger = { wealth = 0 }
		localisation_key = BCT_Wealth_0_50
	}
	text = {
		trigger = { always = yes }
		localisation_key = BCT_Wealth_LT0
	}
}










################################
#                              #
#      Wealth Inheritance      #
#                              #
################################

# Rulers' wealth can be more difficult to inherit, flag this separately
defined_text = {
	name = BCT_Wealth_Inheritance_Ruler
	use_first_valid = yes
	text = {
		trigger = { is_ruler = yes }
		localisation_key = BCT_Wealth_Inheritance_Ruler_Actual
	}
}


# !!! IMPORTANT !!!
# Need to keep the "no relatives" alert in-sync with the individual alerts below.

defined_text = {
	name = BCT_Wealth_Inheritance_NoRelatives
	use_first_valid = yes
	text = {
		trigger = {
			NOR = {
				
				# Ancestors (4 generations)
				mother_even_if_dead = { is_alive = yes }
				father_even_if_dead = { is_alive = yes }
				mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } }
				mother_even_if_dead = { father_even_if_dead = { is_alive = yes } }
				father_even_if_dead = { mother_even_if_dead = { is_alive = yes } }
				father_even_if_dead = { father_even_if_dead = { is_alive = yes } }
				mother_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } }
				mother_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } }
				mother_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } }
				mother_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } }
				father_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } }
				father_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } }
				father_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } }
				father_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } }
				mother_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { father_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { father_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { father_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { father_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				
				# Descendants (4 generations)
				any_child_even_if_dead = {
					OR = {
						is_alive = yes
						any_child_even_if_dead = {
							OR = {
								is_alive = yes
								any_child_even_if_dead = {
									OR = {
										is_alive = yes
										any_child_even_if_dead = {
											is_alive = yes
										}
									}
								}
							}
						}
					}
				}
				
				# Siblings
				any_sibling_even_if_dead = { is_alive = yes }
				
			}
		}
		localisation_key = BCT_Wealth_Inheritance_NoRelatives_Actual
	}
}



defined_text = {
	name = BCT_Wealth_Inheritance_Ancestors
	use_first_valid = yes
	text = {
		trigger = {
			# Ancestors (4 generations)
			# Copied from above
			OR = {
				mother_even_if_dead = { is_alive = yes }
				father_even_if_dead = { is_alive = yes }
				mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } }
				mother_even_if_dead = { father_even_if_dead = { is_alive = yes } }
				father_even_if_dead = { mother_even_if_dead = { is_alive = yes } }
				father_even_if_dead = { father_even_if_dead = { is_alive = yes } }
				mother_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } }
				mother_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } }
				mother_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } }
				mother_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } }
				father_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } }
				father_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } }
				father_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } }
				father_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } }
				mother_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { father_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				mother_even_if_dead = { father_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { father_even_if_dead = { father_even_if_dead = { mother_even_if_dead = { is_alive = yes } } } }
				father_even_if_dead = { father_even_if_dead = { father_even_if_dead = { father_even_if_dead = { is_alive = yes } } } }
			}
		}
		localisation_key = BCT_Wealth_Inheritance_Ancestors_Actual
	}
}



defined_text = {
	name = BCT_Wealth_Inheritance_Descendants
	use_first_valid = yes
	text = {
		trigger = {
			# Descendants (4 generations)
			# Copied from above
			any_child_even_if_dead = {
				OR = {
					is_alive = yes
					any_child_even_if_dead = {
						OR = {
							is_alive = yes
							any_child_even_if_dead = {
								OR = {
									is_alive = yes
									any_child_even_if_dead = {
										is_alive = yes
									}
								}
							}
						}
					}
				}
			}
		}
		localisation_key = BCT_Wealth_Inheritance_Descendants_Actual
	}
}



defined_text = {
	name = BCT_Wealth_Inheritance_Siblings
	use_first_valid = yes
	text = {
		trigger = {
			# Siblings
			# Copied from above
			any_sibling_even_if_dead = { is_alive = yes }
		}
		localisation_key = BCT_Wealth_Inheritance_Siblings_Actual
	}
}