﻿# Events for the travel portion of the Tour grand activity

namespace = cultural_festival

############################
## Tour Mini-Activity: Cultural Festival
######################
## Liege: You find something strange backstage
## 9000
## by James Beaumont
######################

# Something is not quite right about something backstage
cultural_festival.9000 = {
	type = activity_event
	title = cultural_festival.9000.title
	desc = cultural_festival.9000.desc

	theme = cultural_festival
	left_portrait = {
		character = root
		animation = paranoia
	}

	trigger = {
		is_ai = no
		NOT = {
			exists = var:had_event_cultural_festival_9000
		}
		OR = {
			any_owned_story = {
				type = story_cycle_mysterious_journal
				exists = var:mysterious_journal
				var:mysterious_journal = {
					NOT = {
						exists = var:secret_puzzle
					}
				}
			}
			scope:stop_host_scope = {
				is_ai = yes
				is_adult = yes
				has_trait = education_intrigue
				NOR = {
					government_has_flag = government_is_tribal
					government_has_flag = government_is_nomadic
				}
				OR = {
					has_trait = paranoid
					has_trait = schemer
					intrigue >= high_skill_rating
				}
				NOT = {
					has_trait = cynical
					has_trait = zealous
				}
			}
		}
	}

	option = { # I will investigate...
		name = cultural_festival.9000.a
		duel = {
			skill = intrigue
			value = high_skill_rating
			50 = { # You find a room behind the pantry
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				custom_tooltip = you_progress_deeper_tt
				hidden_effect = {
					trigger_event = cultural_festival.9001
				}
			}
			50 = { # You fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = cultural_festival.9000.host_noticed
					left_icon = root
					reverse_add_opinion = {
						target = scope:stop_host_scope
						opinion = -20
						modifier = suspicious_opinion
					}
				}
			}
		}
		stress_impact = {
			trusting = medium_stress_impact_gain
			humble = medium_stress_impact_gain
			honest = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = trusting
					has_trait = humble
					has_trait = honest
				}
			}
			ai_value_modifier = {
				ai_boldness = 1
				ai_compassion = -0.2
			}
		}
	}

	option = { # I will trust that my vassal isn't hiding anything
		name = cultural_festival.9000.b
		stress_impact = {
			cynical = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
			ambitious = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = ambitious
					has_trait = paranoid
				}
			}
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}

	after = {
		if = {
			limit = {
				NOT = {
					owns_story_of_type = story_cycle_mysterious_journal
				}
			}
			set_variable = {
				name = had_event_cultural_festival_9000
				years = 100
			}
		}
	}
}

# You find a secret room with a puzzle-lock door, keep going?
scripted_effect cultural_festival_9001_open_the_box_effect = {
	random_list = {
		50 = { # You find the mysterous journal #2
			trigger_event = cultural_festival.9002
		}
		50 = { # You find a cool knife!
			trigger_event = cultural_festival.9003
		}
		50 = { # You find money
			trigger_event = cultural_festival.9004
		}
		50 = { # You find jewelry
			trigger_event = cultural_festival.9005
		}
		50 = { # You find a... toy
			trigger = {
				scope:stop_host_scope = {
					OR = {
						has_trait = lustful
						is_deviant_trigger = yes
					}
				}
			}
			trigger_event = cultural_festival.9006
		}
	}
}

