﻿#Education focuses
#List them in the order they appear in the interface, clockwise

#prowess
education_nht_prowess = {
	type = education

	skill = prowess
	
	desc = {
		desc = education_nht_prowess_desc
		first_valid = {
			triggered_desc = {
				trigger = { has_prowess_education_affinity_childhood_trait_trigger = yes }
				desc = education_nht_prowess_tt.affinity
			}
			triggered_desc = {
				trigger = { has_prowess_education_disaffinity_childhood_trait_trigger = yes }
				desc = education_nht_prowess_tt.disaffinity
			}
		}
		triggered_desc = {
			trigger = {
				liege = { employs_court_position = court_tutor_court_position }
			}
			desc = education_any_tt.court_tutor
		}
		desc = line_break
	}

	is_default = {
		has_trait = rowdy
	}

	is_good_for = {
		has_prowess_education_affinity_childhood_trait_trigger = yes
	}

	is_bad_for = {
		has_prowess_education_disaffinity_childhood_trait_trigger = yes
	}
	
	on_change_to = {
		if = {
			limit = {
				exists = var:education_point_gain_variable
			}
			change_variable = {
				name = education_point_gain_variable
				multiply = point_conversion_factor
			}
			set_variable = {
				name = education_nht_prowess_variable
				value = var:education_point_gain_variable
			}
			remove_variable = education_point_gain_variable
		}
	}
	
	on_change_from = {
		if = {
			limit = {
				is_alive = yes
				is_adult = no
			}
			add_character_flag = nht_prowess_previous_education
			if = {
				limit = {
					has_variable = education_nht_prowess_variable
				}
				set_variable = {
					name = education_point_gain_variable
					value = var:education_nht_prowess_variable
				}
				remove_variable = education_nht_prowess_variable
			}
			if = {
				limit = {
					any_relation = {
						type = guardian
						NOT = { is_parent_of = root }
					}
				}
				save_scope_as = ward
				random_relation = {
					type = guardian
					trigger_event = childhood_education.0004
				}
			}
		}
	}
		
	modifier = {
		prowess = 1
	}


	auto_selection_weight = {
		value = 100
		if = {
			limit = {
				has_prowess_education_affinity_childhood_trait_trigger = yes
			}
			add = 950
		}
		if = {
			limit = { has_prowess_education_disaffinity_childhood_trait_trigger = yes }
			add = -900
		}
		if = {
			limit = { NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } } }
			multiply = 0.2
		}
	}
}

#Learning
education_nht_leadership = {
	type = education
	
	skill = learning

	desc = {
		desc = education_nht_leadership_desc
		first_valid = {
			triggered_desc = {
				trigger = { has_nht_leadership_education_affinity_childhood_trait_trigger = yes }
				desc = education_nht_leadership_tt.affinity
			}
			triggered_desc = {
				trigger = { has_nht_leadership_education_disaffinity_childhood_trait_trigger = yes }
				desc = education_nht_leadership_tt.disaffinity
			}
		}
		triggered_desc = {
			trigger = {
				liege = { employs_court_position = court_tutor_court_position }
			}
			desc = education_any_tt.court_tutor
		}
		desc = line_break
	}

	is_default = {
		has_trait = pensive
	}

	is_good_for = {
		has_nht_leadership_education_affinity_childhood_trait_trigger = yes
	}

	is_bad_for = {
		has_nht_leadership_education_disaffinity_childhood_trait_trigger = yes
	}
	
	on_change_to = {
		if = {
			limit = {
				exists = var:education_point_gain_variable
			}
			change_variable = {
				name = education_point_gain_variable
				multiply = point_conversion_factor
			}
			set_variable = {
				name = education_nht_leadership_variable
				value = var:education_point_gain_variable
			}
			remove_variable = education_point_gain_variable
		}
	}
	
	on_change_from = {
		if = {
			limit = {
				is_alive = yes
				is_adult = no
			}
			add_character_flag = nht_leadership_previous_education
			if = {
				limit = {
					has_variable = education_nht_leadership_variable
				}
				set_variable = {
					name = education_point_gain_variable
					value = var:education_nht_leadership_variable
				}
				remove_variable = education_nht_leadership_variable
			}
			if = {
				limit = {
					any_relation = {
						type = guardian
						NOT = { is_parent_of = root }
					}
				}
				save_scope_as = ward
				random_relation = {
					type = guardian
					trigger_event = childhood_education.0004
				}
			}
		}
	}

	auto_selection_weight = {
		value = 100
		if = {
			limit = { has_nht_leadership_education_affinity_childhood_trait_trigger = yes }
			add = 950
		}
		if = {
			limit = { has_nht_leadership_education_disaffinity_childhood_trait_trigger = yes }
			add = -900
		}
	}
		
	modifier = {
		stewardship = 1
	}
}