namespace = tgp_japan_yearly_events

##########################################################
# Japan Yearly Events
# tgp_japan_yearly_events - 0001-0999
# by Anna Johansson and Laurence Kennedy
##########################################################

##########################################################
# 0001 - Spreading Joy - Furoshiki (gift wrap something for a loved one)
# 0006 - Treasures from the Sea - Ama divers (establish a trade deal with them)
# 0012 - Monkey Business - Onsen
# 0013 - Purifying the Spirit - Onsen
# 0014 - Taking It Easy - Onsen
# 0021 - Among the Blossoms - Hanami (Cherry Blossoms)
# 0026 - Tales of the Tengu - Tengu
# 0027 - Prove Your Worth - Tengu
# 0028 - False Rumors - Tengu
# 0029 - Practice Makes Perfect - Tengu
# 0036 - Green Thumb
# 1200 - Congestion in the Capital
# 1210 - Fit to Lead?
# 1225 - A Poetic Life
#########################################################

# 0001 - Spreading Joy - Furoshiki (gift wrap something for a loved one)
tgp_japan_yearly_events.0001 = {
	type = character_event
	title = tgp_japan_yearly_events.0001.t
	desc = tgp_japan_yearly_events.0001.desc
	theme = love
	override_background = market
	cooldown = { years = 30 }
	left_portrait = {
		character = root
		animation = japanese_war_fan
	}

	#Person we care about
	right_portrait = {
		character = scope:gift_receiver
		animation = disapproval
		camera = camera_event_center_close_to_right
	}

	artifact = {
		target = scope:gift_uchiwa
		position = lower_left_portrait
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		is_available_healthy_adult = yes
		culture = {
			has_cultural_pillar = heritage_japonic
		}
		location = {
			geographical_region = world_asia_japan
		}
		any_relation = {
			type = friend
			type = best_friend
			type = soulmate
			type = lover
			type = crush
			is_ai = yes
		}
		any_spouse = {
			is_ai = yes
		}
	}

	immediate = {
		every_relation = {
			type = friend
			type = best_friend
			type = soulmate
			type = lover
			type = crush
			limit = {
				is_ai = yes
			}
			add_to_list = potential_gift_receiver
		}
		random_spouse = {
			limit = {
				is_ai = yes
			}
			add_to_list = potential_gift_receiver
		}

		ordered_in_list = {
			list = potential_gift_receiver
			#find the person who likes you the least so improving your relationship is most impactful.
			order_by = {
				value = "opinion(root)"
				multiply = -1
				max = 1
			}
			save_scope_as = gift_receiver
		}

		#Uchiwa is a type of fan that was popular in China/Japan
		hidden_effect_new_object = {
			create_artifact = {
				name = uchiwa
				description = uchiwa_desc
				rarity = common
				type = miscellaneous
				visuals = tapestry
				modifier = artifact_attraction_opinion_1_modifier
				modifier = artifact_fertility_gain_1_modifier
				save_scope_as = gift_uchiwa
			}
		}
	}

	#Option A) Get gift for someone you care about
	option = {
		name = tgp_japan_yearly_events.0001.a

		scope:gift_uchiwa = {
			set_variable = {
				name = suppress_artifact_notifications
				value = yes
				days = 1
			}
			set_owner = {
				target = scope:gift_receiver
				history = {
					actor = root
					recipient = scope:gift_receiver
					type = given
				}
			}
		}

		send_interface_toast = {
			title = tgp_japan_yearly_events.0001.a_spouse_toast
			left_icon = root
			right_icon = scope:gift_receiver

			if = {
				limit = {
				 can_set_relation_lover_trigger = { CHARACTER = scope:gift_receiver }
				}
				progress_towards_lover_effect = {
					CHARACTER = scope:gift_receiver
					REASON = tgp_progress_towards_lover_furoshiki
					OPINION = 0
				}
			}

			reverse_add_opinion = {
				modifier = grateful_opinion
				target = scope:gift_receiver
				opinion = 30
			}
		}

		remove_short_term_gold = minor_gold_value

		stress_impact = {
			gregarious = minor_stress_impact_loss
			generous = minor_stress_impact_loss
			greedy = minor_stress_impact_gain
			shy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -1
				ai_sociability = 1
			}
		}
	}

	#Option B) You get artifact for yourself
	option = {
		name = tgp_japan_yearly_events.0001.b
		flavor = tgp_japan_yearly_events.0001.b.flavor
		scope:gift_uchiwa = {
			set_variable = {
				name = suppress_artifact_notifications
				value = yes
				days = 1
			}
			set_owner = {
				target = root
				history = {
					recipient = root
					type = purchased
				}
			}
		}
		remove_short_term_gold = minor_gold_value
		stress_impact = {
			gregarious = minor_stress_impact_gain
			generous = minor_stress_impact_gain
			greedy = minor_stress_impact_loss
			shy = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 1
				ai_sociability = -1
			}
		}
	}
	#Option C) You are above these petty merchants and their wares (opt out)
	option = {
		name = tgp_japan_yearly_events.0001.c
		add_piety = minor_piety_gain
		stress_impact = {
			gregarious = minor_stress_impact_gain
			generous = minor_stress_impact_gain
			greedy = minor_stress_impact_loss
			shy = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 1
				ai_sociability = -1
			}
		}
	}
}

# 0006 - Treasures from the Sea - Ama divers (establish a trade deal with them)
tgp_japan_yearly_events.0006 = {
	type = character_event
	title = tgp_japan_yearly_events.0006.t
	desc = tgp_japan_yearly_events.0006.desc
	theme = travel
	override_background = bp3_coast
	cooldown = { years = 30 }
	left_portrait = {
		character = root
		animation = steward
	}

	right_portrait = {
		character = scope:pearl_diver
		animation = idle
		outfit_tags = { no_clothes }
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		is_available_travelling_adult = yes
		is_location_valid_for_travel_event_on_land = yes
		location = {
			geographical_region = world_asia_japan
			is_coastal = yes
		}
	}

	immediate = {
		create_character = {
			template = tgp_japan_yearly_events_pearl_diver_template
			location = root.location
			save_scope_as = pearl_diver
		}
	}

	#Diplomacy Duel - Selling freshly caught fish/seaweed
	option = {
		name = tgp_japan_yearly_events.0006.a

		duel = {
			skill = diplomacy
			target = scope:pearl_diver
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0006.tt.success
				min = 20
				max = 90
				root = {
					send_interface_toast = {
						title = tgp_japan_yearly_events.0006.tt.success
						left_icon = root
						right_icon = scope:pearl_diver
						capital_county.title_province = {
							add_province_modifier = {
								modifier = tgp_japan_fresh_fish_county_modifier
								years = 10
							}
						}
						add_diplomacy_lifestyle_xp = medium_lifestyle_xp
						remove_short_term_gold = tiny_gold_value
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0006.tt.failure
				min = 20
				max = 90
				root = {
					send_interface_toast = {
						title = tgp_japan_yearly_events.0006.tt.failure
						left_icon = root
						right_icon = scope:pearl_diver
						add_prestige = minor_prestige_loss
					}
				}
			}
		}

		stress_impact = {
			gluttonous = minor_stress_impact_gain
			temperate = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_sociability = 1
			}
		}
	}

	#Stewardship Duel - Selling found pearls
	option = {
		name = tgp_japan_yearly_events.0006.b

		duel = {
			skill = stewardship
			target = scope:pearl_diver
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0006.tt.success
				min = 20
				max = 90
				root = {
					send_interface_toast = {
						title = tgp_japan_yearly_events.0006.tt.success
						left_icon = root
						right_icon = scope:pearl_diver
						capital_county.title_province = {
							add_province_modifier = {
								modifier = tgp_japan_pearl_county_modifier
								years = 10
							}
						}
						add_stewardship_lifestyle_xp = medium_lifestyle_xp
						remove_short_term_gold = tiny_gold_value
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0006.tt.failure
				min = 20
				max = 90
				root = {
					send_interface_toast = {
						title = tgp_japan_yearly_events.0006.tt.failure
						left_icon = root
						right_icon = scope:pearl_diver
						add_prestige = minor_prestige_loss
					}
				}
			}
		}

		stress_impact = {
			generous = minor_stress_impact_gain
			greedy = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = 1
				ai_rationality = 1
				ai_sociability = 1
			}
		}
	}

	#Learning Duel - Giving abalone to temples
	option = {
		name = tgp_japan_yearly_events.0006.c

		duel = {
			skill = learning
			target = scope:pearl_diver
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0006.tt.success
				min = 20
				max = 90
				root = {
					send_interface_toast = {
						title = tgp_japan_yearly_events.0006.tt.success
						left_icon = root
						right_icon = scope:pearl_diver
						capital_county.title_province = {
							add_province_modifier = {
								modifier = tgp_japan_abalone_temple_offerings_county_modifier
								years = 10
							}
						}
						add_learning_lifestyle_xp = medium_lifestyle_xp
						remove_short_term_gold = tiny_gold_value
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0006.tt.failure
				min = 20
				max = 90
				root = {
					send_interface_toast = {
						title = tgp_japan_yearly_events.0006.tt.failure
						left_icon = root
						right_icon = scope:pearl_diver
						add_prestige = minor_prestige_loss
					}
				}
			}
		}

		stress_impact = {
			lazy = minor_stress_impact_gain
			diligent = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_rationality = 1
				ai_sociability = 1
			}
		}
	}

	#Opt out
	option = {
		name = tgp_japan_yearly_events.0006.d
		add_prestige = minor_prestige_gain

		stress_impact = {
			diligent = minor_stress_impact_gain
			lazy = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}

	after = {
		scope:pearl_diver ?= {
			silent_disappearance_ai_effect = yes
		}
	}
}

# 0012 - Monkey Business - Onsen
tgp_japan_yearly_events.0012 = {
	type = character_event
	title = tgp_japan_yearly_events.0012.t
	desc = tgp_japan_yearly_events.0012.desc
	theme = travel
	override_background = bp3_mountain_winter
	cooldown = { years = 20 }
	override_effect_2d = { reference = fog }
	left_portrait = {
		character = root
		animation = disbelief
	}

	widget = {
		is_shown = {
			current_season_winter = yes
		}
		gui = "event_window_widget_vfx_snow"
		container = "foreground_shader_vfx_container"
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		is_available_travelling_adult = yes
		NOT = {
			has_character_flag = had_event_tgp_japan_yearly_events.0013
			has_character_flag = had_event_tgp_japan_yearly_events.0014
		}
		location = {
			geographical_region = world_asia_japan
			OR = {
				terrain = mountains
				terrain = hills
			}
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_tgp_japan_yearly_events.0012
			years = 15
		}
	}

	#Martial/Intimidation - scare the monkey away from the hot spring
	option = {
		name = tgp_japan_yearly_events.0012.a

		current_travel_plan = {
			delay_travel_plan = { days = 3 }
		}

		duel = {
			skill = martial
			value = decent_skill_rating
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = 20
					max = 90
				}
				desc = tgp_japan_yearly_events.0012.a.monkey.martial.tt.success
				send_interface_toast = {
					title = tgp_japan_yearly_events.0012.a.monkey.martial.tt.success
					left_icon = root
					add_character_modifier = {
						modifier = tpg_japan_hot_spring_relaxation_modifier
						years = 5
					}
					add_martial_lifestyle_xp = medium_lifestyle_xp
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = 20
					max = 90
				}
				desc = tgp_japan_yearly_events.0012.a.monkey.martial.tt.failure
				send_interface_toast = {
					title = tgp_japan_yearly_events.0012.a.monkey.martial.tt.failure
					left_icon = root
					add_prestige = medium_prestige_loss
				}
			}
		}

		stress_impact = {
			brave = minor_stress_impact_loss
			craven = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				martial >= decent_skill_rating
				add = 20
			}
			ai_value_modifier = {
				ai_boldness = 1
				ai_rationality = -1
				ai_vengefulness = 1
			}
		}
	}

	#Intrigue/Disguise - prove to the monkey that you are no threat
	option = {
		name = tgp_japan_yearly_events.0012.b

		current_travel_plan = {
			delay_travel_plan = { days = 3 }
		}

		duel = {
			skill = intrigue
			value = decent_skill_rating
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0012.b.monkey.intrigue.tt.success
				min = 20
				max = 90
				root = {
					send_interface_toast = {
						title = tgp_japan_yearly_events.0012.b.monkey.intrigue.tt.success
						left_icon = root
						add_character_modifier = {
							modifier = tpg_japan_hot_spring_relaxation_modifier
							years = 5
						}
						add_intrigue_lifestyle_xp = medium_lifestyle_xp
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0012.b.monkey.intrigue.tt.failure
				min = 20
				max = 90
				root = {
					send_interface_toast = {
						title = tgp_japan_yearly_events.0012.b.monkey.intrigue.tt.failure
						left_icon = root
						add_prestige = medium_prestige_loss
					}
				}
			}
		}

		stress_impact = {
			brave = minor_stress_impact_loss
			craven = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				intrigue >= decent_skill_rating
				add = 20
			}
			ai_value_modifier = {
				ai_boldness = 1
				ai_rationality = -1
			}
		}
	}

	#Opt out, you don't want to mess with the monkey
	option = {
		name = tgp_japan_yearly_events.0012.c

		add_stress = minor_stress_loss

		stress_impact = {
			brave = minor_stress_impact_gain
			craven = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = -1
				ai_rationality = 1
			}
		}
	}
}