# You find a strange lockbox, try to get it open?
cultural_festival.9001 = {
	type = activity_event
	title = cultural_festival.9001.title
	desc = cultural_festival.9001.desc

	theme = cultural_festival
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = paranoia
	}

	option = { # I can solve it!
		name = cultural_festival.9001.a
		duel = {
			skill = stewardship
			value = high_skill_rating
			50 = { # You open the box
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				custom_tooltip = you_progress_deeper_tt
				hidden_effect = {
					cultural_festival_9001_open_the_box_effect = yes
				}
			}
			50 = { # You fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = cultural_festival.9001.fail_to_get_it_open
					left_icon = root
				}
			}
		}
		stress_impact = {
			impatient = medium_stress_impact_gain
			lazy = medium_stress_impact_gain
			wrathful = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = impatient
					has_trait = lazy
					has_trait = wrathful
				}
			}
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # Smash it!
		name = cultural_festival.9001.b
		duel = {
			skill = prowess
			value = high_skill_rating
			50 = { # You get it open
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				custom_tooltip = you_progress_deeper_tt
				hidden_effect = {
					cultural_festival_9001_open_the_box_effect = yes
				}
			}
			50 = { # You fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				send_interface_toast = {
					title = cultural_festival.9001.destroyed_what_was_inside
					left_icon = root
				}
			}
		}
		stress_impact = {
			patient = medium_stress_impact_gain
			scholar = medium_stress_impact_gain
			diligent = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = patient
					has_trait = scholar
					has_trait = diligent
				}
			}
			ai_value_modifier = {
				ai_boldness = 1
			}
		}
	}

	option = { # Screw this
		name = cultural_festival.9001.c
		stress_impact = {
			lazy = minor_stress_impact_loss
			patient = minor_stress_impact_gain
			diligent = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = patient
					has_trait = diligent
					has_trait = stubborn
					has_trait = wrathful
					has_trait = paranoid
				}
			}
			ai_value_modifier = {
				ai_boldness = -1
			}
		}
	}
}

# You find the secret journal #2
cultural_festival.9002 = {
	type = activity_event
	title = cultural_festival.9002.title
	desc = cultural_festival.9002.desc

	theme = cultural_festival
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = shock
	}
	artifact = {
		target = scope:journal_artifact
		position = lower_right_portrait
	}

	immediate = {
		if = {
			limit = {
				NOT = {
					any_owned_story = {
						type = story_cycle_mysterious_journal
					}
				}
			}
			create_artifact = {
				name = artifact_secret_journal_name
				description = artifact_secret_puzzle_description
				type = miscellaneous
				visuals = book
				wealth = 10
				quality = 10
				modifier = artifact_stress_gain_1_penalty_modifier
				save_scope_as = journal_artifact
			}
		}
		else = {
			random_owned_story = {
				type = story_cycle_mysterious_journal
				var:mysterious_journal = {
					save_scope_as = journal_artifact
				}
			}
		}
		scope:journal_artifact = {
			set_variable = {
				name = secret_puzzle
			}
		}
		increase_tour_success_effect = { POINTS = 1 }
	}

	option = { # What could it mean? Take the journal
		name = cultural_festival.9002.a
		trigger = {
			NOT = {
				any_owned_story = {
					type = story_cycle_mysterious_journal
				}
			}
		}
		hidden_effect = {
			create_story = story_cycle_mysterious_journal
			random_owned_story = {
				type = story_cycle_mysterious_journal
				set_variable = {
					name = mysterious_journal
					value = scope:journal_artifact
				}
			}
		}
		stress_impact = {
			honest = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			trusting = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = paranoid
					has_trait = trusting
				}
			}
		}
	}

	option = { # The mystery grows deeper
		name = cultural_festival.9002.b
		trigger = {
			# You have only one part of the puzzle
			any_character_artifact = {
				OR = {
					exists = var:secret_cipher
					exists = var:secret_journal
				}
			}
			# But not both
			NOT = {
				any_character_artifact = {
					exists = var:secret_cipher
					exists = var:secret_journal
				}
			}
			any_owned_story = {
				type = story_cycle_mysterious_journal
			}
		}
		custom_tooltip = progress_to_unlock_journal_mystery_tt
		random_owned_story = {
			type = story_cycle_mysterious_journal
			var:mysterious_journal = {
				if = {
					limit = {
						exists = var:secret_cipher
					}
					set_artifact_description = artifact_secret_puzzle_with_cipher_description
				}
				else_if = {
					limit = {
						exists = var:secret_journal
					}
					set_artifact_description = artifact_secret_journal_with_puzzle_description
				}
				set_variable = {
					name = secret_puzzle
				}
			}
		}
		ai_chance = {
			base = 10
		}
	}

	option = { # At last, I have them all
		name = cultural_festival.9002.c
		trigger = {
			any_character_artifact = {
				exists = var:secret_cipher
				exists = var:secret_journal
			}
			any_owned_story = {
				type = story_cycle_mysterious_journal
			}
		}
		random_owned_story = {
			type = story_cycle_mysterious_journal
			var:mysterious_journal = {
				set_artifact_description = artifact_secret_journal_unsolved_description
				set_variable = {
					name = secret_puzzle
				}
			}
		}
		ai_chance = {
			base = 10
		}
	}

	option = { # I will not steal
		name = cultural_festival.9002.d
		trigger = {
			NOT = {
				any_owned_story = {
					type = story_cycle_mysterious_journal
				}
			}
		}
		destroy_artifact = scope:journal_artifact
		stress_impact = {
			base = medium_stress_impact_gain
			paranoid = major_stress_impact_loss
			honest = major_stress_impact_loss
			compassionate = major_stress_impact_loss
			forgiving = major_stress_impact_loss
		}
		ai_chance = {
			base = 0
		}
	}
}

