
############################
# MINOR TITLE COSTS
############################

minor_court_position_salary = {
	add = {
		value = 0.25
		desc = COURT_POSITION_SALARY_BREAKDOWN_BASE
		format = "BASE_VALUE_FORMAT_DECIMALS"
	}
	if = {
		limit = {
			scope:liege.sub_realm_size >= 120
		}
		multiply = {
			value = 1.6
			desc = enormous_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		} 
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 90
		}
		multiply = {
			value = 1.4
			desc = large_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		} 
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 60
		}
		multiply = {
			value = 1.2
			desc = medium_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 30
		}
		multiply =  {
			value =  1.1
			desc = small_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_late_medieval
				}
			}
		}
		multiply =  {
			value =  1.75
			desc = culture_era_late_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_high_medieval
				}
			}
		}
		multiply = {
			value = 1.5
			desc = culture_era_high_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_early_medieval
				}
			}
		}
		multiply = {
			value = 1.25
			desc = culture_era_early_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				highest_held_title_tier >= tier_empire
			}
		}
		multiply = {
			value = 1.25
			desc = empire_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				government_has_flag = government_is_tribal
			}
		}
		multiply = {
			value = 0.25
			desc = tribal_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_parameter = cheaper_court_positions
				}
			}
		}
		multiply = {
			value = 0.8
			desc = esteemed_hospitality_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
		}
	}
}
medium_court_position_salary = {
	add = {
		value = 0.5
		desc = COURT_POSITION_SALARY_BREAKDOWN_BASE
		format = "BASE_VALUE_FORMAT_DECIMALS"
	}
	if = {
		limit = {
			scope:liege.sub_realm_size >= 120
		}
		multiply = {
			value = 1.6
			desc = enormous_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 90
		}
		multiply = {
			value = 1.4
			desc = large_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 60
		}
		multiply = {
			value = 1.2
			desc = medium_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 30
		}
		multiply =  {
			value =  1.1
			desc = small_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_late_medieval
				}
			}
		}
		multiply = {
			value = 1.75
			desc = culture_era_late_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_high_medieval
				}
			}
		}
		multiply = {
			value = 1.5
			desc = culture_era_high_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_early_medieval
				}
			}
		}
		multiply = {
			value = 1.25
			desc = culture_era_early_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				highest_held_title_tier >= tier_empire
			}
		}
		multiply = {
			value = 1.25
			desc = empire_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				government_has_flag = government_is_tribal
			}
		}
		multiply = {
			value = 0.25
			desc = tribal_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_parameter = cheaper_court_positions
				}
			}
		}
		multiply = {
			value = 0.8
			desc = esteemed_hospitality_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
		}
	}
}
major_court_position_salary = {
	add = {
		value = 1.0
		desc = COURT_POSITION_SALARY_BREAKDOWN_BASE
		format = "BASE_VALUE_FORMAT_DECIMALS"
	}
	if = {
		limit = {
			scope:liege.sub_realm_size >= 120
		}
		multiply = {
			value = 1.6
			desc = enormous_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 90
		}
		multiply = {
			value = 1.4
			desc = large_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 60
		}
		multiply = {
			value = 1.2
			desc = medium_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 30
		}
		multiply =  {
			value =  1.1
			desc = small_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_late_medieval
				}
			}
		}
		multiply = {
			value = 1.75
			desc = culture_era_late_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_high_medieval
				}
			}
		}
		multiply = {
			value = 1.5
			desc = culture_era_high_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_early_medieval
				}
			}
		}
		multiply = {
			value = 1.25
			desc = culture_era_early_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				highest_held_title_tier >= tier_empire
			}
		}
		multiply = {
			value = 1.25
			desc = empire_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				government_has_flag = government_is_tribal
			}
		}
		multiply = {
			value = 0.25
			desc = tribal_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_parameter = cheaper_court_positions
				}
			}
		}
		multiply = {
			value = 0.8
			desc = esteemed_hospitality_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
		}
	}
}

court_position_physician_salary = {
	add = {
		value = 0.1
		desc = COURT_POSITION_SALARY_BREAKDOWN_BASE
		format = "BASE_VALUE_FORMAT_DECIMALS"
	}
	if = {
		limit = { exists = scope:liege }
		if = {
			limit = {
				scope:liege.culture = {
					has_cultural_era_or_later = culture_era_late_medieval
				}
			}
			multiply =  {
				value =  1.75
				desc = culture_era_late_medieval_salary_mod
				format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
			}
		}
		else_if = {
			limit = {
				scope:liege.culture = {
					has_cultural_era_or_later = culture_era_high_medieval
				}
			}
			multiply = {
				value = 1.5
				desc = culture_era_high_medieval_salary_mod
				format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
			}
		}
		else_if = {
			limit = {
				scope:liege.culture = {
					has_cultural_era_or_later = culture_era_early_medieval
				}
			}
			multiply = {
				value = 1.25
				desc = culture_era_early_medieval_salary_mod
				format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
			} 
		}
		if = {
			limit = {
				scope:liege = {
					highest_held_title_tier >= tier_empire
				}
			}
			multiply = {
				value = 1.25
				desc = empire_salary_mod
				format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
			} 
		}
		if = {
			limit = {
				scope:liege = {
					government_has_flag = government_is_tribal
				}
			}
			multiply = {
				value = 0.25
				desc = tribal_salary_mod
				format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
			} 
		}
		if = {
			limit = {
				scope:liege.culture = {
					has_cultural_parameter = cheaper_court_positions
				}
			}
			multiply = {
				value = 0.8
				desc = esteemed_hospitality_salary_mod
				format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
			}
		}
	}
}

