﻿namespace = yearly

####
# 7001 - marshal suspecting factions are going to target you - modified based on event by Isabella Welch
# 7005 - assassination attempt
###

scripted_trigger valid_coup_leader_trigger = {
	OR = {
		is_leading_faction_type = independence_faction
		is_leading_faction_type = liberty_faction
		is_leading_faction_type = claimant_faction
		is_leading_faction_type = populist_faction
	}
	NOT = { has_council_position = councillor_marshal }
	OR = {
		has_trait = lunatic_1
		has_trait = possessed_1
		has_trait = eccentric
	}
	has_dread_level_towards = {
		target = root
		level = 0
	}
	is_ai = yes
}

### An insane faction leader attempts to kill the ruler, modified based on event by Isabella Welch

yearly.7001 = {
	type = character_event
	title = yearly.7001.t
	desc = yearly.7001.desc
	theme = martial

	override_background = {
		reference = bedchamber
	}
	left_portrait = {
		character = root
		animation = personality_bold
	}
	right_portrait = {
		character = scope:marshal
		animation = worry
	}
	
	trigger = {
		NOT = { has_character_flag = had_first_coup_event }
		any_vassal = {
			valid_coup_leader_trigger = yes
		}
		exists = cp:councillor_marshal
		cp:councillor_marshal = {
			is_ai = yes
		}
		any_vassal = {
			count >=3
			is_a_faction_member = no
		}
		has_ep1_dlc_trigger = yes
		has_royal_court = yes
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		add_character_flag = had_first_coup_event
		cp:councillor_marshal = { save_scope_as = marshal }
		set_signature_weapon_effect = yes
		random_vassal = {
			limit = { valid_coup_leader_trigger = yes }
			save_scope_as = coup_leader
			joined_faction = {
				save_scope_as = coup_faction 
			}	
		}
	}
	
	option = { #ignore_dangers
		name = yearly.7001.a
		add_character_flag = ignored_guard_patrols
		change_current_court_grandeur = medium_court_grandeur_gain
		stress_impact = {
			brave = medium_stress_loss
			arbitrary = medium_stress_loss
			craven = massive_stress_gain
			paranoid = major_stress_gain
		}
	}

	option = { #likelier you will defend yourself
		name = yearly.7001.b
		add_character_flag = increased_guard_patrols
		change_current_court_grandeur = medium_court_grandeur_loss
				stress_impact = {
			brave = minor_stress_gain
			craven = medium_stress_loss
			paranoid = minor_stress_gain
		}
	}

	option = { #dread and defence
		name = yearly.7001.d
		add_character_flag = heavily_increased_guard_patrols
		duel = {
			skill = martial
			value = 14
			30 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				add_dread = medium_dread_gain
				send_interface_toast = {
					left_icon = scope:marshal
					title = yearly.7001.d.win.tt
					show_as_tooltip = { 
						scope:coup_faction = { #I am not 100% sure if this effect actually works
							every_faction_member = {
								custom = custom.all_faction_members
								leave_faction_with_cooldown_effect = {
									FACTION = scope:coup_faction
									YEARS = 20
								}
							}
						}
					}
				}
				scope:coup_faction = {
					every_faction_member = {
						custom = custom.all_faction_members
						leave_faction_with_cooldown_effect = {
							FACTION = scope:coup_faction
							YEARS = 20
						}
					}
				}
			}
			60 = {		
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
					min = -49
				}
				send_interface_toast = {
					left_icon = scope:marshal
					title = yearly.7001.d.tt
					show_as_tooltip = {
						every_courtier_or_guest = {
							custom = all_courtiers_and_guests
							add_opinion = {
								target = root
								modifier = frightened_in_court_opinion
								opinion = -5
							}
						}	
					}
				}
				change_current_court_grandeur = medium_court_grandeur_loss
				every_courtier_or_guest = {
					limit = {
						NOR = { 
							has_trait = brave
							has_trait = craven
						}
					}
					custom = all_courtiers_and_guests
					add_opinion = {
						target = root
						modifier = frightened_in_court_opinion
						opinion = -5
					}
				}
				every_courtier_or_guest = {
					limit = { has_trait = craven }
					custom = all_craven_in_the_court
					add_opinion = {
						target = root
						modifier = frightened_in_court_opinion
						opinion = -15
					}
				}
			}
		}
	}

	after = {
		hidden_effect = {
			duel = {
				skill = martial
				target = scope:coup_leader
				50 = {		
					compare_modifier = {
							value = scope:duel_value
						multiplier = 3.5
							min = -49
					}
					add_character_flag = ruler_won_duel
					set_variable = {
						name = coup_success
						value = -1
					}
				}
				50 = {		
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
						}
					add_character_flag = ruler_lost_duel
					set_variable = {
						name = coup_success
						value = 1
					}
				}
			}
			trigger_event = {
				id = yearly.7005
				days = { 3 5 }
			}	
		}
	}
}

scripted_effect attack_random_outcome_effect = { #figuring out who is going to get targeted by the attack
	random_list = {
		20 = {
			death = {
				death_reason = death_assassination
				killer = scope:coup_leader
			}
			compare_modifier = {
				value = scope:coup_leader.prowess
				multiplier = 0.5
			}
			if = {
				limit = { is_close_family_of = root }
				root = {
					add_opinion = {
						target = scope:coup_leader
						modifier = murdered_close_family_crime
					}
				}
			}
			else_if = {
				limit = { 
					OR = { 
						any_relation = {
							type = friend
							this = root
						}
						any_relation = {
							type = lover
							this = root
						}
						any_relation = {
							type = soulmate
							this = root
						}
					}
				}
				root = {
					add_opinion = {
						target = scope:coup_leader
						modifier = murdered_someone_close_to_me_crime
					}
				}
			}
			else = {
				root = {
					add_opinion = {
						target = scope:coup_leader
						modifier = plotting_against_liege_opinion
					}
				}
			}
		}
		40 = {
			increase_wounds_effect = { REASON = assassination }
			if = {
				limit = { is_close_family_of = root }
				root = {
					add_opinion = {
						target = scope:coup_leader
						modifier = attempted_murder_close_family_crime
					}
				}
			}
			else_if = {
				limit = { 
					OR = { 
						any_relation = {
							type = friend
							this = root
						}
						any_relation = {
							type = lover
							this = root
						}
						any_relation = {
							type = soulmate
							this = root
						}
					}
				}
				root = {
					add_opinion = {
						target = scope:coup_leader
						modifier = hurt_someone_close_to_me_crime
					}
				}
			}
			else = {
				root = {
					add_opinion = {
						target = scope:coup_leader
						modifier = plotting_against_liege_opinion
					}
				}
			}
		}
		20 = {
			add_trait = disfigured
			if = {
				limit = { is_close_family_of = root }
				root = {
					add_opinion = {
						target = scope:coup_leader
						modifier = attempted_murder_close_family_crime
					}
				}
			}
			else_if = {
				limit = { 
					OR = { 
						any_relation = {
							type = friend
							this = root
						}
						any_relation = {
							type = lover
							this = root
						}
						any_relation = {
							type = soulmate
							this = root
						}
					}
				}
				root = {
					add_opinion = {
						target = scope:coup_leader
						modifier = hurt_someone_close_to_me_crime
					}
				}
			}
			else = {
				root = {
					add_opinion = {
						target = scope:coup_leader
						modifier = plotting_against_liege_opinion
					}
				}
			}
		}
	}
}