# You find a cool knife!
cultural_festival.9003 = {
	type = activity_event
	title = cultural_festival.9003.title
	desc = cultural_festival.9003.desc

	theme = cultural_festival
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = shock
	}
	artifact = {
		target = scope:knife_artifact
		position = lower_right_portrait
	}

	immediate = {
		if = {
			limit = {
				NOT = {
					any_owned_story = {
						type = story_cycle_mysterious_journal
					}
				}
			}
			set_artifact_rarity_famed = yes
			create_artifact = {
				name = artifact_ornate_dagger_name
				description = artifact_ornate_dagger_desc
				visuals = dagger
				type = dagger 
				modifier = artifact_prowess_1_modifier
				modifier = artifact_monthly_prestige_2_modifier
				modifier = artifact_intrigue_per_prestige_level_1_modifier
				wealth = scope:wealth
				quality = scope:quality
				save_scope_as = knife_artifact
			}
		}
		increase_tour_success_effect = { POINTS = 1 }
	}

	option = { # My knife now!
		name = cultural_festival.9003.a
		stress_impact = {
			honest = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			trusting = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = paranoid
					has_trait = trusting
				}
			}
		}
	}

	option = { # I will not steal
		name = cultural_festival.9003.b
		destroy_artifact = scope:knife_artifact
		stress_impact = {
			paranoid = major_stress_impact_loss
			honest = major_stress_impact_loss
			compassionate = major_stress_impact_loss
			forgiving = major_stress_impact_loss
		}
		ai_chance = {
			base = 0
		}
	}
}

# You find money
cultural_festival.9004 = {
	type = activity_event
	title = cultural_festival.9004.title
	desc = cultural_festival.9004.desc

	theme = cultural_festival
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = shock
	}

	immediate = {
		increase_tour_success_effect = { POINTS = 1 }
	}

	option = { # My knife now!
		name = cultural_festival.9004.a
		add_gold = major_gold_value
		stress_impact = {
			honest = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			trusting = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = paranoid
					has_trait = trusting
				}
			}
		}
	}

	option = { # I will not steal
		name = cultural_festival.9004.b
		stress_impact = {
			paranoid = major_stress_impact_loss
			honest = major_stress_impact_loss
			compassionate = major_stress_impact_loss
			forgiving = major_stress_impact_loss
		}
		ai_chance = {
			base = 0
		}
	}
}