# 0013 - Purifying the Spirit - Onsen
tgp_japan_yearly_events.0013 = {
	type = character_event
	title = tgp_japan_yearly_events.0013.t
	desc = tgp_japan_yearly_events.0013.desc
	theme = travel
	override_background = bp3_hills_winter
	cooldown = { years = 20 }
	override_effect_2d = { reference = fog }
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:mystic
		animation = physician
	}

	widget = {
		is_shown = {
			current_season_winter = yes
		}
		gui = "event_window_widget_vfx_snow"
		container = "foreground_shader_vfx_container"
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		is_available_travelling_adult = yes
		NOT = {
			has_character_flag = had_event_tgp_japan_yearly_events.0012
			has_character_flag = had_event_tgp_japan_yearly_events.0014
		}
		location = {
			geographical_region = world_asia_japan
			OR = {
				terrain = mountains
				terrain = hills
			}
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_tgp_japan_yearly_events.0013
			years = 15
		}

		random_pool_character = {
			province = root.location
			limit = {
				has_trait = lifestyle_mystic
				is_available_healthy_ai_adult = yes
			}
			save_scope_as = mystic
		}
		if = {
			limit = {
				NOT = { exists = scope:mystic }
			}
			create_character = {
				template = default_mystic_character
				culture = root.culture
				location = root.location
				save_scope_as = mystic
			}
			add_character_flag = {
				flag = fake_mystic
				days = 1
			}
		}
	}

	#Join the mystic in his ritualistic bath, chance of random ailments or buffs
	option = {
		name = tgp_japan_yearly_events.0013.a

		current_travel_plan = {
			delay_travel_plan = { days = 3 }
		}

		add_character_modifier = {
			modifier = tpg_japan_hot_spring_relaxation_modifier
			years = 5
		}
		if = {
			limit = {
				has_trait = ill
			}
			remove_trait = ill
		}

		random_list = {
			33 = {
				custom_tooltip = tgp_japan_yearly_mystic_positive.tt
				send_interface_toast = {
					title = tgp_japan_yearly_mystic_positive.tt
					left_icon = root
					right_icon = scope:mystic

					add_character_modifier = {
						modifier = tgp_japan_hot_spring_mystic_positive_modifier
						years = 5
					}
				}
			}
			33 = {
				custom_tooltip = tgp_japan_yearly_mystic_neutral.tt
				send_interface_toast =  {
					title = tgp_japan_yearly_mystic_neutral.tt
					left_icon = root
					right_icon = scope:mystic

					add_character_modifier = {
						modifier = tgp_japan_hot_spring_mystic_neutral_modifier
						years = 5
					}
				}
			}
			33 = {
				custom_tooltip = tgp_japan_yearly_mystic_negative.tt
				send_interface_toast = {
					title = tgp_japan_yearly_mystic_negative.tt
					left_icon = root
					right_icon = scope:mystic

					add_character_modifier = {
						modifier = tgp_japan_hot_spring_mystic_negative_modifier
						years = 5
					}
				}
			}
		}

		stress_impact = {
			zealous = minor_stress_impact_loss
			cynical = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 1
				ai_compassion = 1
				ai_sociability = 1
			}
		}
	}

	#Ask for guidance/wisdom, but do not join him
	option = {
		name = tgp_japan_yearly_events.0013.b

		current_travel_plan = {
			delay_travel_plan = { days = 3 }
		}

		duel = {
			skill = learning
			value = decent_skill_rating
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0013.b.mystic.learning.tt.success
				min = 20
				max = 90
				root = {
					send_interface_toast = {
						title = tgp_japan_yearly_events.0013.b.mystic.learning.tt.success
						left_icon = root
						right_icon = scope:mystic
						add_learning_lifestyle_xp = medium_lifestyle_xp

						if = {
							limit = {
								has_trait = lifestyle_mystic
							}
							add_trait_xp = {
								trait = lifestyle_mystic
								value = lifestyle_mystic_xp_gain_minor_value
							}
						}
						else = {
							random = {
								chance = 33
								add_trait = lifestyle_mystic
							}
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0013.b.mystic.learning.tt.failure
				min = 20
				max = 90
				root = {
					send_interface_toast = {
						title = tgp_japan_yearly_events.0013.b.mystic.learning.tt.failure
						left_icon = root
						right_icon = scope:mystic
						add_piety = medium_piety_loss
					}
				}
			}
		}

		stress_impact = {
			cynical = minor_stress_impact_loss
			zealous = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -1
				ai_compassion = -1
				ai_rationality = 1
				ai_sociability = 1
			}
		}
	}

	#Opt out
	option = {
		name = tgp_japan_yearly_events.0013.c

		stress_impact = {
			cynical = minor_stress_impact_loss
			zealous = minor_stress_impact_gain
		}

		add_stress = minor_stress_loss

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -1
				ai_compassion = -1
				ai_rationality = 1
				ai_sociability = 1
			}
		}
	}
	after = {
		if = {
			limit = {
				has_character_flag = fake_mystic
			}
		}
		scope:mystic ?= {
			silent_disappearance_effect = yes
		}
	}
}

# 0014 - Taking It Easy - Onsen
tgp_japan_yearly_events.0014 = {
	type = character_event
	title = tgp_japan_yearly_events.0014.t
	desc = tgp_japan_yearly_events.0014.desc
	theme = travel
	override_background = bp3_mountain_winter
	override_effect_2d = { reference = fog }
	cooldown = { years = 20 }
	left_portrait = {
		character = root
		animation = admiration
	}

	widget = {
		is_shown = {
			current_season_winter = yes
		}
		gui = "event_window_widget_vfx_snow"
		container = "foreground_shader_vfx_container"
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		is_available_travelling_adult = yes
		NOT = {
			has_character_flag = had_event_tgp_japan_yearly_events.0012
			has_character_flag = had_event_tgp_japan_yearly_events.0013
		}
		location = {
			geographical_region = world_asia_japan
			OR = {
				terrain = mountains
				terrain = hills
			}
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_tgp_japan_yearly_events.0014
			years = 15
		}
	}

	#Take a relaxing bath, stress reduction
	option = {
		name = tgp_japan_yearly_events.0014.a

		current_travel_plan = {
			delay_travel_plan = { days = 5 }
		}

		add_character_modifier = {
			modifier = tpg_japan_hot_spring_relaxation_modifier
			years = 5
		}

		add_stress = medium_stress_loss

		stress_impact = {
			lazy = minor_stress_impact_loss
			patient = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_energy = 1
			}
		}
	}

	#Take an extended time off, additional stress reduction
	option = {
		name = tgp_japan_yearly_events.0014.b

		current_travel_plan = {
			delay_travel_plan = { days = 10 }
		}


		add_character_modifier = {
			modifier = tpg_japan_hot_spring_relaxation_modifier
			years = 10
		}

		add_stress = major_stress_loss

		stress_impact = {
			lazy = minor_stress_impact_loss
			patient = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_energy = 1
			}
		}
	}

	#Opt out
	option = {
		name = tgp_japan_yearly_events.0014.c

		stress_impact = {
			lazy = minor_stress_impact_gain
			impatient = minor_stress_impact_loss
		}

		add_prestige = minor_prestige_gain

		add_stress = minor_stress_loss

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
				ai_energy = -1
			}
		}
	}
}

# 0021 - Among the Blossoms - Hanami (Cherry Blossoms)
tgp_japan_yearly_events.0021 = {
	type = character_event
	title = tgp_japan_yearly_events.0021.t
	desc = tgp_japan_yearly_events.0021.desc
	theme = love
	override_background = garden
	cooldown = { years = 15 }
	left_portrait = {
		character = root
		animation = toast_goblet
	}
	right_portrait = {
		character = scope:hanami_enjoyer
		animation = storyteller
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		drinks_alcohol_trigger = yes
		any_courtier = {
			NOT = { has_trait = blind }
			is_available_healthy_adult = yes
		}
		location = {
			geographical_region = world_asia_japan
		}
		NOT = { has_trait = blind }
		is_available_healthy_adult = yes
		is_at_war = no
		#The trees are in bloom between the end of March until early May
		current_season_spring = yes
	}

	immediate = {
		random_courtier = {
			limit = {
				NOT = { has_trait = blind }
				is_available_healthy_adult = yes
			}
			save_scope_as = hanami_enjoyer
		}
	}

	#Make an offering of sake to appease the gods
	option = {
		name = tgp_japan_yearly_events.0021.a
		random_list = {
			#Character modifier
			40 = {
				show_chance = no
				desc = tgp_japan_yearly_events.0021.a_pleased_deities.tt
				send_interface_toast = {
					right_icon = root
					title = tgp_japan_yearly_events.0021.a_char_modifier.tt
					add_character_modifier = {
						modifier = tgp_japan_sake_offering_character_modifier
						years = 5
					}
				}
			}
			#County modifier
			40 = {
				show_chance = no
				desc = tgp_japan_yearly_events.0021.a_pleased_deities.tt
				send_interface_toast = {
					right_icon = root
					title = tgp_japan_yearly_events.0021.a_county_modifier.tt
					capital_county = {
						add_county_modifier = {
							modifier = tgp_japan_sake_offering_county_modifier
							years = 5
						}
					}
				}
			}
			#Nothing happens
			20 = {
				show_chance = no
				desc = tgp_japan_yearly_events.0021.a_nothing_happens.tt
				send_interface_toast = {
					right_icon = root
					title = tgp_japan_yearly_events.0021.a_nothing_happens.tt
				}
			}
		}
		add_piety = minor_piety_gain

		add_stress = minor_stress_loss

		stress_impact = {
			calm = minor_stress_impact_loss
			humble = minor_stress_impact_loss
			cynical = major_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 1
				ai_energy = 1
			}
		}
	}

	#Simply take in the view of the celebration
	option = {
		name = tgp_japan_yearly_events.0021.b

		add_prestige = miniscule_prestige_gain

		add_stress = major_stress_loss

		stress_impact = {
			calm = minor_stress_impact_loss
			humble = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -1
				ai_energy = 1
			}
		}
	}
}

