﻿# Activity-owned specialist offices. Both use a Master-of-the-Hunt-style
# yearly task to search for the named quarry required by the legendary mode.

cagm_master_fisher_court_position = {
	sort_order = 213
	max_available_positions = 1
	minimum_rank = county
	skill = learning

	court_position_asset = {
		animation = admiration
		background = "gfx/interface/illustrations/activity_backgrounds/activity_cagm_royal_fishing.dds"
	}

	opinion = { value = regular_court_position_opinion }
	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 10
		add = {
			value = learning
			multiply = 1.5
			max = 30
			desc = cagm_master_fisher_aptitude_learning
		}
		add = {
			value = prowess
			multiply = 1.5
			max = 30
			desc = cagm_master_fisher_aptitude_prowess
		}
		if = { limit = { has_trait = cagm_angler } add = { value = 10 desc = cagm_master_fisher_aptitude_angler } }
		if = { limit = { has_trait_xp = { trait = cagm_angler value >= 50 } } add = { value = 10 desc = cagm_master_fisher_aptitude_angler } }
		if = { limit = { has_trait_xp = { trait = cagm_angler value >= 100 } } add = { value = 10 desc = cagm_master_fisher_aptitude_angler } }
		if = { limit = { has_trait = patient } add = { value = 10 desc = court_position_patient_trait } }
		if = { limit = { has_trait = diligent } add = { value = 5 desc = court_position_diligent_trait } }
		if = { limit = { has_trait = impatient } add = { value = -10 desc = court_position_impatient_trait } }
		if = { limit = { has_trait = lazy } add = { value = -10 desc = court_position_lazy_trait } }
		add = court_position_aptitude_high_penalty_value
		add = general_aptitude_bonus
	}

	is_shown = {
		is_landed_or_landless_administrative = yes
		NOT = { government_has_flag = government_is_nomadic }
		NOT = { government_has_flag = government_is_landless_adventurer }
	}

	valid_position = {
		is_landed_or_landless_administrative = yes
		highest_held_title_tier >= tier_county
		NOT = { government_has_flag = government_is_nomadic }
		NOT = { government_has_flag = government_is_landless_adventurer }
	}

	is_shown_character = {
		scope:employee = { court_position_employee_shown_trigger = yes }
	}

	valid_character = {
		scope:employee = {
			liege = scope:liege
			is_adult = yes
			is_imprisoned = no
			NOT = { is_incapable = yes }
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = { limit = { exists = this is_ai = yes } multiply = 0 }
		}
	}

	salary = {
		gold = {
			value = minor_court_position_salary
			if = { limit = { scope:liege = { has_treasury = yes } } multiply = 0 }
		}
		treasury = {
			value = minor_court_position_salary
			if = { limit = { scope:liege = { has_treasury = no } } multiply = 0 }
		}
		prestige = { value = minor_court_position_prestige_salary }
		round = no
	}

	received_salary = {
		gold = { value = minor_court_position_salary }
		prestige = { value = minor_court_position_prestige_salary }
		round = no
	}

	scaling_employer_modifiers = {
		terrible = { stress_loss_mult = 0.01 }
		poor = { stress_loss_mult = 0.02 }
		average = { stress_loss_mult = 0.03 }
		good = { stress_loss_mult = 0.04 }
		excellent = { stress_loss_mult = 0.05 }
	}
	custom_employer_modifier_description = cagm_master_fisher_employer_custom_effect_description

	modifier = {
		learning = 1
		monthly_prestige = 0.10
	}

	on_court_position_vacated = {
		court_position_vacated_event_effect = { COURT_POSITION_TYPE = cagm_master_fisher_court_position }
	}

	ai_position_score = {
		value = 35
		scope:liege = {
			if = { limit = { has_character_flag = cagm_fishing_legendary_rumor } add = -15 }
		}
		add = court_position_debt_considerations_value
	}

	ai_candidate_score = {
		value = 25
		add = scope:base_value
		add = court_position_candidate_score_base_value
		add = court_position_candidate_aptitude_value
	}
}

