﻿## Hosted Abdicator - Court Position

hosted_abdicator_court_position = {
	max_available_positions = 1
	sort_order = 372
	minimum_rank = duchy
	skill = learning

	court_position_asset = {
		animation = debating
		background = "gfx/interface/illustrations/event_scenes/ep3_relaxing_room.dds"
	}

	opinion = { 
		value = ceremonial_court_position_opinion 
	}

	aptitude_level_breakpoints = { 20 40 60 80 } #Breakpoints are customizable but it's 20 40 60 80 in every single position that currently exists in vanilla.

	aptitude = {
		value = 40
		add = {
			value = health
			multiply = -0.75
			max = 15
			desc = Health
		}
		if = {
			limit = {
				has_trait = diligent
			}
			add = {
				value = 60
				desc = court_position_diligent_trait
			}
		}
		if = {
			limit = {
				has_trait = gluttonous
			}
			add = {
				value = -20
				desc = court_position_gluttonous_trait
			}
		}
		if = {
			limit = {
				OR = {
				has_trait = depressed_1
				has_trait = depressed_genetic
				}
			}
			add = {
				value = -20
				desc = court_position_depressed_trait
			}
		}
		if = {
			limit = {
				has_trait = greedy
			}
			add = {
				value = -10
				desc = court_position_greedy_trait
			}
		}
		if = {
			limit = {
				has_trait = temperate
			}
			add = {
				value = 20
				desc = court_position_temperate_trait
			}
		}
		if = {
			limit = {
				has_trait = content
			}
			add = {
				value = 20
				desc = court_position_content_trait
			}
		}
		if = {
			limit = {
				has_trait = lazy
			}
			add = {
				value = -20
				desc = court_position_content_trait
			}
		}
	}

	is_shown = {
		NOR = { 
			government_has_flag = government_is_nomadic 
			government_has_flag = government_is_landless_adventurer 
		}
	}

	is_shown_character = {
		scope:employee = {
			is_imprisoned = no
			has_trait = abdicator_trait
			OR = { 
				is_courtier_of = scope:liege 
				AND = {
					is_vassal_of = scope:liege
					highest_held_title_tier = tier_barony
				}
			}
			
		}
	}

	valid_position = { 
	}

	valid_character = {
		scope:employee = {
			has_trait = abdicator_trait
		}
	}

	revoke_cost = {
		round = no
		prestige = { value = kickhostedabdicator_prestige_value }
	}

	salary = { 
		# Expenditure on upkeep for the abdicators lifestyle is handled by scaling_employer_modifiers, NOT salary.
	}


	base_employer_modifier = {
		monthly_prestige = 0.2
	}

# Lower aptitude means the ruler is less active in court. Lazies and gluttons give grandeur but cost more. Abdicators who are helping the player cost less but also provide less grandeur
	scaling_employer_modifiers = {
		aptitude_level_1 = {
			court_grandeur_baseline_add = 8
			monthly_income_mult = -0.07
			short_reign_duration_mult = -0.025
		}
		aptitude_level_2 = {
			court_grandeur_baseline_add = 6
			monthly_income_mult = -0.06
			short_reign_duration_mult = -0.05
		}
		aptitude_level_3 = {
			court_grandeur_baseline_add = 4
			monthly_income_mult = -0.05
			short_reign_duration_mult = -0.1
		}
		aptitude_level_4 = {
			court_grandeur_baseline_add = 2
			monthly_income_mult = -0.033
			short_reign_duration_mult = -0.125
		}
		aptitude_level_5 = {
			court_grandeur_baseline_add = 0
			monthly_income_mult = -0.02
			short_reign_duration_mult = -0.15
			monthly_lifestyle_xp_gain_mult = 0.05
		}
	}

	on_court_position_received = {
		basic_gained_court_position_effect = yes
	}

	on_court_position_revoked = {
		basic_revoked_court_position_effect = yes
	}

	on_court_position_invalidated = { 
		basic_invalidated_court_position_effect = yes
	}

	modifier = { 
		health = 0.20
		stress_loss_mult = 0.1
	}

	candidate_score = {
		value = 100
		add = scope:base_value
		add = court_position_candidate_score_base_value
		add = court_position_debt_considerations_value
		
		scope:liege = {
			# More likely if you have a lot of gold and can afford it
			if = {
				limit = {
					monthly_character_income > monthly_character_expenses_plus_fourty_percent
				}
				add = 100
			}
		}
	}
}