### Various Tasks ###
# Your mistress will either:
# - Smooze with the court and make you more popular, while listening out for secrets
# - Spend time with you and de-stress you

# Implement later
#mistress_court_position_task_socialise = {
#	court_position_types = { mistress_court_position }
#
#	is_shown = {
#		trigger_if = {
#			limit = {
#				is_ai = yes
#			}
#		}
#	}
#	ai_will_do = {
#		value = 100
#	}
#}
#
mistress_court_position_task_destress = {
	court_position_types = { mistress_court_position }

	is_shown = {
	}
	is_valid_showing_failures_only = { }

	cost = {
		round = no
		prestige = {
			add = {
				value = monthly_court_position_task_cost
				desc = COURT_POSITION_TASK_COST_BREAKDOWN_BASE
				format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
			}
		}
	}

	employee_modifier = {
		monthly_prestige = 0.25
	}

	scaling_employer_modifiers = {
		terrible = {
			stress_gain_mult = 0
		}
		poor = {
			stress_gain_mult = -0.05
		}
		average = {
			stress_gain_mult = -0.1
		}
		good = {
			stress_gain_mult = -0.2
		}
		excellent = {
			stress_gain_mult = -0.25
		}
	}
	
	on_yearly = {
		if = {
			limit = {
				scope:liege = {
					stress > 0
					is_physically_able = yes
				}
			}
			random = {
				chance = {
					value = 5
					switch = {
						trigger = "aptitude(mistress_court_position)"
						5 = { add = 40 }
						4 = { add = 30 }
						3 = { add = 25 }
						2 = { add = 15 }
						1 = { add = 5 }
					}
				}
				save_scope_as = mistress
				scope:liege = {
					random_list = {
						10 = { # Regular book reading
							trigger_event = {
								id = mistress_task.100
								days = { 0 100 }
							}
						}
						10 = { # Regular garden walk
							trigger_event = {
								id = mistress_task.200
								days = { 0 100 }
							}
						}
						10 = { # Major stress relief if has special knowledge
							trigger = {
								scope:mistress = {
									OR = {
										has_trait = lifestyle_mystic
										has_trait = lifestyle_gardener
										has_trait = lifestyle_herbalist
										has_trait = lifestyle_physician
										has_trait = scholar
										has_trait = witch
									}
								}
							}
							trigger_event = {
								id = mistress_task.300
								days = { 0 100 }
							}
						}
						10 = {
							trigger_event = {
								id = mistress_task.400
								days = { 0 100 }
							}
						}
						60 = {
							trigger_event = {
								id = mistress_task.1300
								days = { 0 150 }
							}
						}
					}
				}
			}
		}
	}

	on_start = {
		scope:liege ?= {
				custom_tooltip = mistress_destress_decision_tt
			}
		}

	on_end = { }

	ai_will_do = {
		value = 100
	}
}