# 0026 - Tales of the Tengu - Tengu
tgp_japan_yearly_events.0026 = {
	type = character_event
	title = tgp_japan_yearly_events.0026.t
	desc = tgp_japan_yearly_events.0026.desc
	theme = memory_intrigue
	override_background = tavern
	cooldown = { years = 70 }
	left_portrait = {
		character = scope:rumormonger
		animation = toast_goblet
	}
	right_portrait = {
		character = scope:gossiper
		animation = wedding_drunk
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		location = {
			geographical_region = world_asia_japan
		}
		any_courtier_or_guest = {
			count >= 2
			is_available_healthy_adult = yes
			NOT = {
				has_trait = temperate
			}
		}
		is_available_healthy_adult = yes
	}

	immediate = {
		random_courtier_or_guest = {
			limit = {
				is_available_healthy_adult = yes
				NOT = {
					has_trait = temperate
				}
			}
			save_scope_as = rumormonger
		}
		random_courtier_or_guest = {
			limit = {
				is_available_healthy_adult = yes
				NOR = {
					this = scope:rumormonger
					has_trait = temperate
				}
			}
			save_scope_as = gossiper
		}
	}

	#Options A) Intrigued by the rumors, try to find this Tengu
	option = {
		name = tgp_japan_yearly_events.0026.a
		custom_tooltip = tgp_japan_yearly_events.0026.a.tt
		add_character_flag = {
			flag = tengu_rumors
			years = 30
		}

		add_character_modifier = {
			modifier = tgp_japan_tengu_rumors_character_modifier
			years = 30
		}

		stress_impact = {
			trusting = minor_stress_impact_loss
			paranoid = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
				ai_energy = 1
			}
		}
	}

	# Option B) Don't bother with the talk of drunks
	option = {
		name = tgp_japan_yearly_events.0026.b

		add_prestige = minor_prestige_gain

		stress_impact = {
			trusting = minor_stress_impact_gain
			paranoid = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_energy = -1
			}
		}
	}
}

# 0027 - Prove Your Worth - Tengu
tgp_japan_yearly_events.0027 = {
	type = character_event
	title = tgp_japan_yearly_events.0027.t
	desc = tgp_japan_yearly_events.0027.desc
	theme = travel
	left_portrait = {
		character = root
		animation = aggressive_sword
	}
	right_portrait = {
		character = scope:tengu_warrior
		animation = hasso_no_kamae
		camera = camera_event_center_background_crowd_right
	}
	override_effect_2d = { reference = fog }
	trigger = {
		has_tgp_dlc_trigger = yes
		has_character_flag = tengu_rumors
		NOT = {
			has_character_flag = had_event_tgp_japan_yearly_events.0028
		}
		location = {
			geographical_region = world_asia_japan
			OR = {
				terrain = mountains
				terrain = forest
			}
		}
		is_available_travelling_adult = yes
	}

	#Create a samurai warrior
	immediate = {
		hidden_effect = {
			remove_character_modifier = tgp_japan_tengu_rumors_character_modifier
		}

		create_character = {
			template = tgp_japan_yearly_events_tengu_warrior_template
			location = root.location
			after_creation = {
				add_trait = disfigured
				add_trait = albino
				add_character_flag = no_headgear
			}
			save_scope_as = tengu_warrior
		}

		scope:tengu_warrior = {
			random_character_trait = {
				limit = {
					has_trait_category = commander
				}
				save_scope_as = commander_trait
			}
		}

		add_character_flag = {
			flag = had_event_tgp_japan_yearly_events.0027
			years = 30
		}
	}

	#Prove your worth, fight the warrior
	option = {
		name = tgp_japan_yearly_events.0027.a


		duel = {
			skill = prowess
			target = scope:tengu_warrior
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0027.a.tt.success
				min = 20
				max = 90
				send_interface_toast = {
					title = tgp_japan_yearly_events.0027.a.tt.success
					left_icon = root
					right_icon = scope:tengu_warrior
					custom_tooltip = tgp_japan_yearly_events.0027.a.tt.success_explanation
					current_travel_plan = {
						delay_travel_plan = { days = 14 }
					}
					add_character_flag = {
						flag = real_tengu
						days = 1
					}
					trigger_event = {
						id = tgp_japan_yearly_events.0029
						days = 13
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0027.a.tt.failure
				min = 20
				max = 90
				send_interface_toast = {
					title = tgp_japan_yearly_events.0027.a.tt.failure
					left_icon = root
					right_icon = scope:tengu_warrior
					increase_wounds_no_death_effect = { REASON = battle }

					add_prestige = minor_prestige_loss
				}
			}
		}

		stress_impact = {
			brave = minor_stress_impact_loss
			craven = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
				ai_boldness = 1
				ai_rationality = -1
				ai_energy = 1
			}
		}
	}

	#Try to convince the warrior to join you
	option = {
		name = tgp_japan_yearly_events.0027.b

		duel = {
			skill = diplomacy
			target = scope:tengu_warrior
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0027.b.tt.success
				min = 20
				max = 90
				send_interface_toast = {
					title = tgp_japan_yearly_events.0027.b.tt.success
					left_icon = root
					right_icon = scope:tengu_warrior
					current_travel_plan = {
						add_companion = scope:tengu_warrior
					}
					add_character_flag = {
						flag = real_tengu
						days = 1
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = tgp_japan_yearly_events.0027.b.tt.failure
				min = 20
				max = 90
				send_interface_toast = {
					title = tgp_japan_yearly_events.0027.b.tt.failure
					left_icon = root
					right_icon = scope:tengu_warrior
					increase_wounds_no_death_effect = { REASON = battle }
				}
			}
		}

		stress_impact = {
			trusting = minor_stress_impact_loss
			shy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_sociability = 1
			}
		}
	}

	#Run away
	option = {
		name = tgp_japan_yearly_events.0027.c

		current_travel_plan = {
			delay_travel_plan = { days = 7 }
		}

		stress_impact = {
			craven = minor_stress_impact_loss
			shy = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_sociability = -1
			}
		}
	}

	after = {
		remove_character_flag = tengu_rumors
		if = {
			limit = {
				NOT = {
					has_character_flag = real_tengu
				}
			}
			scope:tengu_warrior ?= {
				silent_disappearance_effect = yes
			}
		}
	}
}

# 0028 - False Rumors - Tengu
tgp_japan_yearly_events.0028 = {
	type = character_event
	title = tgp_japan_yearly_events.0028.t
	desc = tgp_japan_yearly_events.0028.desc
	theme = travel
	left_portrait = {
		character = root
		animation = anger
		camera = camera_body_right
	}
	widget = {
		gui = "event_window_widget_vfx_fog"
		container = "foreground_shader_vfx_container"
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		has_character_flag = tengu_rumors
		NOT = {
			has_character_flag = had_event_tgp_japan_yearly_events.0027
		}
		location = {
			geographical_region = world_asia_japan
			OR = {
				terrain = mountains
				terrain = forest
			}
		}
		is_available_travelling_adult = yes
	}

	immediate = {
		hidden_effect = {
			remove_character_modifier = tgp_japan_tengu_rumors_character_modifier
		}

		add_character_flag = {
			flag = had_event_tgp_japan_yearly_events.0028
			years = 20
		}
	}

	#Become a bit more cautious for the future
	option = {
		name = tgp_japan_yearly_events.0028.a

		add_character_modifier = {
			modifier = tgp_japan_cautious_curiosity_character_modifier
			years = 5
		}

		stress_impact = {
			craven = minor_stress_impact_loss
			trusting = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_vengefulness = -1
				ai_sociability = -1
			}
		}
	}

	#Scream to let out some stress/disappointment
	option = {
		name = tgp_japan_yearly_events.0028.b

		stress_impact = {
			base = medium_stress_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
				ai_vengefulness = 1
			}
		}
	}

	after = {
		remove_character_flag = tengu_rumors
	}
}

# 0029 - Practice Makes Perfect - Tengu
tgp_japan_yearly_events.0029 = {
	type = character_event
	title = tgp_japan_yearly_events.0029.t
	desc = tgp_japan_yearly_events.0029.desc
	theme = travel
	left_portrait = {
		character = root
		animation = chudan_no_kamae
		camera = camera_event_center_mostly_away_right
	}
	right_portrait = {
		character = scope:tengu_warrior
		animation = chudan_no_kamae
		camera = camera_event_center_pointing_forward_fov35
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		scope:tengu_warrior ?= { is_alive = yes }
	}

	#Gain blademaster combined with a trait your mentor has
	option = {
		name = tgp_japan_yearly_events.0029.a

		if = {
			limit = {
				NOT = {
					has_trait = lifestyle_blademaster
				}
			}
			add_trait = lifestyle_blademaster
		}
		else = {
			add_trait_xp = {
				trait = lifestyle_blademaster
				value = 10
			}
		}

		add_trait = scope:commander_trait

		stress_impact = {
			ambitious = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
				ai_rationality = 1
			}
		}
	}

	option = {
		name = tgp_japan_yearly_events.0029.b

		if = {
			limit = {
				NOT = {
					has_trait = lifestyle_blademaster
				}
			}
			add_trait = lifestyle_blademaster
		}
		else = {
			add_trait_xp = {
				trait = lifestyle_blademaster
				value = 10
			}
		}

		add_martial_lifestyle_perk_points = 1

		stress_impact = {
			ambitious = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				add = 100
				has_lifestyle = martial_lifestyle
			}
			ai_value_modifier = {
				ai_honor = 1
				ai_rationality = 1
			}
		}
	}
}

# 0036 - Reflection of Pure Land
tgp_japan_yearly_events.0036 = {
	type = character_event
	title = tgp_japan_yearly_events.0036.t
	desc = tgp_japan_yearly_events.0036.desc
	theme = memory_positive
	override_background = garden
	cooldown = { years = 30 }
	left_portrait = {
		character = root
		animation = debating
		camera = camera_council
	}
	right_portrait = {
		character = scope:gardener
		animation = interested
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		is_valid_for_japan_events_trigger = yes
		employs_court_position = court_gardener_court_position
		is_available_healthy_adult = yes
	}

	immediate = {
		random_court_position_holder = {
			limit = {
				is_available_ai_adult = yes
			}
			type = court_gardener_court_position
			save_scope_as = gardener
		}
	}

	# Option A) Assist the gardener and get piety and possibly gardener trait.
	option = {
		name = tgp_japan_yearly_events.0036.a
		custom_tooltip = tgp_japan_yearly_events.0036.a.random_chance
		add_piety = medium_piety_gain
		if = {
			limit = {
				NOT = { has_trait = lifestyle_gardener }
			}
			random = {
				chance = {
					value = 20
					if = {
						limit = {
							root.stewardship >= monumentally_high_skill_rating
						}
						add = 20
					}
					else_if = {
						limit = {
							root.stewardship >= extremely_high_skill_rating
						}
						add = 15
					}
					else_if = {
						limit = {
							root.stewardship >= very_high_skill_rating
						}
						add = 10
					}
					else_if = {
						limit = {
							root.stewardship >= high_skill_rating
						}
						add = 5
					}
				}
				add_trait = lifestyle_gardener
			}
		}
		else_if = {
			limit = {
				NOT = { has_trait = lifestyle_herbalist }
			}
			add_trait = lifestyle_herbalist
		}
		else = {
			add_stress = minor_stress_loss
		}

		stress_impact = {
			compassionate = minor_stress_impact_loss
			shy = minor_stress_impact_gain
		}

		ai_chance = {
			base = 5
			ai_value_modifier = {
				ai_compassion = 1
				ai_energy = 1
			}
		}
	}

	# Option B) More fish to get diplomacy bonus
	option = {
		name = tgp_japan_yearly_events.0036.b

		add_character_modifier = {
			modifier = tpg_japan_add_fish_to_pond_modifier
			years = 3
		}

		stress_impact = {
			calm = minor_stress_impact_loss
			content = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_energy = -1
			}
		}
	}
}