yearly.7005 = {
	type = character_event
	title = yearly.7001.t
	left_portrait = {
		character = root
		animation = fear
	}
	right_portrait = {
		character = scope:coup_leader
		animation = severelywounded
	}
	lower_left_portrait = {
		character = scope:first_character_kill
	}
	lower_right_portrait = {
		trigger = {
			OR = {
				has_character_flag = kills_two_people
				has_character_flag = kills_three_people
			}
		}
		character = scope:second_character_kill
	}
	lower_center_portrait = {
		trigger = {
			has_character_flag = kills_three_people
		}
		character = scope:third_character_kill
	}
	theme = martial
	override_background = {
		reference = throne_room
	}
	desc = {
		first_valid = {
			triggered_desc = { #low sec
				trigger = { has_character_flag = ignored_guard_patrols }
				desc = yearly.7005.decreased_security
			}
			triggered_desc = {  #mid sec
				trigger = { has_character_flag = increased_guard_patrols }
				desc = yearly.7005.increased_security
			}
			triggered_desc = {  #max sec
				trigger = { has_character_flag = heavily_increased_guard_patrols }
				desc = yearly.7005.increased_security_max
			}
			
		}
		desc = yearly.7005.throne_approach
		first_valid = {
			triggered_desc = { #custom reasons for each faction to attack
				trigger = { has_character_flag = liberty_faction }
				desc = yearly.7005.liberty_faction
			}
			triggered_desc = {
				trigger = { has_character_flag = independence_faction }
				desc = yearly.7005.independence_faction
			}
			triggered_desc = {
				trigger = { has_character_flag = claimant_faction }
				desc = yearly.7005.claimant_faction
			}
			triggered_desc = {
				trigger = { has_character_flag = populist_faction }
				desc = yearly.7005.populist_faction
			}
		}
		desc = yearly.7005.weapon
		first_valid = {
			triggered_desc = {
				trigger = { has_character_flag = kills_one_person }
				desc = yearly.7005.single_death
			}
			triggered_desc = {
				trigger = { has_character_flag = kills_two_people }
				desc = yearly.7005.double_death
			}
			triggered_desc = {
				trigger = { has_character_flag = kills_three_people }
				desc = yearly.7005.triple_death
			}
			triggered_desc = {
				trigger = { AND = {
					has_character_flag = kills_no_people
					NOT = { has_character_flag = coup_ruler_strike }
					}
				}
				desc = yearly.7005.no_death
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = { has_character_flag = coup_ruler_strike }
				desc = yearly.7005.coup_ruler_strike
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = { has_character_flag = coup_ruler_death }
				desc = yearly.7005.ruler_death
			}
			triggered_desc = {
				trigger = { has_character_flag = coup_ruler_strike }
				desc = yearly.7005.part_failure
			}	
			
			desc = yearly.7005.failure
		}
	}	
	trigger = {
		scope:coup_leader = {
			is_available_ai_adult = yes
		}
		has_character_flag = had_first_coup_event
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		scope:coup_leader = {
			set_signature_weapon_effect = yes
		}
		if = {
			limit = {
				exists = scope:coup_faction
			}
			scope:coup_faction = { #to disband them later if needed
				every_faction_member = {
					add_to_list = coup_faction_list
				}
			}
		}
		set_variable = { #to calculate how many people are going to die
			name = coup_success
			value = 0
		}
		## Determine how guarded or warned the ruler is
		if = {
			limit = {
				has_character_flag = ruler_lost_duel
			}
			change_variable = {
				name = coup_success
				add = 2
			}
		}
		if = {
			limit = {
				has_character_flag = ruler_won_duel
			}
			change_variable = {
				name = coup_success
				add = -1
			}
		}
		if = {
			limit = {
				has_character_flag = ignored_guard_patrols
			}
			change_variable = {
				name = coup_success
				add = 1
			}
		}
		
		if = {
			limit = {
				has_character_flag = heavily_increased_guard_patrols
			}
			change_variable = {
				name = coup_success
				add = -1
			}
		}
		#to have custom loc for the attack reasons for different faction types
		if = {
			limit = {
				scope:coup_leader = {
					is_leading_faction_type = liberty_faction
				}
			}
			add_character_flag = liberty_faction
		}
		else_if = {
			limit = {
				scope:coup_leader = {
					is_leading_faction_type = independence_faction
				}
			}
			add_character_flag = independence_faction
		}
		if = {
			limit = {
				scope:coup_leader = {
					is_leading_faction_type = claimant_faction
				}
			}
			add_character_flag = claimant_faction
		}
		if = {
			limit = {
				scope:coup_leader = {
					is_leading_faction_type = populist_faction
				}
			}
			add_character_flag = populist_faction
		}
		### Find some characters who might get attacked
		if = {
			limit = {
				exists = root.primary_spouse
				root.primary_spouse = {
					NOT = {
						is_in_list = coup_faction_list
					}
				}
			}
			root.primary_spouse = { add_to_list = character_kill_list }
		}
		if = {
			limit = {
				any_councillor = {
					exists = yes
					NOR = {
						has_council_position = councillor_marshal
						primary_spouse = this
						is_in_list = coup_faction_list
					}
				}
			}
			random_councillor = {
				limit = {
					NOR = { 
						has_council_position = councillor_marshal
						primary_spouse = this
						is_in_list = coup_faction_list
					}
				}
				add_to_list = character_kill_list
			}
		}
		if = {
			limit = {
				exists = root.primary_heir
				root.primary_heir = {
					NOT = {
						is_in_list = coup_faction_list
					}
				}
			}
			root.primary_heir = { add_to_list = character_kill_list }
		}

		if = {
			limit = {
				exists = root.father
				root.father = { 
					is_courtier_of = root 
					NOT = { is_in_list = coup_faction_list }
				}
			}
			root.father = { add_to_list = character_kill_list }
		}
		if = {
			limit = {
				exists = root.mother
				root.mother = { 
					is_courtier_of = root 
					NOT = { is_in_list = coup_faction_list } 
				}
			}
			root.mother = { add_to_list = character_kill_list }	
		}
		if = {
			limit = {
				any_powerful_vassal = {
					is_councillor = no
					exists = yes
					NOT = { is_in_list = coup_faction_list }
				}
			}
			random_vassal = {
				limit = {
					is_councillor = no
					NOT = { is_in_list = coup_faction_list }
					is_powerful_vassal = yes
				}
				add_to_list = character_kill_list
			}
		}
		random_vassal = {
			limit = { NOT = { is_in_list = coup_faction_list } }
			add_to_list = character_kill_list
		}
		random_vassal = {
			limit = {
				NOR = {
					is_in_list = coup_faction_list
					is_in_list = character_kill_list
				}
			}
			add_to_list = character_kill_list
		}
		random_vassal = {
			limit = { 
				NOR = {
					is_in_list = coup_faction_list
					is_in_list = character_kill_list
				}
			}
			add_to_list = character_kill_list
		}
		#attacking more important characters first
		random_in_list = {
			list = character_kill_list
			weight = {
				base = 1
				modifier  = {
					factor = 20
					exists = root.primary_spouse
					any_relation = {
						type = lover
						this = root.primary_spouse
					}
				}
				modifier  = {
					factor = 20
					exists = root.primary_spouse
					any_relation = {
						type = soulmate
						this = root.primary_spouse
					}
				}
				modifier = {
					factor = 20
					is_powerful_vassal = yes
				}
				modifier = {
					factor = 10
					is_close_family_of = root
				}
				modifier = {
					opinion = {
						target = root
						value > medium_positive_opinion
					}
					factor = 5
				}
			}
			save_scope_as = first_character_kill
		}
		random_in_list = {
			limit = {
				NOT = {
					scope:first_character_kill = this
				}
			}
			weight = {
				base = 1
				modifier  = {
					factor = 20
					exists = root.primary_spouse
					has_relation_lover = root.primary_spouse
				}
				modifier  = {
					factor = 20
					exists = root.primary_spouse
					has_relation_soulmate = root.primary_spouse
				}
				modifier = {
					factor = 20
					is_powerful_vassal = yes
				}
				modifier = {
					factor = 10
					is_close_family_of = root
				}
				modifier = {
					opinion = {
						target = root
						value > medium_positive_opinion
					}
					factor = 5
				}
			}			
			list = character_kill_list
			save_scope_as = second_character_kill
		}
		random_in_list = {
			limit = {
				NOR = {
					scope:first_character_kill = this
					scope:second_character_kill = this
				}
			}
			weight = {
				base = 1
				modifier  = {
					factor = 20
					exists = root.primary_spouse
					has_relation_lover = root.primary_spouse
				}
				modifier  = {
					factor = 20
					exists = root.primary_spouse
					has_relation_soulmate = root.primary_spouse
				}
				modifier = {
					factor = 20
					is_powerful_vassal = yes
				}
				modifier = {
					factor = 10
					is_close_family_of = root
				}
				modifier = {
					opinion = {
						target = root
						value > medium_positive_opinion
					}
					factor = 5
				}
			}			
			list = character_kill_list
			save_scope_as = third_character_kill
		}
		## Determine how wounded the characters become
		if = {
			limit = { var:coup_success = 0 }
			add_character_flag = kills_one_person
			scope:first_character_kill = {
				attack_random_outcome_effect = yes
			}
		}
		else_if = {
			limit = {
				var:coup_success = 1
			}
			add_character_flag = kills_two_people
			scope:first_character_kill = {
				attack_random_outcome_effect = yes
			}
			scope:second_character_kill = {
				attack_random_outcome_effect = yes
			}
		}
		else_if = {
			limit = {
				var:coup_success > 1
			}
			add_character_flag = kills_three_people
			scope:first_character_kill = {
				attack_random_outcome_effect = yes
			}
			scope:second_character_kill = {
				attack_random_outcome_effect = yes
			}
			scope:third_character_kill = {
				attack_random_outcome_effect = yes
			}
		}
		else = {
			add_character_flag = kills_no_people
		}
		if = {
			limit = { NOT = { has_character_flag = kills_no_people } }
			random_list = {
				5 = {
					compare_modifier = {
						value = var:coup_success
						multiplier = 0.5
					}
					add_character_flag = coup_ruler_strike
					add_character_flag = coup_ruler_death
				}
				40 = {
					increase_wounds_effect = { REASON = assassination }
					add_character_flag = coup_ruler_strike
					add_opinion = {
						target = scope:coup_leader
						modifier = attempted_murder_me_crime
					}
				}
				20 = {
					add_trait = disfigured
					add_character_flag = coup_ruler_strike
					add_opinion = {
						target = scope:coup_leader
						modifier = attempted_murder_me_crime
					}
				}
			}
		}
	}

	option = { #imprison them
		name = yearly.7005.a
		trigger = {
			NOT = { has_character_flag = coup_ruler_death }
		}
		rightfully_imprison_character_effect = {
			TARGET = scope:coup_leader
			IMPRISONER = root
		}
		stress_impact = {
			just = medium_stress_loss
			arbitrary = medium_stress_gain
		}
	}

	option = { #let them slit their own throat
		name = yearly.7005.b
		trigger = {
			NOT = { has_character_flag = coup_ruler_death }
		}
		scope:coup_leader = {
			death = {
				death_reason = death_refused_to_be_imprisoned
			}
		}
		stress_impact = {
			arbitrary = medium_stress_loss
		}
	}
	
	option = { #torture and imprison them
		name = yearly.7005.c
		custom_tooltip = yearly.7005.c.tt
		trigger = {
			NOT = { has_character_flag = coup_ruler_death }
		}
		rightfully_imprison_character_effect = {
			TARGET = scope:coup_leader
			IMPRISONER = root
		}
		scope:coup_leader = {
			add_trait = wounded_3
		}
		stress_impact = {
			just = major_stress_gain
			callous = medium_stress_loss
			sadistic = medium_stress_loss
		}
	}
	option = { #guess I'll die
		name = {
			trigger = {
				OR = {
					has_trait = theologian
					has_trait = zealous
				}
			}
			text = yearly.7005.devout.e
		}
		name = yearly.7005.e
		trigger = {
			has_character_flag = coup_ruler_death
		}
	}
	after = {
		if = {
			limit = {
				has_character_flag = coup_ruler_death
			}
			death = {
				death_reason = death_assassination
				killer = scope:coup_leader
			}
			scope:coup_leader = {
				add_trait = murderer
				death = {
					death_reason = death_while_couping
				}
			}
		}
		else = {
			remove_character_flag = ruler_lost_duel
			remove_character_flag = ruler_won_duel
			remove_character_flag = ignored_guard_patrols
			remove_character_flag = heavily_increased_guard_patrols
			remove_character_flag = increased_guard_patrols
			remove_character_flag = liberty_faction
			remove_character_flag = independence_faction
			remove_character_flag = claimant_faction
			remove_character_flag = populist_faction
			remove_character_flag = kills_one_person
			remove_character_flag = kills_two_people
			remove_character_flag = kills_three_people
			remove_character_flag = kills_no_people
			remove_character_flag = coup_ruler_death
		}
	}
}