court_position_antiquarian_salary = {
	add = {
		value = 0.15
		desc = COURT_POSITION_SALARY_BREAKDOWN_BASE
		format = "BASE_VALUE_FORMAT_DECIMALS"
	}
	if = {
		limit = {
			scope:liege.sub_realm_size >= 120
		}
		multiply = {
			value = 1.6
			desc = enormous_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		} 
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 90
		}
		multiply = {
			value = 1.4
			desc = large_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		} 
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 60
		}
		multiply = {
			value = 1.2
			desc = medium_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege.sub_realm_size >= 30
		}
		multiply =  {
			value =  1.1
			desc = small_realm_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_late_medieval
				}
			}
		}
		multiply =  {
			value =  1.75
			desc = culture_era_late_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_high_medieval
				}
			}
		}
		multiply = {
			value = 1.5
			desc = culture_era_high_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		}
	}
	else_if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_era_or_later = culture_era_early_medieval
				}
			}
		}
		multiply = {
			value = 1.25
			desc = culture_era_early_medieval_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		} 
	}
	if = {
		limit = {
			scope:liege = {
				highest_held_title_tier >= tier_empire
			}
		}
		multiply = {
			value = 1.25
			desc = empire_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
		} 
	}
	if = {
		limit = {
			scope:liege = {
				government_has_flag = government_is_tribal
			}
		}
		multiply = {
			value = 0.25
			desc = tribal_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
		} 
	}
	if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_parameter = cheaper_court_positions
				}
			}
		}
		multiply = {
			value = 0.8
			desc = esteemed_hospitality_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
		}
	}
}

court_position_travel_leader_salary = {
	add = {
		value = 0.1
		desc = COURT_POSITION_SALARY_BREAKDOWN_BASE
		format = "BASE_VALUE_FORMAT_DECIMALS"
	}
	
	if = {
		limit = {
			scope:liege = {
				culture = {
					has_cultural_parameter = cheaper_court_positions
				}
			}
		}
		multiply = {
			value = 0.8
			desc = esteemed_hospitality_salary_mod
			format = "BASE_VALUE_FORMAT_DECIMALS_MINUS_POSITIVE"
		}
	}
}

minor_court_position_task_prestige_salary = 0.2

minor_court_position_prestige_salary = 0.5
medium_court_position_prestige_salary = 1.0
major_court_position_prestige_salary = 2.0

minor_court_position_piety_salary = 0.5
medium_court_position_piety_salary = 1.0
major_court_position_piety_salary = 2.0

minor_court_position_prestige_cost = -0.2

minor_court_position_prestige_revoke_cost = {
	value = 25
	if = {
		limit = {
			exists = this
			has_character_flag = temporary_court_position_cost_removal
		}
		multiply = 0
	}
}
medium_court_position_prestige_revoke_cost = {
	value = 75
	if = {
		limit = {
			exists = this
			has_character_flag = temporary_court_position_cost_removal
		}
		multiply = 0
	}
}
major_court_position_prestige_revoke_cost = {
	value = 200
	if = {
		limit = {
			exists = this
			has_character_flag = temporary_court_position_cost_removal
		}
		multiply = 0
	}
}


# INFLUENCE - EP3
minor_court_position_influence_salary = 0.5
medium_court_position_influence_salary = 1.0
major_court_position_influence_salary = 2.0

minor_court_position_influence_cost = -0.2

minor_court_position_influence_revoke_cost = 25
medium_court_position_influence_revoke_cost = 75
major_court_position_influence_revoke_cost = 200


############################
# COURT POSITION EFFECTIVENESS LEVELS
############################

terrible_effectiveness = 1
poor_effectiveness = 2
average_effectiveness = 3
good_effectiveness = 4
excellent_effectiveness = 5

garuda_prowess_svalue = 8


executioner_control_value = {
	scope:actor = {
		every_court_position_holder = {
			type = executioner_court_position
			add = this.aptitude:executioner_court_position
		}
	}
	multiply = 3
}
executioner_control_value_tooltip = { # Keep identical to executioner_control_value
	every_court_position_holder = {
		type = executioner_court_position
		add = this.aptitude:executioner_court_position
	}
	multiply = 3
}

############################
# COURT POSITION OPINIONS
############################

regular_court_position_opinion = 5
ceremonial_court_position_opinion = 10
regular_camp_officer_opinion = 2
high_camp_officer_opinion = 5

court_jester_position_opinion = {
	scope:employee = {
		if = {
			limit = {
				has_no_particular_noble_roots_trigger = yes
			}
			value = 5
		}
		else = {
			value = -20
		}
	}
}



adjust_court_position_score_for_unity = {
	if = {
		limit = {
			scope:liege = { government_has_flag = government_is_clan }
			scope:employee = {
				house ?= scope:liege.house
				ai_wants_high_unity = yes
			}
		}
		add = 25
	}
	else_if = {
		limit = {
			scope:liege = { government_has_flag = government_is_clan }
			scope:employee = {
				NOT ={ house ?= scope:liege.house }
				ai_wants_low_unity = yes
			}
		}
		add = 25
	}
}