# 1200 - Congestion in the Capital
# by Laurence Kennedy
tgp_japan_yearly_events.1200 = {
	type = character_event
	title = tgp_japan_yearly_events.1200.t
	desc = tgp_japan_yearly_events.1200.desc
	theme = vassal
	cooldown = { years = 20 }
	override_background = {
		reference = tgp_japanese_city
	}
	#You, the Kampaku
	left_portrait = {
		character = scope:kampaku
		animation = disbelief
	}

	#upstart vassal
	right_portrait = {
		character = scope:upstart
		animation = jockey_walk
		camera = camera_event_horse_right
	}
	trigger = {
		has_tgp_dlc_trigger = yes
		is_available_adult = yes
		location = root.capital_province
		has_title = title:e_japan
		NOT = { has_title = title:k_chrysanthemum_throne }
		government_has_flag = government_is_japan_administrative
		any_vassal = {
			is_available_ai_adult = yes
			OR = {
				has_trait = arrogant
				has_trait = ambitious
			}
		}
	}
	immediate = {
		random_vassal = {
			limit = {
				is_available_ai_adult = yes
				OR = {
					has_trait = arrogant
					has_trait = ambitious
				}
			}
			save_scope_as = upstart
		}

		title:k_chrysanthemum_throne.holder ?= {
			save_scope_as = emperor
		}

		save_scope_as = kampaku
	}
	#Drag him from his horse!
	option = {
		name = tgp_japan_yearly_events.1200.a
		#Your men hurt the Upstart
		scope:upstart = {
			increase_wounds_effect = { REASON = horse_riding_accident }
			add_opinion = {
				target = scope:kampaku
				modifier = angry_opinion
				opinion = low_negative_opinion
			}
		}
		#You gain influence and prestige
		change_influence = medium_influence_gain
		add_prestige = medium_prestige_gain
		#Upstart loses prestige and influence
		scope:upstart = {
			add_prestige = minor_prestige_loss
			change_influence = medium_influence_loss
			#If possible it progresses rivalry
			if = {
				limit = {
					can_set_relation_rival_trigger = { CHARACTER = scope:kampaku }
				}
				progress_towards_rival_effect = {
					REASON = rival_pulled_me_off_horse
					CHARACTER = scope:kampaku
					OPINION = default_rival_opinion
				}
			}
			#otherwise it makes them like you less
			else = {
				add_opinion = {
					target = scope:kampaku
					modifier = humbled_opinion
					opinion = -40
				}
			}
		}
		stress_impact = {
			craven = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			just = medium_stress_impact_loss
			callous = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = craven
				has_trait = compassionate
				has_trait = humble
			}
		}
	}
	#Let him think he can get away with this
	option = {
		name = tgp_japan_yearly_events.1200.b
		add_intrigue_lifestyle_xp = medium_lifestyle_experience
		change_influence = minor_influence_loss
		#If we have a scheme, boost it!
		if = {
			limit = {
				NOT = {
					any_scheme = {
						scheme_type = slander
						scheme_target_character = scope:upstart
					}
				}
			}
			#If we don't have a scheme, let's scheme with a boost
			start_scheme = {
				type = slander
				target_character = scope:upstart
			}
		}
		custom_tooltip = {
			text = tgp_japan_yearly_events.1200.b.tt
			random_scheme = {
				limit = {
					scheme_type = slander
					scheme_target_character = scope:upstart
				}
				add_scheme_modifier = {
					type = bided_my_time
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_gain
			brave = minor_stress_impact_gain
			just = minor_stress_impact_gain
			vengeful = medium_stress_impact_loss
			craven = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = ambitious
				has_trait = brave
				has_trait = just
			}
		}
	}
	#Kill him with kindness
	option = {
		name = tgp_japan_yearly_events.1200.c
		add_diplomacy_lifestyle_xp = medium_lifestyle_experience
		add_piety = medium_piety_gain
		change_influence = minor_influence_loss
		if = {
		#If we have a scheme, boost it!
			limit = {
				NOT = {
					any_scheme = {
						scheme_type = befriend
						scheme_target_character = scope:upstart
					}
				}
			}
			#If we don't have a scheme, let's scheme with a boost
			start_scheme = {
				type = befriend
				target_character = scope:upstart
			}
		}
		custom_tooltip = {
			text = tgp_japan_yearly_events.1200.c.tt
			random_scheme = {
				limit = {
					scheme_type = befriend
					scheme_target_character = scope:upstart
				}
				add_scheme_modifier = { type = settled_differences_modifier }
			}
		}
		stress_impact = {
			impatient = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
			patient = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = impatient
				has_trait = paranoid
				has_trait = arrogant
				has_trait = shy
			}
		}
	}
}

scripted_effect create_cadet_house_effect = {
	add_character_flag = found_cadet_branch
	add_trait = disinherited
	trigger_event = tgp_japan_decision.9001
}