# You find jewelry
cultural_festival.9005 = {
	type = activity_event
	title = cultural_festival.9005.title
	desc = cultural_festival.9005.desc

	theme = cultural_festival
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = shock
	}
	artifact = {
		target = scope:jewelry_artifact
		position = lower_right_portrait
	}

	immediate = {
		set_artifact_rarity_masterwork = yes
		create_artifact = {
			name = artifact_strange_necklace_name
			description = artifact_strange_necklace_desc
			visuals = necklace
			type = necklace
			modifier = artifact_monthly_minor_prestige_4_modifier
			modifier = artifact_monthly_prestige_gain_per_dread_add_2_modifier
			modifier = artifact_stress_gain_1_penalty_modifier
			wealth = scope:wealth
			quality = scope:quality
			save_scope_as = jewelry_artifact
		}
		increase_tour_success_effect = { POINTS = 1 }
	}

	option = { # My necklace now!
		name = cultural_festival.9005.a
		stress_impact = {
			honest = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			trusting = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = paranoid
					has_trait = trusting
				}
			}
		}
	}

	option = { # I will not steal
		name = cultural_festival.9005.b
		destroy_artifact = scope:jewelry_artifact
		stress_impact = {
			paranoid = major_stress_impact_loss
			honest = major_stress_impact_loss
			compassionate = major_stress_impact_loss
			forgiving = major_stress_impact_loss
		}
		ai_chance = {
			base = 0
		}
	}
}

# You find a um... toy
cultural_festival.9006 = {
	type = activity_event
	title = cultural_festival.9006.title
	desc = cultural_festival.9006.desc

	theme = cultural_festival
	override_background = { reference = corridor_night }
	left_portrait = {
		character = root
		animation = shock
	}
	artifact = {
		target = scope:dildo_artifact
		position = lower_right_portrait
	}

	immediate = {
		set_artifact_rarity_masterwork = yes
		create_artifact = {
			name = grotesque_wooden_phallus
			description = grotesque_wooden_phallus.desc
			type = miscellaneous
			visuals = small_box
			modifier = artifact_fertility_gain_2_modifier
			modifier = artifact_spouse_opinion_add_4_modifier
			wealth = 20
			quality = 20
			max_durability = 30
			generate_history = no
			save_scope_as = dildo_artifact
		}
		increase_tour_success_effect = { POINTS = 1 }
	}

	option = { # My dildo now!
		name = cultural_festival.9006.a
		stress_impact = {
			honest = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			trusting = medium_stress_impact_gain
			chaste = medium_stress_impact_gain
		}
		ai_chance = {
			base = 10
			modifier = {
				factor = 0
				OR = {
					has_trait = honest
					has_trait = paranoid
					has_trait = trusting
					has_trait = chaste
				}
			}
		}
	}

	option = { # I will not steal
		name = cultural_festival.9006.b
		destroy_artifact = scope:dildo_artifact
		stress_impact = {
			paranoid = major_stress_impact_loss
			honest = major_stress_impact_loss
			compassionate = major_stress_impact_loss
			forgiving = major_stress_impact_loss
			lustful = major_stress_impact_gain
			deviant = major_stress_impact_gain
		}
		ai_chance = {
			base = 0
		}
	}
}

