﻿NCharacter = {
	RANDOM_CHARACTER_MIN_FERTILITY = 0.2
	RANDOM_CHARACTER_MAX_FERTILITY = 0.75

	RANDOM_CHARACTER_MIN_HEALTH = 3.0
	RANDOM_CHARACTER_MAX_HEALTH = 6.0
	RANDOM_CHARACTER_AGE_MIN_HEALTH = 2.1 # This is the minimum starting base health characters get after adjustments for age
		
	BASE_FERTILITY = 0.5
	BASE_HEALTH = 4.7

	MALE_ADULT_AGE = 16
	FEMALE_ADULT_AGE = 14
}

NOldAge = {
	LOWER_HEALTH_START_AGE = 25 # At this age characters start getting the chance to lose health each year
	LOWER_HEALTH_BASE_CHANCE = 0.08 # This is the base chance of losing health at the START_AGE
	LOWER_HEALTH_YEARLY_INCREASE = 0.023 # This is the yearly increase of the chance to lose health
	LOWER_HEALTH_AMOUNT = -0.135 # This is the health change on each failed yearly health roll
	HEALTH_PENALTY_PER_YEAR_IN_POOL = 0.11 # For each year in the pool, your effective health is this much lower. This disappears entirely when you leave the pool
	
	# This DIE values are used with a quadratic chance.
	DIE_HEALTH_TRESHOLD = 3.5 # Characters have a chance to die each DEATH_CHECK_INTERVAL days they have less health than this
	DIE_HEALTH_THRESHOLD = 3.5 # Characters have a chance to die each DEATH_CHECK_INTERVAL days they have less health than this
	DIE_HEALTH_CHANCE_ZERO = 0.25 # This is the DEATH_CHECK_INTERVAL chance that a character dies at zero health (or lower)
	
	DEATH_CHECK_INTERVAL = 30 # Check if the character should die from health this often (in days)
	DEATH_MINIMUM_DELAY = 15 # If marked for death, they will die at least this many days after the check
	DEATH_MAXIMUM_DELAY = 20 # If marked for death, they will die no more than this many days after the check. With these numbers, that means if someone becomes deathly ill, they have a high chance of dying between 7 and 40 days (30 days from the DEATH_CHECK_INTERVAL) after contracting the health penalty

}