# 1210 - Fit to Lead?
# by Laurence Kennedy
tgp_japan_yearly_events.1210 = {
	type = character_event
	title = tgp_japan_yearly_events.1210.t
	desc = {
		desc = tgp_japan_yearly_events.1210.desc.intro
		random_valid = {
			#low prowess house head
			triggered_desc = {
				trigger = { scope:reason ?= flag:weak_prowess }
				desc = tgp_japan_yearly_events.1210.desc.reason_weak_prowess
			}
			#Unhealthy house head
			triggered_desc = {
				trigger = { scope:reason ?= flag:bad_health }
				desc = tgp_japan_yearly_events.1210.desc.reason_bad_health
			}
			#drunk house head
			triggered_desc = {
				trigger = { scope:reason ?= flag:drunkard }
				desc = tgp_japan_yearly_events.1210.desc.reason_drunkard
			}
			#bad genetics
			triggered_desc = {
				trigger = { scope:reason ?= flag:bad_genetic }
				desc = tgp_japan_yearly_events.1210.desc.bad_genetic
			}
			#sinful
			triggered_desc = {
				trigger = { scope:reason ?= flag:sinful }
				desc = tgp_japan_yearly_events.1210.desc.sinful
			}
			#low legitimacy
			triggered_desc = {
				trigger = { scope:reason ?= flag:low_legitimacy }
				desc = tgp_japan_yearly_events.1210.desc.low_legitimacy
			}
			#older sibling
			triggered_desc = {
				trigger = { scope:reason ?= flag:older_sibling }
				desc = tgp_japan_yearly_events.1210.desc.older_sibling
			}
			#illegitimized
			triggered_desc = {
				trigger = { scope:reason ?= flag:illegitimized }
				desc = tgp_japan_yearly_events.1210.desc.illegitimized
			}

			#child of a concubine
			triggered_desc = {
				trigger = { scope:reason ?= flag:concubine_child  }
				desc = tgp_japan_yearly_events.1210.desc.concubine_child
			}
			#Wrong Gender
			triggered_desc = {
				trigger = { scope:reason ?= flag:non_dominant_gender }
				desc = tgp_japan_yearly_events.1210.desc.reason_non_dominant_gender
			}
			#Fallback
			triggered_desc = {
				trigger = { scope:reason ?= flag:fallback }
				desc = tgp_japan_yearly_events.1210.desc.reason_fallback
			}
		}
		desc = tgp_japan_yearly_events.1210.desc.outro
	}
	theme = dynasty
	cooldown = { years = 20 }
	override_background = {
		reference = throne_room
	}
	#You, the Contested House Head
	left_portrait = {
		character = scope:new_house_head
		animation = disgust
		camera = camera_event_crowd
	}

	#The person contesting your place as house head
	right_portrait = {
		character = scope:contester
		animation = debating
	}
	trigger = {
		has_tgp_dlc_trigger = yes
		is_available_adult = yes
		government_is_japanese_trigger = yes
		is_house_head = yes
		has_domicile = yes
		is_independent_ruler = no
		any_close_or_extended_family_member = {
			is_available_ai_adult = yes
			#make sure they live in japan
			top_liege ?= root.top_liege
			is_house_head = no
			house = root.house
			# Dominant gender
			can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
			#if it's your kid, stricter requirements
			trigger_if = {
				limit = {
					is_child_of = root
				}
				#you're too old, become a monk!
				root.age > 60
				#he hates you
				opinion = { target = root value <= low_positive_opinion  }
				#he's a little shit
				OR = {
					has_trait = ambitious
					has_trait = arrogant
				}
			}
			#not a friendly with you
			NOR = {
				has_trait = loyal
				has_friendly_relationship_trigger = { CHARACTER = root }
				this = root
				has_trait = humble
				has_trait = content
				has_trait = devoted
			}
		}
	}
	immediate = {
		#This is root
		save_scope_as = new_house_head
		#find a contester
		random_close_or_extended_family_member = {
			limit = {
				is_available_ai_adult = yes
				#make sure they live in japan
				top_liege ?= root.top_liege
				is_house_head = no
				house = root.house
				# Dominant gender
				can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root }
				#if it's your kid, stricter requirements
				trigger_if = {
					limit = {
						is_child_of = root
					}
					#you're too old, become a monk!
					root.age > 60
					#he hates you
					opinion = { target = root value <= low_positive_opinion  }
					#he's a little shit
					OR = {
						has_trait = ambitious
						has_trait = arrogant
					}
				}
				#not a friendly with you
				NOR = {
					has_trait = loyal
					has_friendly_relationship_trigger = { CHARACTER = root }
					this = root
					has_trait = humble
					has_trait = content
					has_trait = devoted
				}
			}
			weight = {
				base = 1
				modifier = {
					has_trait = ambitious
					add = 20
				}
				modifier = {
					has_trait = arrogant
					add = 20
				}
				modifier = {
					has_trait = lazy
					add = -10
				}
				modifier = {
					is_close_family_of = scope:new_house_head
					add = 40
				}
				modifier = {
					is_child_of = scope:new_house_head
					add = -50
				}
			}
			save_scope_as = contester
		}
		if = {
			limit = {
				any_held_county = {
					count > 1
					is_landless_type_title = no
				}
			}
			ordered_held_county = {
				limit = {
					is_landless_type_title = no
					NOT = { this = root.capital_county }
				}
				order_by = {
					value = 0
					subtract = root.capital_province.num_buildings
				}
				save_scope_as = gift_county
			}
		}
		#reason for being challenged as house head
		random_list = {
			#low prowess
			100 = {
				trigger = {
					prowess < scope:contester.prowess
				}
				save_scope_value_as = {
					name = reason
					value = flag:weak_prowess
				}
			}
			#Unhealthy house head
			100 = {
				trigger = {
					is_healthy = no
					NOT = {
							scope:contester = {
								is_healthy = no
						}
					}
				}
				save_scope_value_as = {
					name = reason
					value = flag:bad_health
				}
			}
			#drunk house head
			100 = {
				trigger = {
					has_trait = drunkard
					NOT = {
							scope:contester = {
								has_trait = drunkard
						}
					}
				}
				save_scope_value_as = {
					name = reason
					value = flag:drunkard
				}
			}
			#bad congenital traits
			100 = {
				trigger = {
					num_of_bad_genetic_traits > scope:contester.num_of_bad_genetic_traits
				}
				save_scope_value_as = {
					name = reason
					value = flag:bad_genetic
				}
			}
			#low legitimacy
			100 = {
				trigger = {
					has_legitimacy = yes
					legitimacy < 3
				}
				save_scope_value_as = {
					name = reason
					value = flag:low_legitimacy
				}
			}
			#sinful traits
			100 = {
				trigger = {
					num_sinful_traits > scope:contester.num_sinful_traits
				}
				save_scope_value_as = {
					name = reason
					value = flag:sinful
				}
			}
			100 = {
				trigger = {
					OR = {
						has_trait = child_of_concubine
						has_trait = child_of_concubine_female
					}
					NOR = {
						scope:contester = {
							has_trait = child_of_concubine
							has_trait = child_of_concubine_female
						}
					}
				}
				save_scope_value_as = {
					name = reason
					value = flag:concubine_child
				}
			}
			#find an older sibling who is the right gender to inherit
			100 = {
				trigger = {
					scope:contester = {
						is_sibling_of = scope:new_house_head
						age > scope:new_house_head.age
						trigger_if = {
							limit = { is_male = yes }
							scope:new_house_head = {
								OR = {
									has_realm_law = male_only_law
									has_realm_law = male_preference_law
								}
							}
						}
						trigger_else = {
							scope:new_house_head = {
								OR = {
									has_realm_law = female_only_law
									has_realm_law = female_preference_law
								}
							}
						}
					}
				}
				save_scope_value_as = {
					name = reason
					value = flag:older_sibling
				}
			}

			#house head was illegitimized
			100 = {
				trigger = {
					OR = {
						AND = {
							has_trait = bastard
							scope:new_house_head = {
								faith = { NOT = { has_doctrine = doctrine_bastardry_none } }
							}
						}
						has_trait = denounced
						has_trait = disinherited
					}
					scope:contester = {
						NOR = {
							AND = {
								has_trait = bastard
								scope:new_house_head = {
									faith = { NOT = { has_doctrine = doctrine_bastardry_none } }
								}
							}
							has_trait = denounced
							has_trait = disinherited
						}
					}
				}
				save_scope_value_as = {
					name = reason
					value = flag:illegitimized
				}
			}
			#wrong gender
			100 = {
				trigger = {
					OR = {
						AND = {
							is_male = yes
							OR = {
								has_realm_law = female_only_law
								has_realm_law = female_preference_law
							}
						}
						AND = {
							is_female = yes
							OR = {
								has_realm_law = male_only_law
								has_realm_law = male_preference_law
							}
						}
					}
					scope:contester = {
						OR = {
							AND = {
								is_male = no
								OR = {
									has_realm_law = female_only_law
									has_realm_law = female_preference_law
								}
							}
							AND = {
								is_female = no
								OR = {
									has_realm_law = male_only_law
									has_realm_law = male_preference_law
								}
							}
						}
					}
				}
				save_scope_value_as = {
					name = reason
					value = flag:non_dominant_gender
				}
			}
			#fallback
			1 = {
				save_scope_value_as = {
					name = reason
					value = flag:fallback
				}
			}
		}
	}
	# a) Rebuke this outrageous claim!
	option = {
		name = tgp_japan_yearly_events.1210.a
		#You gain Prestige and Dread
		add_prestige = medium_prestige_gain
		add_dread =	 medium_dread_gain
		#Contester doesn't like you
		scope:contester = {
			#They go to the pool if they're your courtier
			if = {
				limit = {
					is_courtier_of = scope:new_house_head
				}
				move_to_pool = yes
			}
			#their family is upset by contester's departure
			if = {
				limit = {
					scope:contester = {
						NOT = { is_close_family_of = root }
					}
				}
				every_close_family_member = {
					custom = all_family_members
					limit = {
						scope:new_house_head != this
					}
					add_opinion = {
						modifier = sullied_our_house_opinion
						target = scope:new_house_head
					}
				}
			}
			#If possible it progresses rivalry
			if = {
				limit = {
					can_set_relation_rival_trigger = { CHARACTER = scope:new_house_head }
				}
				progress_towards_rival_effect = {
					REASON = rival_challenged_house_head_status
					CHARACTER = scope:new_house_head
					OPINION = default_rival_opinion
				}
			}
			#otherwise it makes them like you even less
			else = {
				add_opinion = {
					target = scope:new_house_head
					modifier = humbled_opinion
					opinion = -60
				}
			}
		}
		stress_impact = {
			craven = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			just = medium_stress_impact_loss
			callous = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = craven
				has_trait = humble
			}
		}
	}
	#b) Compromise by giving them a cadet branch with modifier that has has friendly house relations
	option = {
		name = tgp_japan_yearly_events.1210.b
		flavor = tgp_japan_yearly_events.1210.b.flavor
		trigger = { exists = scope:gift_county }
		#You gain Piety
		add_piety = medium_piety_gain
		# Give land
		create_title_and_vassal_change = {
			type = granted
			save_scope_as = change
			add_claim_on_loss = no
		}
		scope:gift_county = {
			change_title_holder = {
				holder = scope:contester
				change = scope:change
			}
		}
		resolve_title_and_vassal_change = scope:change
		#Contester gets cadet branch and likes you
		scope:contester = {
			custom_tooltip = {
				text = tgp_japan_yearly_events.1210.b.tt
				create_cadet_house_effect = yes
				create_noble_family_effect = { GOVERNMENT_GIVER = root }
				house = {
					set_house_relation = {
						target = scope:new_house_head.house
						level = friendly
						description = house_relation_friendly_reason_cadet_branch_permission_desc
					}
				}
			}
			add_opinion = {
				target = scope:new_house_head
				modifier = respect_opinion
				opinion = low_positive_opinion
			}
			if = {
				limit = {
					scope:contester = {
						NOT = { is_close_family_of = root }
					}
				}
				#their family appreciates your kindness
				every_close_family_member = {
					custom = all_family_members
					limit = {
						scope:new_house_head != this
					}
					add_opinion = {
						modifier = kindness_opinion
						target = scope:new_house_head
						opinion = 35
					}
				}
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			content = medium_stress_impact_loss
		}
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				has_trait = ambitious
				has_trait = arrogant
			}
			modifier = {
				top_liege = {
					any_vassal = {
						count >= 100
						is_landed = no
					}
				}
				factor = 0
			}
		}
	}
	#c) Smooth it over
	option = {
		name = tgp_japan_yearly_events.1210.c
		add_diplomacy_lifestyle_xp = medium_lifestyle_experience

		#Diplomacy Challenge
		duel = {
			skill = diplomacy
			value = high_skill_rating
			# Good outcome!
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				min = 5
				desc = tgp_japan_yearly_events.1210.c.good
				send_interface_toast = {
					title = tgp_japan_yearly_events.1210.c.good
					change_influence = major_influence_gain
					house = {
						every_house_member = {
							custom = tgp_japan_yearly_events.1210.c.good.tt
							limit = {
								NOT = { this = root }
							}
							add_opinion = {
								target = root
								modifier = respect_opinion
								opinion = 20
							}
						}
					}
					scope:contester = {
						add_opinion = {
							target = root
							modifier = respect_opinion
							opinion = 30
						}
					}
				}
			}
			# Mid outcome.
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				min = 5
				desc = tgp_japan_yearly_events.1210.c.bad
				send_interface_toast = {
					title = tgp_japan_yearly_events.1210.c.bad
					pay_short_term_gold = {
						target = scope:contester
						gold = minor_gold_value
					}
					scope:contester = {
						add_opinion = {
							target = root
							modifier = respect_opinion
							opinion = 15
						}
					}
				}
			}
			10 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				min = 5
				desc = tgp_japan_yearly_events.1210.c.ugly
				send_interface_toast = {
					title = tgp_japan_yearly_events.1210.c.ugly
					add_prestige = medium_prestige_loss
					scope:contester = {
					#You really put your foot in it, nemesis time
						if = {
							limit = {
								can_set_relation_nemesis_trigger = { CHARACTER = scope:new_house_head }
							}
							set_relation_nemesis = {
								target = scope:new_house_head
								reason = rival_challenged_house_head_status
							}
						}
						#If you already have a nemesis, it's possible it progresses rivalry
						else_if = {
							limit = {
								can_set_relation_rival_trigger = { CHARACTER = scope:new_house_head }
							}
							progress_towards_rival_effect = {
								REASON = rival_challenged_house_head_status
								CHARACTER = scope:new_house_head
								OPINION = default_rival_opinion
							}
						}
						#otherwise it makes them like you even less
						else = {
							add_opinion = {
								target = scope:new_house_head
								modifier = humbled_opinion
								opinion = -60
							}
						}
					}
				}
			}
		}
		stress_impact = {
			impatient = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
			patient = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = impatient
				has_trait = arrogant
				has_trait = shy
			}
		}
	}
	#d) Ignore it.
	option = {
		name = tgp_japan_yearly_events.1210.d
		flavor = tgp_japan_yearly_events.1210.d.flavor
		#You gain influence and prestige
		change_influence = minor_influence_gain
		add_prestige = minor_prestige_gain
		#Contester gets cadet branch and dislikes you
		scope:contester = {
			custom_tooltip = {
				text = tgp_japan_yearly_events.1210.d.tt
				create_cadet_house_effect = yes
				create_noble_family_effect = { GOVERNMENT_GIVER = root }
				house = {
					set_house_relation = {
						target = scope:new_house_head.house
						level = quarrel
						description = house_relation_quarrel_reason_cadet_branch_permission_desc
					}
				}
			}
			add_opinion = {
				target = scope:new_house_head
				modifier = angry_opinion
				opinion = low_negative_opinion
			}
		}
		stress_impact = {
			ambitious = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			content = minor_stress_impact_loss
			lazy = minor_stress_impact_loss
		}
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				has_trait = ambitious
				has_trait = arrogant
			}
			modifier = {
				top_liege = {
					any_vassal = {
						count >= 100
						is_landed = no
					}
				}
				factor = 0
			}
		}
	}
}
# 1225 - A Poetic Life
# by Laurence Kennedy
tgp_japan_yearly_events.1225 = {
	type = character_event
	title = tgp_japan_yearly_events.1225.t
	desc = {
			#if teacher
			triggered_desc = {
				trigger = { exists = scope:poet_influencer }
				desc = tgp_japan_yearly_events.1225.desc.intro.influencer
			}
			#Fallback
			triggered_desc = {
				trigger = {
					NOT = { exists = scope:poet_influencer }
				}
				desc = tgp_japan_yearly_events.1225.desc.intro
			}
		desc = tgp_japan_yearly_events.1225.desc
	}
	theme = education
	cooldown = { years = 100 }
	#You, the poet to be
	left_portrait = {
		character = scope:new_poet
		animation = admiration
	}
	#Your teacher if you have one guardian, elder, tutor etc
	right_portrait = {
		character = scope:poet_influencer
		animation = debating
	}
	trigger = {
		has_tgp_dlc_trigger = yes
		NOT = {
			has_trait = lifestyle_poet
		}
		#East Asia values poetry
		location = {
			geographical_region = world_asia_east
		}
		government_has_flag = government_is_tribal
		age >= 10
		is_lowborn = no
		probably_unintelligent_trigger = no
	}
	immediate = {
		#This is root
		save_scope_as = new_poet
		#find a teacher figure if they exist
		every_relation = {
			type = guardian
			type = elder
			type = mentor
			add_to_list = potential_poet_influencer
		}
		every_courtier = {
			limit = {
				has_trait = lifestyle_poet
			}
			add_to_list = potential_poet_influencer
		}
		every_court_position_holder = {
			type = court_poet_court_position
			type = court_tutor_court_position
			type = court_scholar_court_position
			add_to_list = potential_poet_influencer
		}

		every_parent = {
			add_to_list = potential_poet_influencer
		}
		random_in_list = {
			list = potential_poet_influencer
			limit = {
				has_trait = lifestyle_poet
				is_available_ai_adult = yes
				probably_unintelligent_trigger = no
			}
			alternative_limit = {
				is_available_ai_adult = yes
				probably_unintelligent_trigger = no
			}
			weight = {
				base = 1
				opinion_modifier = {
					opinion_target = root
					multiplier = 1
				}
				is_of_minor_interest_to_weight_up_modifier = { CHARACTER = root }
				is_of_major_interest_to_weight_up_modifier = { CHARACTER = root }
			}
			save_scope_as = poet_influencer
		}
	}
	# a) Poetry is a way of life, start living!
	option = {
		name = tgp_japan_yearly_events.1225.a
		flavor = tgp_japan_yearly_events.1225.a.flavor
		add_character_modifier = {
			modifier = tgp_japan_a_poetic_life_modifier
		}
		add_trait = lifestyle_poet
		stress_impact = {
			impatient = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			content = minor_stress_impact_gain
			ambitious = medium_stress_impact_loss
			eccentric = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = impatient
					has_trait = content
					has_trait = humble
				}
			}
			modifier = {
				factor = 0
				diplomacy <= high_skill_rating
			}
		}
	}

	#b) alt no poetry give xp?
	option = {
		name = tgp_japan_yearly_events.1225.b
		add_prestige = minor_prestige_gain
		gain_appropriate_lifestyle_major_xp_effect = yes
		stress_impact = {
			patient = minor_stress_impact_gain
			fickle = minor_stress_impact_gain
			impatient = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = patient
					has_trait = fickle
				}
			}
		}
	}
}