# Your kid becomes entranced by the local culture
cultural_festival.9010 = {
	type = activity_event
	title = cultural_festival.9010.title
	desc = cultural_festival.9010.desc

	theme = cultural_festival
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:weeb_child
		animation = ecstasy
	}
	cooldown = { years = 5 }

	trigger = {
		root.culture != root.location.county.culture
		current_travel_plan = {
			any_entourage_character = {
				culture != root.location.county.culture
				is_child_of = root
				child_not_infant_trigger = yes
			}
		}
	}

	immediate = {
		current_travel_plan = {
			random_entourage_character = {
				limit = {
					culture != root.location.county.culture
					is_child_of = root
					child_not_infant_trigger = yes
				}
				save_scope_as = weeb_child
			}
		}
		root.location.county.culture = { save_scope_as = festival_culture_scope }
	}

	option = { # How cute
		name = cultural_festival.9010.a
		culture = {
			change_cultural_acceptance = {
				target = scope:festival_culture_scope
				value = minor_cultural_acceptance_gain
				desc = cultural_acceptance_embraced_festival
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
		}
		ai_chance = {
			base = 10
		}
	}

	option = { # Go on, be with them
		name = cultural_festival.9010.b
		random = {
			chance = 25
			scope:weeb_child = {
				set_culture = scope:festival_culture_scope
			}
		}
		culture = {
			change_cultural_acceptance = {
				target = scope:festival_culture_scope
				value = major_cultural_acceptance_gain
				desc = cultural_acceptance_embraced_festival
			}
		}
		stress_impact = {
			humble = minor_stress_impact_loss
			arrogant = medium_stress_impact_gain
			zealous = medium_stress_impact_gain
		}
		ai_chance = { # The AI probably shouldn't encourage cultural conversion
			base = 0
		}
	}
}

# A human sacrifice is happening
cultural_festival.9020 = {
	type = activity_event
	title = cultural_festival.9020.title
	desc = cultural_festival.9020.desc

	theme = cultural_festival
	left_portrait = {
		character = root 
		triggered_animation = {
			trigger = {
				OR = {
					has_trait = callous
					has_trait = sadistic
				}
			}
			animation = personality_callous
		}
	   	animation = disbelief
	}
	right_portrait = {
		character = scope:human_sacrifice
	   	animation = prisondungeon
	}
	cooldown = { years = 5 }

	trigger = {
		NOT = { root.faith = { has_doctrine_parameter = human_sacrifice_active } }
		location = {
			county = {
				faith = { has_doctrine_parameter = human_sacrifice_active }
			}
		}
	}
	immediate = {
		if = {
			limit = {
				any_pool_character = {
					province = root.location
					is_lowborn = yes
				}
			}
			random_pool_character = {
				province = root.location
				limit = { is_lowborn = yes }
				save_scope_as = human_sacrifice
			}
		}
		else = {
			create_character = {
				template = generic_peasant_character
				location = root.location
				culture = root.location.county.culture
				faith = root.location.county.faith
				#Set up the scope
				save_scope_as = human_sacrifice
			}
		}
		root.location.county.culture = { save_scope_as = festival_culture_scope }
		scope:human_sacrifice = {
			add_character_flag = is_naked
		}
	}
	# Just let it happen
	option = {
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = { has_trait = sadistic }
						desc = travel_events.4021.a.sadist
					}
					desc = travel_events.4021.a
				}
			}
		}
		scope:human_sacrifice = {
			death = {
				death_reason = death_sacrificed_to_gods
			}
		}
		if = {
			limit = {
				culture != root.location.culture
			}
			culture = {
				change_cultural_acceptance = {
					target = scope:festival_culture_scope
					value = minor_cultural_acceptance_gain
					desc = cultural_acceptance_embraced_festival
				}
			}
		}
		else = {
			root.location.county = {
				add_county_modifier = {
					modifier = appreciated_culture_modifier
					years = 15
				}
			}
		}
		stress_impact = {
			sadistic = medium_stress_impact_loss
			compassionate = medium_stress_impact_gain
			just = medium_stress_impact_gain
			zealous = medium_stress_impact_gain
			humble = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
			generous = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 1
				ai_compassion = -1
				ai_boldness = -0.5
			}
		}
	}
	# Stop this madness in the name of your King!
	option = {
		name = cultural_festival.9020.b
		if = {
			limit = {
				culture != root.location.culture
			}
			culture = {
				change_cultural_acceptance = {
					target = scope:festival_culture_scope
					value = medium_cultural_acceptance_loss
					desc = cultural_acceptance_insulted_festival
				}
			}
		}
		else = {
			root.location.county = {
				add_county_modifier = {
					modifier = no_culture_modifier
					years = 10
				}
			}
		}
		add_hook = {
			type = saved_my_life_hook
			target = scope:human_sacrifice
		}
		stress_impact = {
			compassionate = medium_stress_impact_loss
			just = medium_stress_impact_loss
			zealous = medium_stress_impact_loss
			humble = medium_stress_impact_loss
			forgiving = medium_stress_impact_loss
			generous = medium_stress_impact_loss
			sadistic = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = -1
				ai_compassion = 1
				ai_boldness = 0.5
			}
		}
	}
	after = {
		scope:human_sacrifice ?= {
			remove_character_flag = is_naked
		}
	}
}