#Participate in a football game
#by Nick Meredith

# Set up event
yearly.7010 = {
	type = character_event
	title = yearly.7010.t
	desc = yearly.7010.desc
	theme = recovery
	override_background = { reference = farmland }
	left_portrait = {
		character = root
		animation = idle
	}
	trigger = {
		is_landed = yes
		is_available_at_peace_adult = yes
		capital_province = {
			geographical_region = world_europe
		}
	}
	# Display interest
	option = {
		name = yearly.7010.a
		custom_tooltip = yearly.7010.tt.yes
		trigger_event = {
			id = yearly.7011
			days = { 1 3 }
		}
	}
	# Stay out of it
	option = {
		name = yearly.7010.b
	}
}

# Valet explains game
yearly.7011 = {
	type = character_event
	title = yearly.7011.t
	desc = yearly.7011.desc
	theme = battle
	override_background = { reference = farmland }
	left_portrait = {
		character = root
		animation = personality_bold
	}
	immediate = {
		random_dummy_gender_soldier_effect = { 
			SCOPE_NAME = dummy_gender
		}
	}
	# I'm in!
	option = {
		name = yearly.7011.a
		add_internal_flag = dangerous
		custom_tooltip = yearly.7011.tt
		stress_impact = {
			athletic = minor_stress_impact_loss
			lazy = miniscule_stress_impact_gain
		}
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7012
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7013
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7014
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7015
						days = { 1 3 }
					}
				}
			}
		}
	}
	# Typical commoner pastime, leave them to it
	option = {
		name = yearly.7011.b

		stress_impact = {
			athletic = minor_stress_impact_gain
			lazy = miniscule_stress_impact_loss
			craven = miniscule_stress_impact_loss
		}
	}
}

# Pre-game: Literal Under Armour
yearly.7012 = {
	type = character_event
	title = yearly.7012.t
	desc = yearly.7012.desc
	theme = recovery
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = personality_cynical
	}
	# I'll buy it off you!
	option = {
		name = yearly.7012.a
		remove_short_term_gold = minor_gold_value
		stress_impact = {
			craven = miniscule_stress_impact_loss
			brave = minor_stress_impact_gain
		}
		trigger_event = {
			id = yearly.7020
			days = { 1 3 }
		}
	}
	# Give it up, old man
	option = {
		name = yearly.7012.b
		stress_impact = {
			ambitious = miniscule_stress_impact_gain
			craven = minor_stress_impact_gain
			deceitful = minor_stress_impact_gain
		}
		trigger_event = {
			id = yearly.7020
			days = { 1 3 }
		}
	}
}

# Pre-game: Wealthy merchant buys your best player
yearly.7013 = {
	type = character_event
	title = yearly.7013.t
	desc = yearly.7013.desc
	theme = battle
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = disapproval
	}
	# Whatever he's paid you, I'll double it!
	option = {
		name = yearly.7013.a
		remove_short_term_gold = minor_gold_value
		custom_tooltip = yearly.7010.tt.win
		add_character_flag = retained_star
		stress_impact = {
			greedy = major_stress_impact_gain
		}
		trigger_event = {
			id = yearly.7020
			days = { 1 3 }
		}
	}
	# How dare he!
	option = {
		name = yearly.7013.b
		custom_tooltip = yearly.7010.tt.lose
		add_character_flag = lost_star
		trigger_event = {
			id = yearly.7020
			days = { 1 3 }
		}
	}
	# I reckon I can compensate...
	option = {
		name = yearly.7013.c
		trigger = {
			OR = {
				has_trait = physique_good_1
				has_trait = physique_good_2
				has_trait = physique_good_3
				has_trait = strong
				has_trait = giant
			}
		}
		add_prestige = minor_prestige_value
		add_character_flag = became_star
		stress_impact = {
			craven = minor_stress_impact_gain
			shy = minor_stress_impact_gain
		}
		trigger_event = {
			id = yearly.7020
			days = { 1 3 }
		}
	}
}