# 1260 - A Poetic Life : Love and Death
# by Laurence Kennedy
tgp_japan_yearly_events.1260 = {
	type = character_event
	title = tgp_japan_yearly_events.1260.t
	desc = {
		desc = tgp_japan_yearly_events.1260.desc
	}
	override_effect_2d = {
		reference = legend_glow
	}
	theme = romance_scheme
	override_background = {
		reference = garden
	}
	cooldown = { years = 100 }
	#You, the poet ready for inspiration
	left_portrait = {
		character = scope:inspired_poet
		animation = love
	}
	trigger = {
		has_tgp_dlc_trigger = yes
		has_trait = lifestyle_poet
		is_adult = yes
	}
	immediate = {
		#This is root
		save_scope_as = inspired_poet
	}
	# a) Poetry is a way of life, start living!
	option = {
		name = tgp_japan_yearly_events.1260.a
		flavor = tgp_japan_yearly_events.1260.a.flavor
		#If they didn't get the poetry learning event give them a modifier
		if = {
			limit = {
				NOT = {
					has_character_modifier = tgp_japan_a_poetic_life_modifier
				}
			}
			add_character_modifier = {
				modifier = tgp_japan_a_poetic_life_modifier
				years = { 10 20 }
			}
		}
		add_trait = lifestyle_poet
		stress_impact = {
			shy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			chaste = minor_stress_impact_gain
			gregarious = medium_stress_impact_loss
			eccentric = medium_stress_impact_loss
			lustful = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = shy
					has_trait = humble
					has_trait = chaste
				}
			}
			modifier = {
				factor = 0
				diplomacy <= high_skill_rating
			}
		}
	}
	#b) Maybe poetry isn't for me?
	option = {
		name = tgp_japan_yearly_events.1260.b
		add_piety = medium_piety_gain
		stress_impact = {
			lustful = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
			eccentric = minor_stress_impact_gain
			chaste = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = gregarious
				}
			}
		}
	}
	after = {
		trigger_event = {
			on_action = tgp_japan_poetry_events
			days = 365
		}
	}
}

scripted_effect count_poet_inspiration_events = {
	if = {
		limit = {
			has_variable = count_poet_inspiration
		}
		change_variable = {
			name = count_poet_inspiration
			add = 1
		}
	}
	else = {
		set_variable = {
			name = count_poet_inspiration
			value = 1
		}
	}
	#trigger next event after a year
	if = {
		limit = {
			has_variable = count_poet_inspiration
			var:count_poet_inspiration < 3
		}
		trigger_event = {
			on_action = tgp_japan_poetry_events
			months = { 10 12 }
		}
	}
	#trigger follow up where you get your book of poetry
	else = {
		trigger_event = {
			id = tgp_japan_yearly_events.1270
			days = { 14 29 }
		}
	}

}

scripted_trigger can_have_poet_inspiration_trigger = {
	trigger_if = {
			limit = {
				exists = var:count_poet_inspiration
			}
			var:count_poet_inspiration < 3
		}
}
# 1261 - A Poetic Life : Imperial Immortality
# by Laurence Kennedy
tgp_japan_yearly_events.1261 = {
	type = character_event
	title = tgp_japan_yearly_events.1261.t
	desc = {
		desc = tgp_japan_yearly_events.1261.desc
		triggered_desc = {
			trigger = {
				scope:inspired_poet = {
					has_trait = eunuch
				}
			}
			desc = tgp_japan_yearly_events.1261.chop.desc
		}
	}
	override_effect_2d = {
		reference = legend_glow
	}
	theme = romance_scheme
	override_background = {
		reference = corridor_night
	}
	cooldown = { years = 100 }
	#You, the poet ready for to attend on your topliege's spouse
	left_portrait = {
		character = scope:inspired_poet
		animation = love
	}
	#A spouse to help with your immortality
	right_portrait = {
		character = scope:top_liege_spouse
		animation = flirtation
	}

	lower_center_portrait = {
		character = scope:top_cuckold
		animation = anger
	}

	trigger = {
		can_have_poet_inspiration_trigger = yes
		has_tgp_dlc_trigger = yes
		has_trait = lifestyle_poet
		is_adult = yes
		is_available = yes

		#find a emperor or top liege to meet the spouse of
		OR = {
			AND = {
				tgp_realm_has_ceremonial_liege_trigger = yes
				top_liege.primary_title.var:administrative_ui_special_title.holder = {
					this != root
					any_spouse = {
						this != root
						possibly_interested_in_character_trigger = { CHARACTER = root }
						might_cheat_on_every_partner_trigger = yes
					}
				}
			}
			top_liege = {
				this != root
				any_spouse = {
					this != root
					possibly_interested_in_character_trigger = { CHARACTER = root }
					might_cheat_on_every_partner_trigger = yes
				}
			}
		}
	}

	immediate = {
		#This is you
		save_scope_as = inspired_poet
		#Find spouse of top liege or ceremonial liege
		tgp_save_realm_ceremonial_liege_effect = yes
		if = {
			limit = {
				scope:ceremonial_liege ?= {
					this != root
					any_spouse = {
						count > 0
					}
				}
			}
			scope:ceremonial_liege = {
				save_scope_as = top_cuckold
				random_spouse = {
					limit = {
						#don't sleep with yourself
						this != root
						possibly_interested_in_character_trigger = {
							CHARACTER = root
						}
						might_cheat_on_every_partner_trigger = yes
					}
					save_scope_as = top_liege_spouse
				}
			}
		}
		else = {
			top_liege = {
				save_scope_as = top_cuckold
				random_spouse = {
					limit = {
						#don't sleep with yourself
						this != root
						possibly_interested_in_character_trigger = {
							CHARACTER = root
						}
						might_cheat_on_every_partner_trigger = yes
					}
					save_scope_as = top_liege_spouse
				}
			}
		}
	}

	# a) Let's be immortal together!
	option = {
		name = tgp_japan_yearly_events.1261.a
		flavor = tgp_japan_yearly_events.1261.a.flavor
		trigger = {
			NOT = {
				scope:inspired_poet = {
					has_trait = eunuch
				}
			}
		}
		had_sex_with_effect = {
			CHARACTER = scope:top_liege_spouse
			PREGNANCY_CHANCE = pregnancy_chance
		}
		scope:top_liege_spouse ?= {
			add_opinion = {
				target = scope:inspired_poet
				modifier = pleased_opinion
				opinion = 30
			}
		}
		add_character_modifier = {
			modifier = tgp_japan_made_high_liege_cuckold_modifier
			years = { 10 20 }
		}
		dynasty = {
			add_dynasty_prestige = minor_dynasty_prestige_gain
		}
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		stress_impact = {
			shy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			chaste = medium_stress_impact_gain
			loyal = medium_stress_impact_gain
			gregarious = medium_stress_impact_loss
			eccentric = minor_stress_impact_loss
			lustful = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = shy
					has_trait = humble
					has_trait = chaste
					has_trait = loyal
				}
			}
			modifier = {
				factor = 0
				diplomacy <= high_skill_rating
				prowess <= high_skill_rating
			}
			modifier = {
				factor = 0
				NOT = {
					possibly_interested_in_character_trigger = {
						CHARACTER = scope:top_liege_spouse
					}
				}
				might_cheat_on_every_partner_trigger = no
			}
			modifier = {
				factor = 100
				possibly_interested_in_character_trigger = {
					CHARACTER = scope:top_liege_spouse
				}
				might_cheat_on_every_partner_trigger = yes
			}
		}
	}
	# d) eunuch sex
	option = {
		name = tgp_japan_yearly_events.1261.d
		trigger = {
			scope:inspired_poet = {
				has_trait = eunuch
			}
		}
		had_sex_with_effect = {
			CHARACTER = scope:top_liege_spouse
			PREGNANCY_CHANCE = 0
		}
		scope:top_liege_spouse ?= {
			add_opinion = {
				target = scope:inspired_poet
				modifier = pleased_opinion
				opinion = 30
			}
		}
		add_character_modifier = {
			modifier = tgp_japan_made_high_liege_cuckold_modifier
			years = { 10 20 }
		}
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		stress_impact = {
			shy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			chaste = minor_stress_impact_gain
			loyal = minor_stress_impact_gain
			gregarious = medium_stress_impact_loss
			eccentric = minor_stress_impact_loss
			lustful = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = shy
					has_trait = humble
					has_trait = chaste
					has_trait = loyal
				}
			}
			modifier = {
				factor = 0
				diplomacy <= high_skill_rating
				prowess <= high_skill_rating
			}
			modifier = {
				factor = 0
				NOT = {
					possibly_interested_in_character_trigger = {
						CHARACTER = scope:top_liege_spouse
					}
				}
				might_cheat_on_every_partner_trigger = no
			}
			modifier = {
				factor = 100
				possibly_interested_in_character_trigger = {
					CHARACTER = scope:top_liege_spouse
				}
				might_cheat_on_every_partner_trigger = yes
			}
		}
	}
	#b) Maybe exchanging a poem is enough
	option = {
		name = tgp_japan_yearly_events.1261.b
		add_prestige = medium_prestige_gain
		change_influence = medium_influence_gain
		add_trait_xp = {
			trait = lifestyle_poet
			value = { 5 10 }
		}
		stress_impact = {
			lustful = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			eccentric = minor_stress_impact_gain
			chaste = minor_stress_impact_loss
			just = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = shy
					has_trait = eccentric
				}
			}
		}
	}
	#c) I don't want to upset the emperor
	option = {
		name = tgp_japan_yearly_events.1261.c
		add_piety = medium_piety_gain
		scope:top_liege_spouse ?= {
			add_opinion = {
				target = scope:inspired_poet
				modifier = angry_opinion
				opinion = -40
			}
		}
		if = {
			limit = {
				NOT = {
					has_trait = loyal
				}
			}
			add_trait = loyal
		}
		stress_impact = {
			lustful = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
			eccentric = minor_stress_impact_gain
			chaste = minor_stress_impact_loss
			shy = minor_stress_impact_loss
			craven = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = gregarious
					has_trait = eccentric
				}
			}
		}
	}
	after = {
		count_poet_inspiration_events = yes
	}
}

