﻿### HARDCODED ###
# Must have one entry of the "default" template, the template itself can be modified but one instance of it MUST exist with all parameters filled out

default = {
	first_name = culture 		# Picks a random first and last name from the culture, combines those together to make one name
	last_name = culture
	historical = no
	culture = primary_culture
	female = no
	dna = random 				# Generate random dna from a random ethnicity in the culture
	age = default 				# A random age base on AGE_GENERATION_STARTVAL + ( random_int % ( AGE_GENERATION_DICE_ROLL_MAGNITUDE + 1 ) )
	interest_group = random 	# Select a random interest group based on clout
	commander_rank = default	# commander rank if this character would be a military commander
	trait_generation = { 		# this effect will run as soon as the character is created (should only be used for traits)	
		if = {
			limit = {
				trait_value > 0
			}
			set_variable = has_historical_traits
			add_experience = trait_value
		}
		else = {
			add_experience = 4
		}

		if = {
			limit = {
				age < define:NCharacters|ADULT_AGE
			}
			add_trait = trait_child						
		}
		if = {
			limit = {
				age >= define:NCharacters|ADULT_AGE
				trait_value = 0
			}
			add_random_trait = personality
			if = {
				limit = { 
					OR = {
						NOT = { has_variable = has_historical_traits }
						trait_value <= 3
					}
				}
				add_random_trait = skill			
			}
		}	

		if = {
			limit = {
				age >= 45
				trait_value < 8
			}		
			random_list = {
				33 = {}
				33 = { add_experience = 1 }
				33 = { 
					add_experience = 2
					add_random_trait = skill 
				}
			}
		}
		if = {
			limit = {
				age >= 30
				NOT = { has_variable = has_historical_traits }
			}
			random_list = {
				95 = {}
				5 = { add_random_trait = condition }
			}						
		}
	}
}