NChildbirth = {
	MIN_REPRODUCTION_AGE_IN_HISTORY_DB = 12 # If a historical parent is younger than this when their child is born, we log an error
	MIN_FEMALE_REPRODUCTION_AGE = 14
	MAX_FEMALE_REPRODUCTION_AGE = 45
	MIN_MALE_REPRODUCTION_AGE = 15
	BASE_NR_OF_CHILDREN_PER_COUPLE = { 6 6 7 7 7 8 } # Based on tier of character or parents; whichever is higher Unlanded, Baron, Count, ..., Emperor
	CHANCE_OF_LOWERED_CHILD_LIMIT = 0.5	# Chance that the child limit is lowered by 1
	EXTRA_CHILDREN_FOR_RULERS = 1 # If either character is a ruler, they get extra children
	CHARACTER_IN_POOL_CHILD_LIMIT = -1	# If in the pool, child limit is modified by this
	CHILD_BIRTH_TO_PREGNANCY_WAIT = 2
	MALE_FERTILITY_MULTIPLIER_LIMITS = { 70 60 50 40 35 } # Ages where fertility multiplier is applied 25 means up to 25, needs to be sorted in descending order
	MALE_FERTILITY_MULTIPLIER = { 0.5 0.6 0.7 0.8 0.9 1.0 } # Multiplier values based on age limits from FERTILITY_MULTIPLIER_LIMITS should have an extra value at the beginning for characters older than first limit
	FEMALE_FERTILITY_MULTIPLIER_LIMITS = { 45 40 35 30 25 } # Ages where fertility multiplier is applied 25 means up to 25, needs to be sorted in descending order
	FEMALE_FERTILITY_MULTIPLIER = { 0.1 0.33 0.5 0.7 0.9 1.0 } # Multiplier values based on age limits from FERTILITY_MULTIPLIER_LIMITS should have an extra value at the beginning for characters older than first limit
	MOTHER_FERTILITY_REDUCTION_PER_PREVIOUS_CHILD = 0.03
	LOW_FERTILITY = 0.1
	PRIMARY_SPOUSE_FERTILITY_MULTIPLIER = 1
	SECONDARY_SPOUSE_FERTILITY_MULTIPLIER = 0.6
	CONCUBINE_FERTILITY_MULTIPLIER = 0.6
	NOT_SPOUSE_FERTILITY_MULTIPLIER = 1
	NON_RULER_FERTILITY_MULTIPLIER = 0.85	# If neither parent is a ruler, resulting fertility gets multiplied by this
	FERTILITY_CHANCE_MULTIPLIER = 4.75 # Fertility is an average between the father and the mother (if the mother has 0.3 and the father 0.5, the average is 0.4), this number is then multiplied by this multiplier to produce the percentage chance of impregnation. Impregnation is checked every month.
	MIN_FERTILITY_CHANCE = 1
	MAX_FERTILITY_CHANCE = 25
	TWIN_BASE_CHANCE = 0.02
	TWIN_BONUS_MAX_AGE = 35
	TWIN_BONUS_MIN_AGE = 25
	TWIN_BONUS_CHANCE = 0.02
	TWIN_MOTHER_HAD_TWINS_BONUS = 0.07
	TWIN_GRANDMOTHER_HAD_TWINS_BONUS = 0.05
	IDENTICAL_TWIN_CHANCE = 0.013
	PREGNANCY_DAYS = 280
	DAYS_TO_PREGNANCY_REVEAL = 60
	FEMALE_CHANCE = 49
	NEWBORN_HEALTH_BASE = 3.2
	NEWBORN_HEALTH_SPAN = 2.8
	NEWBORN_HEALTH_FEMALE_BONUS = 0.5

	EXTRA_CHILDREN_FOR_PLAYERS = 2 # Num of extra children players can have before reaching living child limit
	EXTRA_CHILDREN_PER_EXTRA_SPOUSE = 3 # Num of extra children per spouse above one before reaching living child limit
	EXTRA_CHILDREN_PER_EXTRA_CONCUBINE = 3 # Num of extra children per concubine above one before reaching living child limit
	EXTRA_FERTILITY_FOR_FIRST_CHILD = 0.0 # Extra fertility if the couple are primary spouses and have no children together
	EXTRA_FERTILITY_FOR_FIRST_RULER_CHILD = 0.3 # Extra fertility if the couple are primary spouses and have no children together, and at least one of them is a ruler
	DIVINE_MARRIAGE_FERTILITY_MULTIPLIER = 1 # Multiplier if the couple is close or extended family and their faith allows divine marriage
	CLOSE_FAMILY_FERTILITY_MULTIPLIER = 0.9 # Multiplier if the couple is close family and their faith does not allow divine marriage
	EXTENDED_FAMILY_FERTILITY_MULTIPLIER = 1 # Multiplier if the couple is extended family and their faith does not allow divine marriage
	FERTILITY_IN_POOL_MULTIPLIER = 0.25	# Characters in the pool will have their fertility multiplied by this
}

NMarriage = {
	AGE_OF_MARRIAGE_MALE = 16
	AGE_OF_MARRIAGE_FEMALE = 14
	MAX_ALLIANCE_FAMILY_DISTANCE_SUM = 4	# How far can the married characters be related (a sum of both distances) to the arrangers in order for the arrangers to get alliances.
	LANDED_AI_DESCENDANTS_CANT_MARRY_YEARS = 10	# For how many years can't same-subrealm players' children and grandchildren marry after when they're landed
}