# 1262 - A Poetic Life: An Exchange of Verses
# by Laurence Kennedy
tgp_japan_yearly_events.1262 = {
	type = character_event
	title = tgp_japan_yearly_events.1262.t
	desc = {
		desc = tgp_japan_yearly_events.1262.desc.intro
		#Inspiration in Japan
		triggered_desc = {
			trigger = {
				location = {
					geographical_region = world_asia_japan
				}
			}
			desc = tgp_japan_yearly_events.1262.japan.inspo
		}
		#Inspiration elsewhere
		triggered_desc = {
			trigger = {
				NOT = {
					location = {
						geographical_region = world_asia_japan
					}
				}
			}
			desc = tgp_japan_yearly_events.1262.inspo
		}
		#body
		desc = tgp_japan_yearly_events.1262.desc
		#Outro in Japan
		triggered_desc = {
			trigger = {
				location = {
					geographical_region = world_asia_japan
				}
			}
			desc = tgp_japan_yearly_events.1262.japan.outro
		}
		#Outro elsewhere
		triggered_desc = {
			trigger = {
				NOT = {
					location = {
						geographical_region = world_asia_japan
					}
				}
			}
			desc = tgp_japan_yearly_events.1262.outro
		}
		desc = tgp_japan_yearly_events.1262.japan.outro.outro
	}
	theme = intrigue_temptation_focus
	#If in Japan
	override_background = {
		trigger = {
			location = {
				geographical_region = world_asia_japan
			}
		}
		reference = moon_festival_night_japan
	}
	#If not in Japan
	override_background = {
		trigger = {
			NOT = {
				location = {
					geographical_region = world_asia_japan
				}
			}
		}
		reference = alley_night
	}

	cooldown = { years = 100 }
	#You, the poet
	left_portrait = {
		character = scope:inspired_poet
		animation = love
	}
	#Another poet who wants to exchange verses among other things
	right_portrait = {
		character = scope:local_poet
		triggered_animation = {
			trigger = {
				location = {
					geographical_region = world_asia_japan
				}
			}
			animation = fanning_coyly
		}
		animation = admiration
	}

	trigger = {
		can_have_poet_inspiration_trigger = yes
		has_tgp_dlc_trigger = yes
		has_trait = lifestyle_poet
		is_adult = yes
		is_available = yes
	}

	immediate = {
		#This is you
		save_scope_as = inspired_poet
		#find a local poet who is into you
		location = {
			random_character_in_location = {
				limit = {
					#don't sleep with yourself
					this != root
					#make sure they're into you
					possibly_interested_in_character_trigger = {
						CHARACTER = scope:inspired_poet
					}
					#make sure you're into them as well
					scope:inspired_poet = {
						possibly_interested_in_character_trigger = {
							CHARACTER = prev
						}
					}
					might_cheat_on_every_partner_trigger = yes
					is_adult = yes
					has_trait = lifestyle_poet
				}
				save_scope_as = local_poet
			}
		}
		#or make a local poet if none are to be found
		if = {
			limit = {
				NOT = { exists = scope:local_poet }
			}
			create_character = {
				template = tgp_poet_lover_template
				location = root.location
				save_scope_as = local_poet
				after_creation = {
					add_character_flag = created
				}
			}
			add_character_flag = {
				flag = fake_local_poet
				days = 1
			}
		}
		location = {
			save_scope_as = local_poet_spot
		}
	}

	# a) Friendship is fun (friends can exchange lines about love)
	option = {
		name = tgp_japan_yearly_events.1262.a
		flavor = tgp_japan_yearly_events.1262.a.flavor
		add_trait_xp = {
			trait = lifestyle_poet
			value = { 10 15 }
		}
		add_diplomacy_lifestyle_xp = minor_lifestyle_xp
		scope:local_poet = {
			#If possible progress friendship
			if = {
				limit = {
					can_set_relation_friend_trigger = { CHARACTER = scope:inspired_poet }
				}
				progress_towards_friend_effect = {
					REASON = friend_renga_poetry
					CHARACTER = scope:inspired_poet
					OPINION = 30
				}
			}
			#otherwise it makes them like them more at the very least
			else = {
				add_opinion = {
					target = scope:inspired_poet
					modifier = charmed_opinion
					opinion = 20
				}
			}
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
			gregarious = medium_stress_impact_loss
			eccentric = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = shy
					has_trait = humble
					has_trait = paranoid
				}
			}
		}
	}
	#b) Exchange more than poetry (I'll compose a verse while we tumble)
	option = {
		name = tgp_japan_yearly_events.1262.b
		flavor = tgp_japan_yearly_events.1262.b.flavor
		had_sex_with_effect = {
			CHARACTER = scope:local_poet
			PREGNANCY_CHANCE = pregnancy_chance
		}
		add_character_modifier = {
			modifier = tgp_japan_exchanged_verses_modifier
			years = { 10 20 }
		}
		scope:local_poet ?= {
			add_opinion = {
				target = scope:inspired_poet
				modifier = charmed_opinion
				opinion = 40
			}
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			chaste = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 10
				possibly_interested_in_character_trigger = {
					CHARACTER = scope:local_poet
				}
				might_cheat_on_every_partner_trigger = yes
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = shy
					has_trait = humble
					has_trait = chaste
					has_trait = paranoid
				}
			}
			#helps limit poets generated
			modifier = {
				factor = 0
				diplomacy <= high_skill_rating
				prowess <= high_skill_rating
			}
			modifier = {
				factor = 0
				NOT = {
					possibly_interested_in_character_trigger = {
						CHARACTER = scope:local_poet
					}
				}
				might_cheat_on_every_partner_trigger = no
			}
		}
	}
	#c) You think it's an assassin and run thinking about the ephemeral nature of your own life
	option = {
		name = tgp_japan_yearly_events.1262.c
		trigger = {
			has_trait = paranoid
		}
		scope:local_poet ?= {
			add_opinion = {
				target = scope:inspired_poet
				modifier = angry_opinion
				opinion = -40
			}
		}
		add_intrigue_lifestyle_xp = medium_lifestyle_xp
		add_character_modifier = {#
			modifier = more_vigilant_recistance_modifier
			days = 1095
		}
		add_character_flag = {
			flag = no_love
			days = 1
		}

		stress_impact = {
			lustful = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
			chaste = minor_stress_impact_loss
			shy = minor_stress_impact_loss
			paranoid = medium_stress_impact_loss

		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = gregarious
				}
			}
		}
	}
	after = {
		if = {
			limit = {
				has_character_flag = fake_local_poet
				has_character_flag = no_love
			}
			scope:local_poet ?= {
				silent_disappearance_effect = yes
			}
		}
		count_poet_inspiration_events = yes
		scope:local_poet ?= {
			silent_disappearance_ai_if_created_effect = yes
		}
	}
}