# Pre-game: Messing with pies
yearly.7014 = {
	type = character_event
	title = yearly.7014.t
	desc = {
		# kick over cart vs poison pies
		first_valid = {
			triggered_desc = { # poison the pies
				trigger = {
					has_trait = lifestyle_herbalist
				}
				desc = yearly.7014.desc.1
			}
			desc = yearly.7014.desc # kick over the cart
		}
	}
	theme = battle
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = scheme
	}
	# Herbalist option - poison the pies
	option = {
		name = yearly.7014.a
		trigger = {
			has_trait = lifestyle_herbalist
		}
		stress_impact = {
			deceitful = miniscule_stress_impact_loss
		}
		add_character_flag = poisoned_pies
		custom_tooltip = yearly.7014.hemlock
		custom_tooltip = yearly.7010.tt.win
		trigger_event = {
			id = yearly.7020
			days = { 1 3 }
		}
	}
	# Overturn the cart
	option = {
		name = yearly.7014.b
		trigger = {
			NOT = {
				has_trait = lifestyle_herbalist
			}
		}
		custom_tooltip = yearly.7010.tt.win
		add_character_flag = yeeted_cart
		stress_impact = {
			gluttonous = minor_stress_impact_gain
		}
		trigger_event = {
			id = yearly.7020
			days = { 1 3 }
		}
	}
	# Even I'm not that evil
	option = {
		name = yearly.7014.c

		add_character_flag = left_cart

		trigger_event = {
			id = yearly.7020
			days = { 1 3 }
		}
	}
}

# Pre-game: Performance-Enhancing Draughts
yearly.7015 = {
	type = character_event
	title = yearly.7015.t
	desc = yearly.7015.desc
	theme = battle
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = shock
	}
	immediate = {
		random_dummy_gender_effect = yes
	}
	# How much do you want for the drugs?
	option = {
		name = yearly.7015.a
		remove_short_term_gold = minor_gold_value
		add_character_modifier = {
			modifier = performance_enhancers_modifier
			months = 1
		}
		stress_impact = {
			greedy = minor_stress_impact_gain
			honest = major_stress_impact_gain
			just = minor_stress_impact_gain
		}
		add_character_flag = took_peds
	}
	# You should be ashamed!
	option = {
		name = yearly.7015.b

		add_character_flag = left_peds
	}
	after = {
		trigger_event = {
			id = yearly.7020
			days = { 1 3 }
		}
	}
}

# Game starts!
yearly.7020 = {
	type = character_event
	title = yearly.7020.t
	desc = yearly.7020.desc
	theme = battle
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = personality_bold
	}
	option = {
		name = yearly.7020.a
		stress_impact = {
			craven = minor_stress_impact_gain
		}
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7021
						days = { 1 3 }
						}
					}
				1 = {
					trigger_event = {
						id = yearly.7022
						days = { 1 3 }
						}
					}
				1 = {
					trigger_event = {
						id = yearly.7023
						days = { 1 3 }
						}
					}
				1 = {
					trigger_event = {
						id = yearly.7024
						days = { 1 3 }
					}
				}
			}
		}
	}
	# BERSERKER SMASH
	option = {
		name = yearly.7020.b
		trigger = {
			has_trait = berserker
		}
		stress_impact = {
			base = miniscule_stress_impact_loss
		}
		add_character_flag = berserker_start
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7021
						days = { 1 3 }
						}
					}
				1 = {
					trigger_event = {
						id = yearly.7022
						days = { 1 3 }
						}
					}
				1 = {
					trigger_event = {
						id = yearly.7023
						days = { 1 3 }
						}
					}
				1 = {
					trigger_event = {
						id = yearly.7024
						days = { 1 3 }
					}
				}
			}
		}
	}
}

# First half: A villager comes at you with a rock!
yearly.7021 = {
	type = character_event
	title = yearly.7021.t
	desc = yearly.7021.desc
	theme = battle
	left_portrait = {
		character = root
		animation = anger
	}
	# Hey, that's illegal!
	option = {
		name = yearly.7021.a
		add_internal_flag = dangerous
		random_list = {
			80 = {
				send_interface_toast = {
					title = yearly.7021.a.tt.lose
					left_icon = root
					add_prestige = minor_prestige_loss
					increase_wounds_effect = { REASON = fight }
				}
				add_character_flag = hit_with_rock
			}
			20 = {
				modifier = {
					add = 20
					prowess > 5
				}
				modifier = {
					add = 30
					prowess > 10
				}
				modifier = {
					add = 40
					prowess > 15
				}
				modifier = {
					add = 50
					prowess > 20
			}
			add_character_flag = stole_rock
			send_interface_toast = {
				title = yearly.7021.a.tt.win
				left_icon = root
				add_prestige = minor_prestige_gain
				}
			}
		}
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7030
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7031
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7032
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7033
						days = { 1 3 }
					}
				}
			}
		}
	}
	# BERSERKER SMASH
	option = {
		name = yearly.7021.b
		trigger = {
			has_trait = berserker
		}
		trait = berserker
		add_character_flag = stole_rock
		send_interface_toast = {
			title = yearly.7021.a.tt.win
			left_icon = root
			add_prestige = minor_prestige_gain
		}
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7030
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7031
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7032
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7033
						days = { 1 3 }
					}
				}
			}
		}
	}
	# Run away!
	option = {
		name = yearly.7021.c
		stress_impact = {
			craven = miniscule_stress_impact_loss
			brave = minor_stress_impact_gain
		}
		add_character_flag = hit_with_rock
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7030
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7031
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7032
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7033
						days = { 1 3 }
					}
				}
			}
		}
	}
}

# First half: Player is getting seduced by a winsome lad/lass
yearly.7022 = {
	type = character_event
	title = yearly.7022.t
	desc = yearly.7022.desc
	theme = battle
	left_portrait = {
		character = root
		animation = flirtation
	}
	immediate = {
		romance_target_gender_effect = { 
			SCOPE_NAME = dummy_gender }
		save_scope_as = same_gender
		}
	# Yoink!
	option = {
		name = yearly.7022.a
		stress_impact = {
			honest = minor_stress_impact_gain
			compassionate = medium_stress_impact_gain
			chaste = minor_stress_impact_gain
		}
		add_character_flag = stole_ball
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7030
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7031
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7032
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7033
						days = { 1 3 }
					}
				}
			}
		}
	}
	# Ah, young love!
	option = {
		name = yearly.7022.b
		custom_tooltip = yearly.7010.tt.lose
		add_prestige = minor_prestige_value
		stress_impact = {
			chaste = miniscule_stress_impact_gain
			deceitful = miniscule_stress_impact_gain
		}
		add_character_flag = winsome_stranger
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7030
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7031
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7032
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7033
						days = { 1 3 }
					}
				}
			}
		}
	}
	# Seduce them yourself
	option = {
		name = yearly.7022.c
		trigger = {
			OR = {
				has_trait = lustful
				has_trait = seducer
			}
		}
		trait = lustful
		trait = seducer
		add_character_flag = winsome_stranger
		stress_impact = {
			base = minor_stress_impact_loss
			rakish = miniscule_stress_impact_loss
		}
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7030
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7031
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7032
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7033
						days = { 1 3 }
					}
				}
			}
		}
	}
}

# First half: Punching a priest
yearly.7023 = {
	type = character_event
	title = yearly.7023.t
	desc = yearly.7023.desc
	theme = battle
	left_portrait = {
		character = root
		animation = stress
	}
	immediate = {
		random_dummy_gender_clergy_effect = yes
	}
	# Punch the priest in the face
	option = {
		name = yearly.7023.a

		add_piety = minor_piety_loss
		stress_impact = {
			base = miniscule_stress_impact_gain
			zealous = major_stress_impact_gain
			cynical = miniscule_stress_impact_loss
		}
		add_character_flag = punched_priest
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7030
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7031
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7032
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7033
						days = { 1 3 }
					}
				}
			}
		}
	}
	# leave him be
	option = {
		name = yearly.7023.b
		stress_impact = {
			cynical = minor_stress_impact_gain
			callous = minor_stress_impact_gain
		}
		add_piety = miniscule_piety_gain
		add_character_flag = let_priest_go
		hidden_effect = {
				random_list = {
				1 = {
					trigger_event = {
						id = yearly.7030
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7031
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7032
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7033
						days = { 1 3 }
					}
				}
			}
		}
	}
}