cagm_master_whaler_court_position = {
	sort_order = 212
	max_available_positions = 1
	minimum_rank = county
	skill = prowess

	court_position_asset = {
		animation = relaxed_spear
		background = "gfx/interface/illustrations/activity_backgrounds/activity_cagm_whaling_voyage.dds"
	}

	opinion = { value = regular_court_position_opinion }
	aptitude_level_breakpoints = { 20 40 60 80 }

	aptitude = {
		value = 10
		add = {
			value = prowess
			multiply = 2
			max = 40
			desc = cagm_master_whaler_aptitude_prowess
		}
		add = {
			value = martial
			multiply = 1.5
			max = 30
			desc = cagm_master_whaler_aptitude_martial
		}
		if = { limit = { has_trait = cagm_whaler } add = { value = 10 desc = cagm_master_whaler_aptitude_whaler } }
		if = { limit = { has_trait_xp = { trait = cagm_whaler value >= 50 } } add = { value = 10 desc = cagm_master_whaler_aptitude_whaler } }
		if = { limit = { has_trait_xp = { trait = cagm_whaler value >= 100 } } add = { value = 10 desc = cagm_master_whaler_aptitude_whaler } }
		if = { limit = { has_trait = brave } add = { value = 10 desc = court_position_brave_trait } }
		if = { limit = { has_trait = diligent } add = { value = 5 desc = court_position_diligent_trait } }
		if = { limit = { has_trait = craven } add = { value = -15 desc = court_position_craven_trait } }
		if = { limit = { has_trait = lazy } add = { value = -10 desc = court_position_lazy_trait } }
		add = court_position_aptitude_high_penalty_value
		add = general_aptitude_bonus
	}

	is_shown = {
		is_landed_or_landless_administrative = yes
		NOT = { government_has_flag = government_is_nomadic }
		NOT = { government_has_flag = government_is_landless_adventurer }
		cagm_whaling_practice_access_trigger = yes
	}

	valid_position = {
		is_landed_or_landless_administrative = yes
		highest_held_title_tier >= tier_county
		NOT = { government_has_flag = government_is_nomadic }
		NOT = { government_has_flag = government_is_landless_adventurer }
		cagm_whaling_practice_access_trigger = yes
	}

	is_shown_character = {
		scope:employee = { court_position_employee_shown_trigger = yes }
	}

	valid_character = {
		scope:employee = {
			liege = scope:liege
			is_adult = yes
			is_imprisoned = no
			NOT = { is_incapable = yes }
		}
	}

	revoke_cost = {
		prestige = {
			value = minor_court_position_prestige_revoke_cost
			if = { limit = { exists = this is_ai = yes } multiply = 0 }
		}
	}

	salary = {
		gold = {
			value = minor_court_position_salary
			if = { limit = { scope:liege = { has_treasury = yes } } multiply = 0 }
		}
		treasury = {
			value = minor_court_position_salary
			if = { limit = { scope:liege = { has_treasury = no } } multiply = 0 }
		}
		prestige = { value = minor_court_position_prestige_salary }
		round = no
	}

	received_salary = {
		gold = { value = minor_court_position_salary }
		prestige = { value = minor_court_position_prestige_salary }
		round = no
	}

	scaling_employer_modifiers = {
		terrible = { monthly_prestige = 0.02 }
		poor = { monthly_prestige = 0.05 }
		average = { monthly_prestige = 0.10 }
		good = { monthly_prestige = 0.15 }
		excellent = { monthly_prestige = 0.25 }
	}
	custom_employer_modifier_description = cagm_master_whaler_employer_custom_effect_description

	modifier = {
		martial = 1
		monthly_prestige = 0.15
	}

	on_court_position_vacated = {
		court_position_vacated_event_effect = { COURT_POSITION_TYPE = cagm_master_whaler_court_position }
	}

	ai_position_score = {
		value = 35
		scope:liege = {
			if = { limit = { has_character_flag = cagm_whaling_legendary_rumor } add = -15 }
		}
		add = court_position_debt_considerations_value
	}

	ai_candidate_score = {
		value = 25
		add = scope:base_value
		add = court_position_candidate_score_base_value
		add = court_position_candidate_aptitude_value
	}
}
