﻿#AuGu_weight_value = {
#	value = 1
#	add = AuGu_education_focus_weight_value
#	add = AuGu_learning_weight_value
#	if = {
#		limit = { culture = scope:AuGu_liege.culture }
#		add = 2
#	}
#	if = {
#		limit = { faith = scope:AuGu_liege.faith }
#		add = 2
#	}
#	if = {
#		limit = { has_council_position = councillor_court_chaplain }
#		add = 2
#	}
#	if = {
#		limit = { is_councillor = yes }
#		add = 1
#	}
#	if = {
#		limit = { dynasty = scope:AuGu_liege.dynasty }
#		add = 2
#	}
#	if = {
#		limit = { has_education_rank_5_trigger = yes }
#		add = 4
#	}
#	if = {
#		limit = { has_education_rank_4_trigger = yes }
#		add = 3
#	}
#	if = {
#		limit = { has_education_rank_3_trigger = yes }
#		add = 2
#	}
#	if = {
#		limit = { has_education_rank_2_trigger = yes }
#		add = 1
#	}
#	if = {
#		limit = {
#			OR = {
#				has_trait = intellect_good_1
#				has_trait = shrewd
#			}
#		}
#		add = 2
#	}
#	if = {
#		limit = { has_trait = intellect_good_2 }
#		add = 3
#	}
#	if = {
#		limit = { has_trait = intellect_good_3 }
#		add = 4
#	}
#	if = {
#		limit = { culture = { has_cultural_parameter = better_ward_education } }
#		add = 3
#	}
#	if = {
#		limit = {
#			num_sinful_traits = {
#				value > 0
#				faith = scope:AuGu_liege.faith
#			}
#		}
#		add = -2
#	}
#	if = {
#		limit = {
#			num_virtuous_traits = { 
#				value > 0
#				faith = scope:AuGu_liege.faith
#			}
#		}
#		add = 2
#	}
#}

### voir 00_education_effects.txt a partir ligne 288

AuGu_education_focus_weight_value = {
	if = {
		limit = { root = { has_focus = education_diplomacy } }
		add	= {
			value = diplomacy
			subtract = medium_skill_rating
		}
	}
	else_if = {
		limit = { root = { has_focus = education_martial } }
		add	= {
			value = martial
			subtract = medium_skill_rating
		}
	}
	else_if = {
		limit = { root = { has_focus = education_stewardship } }
		add	= {
			value = stewardship
			subtract = medium_skill_rating
		}
	}
	else_if = {
		limit = { root = { has_focus = education_intrigue } }
		add	= {
			value = intrigue
			subtract = medium_skill_rating
		}
	}
	else_if = {
		limit = { root = { has_focus = education_learning } }
		add	= {
			value = learning
			subtract = medium_skill_rating
		}
	}
}

AuGu_learning_weight_value = {
	value = 0
	add = {
		value = learning
		subtract = medium_skill_rating
	}
}

AuGu_check_weight_value = {
	value = 1
	add = AuGu_education_focus_weight_value
	add = AuGu_learning_weight_value
	if = {
		limit = { has_education_rank_5_trigger = yes }
		add = 4
	}
	if = {
		limit = { has_education_rank_4_trigger = yes }
		add = 3
	}
	if = {
		limit = { has_education_rank_3_trigger = yes }
		add = 2
	}
	if = {
		limit = { has_education_rank_2_trigger = yes }
		add = 1
	}
	if = {
		limit = { has_education_rank_1_trigger = yes }
		add = -1
	}
	if = {
		limit = {
			OR = {
				has_trait = intellect_good_1
				has_trait = shrewd
			}
		}
		add = 2
	}
	if = {
		limit = { has_trait = intellect_good_2 }
		add = 3
	}
	if = {
		limit = { has_trait = intellect_good_3 }
		add = 4
	}
	if = {
		limit = { culture = { has_cultural_parameter = better_ward_education } }
		add = 3
	}
	if = {
		limit = {
			num_sinful_traits = {
				value > 0
				target = scope:AuGu_liege.faith
			}
		}
		add = -2
	}
	if = {
		limit = {
			num_virtuous_traits = {
				value > 0
				target = scope:AuGu_liege.faith
			}
		}
		add = 2
	}
}

AuGu_check_weight_value_ts = -1

AuGu_multiply_ai_value = 10


AuGu_education_focus_weight_AI_value = {
	if = {
		limit = {  scope:recipient = { has_focus = education_diplomacy } }
		add	= {
			value = diplomacy
			subtract = medium_skill_rating
		}
	}
	else_if = {
		limit = { scope:recipient = { has_focus = education_martial } }
		add	= {
			value = martial
			subtract = medium_skill_rating
		}
	}
	else_if = {
		limit = { scope:recipient = { has_focus = education_stewardship } }
		add	= {
			value = intrigue
			subtract = medium_skill_rating
		}
	}
	else_if = {
		limit = { scope:recipient = { has_focus = education_intrigue } }
		add	= {
			value = intrigue
			subtract = medium_skill_rating
		}
	}
	else_if = {
		limit = { scope:recipient = { has_focus = education_learning } }
		add	= {
			value = learning
			subtract = medium_skill_rating
		}
	}
}

AuGu_learning_weight_AI_value = {
	value = 0
	add = {
		value = learning
		subtract = medium_skill_rating
	}
}

AuGu_check_weight_AI_value = {
	value = 1
	add = AuGu_education_focus_weight_AI_value
	add = AuGu_learning_weight_AI_value
	if = {
		limit = { has_education_rank_5_trigger = yes }
		add = 4
	}
	if = {
		limit = { has_education_rank_4_trigger = yes }
		add = 3
	}
	if = {
		limit = { has_education_rank_3_trigger = yes }
		add = 2
	}
	if = {
		limit = { has_education_rank_2_trigger = yes }
		add = 1
	}
	if = {
		limit = { has_education_rank_1_trigger = yes }
		add = -1
	}
	if = {
		limit = {
			OR = {
				has_trait = intellect_good_1
				has_trait = shrewd
			}
		}
		add = 2
	}
	if = {
		limit = { has_trait = intellect_good_2 }
		add = 3
	}
	if = {
		limit = { has_trait = intellect_good_3 }
		add = 4
	}
	if = {
		limit = { culture = { has_cultural_parameter = better_ward_education } }
		add = 3
	}
	if = {
		limit = {
			num_sinful_traits = {
				value > 0
				target = scope:actor.faith
			}
		}
		add = -2
	}
	if = {
		limit = {
			num_virtuous_traits = {
				value > 0
				target = scope:actor.faith
			}
		}
		add = 2
	}
}

AuGu_max_courtier_value = {
	value = 1
	scope:actor = {
		every_courtier = {
			limit = {
				is_physically_able_adult = yes
				num_of_relation_ward < 2
				is_imprisoned = no
				NOT = { has_trait = incapable }
			}
			add = 1
		}
	}
}