﻿femme_fatale_task_poison_opinion = {
	court_position_types = { 
		femme_fatale_court_position
	}
	is_shown = {
	}
	is_valid_showing_failures_only = {
	}
	cost = {
		round = no
		gold = {
			value = 0
			if = {
				limit = {
					scope:liege = {
						has_treasury = no
					}
				}
			}
			add = {
				value = monthly_court_position_task_cost
				desc = COURT_POSITION_TASK_COST_BREAKDOWN_BASE
				format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
			}
		}
		treasury = {
			value = 0
			if = {
				limit = {
					scope:liege = {
						has_treasury = yes
					}
				}
				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 = minor_court_position_task_prestige_salary
	}

	base_employer_modifier = {
		max_poison_opinion_schemes_add = 1
	}

	# Set Poison Opinion variable on start
	on_start = { 
		scope:liege = {
			set_variable = {
				name = femme_fatale_is_poisoning_opinion
				value = yes
			}
		}
		custom_tooltip = allow_poisoning_opinion_scheme_tt
	}

	# If it's fallen off while still working, reapply when we can; this can happen if say a Liege dies
	on_monthly = {
		if = {
			limit = { scope:liege.var:femme_fatale_is_poisoning_opinion = no }
			set_variable = {
				name = femme_fatale_is_poisoning_opinion
				value = yes
			}
		}
	}

	on_end = { 
		scope:liege = {
			set_variable = {
				name = femme_fatale_is_poisoning_opinion
				value = no
			}
		}
	}

	ai_will_do = {
		value = {
			add = 25
			add = ai_rationality
			add = ai_vengefulness
			subtract = ai_honor
			subtract = ai_compassion
		}
	}
}

femme_fatale_task_embrace_the_spiders = {
	court_position_types = { 
		femme_fatale_court_position
	}
	is_shown = {
	}
	is_valid_showing_failures_only = {
	}
	cost = {
		round = no
		gold = {
			value = 0
			if = {
				limit = {
					scope:liege = {
						has_treasury = no
					}
				}
			}
			add = {
				value = monthly_court_position_task_cost
				desc = COURT_POSITION_TASK_COST_BREAKDOWN_BASE
				format = "BASE_VALUE_FORMAT_DECIMALS_PLUS_NEGATIVE"
			}
		}
		treasury = {
			value = 0
			if = {
				limit = {
					scope:liege = {
						has_treasury = yes
					}
				}
				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 = minor_court_position_task_prestige_salary
	}

	# Set Embracing the Spiders variable on start
	on_start = { 
		scope:liege = {
			set_variable = {
				name = femme_fatale_is_embracing_the_spiders
				value = yes
			}
		}
		custom_tooltip = femme_fatale_increase_spy_discovery_chance_tt
	}

	# If it's fallen off while still working, reapply when we can; this can happen if say a Liege dies
	on_monthly = {
		if = {
			limit = { scope:liege.var:femme_fatale_is_embracing_the_spiders = no }
			set_variable = {
				name = femme_fatale_is_embracing_the_spiders
				value = yes
			}
		}
	}

	on_end = { 
		scope:liege = {
			set_variable = {
				name = femme_fatale_is_embracing_the_spiders
				value = no
			}
		}
	}

	scaling_employer_modifiers = {
		terrible = {
		 	enemy_scheme_secrecy_add = -1
		}
		poor = {
		 	enemy_scheme_secrecy_add = -3
		}
		average = {
		 	enemy_scheme_secrecy_add = -5
		}
		good = {
		 	enemy_scheme_secrecy_add = -7
		}
		excellent = {
		 	enemy_scheme_secrecy_add = -10
		}
	}

	ai_will_do = {
		value = {
			add = 25
			add = ai_rationality
			subtract = ai_honor
		}
		if = {
			limit = {
				scope:liege = {
					has_trait = paranoid
				}
			}
			add = 50
		}
	}
}

femme_fatale_task_soothe_and_surveil = {
	court_position_types = { 
		femme_fatale_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"
			}
		}
	}

	on_start = {
		scope:liege = {
			set_variable = {
				name = femme_fatale_is_soothing_and_surveiling
				value = yes
			}
		}
		custom_tooltip = increased_poison_opinion_defense_tt
	}

	on_monthly = {
		if = {
			limit = { scope:liege.var:femme_fatale_is_soothing_and_surveiling = no }
			set_variable = {
				name = femme_fatale_is_soothing_and_surveiling
				value = yes
			}
		}
	}

	on_end = { 
		# remove_character_flag = blocked_from_leaving # Removing travel block
		scope:liege = {
			set_variable = {
				name = femme_fatale_is_soothing_and_surveiling
				value = no
			}
		}
	}

	scaling_employer_modifiers = {
		terrible = {
			enemy_hostile_scheme_success_chance_max_add = -2
		 	monthly_intrigue_lifestyle_xp_gain_mult = 0.01
		}
		poor = {
			enemy_hostile_scheme_success_chance_max_add = -4
		 	monthly_intrigue_lifestyle_xp_gain_mult = 0.03
		}
		average = {
			enemy_hostile_scheme_success_chance_max_add = -10
		 	monthly_intrigue_lifestyle_xp_gain_mult = 0.05
		}
		good = {
			enemy_hostile_scheme_success_chance_max_add = -14
		 	monthly_intrigue_lifestyle_xp_gain_mult = 0.07
		}
		excellent = {
			enemy_hostile_scheme_success_chance_max_add = -20
		 	monthly_intrigue_lifestyle_xp_gain_mult = 0.1
		}
	}

	ai_will_do = {
		value = {
			add = 25
			add = ai_sociability
		}
		if = {
			limit = {
				scope:liege = {
					has_trait = paranoid
				}
			}
			add = 50
		}
	}
}