# 1263 - A Poetic Life: Ephemeral Beauty in the Wilds
# by Laurence Kennedy
tgp_japan_yearly_events.1263 = {
	type = character_event
	title = tgp_japan_yearly_events.1263.t
	desc = tgp_japan_yearly_events.1263.desc
	override_effect_2d = {
		reference = rain
	}
	theme = romance_scheme
	override_background = {
		reference = wilderness
	}
	cooldown = { years = 100 }
	#You, the poet
	left_portrait = {
		character = scope:inspired_poet
		animation = love
	}
	#A local beauty
	right_portrait = {
		character = scope:rural_beauty
		animation = dancing
		outfit_tags = { no_clothes }
	}
	artifact = {
		position = lower_right_portrait
		target = scope:newly_created_artifact
	}

	trigger = {
		can_have_poet_inspiration_trigger = yes
		has_tgp_dlc_trigger = yes
		has_trait = lifestyle_poet
		is_adult = yes
		is_available = yes
	}
	immediate = {
		#This is you
		save_scope_as = inspired_poet
		#Make artifact
		get_pressed_flower_species_effect = { LOCATION = root.location}
		hidden_effect = {
			create_artifact_pressed_flower_effect = { OWNER = root }
			random_list = {
				10 = { # Poisonous Flowers
					trigger = { has_personality_benevolent_trigger = no }
					modifier = {
						factor = 2
						has_trait = schemer
					}
					modifier = {
						factor = 2
						any_scheme = { scheme_type = murder }
					}
					modifier = {
						factor = 2
						has_trait = education_intrigue
					}
					modifier = {
						factor = 2
						has_trait = callous
					}
					save_scope_as = poisonous_herbs
				}
				10 = { # Medicinal Flowers
					modifier = {
						factor = 2
						has_trait = schemer
					}
					modifier = {
						factor = 2
						has_court_position = court_physician_court_position
					}
					modifier = {
						factor = 2
						has_trait = education_learning
					}
					modifier = {
						factor = 2
						has_trait = compassionate
					}
					modifier = {
						factor = 2
						has_trait = lifestyle_physician
					}
				}
			}
		}
		hidden_effect_new_object = {
			scope:newly_created_artifact = {
				flag_as_trash_artifact = yes
			}
		}
		#find a local beauty who is into you
		location = {
			random_character_in_location = {
				limit = {
					#don't sleep with yourself
					this != root
					#make sure they're into you
					possibly_interested_in_character_trigger = {
						CHARACTER = scope:inspired_poet
					}
					#make sure you're into them as well
					scope:inspired_poet = {
						possibly_interested_in_character_trigger = {
							CHARACTER = prev
						}
					}
					might_cheat_on_every_partner_trigger = yes
					is_adult = yes
					is_available = yes
				}
				save_scope_as = rural_beauty
			}
		}
		#or make a local poet if none are to be found
		if = {
			limit = {
				NOT = { exists = scope:rural_beauty }
			}
			create_character = {
				template = tgp_poet_lover_template
				location = root.location
				save_scope_as = rural_beauty
				after_creation = {
					add_character_flag = created
				}
			}
			add_character_flag = {
				flag = fake_rural_beauty
				days = 1
			}
		}
		location = {
			save_scope_as = rural_beauty_location
		}
	}

	#a) Let's celebrate our fleeting lives
	option = {
		name = tgp_japan_yearly_events.1263.a
		flavor = tgp_japan_yearly_events.1263.a.flavor
		#get rid of the artifact if you don't choose the artifact option
		hidden_effect = {
			destroy_artifact = scope:newly_created_artifact
		}
		had_sex_with_effect = {
			CHARACTER = scope:rural_beauty
			PREGNANCY_CHANCE = pregnancy_chance
		}
		scope:rural_beauty ?= {
			add_opinion = {
				target = scope:inspired_poet
				modifier = charmed_opinion
				opinion = 30
			}
		}
		add_trait_xp = {
			trait = lifestyle_poet
			value = { 15 20 }
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			chaste = medium_stress_impact_gain
			gregarious = medium_stress_impact_loss
			eccentric = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 10
				possibly_interested_in_character_trigger = {
					CHARACTER = scope:rural_beauty
				}
				might_cheat_on_every_partner_trigger = yes
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = shy
					has_trait = humble
					has_trait = chaste
				}
			}
			modifier = {
				factor = 0
				diplomacy <= high_skill_rating
				prowess <= high_skill_rating
			}
			modifier = {
				factor = 0
				NOT = {
					possibly_interested_in_character_trigger = {
						CHARACTER = scope:rural_beauty
					}
				}
				might_cheat_on_every_partner_trigger = no
			}
		}
	}
	# b) Artifact flower
	option = {
		name = tgp_japan_yearly_events.1263.b
		flavor = tgp_japan_yearly_events.1263.b.flavor
		show_as_tooltip = {
			scope:newly_created_artifact = { set_owner = root }
		}
		add_prestige = medium_prestige_gain
		scope:rural_beauty ?= {
			add_opinion = {
				target = scope:inspired_poet
				modifier = angry_opinion
				opinion = -20
			}
		}
		stress_impact = {
			lustful = medium_stress_impact_gain
			content = minor_stress_impact_gain
			eccentric = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = content
				}
			}
		}
	}
	#c) Let's make a study of nature (become gardener or herbalist)
	option = {
		name = tgp_japan_yearly_events.1263.c
		flavor = {
			first_valid = {
				triggered_desc = {
					trigger = { exists = scope:poisonous_herbs }
					desc = tgp_japan_yearly_events.1263.c.poisonous
				}
				desc = tgp_japan_yearly_events.1263.c.medicinal
			}
		}
		#get rid of the artifact if you don't choose the artifact option
		hidden_effect = {
			destroy_artifact = scope:newly_created_artifact
		}
		add_learning_lifestyle_xp = medium_lifestyle_xp
		add_character_flag = {
			flag = no_love
			days = 1
		}

		if = {
			limit = { exists = scope:poisonous_herbs }
			add_character_modifier = {
				modifier = tgp_japan_poet_poisonous_flowers_modifier
				years = 5
			}
			stress_impact = {
				lustful = minor_stress_impact_gain
				schemer = minor_stress_impact_loss
				lifestyle_gardener = miniscule_stress_impact_loss
				lifestyle_herbalist = minor_stress_impact_loss
			}
		}
		else = {
			add_character_modifier = {
				modifier = tgp_japan_poet_medicinal_flowers_modifier
				years = 5
			}
			if = {
				limit = { has_trait = lifestyle_physician }
				add_trait_xp = {
					trait = lifestyle_physician
					value = 2
				}
			}
			stress_impact = {
				lustful = minor_stress_impact_gain
				lifestyle_physician = minor_stress_impact_loss
				lifestyle_gardener = miniscule_stress_impact_loss
				lifestyle_herbalist = minor_stress_impact_loss
			}
		}
		stress_impact = {
			lustful = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
			eccentric = minor_stress_impact_gain
			chaste = minor_stress_impact_loss
			shy = minor_stress_impact_loss
			craven = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR ={
					has_trait = lustful
					has_trait = gregarious
					has_trait = eccentric
				}
			}
		}
	}

	after = {
		if = {
			limit = {
				has_character_flag = fake_rural_beauty
				has_character_flag = no_love
			}
			scope:rural_beauty ?= {
				silent_disappearance_effect = yes
			}
		}
		count_poet_inspiration_events = yes
		scope:rural_beauty = {
			silent_disappearance_ai_if_created_effect = yes
		}
	}
}

scripted_effect create_poetic_life_artifact_effect = {
	$OWNER$ = { save_scope_as = owner }

	hidden_effect_new_object = {
		#set rarity based on how love related memories you have
		save_scope_value_as = {
			name = quality
			value = {
				value = 15
				multiply = list_size:love_memories
				min = 40
			}

		}
		save_scope_value_as = {
			name = wealth
			value = {
				value = 10
				multiply = list_size:love_memories
				min = 20
			}
		}

		scope:owner = {
			create_artifact = {
				name = poetic_life_artifact_name
				creator = scope:owner
				description = poetic_life_artifact_description
				visuals = scroll
				type = miscellaneous
				modifier = artifact_monthly_minor_prestige_1_modifier
				modifier = artifact_attraction_opinion_1_modifier
				save_scope_as = newly_created_artifact
				wealth = scope:wealth
				quality = scope:quality
			}
		}

		scope:newly_created_artifact = {
			add_scaled_artifact_modifier_minor_prestige_effect = yes
			add_scaled_artifact_modifier_majesty_effect = yes
			if = {
				limit = {
					exists = scope:love_memory_1
				}
				set_artifact_description = poetic_life_artifact_description.love_memory_1
			}
			if = {
				limit = {
					exists = scope:love_memory_2
				}
				set_artifact_description = poetic_life_artifact_description.love_memory_2
			}
			if = {
				limit = {
					exists = scope:love_memory_3
				}
				set_artifact_description = poetic_life_artifact_description.love_memory_3
			}
			if = {
				limit = {
					exists = scope:death_memory_1
				}
				set_artifact_description = poetic_life_artifact_description.death_memory_1
			}
			if = {
				limit = {
					exists = scope:death_memory_2
				}
				set_artifact_description = poetic_life_artifact_description.death_memory_2
			}
			if = {
				limit = {
					exists = scope:death_memory_3
				}
				set_artifact_description = poetic_life_artifact_description.death_memory_3
			}
			set_artifact_description = poetic_life_artifact_description.end
		}
	}
}
scripted_effect create_poetic_life_memory_list_effect = {

	every_memory = {
		limit = {
			OR = {
				has_memory_category = lover
				has_memory_category = intimate
			}
		}
		add_to_list = love_memories
	}
	every_memory = {
		limit = {
			OR = {
				has_memory_category = death
				has_memory_category = war
			}
		}
		add_to_list = death_memories
	}
	ordered_in_list = {
		list = love_memories
		order_by = memory_creation_date
		limit = {
			OR = {
				has_memory_category = lover
				has_memory_category = intimate
			}
		}
		max = 3
		check_range_bounds = no
		if = {
			limit = { exists = scope:love_memory_2 }
			save_scope_as = love_memory_3
		}
		else_if = {
			limit = { exists = scope:love_memory_1 }
			save_scope_as = love_memory_2
		}
		else = { save_scope_as = love_memory_1 }
	}
	ordered_in_list = {
		list = death_memories
		order_by = memory_creation_date
		limit = {
			OR = {
				has_memory_category = death
				has_memory_category = war
			}
		}
		max = 3
		check_range_bounds = no
		if = {
			limit = { exists = scope:death_memory_2 }
			save_scope_as = death_memory_3
		}
		else_if = {
			limit = { exists = scope:death_memory_1 }
			save_scope_as = death_memory_2
		}
		else = { save_scope_as = death_memory_1 }
	}
}
#1270 - A Poetic Life: A Thousand Immortal Leaves
#by Laurence Kennedy
tgp_japan_yearly_events.1270 = {
	type = character_event
	title = tgp_japan_yearly_events.1270.t
	desc = {
		desc = tgp_japan_yearly_events.1270.desc
		triggered_desc = {
			trigger = {
				exists = scope:love_memory_1
			}
			desc = tgp_japan_yearly_events.1270.desc.love_memory_1
		}
		triggered_desc = {
			trigger = {
				exists = scope:love_memory_2
			}
			desc = tgp_japan_yearly_events.1270.desc.love_memory_2
		}
		triggered_desc = {
			trigger = {
				exists = scope:love_memory_3
			}
			desc = tgp_japan_yearly_events.1270.desc.love_memory_3
		}
		triggered_desc = {
			trigger = {
				exists = scope:death_memory_1
			}
			desc = tgp_japan_yearly_events.1270.desc.death_memory_1
		}
		triggered_desc = {
			trigger = {
				exists = scope:death_memory_2
			}
			desc = tgp_japan_yearly_events.1270.desc.death_memory_2
		}
		triggered_desc = {
			trigger = {
				exists = scope:death_memory_3
			}
			desc = tgp_japan_yearly_events.1270.desc.death_memory_3
		}
	}
	override_effect_2d = {
		reference = legend_glow
	}
	theme = romance_scheme
	cooldown = { years = 100 }
	#You, the poet
	left_portrait = {
		character = scope:inspired_poet
		animation = happy_teacher
	}
	artifact = {
		position = lower_right_portrait
		target = scope:newly_created_artifact
	}

	trigger = {
		has_tgp_dlc_trigger = yes
		has_trait = lifestyle_poet
		is_adult = yes
		is_available = yes
		is_ai = no
	}
	#an insurance policy so the event chain doesn't close without you getting your book
	on_trigger_fail = {
		trigger_event = {
			id = tgp_japan_yearly_events.1270
			days = { 14 29 }
		}
	}

	immediate = {
		#This is you
		save_scope_as = inspired_poet
		#Get Memories
		create_poetic_life_memory_list_effect = yes
		#Make artifact
		hidden_effect_new_object = {
			create_poetic_life_artifact_effect = { OWNER = root }
			scope:newly_created_artifact = {
				save_scope_as = love_poetry_artifact
			}
		}
	}

	#a) If you have court make it court artifact
	option = {
		name = tgp_japan_yearly_events.1270.a
		trigger = {
			has_royal_court = yes
		}
		hidden_effect_new_object = {
			scope:newly_created_artifact = {
				add_scaled_artifact_modifier_grandeur_small_effect = yes

				reforge_artifact = {
					type = pedestal
				}
			}
		}
		add_character_modifier = {
			modifier = tgp_japan_made_poetic_life_artifact_modifier
			years = { 50 60 }
		}
		custom_tooltip = tgp_japan_yearly_events.1270.a_effect
		remove_short_term_gold = minor_gold_value
		stress_impact = {
			chaste = minor_stress_impact_gain
			shy = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				gold < major_gold_value
			}
			modifier = {
				factor = 0
				OR = {
					has_trait = greedy
					has_trait = shy
				}
			}
		}
	}
	#b) Book option 2
	option = {
		name = tgp_japan_yearly_events.1270.b
		add_character_modifier = {
			modifier = tgp_japan_made_poetic_life_artifact_modifier
			years = { 50 60 }
		}
		custom_tooltip = tgp_japan_yearly_events.1270.b_effect
		stress_impact = {
			shy = minor_stress_impact_gain
			humble = minor_stress_impact_gain
			chaste = medium_stress_impact_gain
			gregarious = medium_stress_impact_loss
			eccentric = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = shy
					has_trait = humble
					has_trait = chaste
				}
			}
			modifier = {
				factor = 0
				diplomacy <= high_skill_rating
				prowess <= high_skill_rating
			}
		}
	}
}