# Vassal: attempt to get religious protection
cultural_festival.9030 = {
	type = activity_event
	title = cultural_festival.9030.title
	desc = cultural_festival.9030.desc

	theme = cultural_festival
	left_portrait = {
		character = root 
	   	animation = thinking
	}
	right_portrait = {
		character = scope:visiting_liege
	   	animation = ecstasy
	}
	cooldown = { years = 5 }

	trigger = {
		scope:visiting_liege = { is_ai = yes } # Ideally this would be bilateral, but time constraints.
		faith != scope:visiting_liege.faith
		vassal_contract_obligation_level_can_be_increased = religious_rights
	}
	# Ask for protection
	option = {
		name = cultural_festival.9030.a
		duel = {
			skill = diplomacy
			target = scope:visiting_liege
			50 = { # You convince them
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				modifier = { # Reduce chance for zealousness
					add = {
						value = 0
						subtract = scope:visiting_liege.ai_zeal
					}
				}
				send_interface_toast = {
					title = cultural_festival.9030.success
					left_icon = root
					vassal_contract_increase_obligation_level = religious_rights
				}
			}
			50 = { # You fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				modifier = { # Reduce chance for zealousness
					add = scope:visiting_liege.ai_zeal
				}
				send_interface_toast = {
					title = cultural_festival.9030.failure
					left_icon = root
					right_icon = scope:visiting_liege
					reverse_add_opinion = {
						target = scope:visiting_liege
						opinion = -20
						modifier = insult_opinion
					}
				}
			}
		}
		stress_impact = {
			zealous = medium_stress_impact_loss
			ambitious = medium_stress_impact_loss
			shy = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 1
				ai_sociability = 1
				ai_boldness = 0.5
			}
		}
	}
	# No, I don't think it's worth upsetting them
	option = {
		name = cultural_festival.9030.b
		stress_impact = {
			humble = medium_stress_impact_loss
			zealous = medium_stress_impact_gain
			ambitious = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -1
				ai_sociability = -1
				ai_boldness = -0.5
			}
		}
	}
}

