﻿###################################
# Character Weighting Values
# For a given character, each value will return a given score based on how relevant/important that character is to ROOT given the situation.
###################################
# Weight List:
#  captured_combatant_weights_for_root_participant		- For evaluating importance of prisoners captured during war, for the participants of that war.
#  captured_combatant_weights_for_root_nonparticipant	- For evaluating importance of prisoners captured during war for noncombatants (e.g., relatives of the prisoner).
#  slain_combatant_weights_for_root_participant			- For evaluating importance of casualties slain during war, for the participants of that war.
#  slain_combatant_weights_for_root_nonparticipant		- For evaluating importance of casualties slain during war for noncombatants (e.g., relatives of the deceased).

captured_combatant_weights_for_root_participant = {
	value = 0
	if = {
		limit = {
			# Captured primary participants are worth 100% warscore, so are absolute #1 priority.
			exists = scope:combat_war
			OR = {
				this = scope:combat_war.primary_attacker
				this = scope:combat_war.primary_defender
			}
		}
		add = 5000
	}
	if = {
		limit = {
			# Captured heirs of primary participants are worth 50% warscore, so are #2 priority.
			exists = scope:combat_war
			OR = {
				is_heir_of = scope:combat_war.primary_attacker
				is_heir_of = scope:combat_war.primary_defender
			}
		}
		add = 1000
	}
	if = { limit = { this = root.player_heir } # My own heir is of 3rd importance, since they are very important in the long term but not immediately relevant to the ongoing war.
		add = 500
	}
	if = {
		limit = {
			# The person I just defeated in combat is of 4th importance, since they are defeated 'for good' (for the moment).
			exists = scope:combat_loser
			this = scope:combat_loser
		}
		add = 100
	}
	if = { limit = { is_close_family_of = root}
		add = 50
	}
	if = { limit = { is_of_major_interest_to_root_trigger = yes }
		add = 10
	}
	if = { limit = { is_of_minor_interest_to_root_trigger = yes}
		add = 5
	}
	add = this.highest_held_title_tier
}

captured_combatant_weights_for_root_nonparticipant = {
	value = 0

	if = { limit = { this = root.player_heir }
		add = 1000
	}
	if = { limit = { is_heir_of = root }
		add = 500
	}
	if = { limit = { is_of_major_interest_to_root_trigger = yes }
		add = 100
	}
	if = { limit = { is_consort_of = root }
		add = 50
	}
	if = { limit = { is_child_of = root }
		add = 25
	}
	if = { limit = { is_of_minor_interest_to_root_trigger = yes	}
		add = 10
	}
	if = { limit = { is_courtier_of = root }
		add = 1
	}
	add = this.highest_held_title_tier
}

slain_combatant_weights_for_root_participant = {
	value = 0
	if = {
		limit = {
			# Slain primary participants do not give warscore, but can change the outcome of the ongoing war (esp. if their successors are reluctant to continue the war).
			exists = scope:combat_war
			OR = {
				this = scope:combat_war.primary_attacker
				this = scope:combat_war.primary_defender
			}
		}
		add = 1000
	}
	if = { limit = { this = root.player_heir } # I care about my heir in the long-term, even if not immediately relevant.
		add = 500
	}
	if = {
		limit = {
			# If I killed the person I just fought in battle, I don't have to worry about them any more!
			exists = scope:combat_loser
			this = scope:combat_loser
		}
		add = 100
	}
	if = { limit = { is_close_family_of = root}
		add = 50
	}
	if = { limit = { is_of_major_interest_to_root_trigger = yes }
		add = 10
	}
	if = { limit = { is_of_minor_interest_to_root_trigger = yes}
		add = 5
	}
	add = this.highest_held_title_tier
}

slain_combatant_weights_for_root_nonparticipant = {
	value = 0

	if = { limit = { this = root.player_heir }
		add = 1000
	}
	if = { limit = { is_heir_of = root }
		add = 500
	}
	if = { limit = { is_of_major_interest_to_root_trigger = yes }
		add = 100
	}
	if = { limit = { is_consort_of = root }
		add = 50
	}
	if = { limit = { is_child_of = root }
		add = 25
	}
	if = { limit = { is_of_minor_interest_to_root_trigger = yes	}
		add = 10
	}
	if = { limit = { is_courtier_of = root }
		add = 1
	}
	add = this.highest_held_title_tier
}