# First half: Damaging a local building
yearly.7024 = {
	type = character_event
	title = yearly.7024.t
	desc = yearly.7024.desc
	theme = battle
	left_portrait = {
		character = root
		animation = shock
	}
	immediate = {
		random_held_title = {
			limit = {
				tier = tier_county
			}
		save_scope_as = damaged_building
		}
	}
	# I'll pay for the refurbishments
	option = {
		name = yearly.7024.a

		remove_short_term_gold = medium_gold_value

		stress_impact = {
			greedy = miniscule_stress_impact_gain
		}
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7030
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7031
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7032
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7033
						days = { 1 3 }
					}
				}
			}
		}
	}
	# I won't pay for the refurbishments!
	option = {
		name = yearly.7024.b

		scope:damaged_building = {
			change_county_control = minor_county_control_loss
		}
		stress_impact = {
			generous = miniscule_stress_impact_gain
		}
		hidden_effect = {
			random_list = {
				1 = {
					trigger_event = {
						id = yearly.7030
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7031
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7032
						days = { 1 3 }
					}
				}
				1 = {
					trigger_event = {
						id = yearly.7033
						days = { 1 3 }
					}
				}
			}
		}
	}
}

# Second half: Diving scum
yearly.7030 = {
	type = character_event
	title = yearly.7030.t
	desc = yearly.7030.desc
	theme = battle
	left_portrait = {
		character = root
		animation = disbelief
	}
	# wtf ref!
	option = {
		name = yearly.7030.a

		stress_impact = {
			trusting = massive_stress_impact_gain
		}
		add_character_flag = let_cheater_go
		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
	# Get him!
	option = {
		name = yearly.7030.b
		stress_impact = {
			paranoid = miniscule_stress_impact_gain
			vengeful = miniscule_stress_impact_gain
			trusting = massive_stress_impact_gain
		}
		random_list = {
			60 = {
				custom_tooltip = yearly.7030.b.win
				add_character_flag = caught_cheater
				send_interface_toast = {
					title = yearly.7030.b.win
					left_icon = root
					add_prestige = miniscule_prestige_gain
					}
				modifier = {
					add = 20
					prowess > 5
				}
				modifier = {
					add = 30
					prowess > 10
				}
				modifier = {
					add = 40
					prowess > 15
				}
				modifier = {
					add = 50
					prowess > 20
				}
				trigger_event = {
					id = yearly.7040
					days = { 1 3 }
				}
			}
			40 = {
				add_character_flag = let_cheater_go
				custom_tooltip = yearly.7030.b.lose
				send_interface_toast = {
					title = yearly.7030.b.lose
					left_icon = root
					add_prestige = miniscule_prestige_loss
				}
				trigger_event = {
					id = yearly.7040
					days = { 1 3 }
				}
			}
		}
	}
	# Damn you're gullible
	option = {
		name = yearly.7030.c

		trigger = {
			has_trait = trusting
			}
		trait = trusting
		add_character_flag = let_cheater_go
		stress_impact = {
			trusting = minor_stress_impact_loss
		}
		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
}

# Second half: Bladed boots
yearly.7031 = {
	type = character_event
	title = yearly.7031.t
	desc = yearly.7031.desc
	theme = battle
	left_portrait = {
		character = root
		animation = shock
	}
	# Get the shoes off him!
	option = {
		name = yearly.7031.a
		add_internal_flag = dangerous
		random_list = {
			50 = {
				add_character_flag = stole_shoes
				send_interface_toast = {
					title = yearly.7031.a.win
					left_icon = root
					}

				custom_tooltip = yearly.7031.a.win
				modifier = {
					add = 20
					prowess > 5
				}
				modifier = {
					add = 30
					prowess > 10
				}
				modifier = {
					add = 40
					prowess > 15
				}
				modifier = {
					add = 50
					prowess > 20
				}
			}
			50 = {
				add_character_flag = kicked_by_blades
				send_interface_toast = {
					title = yearly.7031.a.lose
					left_icon = root
					add_prestige = minor_prestige_loss
					increase_wounds_effect = { REASON = fight }
				}
			}
		}
		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
	# Stay away from him
	option = {
		name = yearly.7031.b
		add_character_flag = kicked_by_blades
		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
	# What a great idea...
	option = {
		name = yearly.7031.c

		trigger = {
			has_trait = sadistic
		}
		trait = sadistic
		add_dread = minor_dread_gain
		add_character_flag = kicked_by_blades
		stress_impact = {
			sadistic = miniscule_stress_impact_loss
		}
		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
}

# Second half: Drinks break
yearly.7032 = {
	type = character_event
	title = yearly.7032.t
	desc = yearly.7032.desc
	theme = battle
	left_portrait = {
		character = root
		animation = happiness
	}
	# Water please
	option = {
		name = yearly.7032.a

		add_character_flag = water_refreshments

		remove_short_term_gold = minor_gold_value

		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
	# Beer please
	option = {
		name = yearly.7032.b

		trigger = {
			root = {
				drinks_alcohol_trigger = yes
			}
		}
		remove_short_term_gold = minor_gold_value
		add_character_flag = alcoholic_refreshments
		stress_impact = {
			gluttonous = miniscule_stress_impact_loss
			temperate = major_stress_impact_gain
		}
		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
	# Bring me wine!
	option = {
		name = yearly.7032.c
		trigger = {
			root = {
				drinks_alcohol_trigger = yes
			}
			has_trait = lifestyle_reveler
		}
		add_character_flag = alcoholic_refreshments
		remove_short_term_gold = medium_gold_value
		trait = lifestyle_reveler
		stress_impact = {
			lifestyle_reveler = minor_stress_impact_loss
		}
		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
	# I'd love a hashish cake...
	option = {
		name = yearly.7032.d

		trigger = {
			root = {
				drinks_alcohol_trigger = no
				OR = {
					has_trait = hashishiyah
					can_be_hashishiyah = yes
				}
			}
		}
		add_character_flag = alcoholic_refreshments
		remove_short_term_gold = medium_gold_value
		add_stress = minor_stress_loss
		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
}

# Second half: Bowyer and dyer fight
yearly.7033 = {
	type = character_event
	title = yearly.7033.t
	desc = yearly.7033.desc
	theme = battle
	left_portrait = {
		character = root
		animation = rage
	}
	# Break it up!
	option = {
		name = yearly.7033.a
		add_internal_flag = dangerous
		random_list = {
			50 = {
				add_character_flag = broke_up_fight
				custom_tooltip = yearly.7021.c.tt.escape
				send_interface_toast = {
					title = yearly.7033.a.win
					left_icon = root
				}
				modifier = {
					add = 20
					prowess > 5
				}
				modifier = {
					add = 30
					prowess > 10
				}
				modifier = {
					add = 40
					prowess > 15
				}
				modifier = {
					add = 50
					prowess > 20
				}
			}
			50 = {
				add_character_flag = escalated_fight
				send_interface_toast = {
					title = yearly.7033.a.lose
					left_icon = root
					add_prestige = minor_prestige_loss
					increase_wounds_effect = { REASON = fight }
				}
			}
		}
		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
	# Leave them to it
	option = {
		name = yearly.7033.b
		custom_tooltip = yearly.7010.tt.lose
		add_character_flag = escalated_fight
		trigger_event = {
			id = yearly.7040
			days = { 1 3 }
		}
	}
}

# Match resolution holding event
yearly.7040 = {
	type = character_event
	title = yearly.7040.t
	desc = yearly.7040.desc
	theme = battle
	left_portrait = {
		character = root
		animation = pain
	}
	# Victory decider
	option = {
		name = yearly.7040.a

		hidden_effect = {
			change_current_weight = -2
			random_list = {	# Big Victory - has more than 3 positive flags
				10 = {
					trigger_event = {
						id = yearly.7041
						days = { 1 3 }
					}
					modifier = {
						add = 100
						calc_true_if = {
							amount = 3
							has_character_flag = retained_star
							has_character_flag = became_star
							has_character_flag = poisoned_pies
							has_character_flag = yeeted_cart
							has_character_flag = took_peds
							has_character_flag = berserker_start
							has_character_flag = stole_rock
							has_character_flag = stole_ball
							has_character_flag = punched_priest
							has_character_flag = caught_cheater
							has_character_flag = stole_shoes
							has_character_flag = water_refreshments
							has_character_flag = broke_up_fight
						}
					}
				}
				10 = { 	# Victory - has between 1 and 3 positive flags
					trigger_event = {
						id = yearly.7042
						days = { 1 3 }
					}
					modifier = {
						add = 100
						calc_true_if = {
							amount = 2
							has_character_flag = retained_star
							has_character_flag = became_star
							has_character_flag = poisoned_pies
							has_character_flag = yeeted_cart
							has_character_flag = took_peds
							has_character_flag = berserker_start
							has_character_flag = stole_rock
							has_character_flag = stole_ball
							has_character_flag = punched_priest
							has_character_flag = caught_cheater
							has_character_flag = stole_shoes
							has_character_flag = water_refreshments
							has_character_flag = broke_up_fight
						}
					}
				}
				10 = {	# Draw - has 1 at most positive or negative flag
					trigger_event = {
						id = yearly.7043
						days = { 1 3 }
					}
					modifier = {
						add = 100
						calc_true_if = {
							amount = 1
							has_character_flag = retained_star
							has_character_flag = became_star
							has_character_flag = poisoned_pies
							has_character_flag = yeeted_cart
							has_character_flag = took_peds
							has_character_flag = berserker_start
							has_character_flag = stole_rock
							has_character_flag = stole_ball
							has_character_flag = punched_priest
							has_character_flag = caught_cheater
							has_character_flag = stole_shoes
							has_character_flag = water_refreshments
							has_character_flag = broke_up_fight
							has_character_flag = lost_star
							has_character_flag = left_cart
							has_character_flag = left_peds
							has_character_flag = hit_with_rock
							has_character_flag = winsome_stranger
							has_character_flag = let_priest_go
							has_character_flag = let_cheater_go
							has_character_flag = kicked_by_blades
							has_character_flag = alcoholic_refreshments
							has_character_flag = escalated_fight
						}
					}
				}
				10 = {	# Defeat - has between 1 and 3 negative flags
					trigger_event = {
						id = yearly.7044
						days = { 1 3 }
					}
					modifier = {
						add = 100
						calc_true_if = {
							amount = 2
							has_character_flag = lost_star
							has_character_flag = left_cart
							has_character_flag = left_peds
							has_character_flag = hit_with_rock
							has_character_flag = winsome_stranger
							has_character_flag = let_priest_go
							has_character_flag = let_cheater_go
							has_character_flag = kicked_by_blades
							has_character_flag = alcoholic_refreshments
							has_character_flag = escalated_fight
						}
					}
				}
				10 = {	# Big Defeat - has more than 3 negative flags
					trigger_event = {
						id = yearly.7045
						days = { 1 3 }
					}
					modifier = {
						add = 100
						calc_true_if = {
							amount = 3
							has_character_flag = lost_star
							has_character_flag = left_cart
							has_character_flag = left_peds
							has_character_flag = hit_with_rock
							has_character_flag = winsome_stranger
							has_character_flag = let_priest_go
							has_character_flag = let_cheater_go
							has_character_flag = kicked_by_blades
							has_character_flag = alcoholic_refreshments
							has_character_flag = escalated_fight
						}
					}
				}
			}
		}
	}

	after = {
		remove_character_flag = retained_star
		remove_character_flag = became_star
		remove_character_flag = poisoned_pies
		remove_character_flag = yeeted_cart
		remove_character_flag = took_peds
		remove_character_flag = berserker_start
		remove_character_flag = stole_rock
		remove_character_flag = stole_ball
		remove_character_flag = punched_priest
		remove_character_flag = caught_cheater
		remove_character_flag = stole_shoes
		remove_character_flag = water_refreshments
		remove_character_flag = broke_up_fight
		remove_character_flag = lost_star
		remove_character_flag = left_cart
		remove_character_flag = left_peds
		remove_character_flag = hit_with_rock
		remove_character_flag = winsome_stranger
		remove_character_flag = let_priest_go
		remove_character_flag = let_cheater_go
		remove_character_flag = kicked_by_blades
		remove_character_flag = alcoholic_refreshments
		remove_character_flag = escalated_fight
	}
}

#Glorious victory
yearly.7041 = {
	type = character_event
	title = yearly.7041.t
	desc = {
		desc = yearly.7041.desc
		desc = yearly.7041.desc.ending
	}
	theme = recovery
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = throne_room_cheer_2
	}
	# Have a celebratory drink
	option = {
		name = yearly.7041.a
		add_prestige = major_prestige_value
		add_character_modifier = {
			modifier = footballer_modifier
			years = 5
		}
	}
	# Commission a cup
	option = {
		name = yearly.7041.b
		trigger = { has_dlc_feature = royal_court }

		add_character_modifier = {
			modifier = footballer_modifier
			years = 5
		}
		save_scope_value_as = {
			name = quality
			value = 40
		}
		save_scope_value_as = {
			name = wealth
			value = 40
		}
		create_artifact = {
			name = football_cup
			description = football_cup_desc
			type = goblet
			visuals = goblet
			wealth = 40
			quality = 40
			modifier = artifact_monthly_prestige_1_modifier
			modifier = artifact_negate_prowess_penalty_add_1_modifier
		}
	}
}

#Victory
yearly.7042 = {
	type = character_event
	title = yearly.7042.t
	desc = {
		desc = yearly.7042.desc
		desc = yearly.7041.desc.ending
	}
	theme = recovery
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = throne_room_cheer_2
	}
	# Have a celebratory drink
	option = {
		name = yearly.7042.a

		add_prestige = medium_prestige_value
		add_character_modifier = {
			modifier = footballer_modifier
			years = 2
		}
	}
	# Commission a cup
	option = {
		name = yearly.7042.b
		trigger = { has_dlc_feature = royal_court }

		add_character_modifier = {
			modifier = footballer_modifier
			years = 2
		}
		save_scope_value_as = {
			name = quality
			value = 40
		}
		save_scope_value_as = {
			name = wealth
			value = 40
		}
		create_artifact = {
			name = football_cup
			description = football_cup_desc
			type = goblet
			visuals = goblet
			wealth = 40
			quality = 40
			modifier = artifact_monthly_prestige_2_modifier
			modifier = artifact_negate_prowess_penalty_add_2_modifier
		}
	}
}

#Draw
yearly.7043 = {
	type = character_event
	title = yearly.7043.t
	desc = {
		desc = yearly.7043.desc
		desc = yearly.7041.desc.ending
	}
	theme = recovery
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = war_over_tie
	}
	# Wander away listlessly
	option = {
		name = yearly.7043.a

		add_character_modifier = {
			modifier = footballer_health_modifier
			years = 1
		}
	}
}

#Defeat
yearly.7044 = {
	type = character_event
	title = yearly.7044.t
	desc = {
		desc = yearly.7044.desc
		desc = yearly.7041.desc.ending
	}
	theme = recovery
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = throne_room_applaud_1
	}
	# Be a gracious loser
	option = {
		name = yearly.7044.a
		stress_impact = {
			arrogant = major_stress_gain
			ambitious = minor_stress_gain
			gregarious = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
		}
		add_prestige = miniscule_prestige_value
		add_character_modifier = {
			modifier = footballer_health_modifier
			years = 1
		}
	}
	# Be a bad loser
	option = {
		name = yearly.7044.b
		stress_impact = {
			arrogant = minor_stress_loss
			ambitious = miniscule_stress_impact_loss
			gregarious = minor_stress_gain
			humble = minor_stress_gain
		}
		add_character_modifier = {
			modifier = footballer_health_modifier
			years = 2
		}
	}
	# Commission a participation trophy
	option = {
		name = yearly.7044.c
		trigger = {
			has_trait = arrogant
			has_dlc_feature = royal_court
		}
		trait = arrogant
		stress_impact = {
			arrogant = minor_stress_loss
		}
		save_scope_value_as = {
			name = quality
			value = 20
		}
		save_scope_value_as = {
			name = wealth
			value = 20
		}
		create_artifact = {
			name = participation_trophy
			description = participation_trophy_desc
			type = goblet
			visuals = goblet
			wealth = 20
			quality = 20
			modifier = artifact_stress_gain_1_modifier
			modifier = artifact_vassal_opinion_penalty_1_modifier
		}
	}
}

#Heavy Defeat
yearly.7045 = {
	type = character_event
	title = yearly.7045.t
	desc = {
		desc = yearly.7045.desc
		desc = yearly.7041.desc.ending
	}
	theme = recovery
	override_background = { reference = market }
	left_portrait = {
		character = root
		animation = loss_1
	}
	# Be a gracious loser
	option = {
		name = yearly.7045.a

		stress_impact = {
			arrogant = major_stress_gain
			ambitious = minor_stress_gain
			gregarious = miniscule_stress_impact_loss
			humble = miniscule_stress_impact_loss
		}

		add_prestige = miniscule_prestige_value

		add_character_modifier = {
			modifier = footballer_health_modifier
			years = 1
		}
	}
	# Be a bad loser
	option = {
		name = yearly.7045.b

		stress_impact = {
			arrogant = minor_stress_loss
			ambitious = miniscule_stress_impact_loss
			gregarious = minor_stress_gain
			humble = minor_stress_gain
		}

		add_character_modifier = {
			modifier = footballer_health_modifier
			years = 2
		}
	}
	# Commission a participation trophy
	option = {
		name = yearly.7045.c

		trigger = {
			has_trait = arrogant
			has_dlc_feature = royal_court
		}

		trait = arrogant

		stress_impact = {
			arrogant = minor_stress_loss
		}
		save_scope_value_as = {
			name = quality
			value = 20
		}
		save_scope_value_as = {
			name = wealth
			value = 20
		}
		create_artifact = {
			name = participation_trophy
			description = participation_trophy_desc
			type = goblet
			visuals = goblet
			wealth = 20
			quality = 20
			modifier = artifact_stress_gain_2_modifier
			modifier = artifact_vassal_opinion_penalty_1_modifier
		}
	}
}

## Foggy Hill 
# 7050 - There used to be a hole here
# 7051 - A bad dream?
# 7052 - Waking up
# 7053 - Denial
# 7054 - Coming to
# 7055 - It was the dog all along

#There used to be a hole here
yearly.7050 = {
	type = character_event
	title = yearly.7050.t
	desc = yearly.7050.desc
	theme = mental_health
	override_background = { reference = corridor_day }
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = wrathful
					has_trait = irritable
					has_trait = sadistic
					has_trait = callous
					has_trait = impatient
				}
			}
			animation = disapproval
		}
		triggered_animation = {
			trigger = { has_trait = paranoid }
			animation = paranoia
		}
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = lunatic
					has_trait = possessed
				}
			}
			animation = personality_irrational
		}
		animation = worry
	}
	right_portrait = {
		character = scope:unfortunate_soul
		animation = personality_irrational
	}
	trigger = {
		is_landed = yes
		is_available_at_peace_adult = yes
		#Find someone to spark the flame
		any_courtier_or_guest = {
			#Could technically be a child
			is_available = yes
			OR = {
				has_trait = lunatic
				has_trait = possessed
			}
			any_secret = { secret_type = secret_non_believer }
		}
		NOR = {
			any_owned_story = { story_type = story_cycle_pet_dog }
			has_character_modifier = dog_story_modifier
			exists = var:had_event_yearly_7050
			has_trait = eccentric
		}
		any_killed_character = { count >= 2 }
	}
	#Mostly sad people or strange people... or murderous people
	weight_multiplier = {
		base = 1
		modifier = {
			has_trait = lunatic
			add = 1
		}
		modifier = {
			has_trait = possessed
			add = 1
		}
		modifier = {
			has_trait = depressed
			add = 1
		}
		modifier = {
			any_killed_character = { count = 4 }
			add = 2
		}
		modifier = {
			any_killed_character = { count = 6 }
			add = 3
		}
		#You're a cold-blooded killer, huh
		modifier = {
			any_killed_character = { count >= 7 }
			factor = 2
		}
		modifier = {
			OR = {
				has_trait = murderer
				any_secret = { secret_type = secret_murder }
			}
			factor = 2
		}
		modifier = {
			stress_level >= 1
			factor = 2
		}
	}
	immediate = {
		random_courtier_or_guest = {
			limit = {
				OR = {
					has_trait = lunatic
					has_trait = possessed
				}
				any_secret = { secret_type = secret_non_believer }
			}
			save_scope_as = unfortunate_soul
		}
		set_variable = had_event_yearly_7050
	}
	#Right, a hole... here...
	option = {
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = {
							OR = {
								has_trait = paranoid
								has_trait = lunatic
								has_trait = possessed
							}
						}
						desc = yearly.7050.a_paranoid
					}
					desc = yearly.7050.a
				}
			}
		}
		#Hmmyes
		flavor = yearly.7050.a.flavor
		add_secret = { type = secret_non_believer }
		set_variable = {
			name = 7050_decision
			value = flag:agree
		}
		stress_impact = {
			cynical = major_stress_impact_gain
			zealous = major_stress_impact_gain
		}
	}
	#This is nonsense
	option = {
		name = yearly.7050.b
		#Hmmno
		flavor = yearly.7050.b.flavor
		set_variable = {
			name = 7050_decision
			value = flag:disagree
		}
		stress_impact = {
			craven = medium_stress_impact_gain
			paranoid = massive_stress_impact_gain
		}
	}
	#Stop wasting my time
	option = {
		name = yearly.7050.c
		trigger = {
			OR = {
				has_trait = wrathful
				has_trait = irritable
				has_trait = sadistic
				has_trait = callous
				has_trait = impatient
			}
		}
		scope:unfortunate_soul = {
			increase_wounds_effect = { REASON = whipping }
		}
		#This will come back to bite you
		add_character_flag = 7050_whipped_unfortunate_soul
		set_variable = {
			name = 7050_decision
			value = flag:disagree
		}
		stress_impact = {
			compassionate = major_stress_impact_gain
			craven = medium_stress_impact_gain
			paranoid = massive_stress_impact_gain
		}
	}
	after = {
		if = {
			limit = { exists = var:7050_decision }
			if = {
				limit = { var:7050_decision = flag:agree }
				#A bad dream?
				trigger_event = {
					id = yearly.7051
					days = { 3 5 }
				}
			}
			else_if = {
				limit = { var:7050_decision = flag:disagree }
				#Denial
				trigger_event = {
					id = yearly.7053
					days = { 3 5 }
				}
			}
			remove_variable = 7050_decision
		}
	}
}