# Encounter a fortune teller
cultural_festival.9040 = {
	type = activity_event
	title = cultural_festival.9040.t
	desc = cultural_festival.9040.desc
	theme = cultural_festival
	left_portrait = {
		character = root 
	   	animation = admiration
	}
	right_portrait = {
		character = scope:mystic_scope
		animation = thinking
	}
	cooldown = { years = 5 }
	trigger = {
		NOR = {
			has_character_modifier = bp1_superstition_modifier
			has_character_modifier = bad_omen_modifier
		}
	}
	immediate = {
		create_character = {
			template = default_mystic_character
			location = root.location
			culture = root.location.county.culture
			faith = root.location.county.faith
			#Set up the scope
			save_scope_as = mystic_scope
		}
		hidden_effect = {
			root.location.county.culture = { save_scope_as = festival_culture_scope }
			scope:mystic_scope = {
				random_list = {
					25 = { }
					25 = { add_trait = deceitful }
					25 = { add_trait = lifestyle_mystic }
					25 = { add_trait = witch }
				}
			}
		}
	}
	#Get a mystical reading
	option = {
		name = cultural_festival.9040.a
		remove_short_term_gold = tiny_gold_value
		if = {
			limit = {
				NOT = { has_trait = cynical }
			}
			add_character_modifier = {
				modifier = bp1_superstition_modifier
				years = 15
			}
		}
		if = {
			limit = {
				culture != root.location.culture
			}
			culture = {
				change_cultural_acceptance = {
					target = scope:festival_culture_scope
					value = minor_cultural_acceptance_gain
					desc = cultural_acceptance_embraced_festival
				}
			}
		}
		stress_impact = {   
			base = minor_stress_impact_loss
			paranoid = minor_stress_impact_loss
			greedy = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				short_term_gold < minor_gold_value
			}
		}
	}
	#Pass them by
	option = {
		name = cultural_festival.9040.b
		stress_impact = {   
			paranoid = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}
	#Teach me your ways, wise one!
	option = {
		name = cultural_festival.9040.c
		trigger = {
			has_trait = lifestyle_mystic
		}
		if = {
			limit = {
				scope:mystic_scope = { has_trait = deceitful }
			}
			add_intrigue_skill = 1
		}
		else_if = {
			limit = {
				scope:mystic_scope = { has_trait = witch }
			}
			give_witch_secret_or_trait_effect = yes
		}
		else = {
			add_trait_xp = {
				trait = lifestyle_mystic
				value = 50
			}
		}
		if = {
			limit = {
				culture != scope:festival_culture_scope
			}
			culture = {
				change_cultural_acceptance = {
					target = scope:festival_culture_scope
					value = medium_cultural_acceptance_gain
					desc = cultural_acceptance_insulted_festival
				}
			}
		}
		stress_impact = {   
			base = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}
}

# A beautiful woman/man dances for you
cultural_festival.9050 = {
	type = activity_event
	title = cultural_festival.9050.t
	desc = cultural_festival.9050.desc
	theme = cultural_festival
	left_portrait = {
		character = root 
	   	animation = admiration
	}
	right_portrait = {
		character = scope:sexy_dancer
		animation = dancing
	}
	cooldown = { years = 5 }
	trigger = {
		is_adult = yes
		NOT = {
			has_trait = celibate
		}
		OR = { # Should be fairly opt-in
			has_activity_intent = lechery_intent
			has_trait = lustful
			has_trait = seducer
			has_trait = rakish
			is_deviant_trigger = yes
			has_focus = intrigue_temptation_focus
		}
		trigger_if = {
			limit = {
				is_ai = yes
			}
			any_pool_character = {
				province = root.location
				is_adult = yes
				save_temporary_scope_as = attracted_character
				matching_gender_and_sexuality_trigger = {
					CHARACTER_1 = scope:attracted_character
					CHARACTER_2 = root
				}
				attraction >= medium_positive_attraction
			}
		}
	}
	immediate = {
		hidden_effect = {
			root.location.county.culture = { save_scope_as = festival_culture_scope }
			if = {
				limit = {
					any_pool_character = {
						province = root.location
						is_adult = yes
						save_temporary_scope_as = attracted_character
						matching_gender_and_sexuality_trigger = {
							CHARACTER_1 = scope:attracted_character
							CHARACTER_2 = root
						}
						attraction >= medium_positive_attraction
					}
				}
				random_pool_character = {
					province = root.location
					limit = {
						is_adult = yes
						save_temporary_scope_as = attracted_character_check
						matching_gender_and_sexuality_trigger = {
							CHARACTER_1 = scope:attracted_character_check
							CHARACTER_2 = root
						}
						attraction >= medium_positive_attraction
					}
					save_scope_as = sexy_dancer
				}
			}
			else = {
				create_character = {
					location = root.location
					template = beautiful_peasant_character
					culture = root.location.county.culture
					faith = root.location.county.faith
					age = age_compared_to_root_minus_ten_always_adult
					gender_female_chance = root_sexuality_female_chance
					save_scope_as = sexy_dancer
				}
				scope:sexy_dancer = {
					random_list = {
						10 = {
							trigger = {
								OR = {
									AND = {
										ROOT = { is_male = yes }
										is_female = yes
									}
									AND = {
										ROOT = { is_female = yes }
										is_male = yes
									}
								}
							}
							set_sexuality = heterosexual
						}
						10 = {
							set_sexuality = bisexual
						}
						10 = {
							trigger = {
								OR = {
									AND = {
										ROOT = { is_male = yes }
										is_male = yes
									}
									AND = {
										ROOT = { is_female = yes }
										is_female = yes
									}
								}
							}
							set_sexuality = homosexual
						}
					}
				}
			}
		}
	}

	option = { # She/he must be mine!
		name = cultural_festival.9050.a
		set_relation_lover = {
			target = scope:sexy_dancer
			reason = lover_enchanting_dancing
		}
		add_to_entourage_court_and_activity_effect = {
			CHAR_TO_ADD = scope:sexy_dancer 
			NEW_COURT_OWNER = root 
		}
		stress_impact = {
			base = medium_stress_impact_loss
			lustful = major_stress_impact_loss
			loyal = minor_stress_impact_gain
			honest = medium_stress_impact_gain
			chaste = major_stress_impact_gain
			zealous = major_stress_impact_gain
		}
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				has_trait = chaste
			}
			modifier = {
				add = -50
				would_be_sinful_adulterer_trigger = yes
				relation_with_character_is_sodomy_in_faith_trigger = {
					CHARACTER = scope:sexy_dancer
					FAITH = root.faith
				}
				has_trait = zealous
			}
		}
	}

	option = { # How nice!
		name = cultural_festival.9050.b
		if = {
			limit = {
				culture != root.location.culture
			}
			culture = {
				change_cultural_acceptance = {
					target = scope:festival_culture_scope
					value = minor_cultural_acceptance_gain
					desc = cultural_acceptance_embraced_festival
				}
			}
		}
		else = {
			root.location.county = {
				add_county_modifier = {
					modifier = appreciated_culture_modifier
					years = 15
				}
			}
		}
		ai_chance = {
			base = 50
		}
	}
}

