### This file determines how the ai evaluates the council positions.
# The ai will add all of the ai_selection entries under ai_selection_additive = {} for all of the positions.
# If there's any of the positions with an ai_selection value higher than zero (0) the position with the HIGHEST score will be chosen by that ai.
# If there's no position with an  ai_selection value higher than zero (0) the ai will go through the list of positions in order of the default selection value and pick the first position which fulfill the potential = {} trigger.

### It also determines how a position will vote in the realm interactions the council is allowed to vote in. 
# This is determined with a FOR trigger which checks if the voter will vote in favor of a decision. 
# If that fails the voter will then go through the AGAINST trigger to see if it will vote against a decision. 
# If both those triggers fail the voter will abstain from voting until swayed by the for or against side.

### SCOPES AND SPECIAL TRIGGERS FOR WAR TARGET TRIGGER:
#liege == FROM
#target == FROMFROM

### SCOPES AND SPECIAL TRIGGERS FOR WAR DECLARATION VOTES:
#attacker == FROM
#defender == FROMFROM
#thirdparty == FROMFROMFROM
#thirdparty_title == FROMFROMFROMFROM
#stored_token_trigger = cb_type ### trigger that's available in the FROM or ROOT scope.

glory_hound = {
	icon = 5
	
	potential = { # The player also needs to obey the potential triggers when choosing a position.
		#NOT = { trait = craven } #added negative modifier instead
		NOT = { trait = horse }
	}
	
	default_selection = {
		value = 0
	}
	
	selection = {
		value = 0
		
		additive_opinion_modifier = { # Adds the opinion from 'ROOT' to 'who' multiplied by factor to the score.
			who = liege
			factor = -0.4
			always = yes
		}
		additive_power_diff_modifier = { # Adds the percentage of available troops from 'ROOT' to 'who' multiplied by factor to the score.
			who = liege
			factor = 1
			always = yes
		}
		additive_realm_size_modifier = { 
			factor = 15
			balance = 50
			always = yes
		}
		additive_modifier = { # Threshold
			value = 30
			always = yes
		}		
		additive_modifier = {
			value = 10
			trait = brave
		}
		additive_modifier = {
			value = 10
			trait = honest
		}
		additive_modifier = {
			value = 10
			trait = proud
		}
		#additive_modifier = {
		#	value = 10
		#	OR = {
		#		trait = misguided_warrior
		#		trait = tough_soldier
		#		trait = skilled_tactician
		#		trait = brilliant_strategist
		#	}
		#}
		additive_modifier = {
			value = 20
			in_faction = faction_glory
		}
		additive_modifier = {
			value = -50
			trait = craven
		}
		additive_modifier = {
			value = -10
			trait = shy
		}
		additive_modifier = {
			value = -10
			trait = humble
		}
		additive_modifier = {
			value = -10
			trait = content
		}
	}
	
	war_target = {
		FROMFROM = {
			NOT = {
				is_close_relative = ROOT
			}
			NOT = {
				relative_power_including_allies_defender = {
					who = FROM
					power = 2
				}
			}
			FROM = {
				NOT = {
					relative_power_including_allies_attacker = {
						who = FROMFROM
						power = 3
					}
				}
			}
		}
	}
	
	voting_patterns = {
		me_pattern_for
		selfish_pattern_for
		selfish_pattern_against
		family_pattern_for
		family_pattern_against
		faction_pattern_for
		faction_pattern_against
		glory_hound_pattern_for
		glory_hound_pattern_against
		interaction_pattern_for
		interaction_pattern_against
		preferred_war_target_pattern_against
	}
}