scripted_effect 7051_duel_effect = {
	duel = {
		skill = $SKILL$
		target = root
		#You convince yourself
		50 = {
			compare_modifier = {
				value = scope:duel_value
				multiplier = 3.5
				min = -49
			}
			desc = yearly.7051.b_conviction.desc
			stress_impact = {
				base = major_stress_loss
			}
		}
		#You break down
		50 = {
			compare_modifier = {
				value = scope:duel_value
				multiplier = -3.5
				min = -49
			}
			desc = yearly.7051.b_unconvinced.desc
			stress_impact = {
				base = massive_stress_gain
			}
			set_variable = {
				name = 7051_conviction
				value = flag:unconvinced
			}
		}
	}
}

#A bad dream?
yearly.7051 = {
	type = character_event
	title = yearly.7051.t
	desc = yearly.7051.desc
	theme = mental_health
	override_background = { reference = battlefield }
	override_effect_2d = { reference = fog }
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = lunatic
					has_trait = possessed
					has_trait = paranoid
				}
			}
			animation = thinking
		}
		animation = paranoia
	}
	right_portrait = {
		character = scope:victim
		animation = prisonhouse
	}
	lower_right_portrait = {
		trigger = { exists = scope:victim_2 }
		character = scope:victim_2
	}
	lower_center_portrait = {
		trigger = { exists = scope:victim_3 }
		character = scope:victim_3
	}
	lower_left_portrait = {
		trigger = { exists = scope:victim_4 }
		character = scope:victim_4
	}
	immediate = {
		#BOO!
		random_killed_character = { save_scope_as = victim }
		random_killed_character = {
			limit = {
				NOT = { this = scope:victim }
			}
			save_scope_as = victim_2
		}
		random_killed_character = {
			limit = {
				NOR = { 
					this = scope:victim
					this = scope:victim_2
				}
			}
			save_scope_as = victim_3
		}
		random_killed_character = {
			limit = {
				NOR = { 
					this = scope:victim
					this = scope:victim_2
					this = scope:victim_3
				}
			}
			save_scope_as = victim_4
		}
	}
	#...alright
	option = {
		name = yearly.7051.a
		flavor = yearly.7051.a.flavor
		if = {
			limit = {
				any_killed_character = { count >= 15 }
			}
			stress_impact = { base = massive_stress_gain }
		}
		else_if = {
			limit = {
				any_killed_character = { count >= 10 }
			}
			stress_impact = { base = major_stress_gain }
		}
		else_if = {
			limit = { 
				any_killed_character = { count >= 5 }
			}
			stress_impact = { base = medium_stress_gain }
		}
		else = {
			stress_impact = { base = minor_stress_gain }
		}
		add_character_modifier = {
			modifier = 7051_repentance_modifier
			years = 25
		}
	}
	#They deserved it. All of them.
	option = {
		name = yearly.7051.b
		#If two or more of your skills have the same level
		random_list = {
			1 = {
				trigger = { highest_skill = diplomacy }
				#Checks highest skill and runs duel effect
				7051_duel_effect = { SKILL = diplomacy }
			}
			1 = {
				trigger = { highest_skill = martial }
				#Checks highest skill and runs duel effect
				7051_duel_effect = { SKILL = martial }
			}
			1 = {
				trigger = { highest_skill = stewardship }
				#Checks highest skill and runs duel effect
				7051_duel_effect = { SKILL = stewardship }
			}
			1 = {
				trigger = { highest_skill = intrigue }
				#Checks highest skill and runs duel effect
				7051_duel_effect = { SKILL = intrigue }
			}
			1 = {
				trigger = { highest_skill = learning }
				#Checks highest skill and runs duel effect
				7051_duel_effect = { SKILL = learning }
			}
		}
	}
	after = {
		create_character_memory = { type = foggy_hill_memory }
		#Wake up!
		trigger_event = {
			id = yearly.7052
			days = 1
		}
	}
}