# Orchestrate a performance of your legend!
cultural_festival.9060 = {
	type = activity_event
	title = cultural_festival.9060.t
	desc = cultural_festival.9060.desc
	theme = cultural_festival
	left_portrait = {
		character = root 
	   	animation = thinking
	}
	cooldown = { years = 5 }
	trigger = {
		has_activity_intent = spread_legend_intent
		scope:stop_host_scope = {
			NOT = { exists = promoted_legend }
		}
	}

	option = { # Let's do it!
		name = cultural_festival.9060.a
		duel = {
			skill = diplomacy
			target = scope:stop_host_scope
			50 = {
				desc = cultural_festival.9060.a.success
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
				}
				send_interface_toast = {
					title = cultural_festival.9060.a.success
					left_icon = root
					right_icon = scope:stop_host_scope
					add_prestige = medium_prestige_gain
					scope:stop_host_scope = {
						set_promoted_legend = root.promoted_legend
					}
				}
			}
			50 = {
				desc = cultural_festival.9060.a.failure
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
				}
				send_interface_toast = {
					title = cultural_festival.9060.a.failure
					left_icon = root
					add_character_modifier = {
						modifier = ce1_legendary_performance
						years = 15
					}
				}
			}
		}
		ai_chance = {
			base = 500
		}
	}

	option = { # Let's just put on a show about their culture
		name = cultural_festival.9060.b
		if = {
			limit = {
				culture != root.location.culture
			}
			culture = {
				change_cultural_acceptance = {
					target = scope:festival_culture_scope
					value = minor_cultural_acceptance_gain
					desc = cultural_acceptance_embraced_festival
				}
			}
		}
		else = {
			root.location.county = {
				add_county_modifier = {
					modifier = appreciated_culture_modifier
					years = 15
				}
			}
		}
		ai_chance = {
			base = 50
		}
	}
}