#Waking up
yearly.7052 = {
	type = character_event
	title = yearly.7052.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = var:7051_conviction
					var:7051_conviction = flag:unconvinced
				}
				desc = yearly.7052.desc_unconvinced
			}
			#Acceptance/convinced yourself
			desc = yearly.7052.desc
		}
	}
	theme = mental_health
	override_background = { reference = bedchamber }
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				exists = var:7051_conviction
				var:7051_conviction = flag:unconvinced
			}
			animation = paranoia
		}
		animation = thinking
	}
	#...alright
	option = {
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = {
							exists = var:7051_conviction
							var:7051_conviction = flag:unconvinced
						}
						desc = yearly.7052.a
					}
					triggered_desc = {
						desc = yearly.7052.a_positive
					}
				}
			}
		}
		#Doggo
		trigger_event = {
			id = yearly.7055
			days = { 3 5 }
		}
	}
}

#Denial
yearly.7053 = {
	type = character_event
	title = yearly.7053.t
	desc = yearly.7053.desc
	theme = mental_health
	override_background = { reference = corridor_day }
	left_portrait = {
		character = root
		animation = disbelief
	}
	#What the
	option = {
		name = yearly.7053.a
		stress_impact = {
			brave = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
		}
	}
	#Put your hand in the hole
	option = {
		name = yearly.7053.b
		random_list = {
			#You find a coin pouch
			50 = {
				modifier = {
					any_killed_character = { count <= 5 }
					add = 25
				}
				desc = yearly.7053.b_pouch.desc
				show_as_tooltip = {
					add_gold = major_gold_value
				}
				set_variable = {
					name = 7053_hole_outcome
					value = flag:pouch
				}
			}
			#Something hurts you
			50 = {
				modifier = {
					any_killed_character = {
						count > 2
					}
					add = 10
				}
				modifier = {
					any_killed_character = {
						count > 4
					}
					add = 10
				}
				modifier = {
					OR = {
						has_trait = murderer
						any_secret = {
							secret_type = secret_murder
						}
					}
					add = 10
				}
				modifier = {
					has_character_flag = 7050_whipped_unfortunate_soul
					add = 25
				}
				desc = yearly.7053.b_scratch.desc
				show_as_tooltip = {
					add_character_modifier = {
						modifier = 7053_scratched_modifier
						years = 25
					}
				}
				set_variable = {
					name = 7053_hole_outcome
					value = flag:scratch
				}
			}
		}
		#You put your hand into a hole in the wall? Seriously?
		create_character_memory = { type = wall_hole_memory }
		stress_impact = {
			craven = medium_stress_impact_gain
			paranoid = major_stress_impact_gain
		}
	}
	after = {
		#Wake up!
		trigger_event = yearly.7054
	}
}

#Coming to
yearly.7054 = {
	type = character_event
	title = yearly.7054.t
	desc = {
		desc = yearly.7054.intro
		first_valid = {
			#Got the gold
			triggered_desc = {
				trigger = {
					exists = var:7053_hole_outcome
					var:7053_hole_outcome = flag:pouch
				}
				desc = yearly.7054.desc_pouch
			}
			#Got scratched
			triggered_desc = {
				trigger = {
					exists = var:7053_hole_outcome
					var:7053_hole_outcome = flag:scratch
				}
				desc = yearly.7054.desc_scratch
			}
			#Did NOT stick my HAND IN A FLIPPIN' HOLE
			desc = yearly.7054.desc
		}
		desc = yearly.7054.outro
	}
	theme = mental_health
	override_background = { reference = corridor_day }
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = lunatic
					has_trait = possessed
					has_trait = paranoid
				}
			}
			animation = thinking
		}
		animation = paranoia
	}
	immediate = {
		random_list = {
			1 = {
				dummy_female = { save_scope_as = 7054_servant }
			}
			1 = {
				dummy_male = { save_scope_as = 7054_servant }
			}
		}
		if = {
			limit = { exists = var:7053_hole_outcome }
			if = {
				limit = { var:7053_hole_outcome = flag:pouch }
				add_gold = major_gold_value
			}
			else = {
				add_character_modifier = {
					modifier = 7053_scratched_modifier
					years = 25
				}
			}
		}
	}
	#I'm so confused (pouch)
	option = {
		name = yearly.7054.a
		flavor = {
			first_valid = {
				triggered_desc = {
					trigger = {
						exists = var:7053_hole_outcome
						var:7053_hole_outcome = flag:pouch
					}
					desc = yearly.7054.a.flavor_pouch
				}
				triggered_desc = {
					trigger = {
						exists = var:7053_hole_outcome
						var:7053_hole_outcome = flag:scratch
					}
					desc = yearly.7054.a.flavor_scratch
				}
				desc = yearly.7054.a.flavor
			}
		}
	}
	after = {
		if = {
			limit = { has_character_flag = 7050_whipped_unfortunate_soul }
			remove_character_flag = 7050_whipped_unfortunate_soul
		}
		remove_variable ?= 7053_hole_outcome
	}
}

#It was the dog all along
yearly.7055 = {
	type = character_event
	title = yearly.7055.t
	desc = yearly.7055.desc
	theme = mental_health
	override_background = { reference = courtyard }
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	#I guess I have a dog now
	option = {
		name = yearly.7055.a
		start_dog_story_cycle_effect = yes
	}
	#NO
	option = {
		name = yearly.7055.b
		flavor = yearly.7055.b.flavor
	}
	after = { remove_variable ?= 7051_conviction }
}