﻿namespace = contest_events

###############################
###############################
###   RECITAL - 5000-5499   ###
###############################
###############################
# Complete your own verse!
# By James Beaumont
contest_events.5000 = {
	type = activity_event
	title = contest_events.5000.t
	desc = contest_events.5000.desc
	theme = tournament_contest
	window = widget_activity_locale_fullscreen_event
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:enemy
		animation = schadenfreude
	}
	cooldown = { years = 1 }

	trigger = {
		scope:activity = {
			any_guest_subset_current_phase = {
				name = qualified
				contest_event_general_contestant_valid_trigger = yes
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset_current_phase = {
				name = qualified
				limit = { contest_event_general_contestant_valid_trigger = yes }
				save_scope_as = enemy
			}
		}
		scope:enemy = {
			select_poem_theme_incompetence_effect = yes
			select_poem_subject_gender_effect = {
				SUBJECT = flag:specific
				SUBJECT_TARGET = root
			}
		}
	}

	# Furthermore, I had sex with your mother
	option = {
		name = {
			trigger = {
				is_attracted_to_men = yes
			}
			text = contest_events.5000.shagged_your_dad
		}
		name = contest_events.5000.shagged_your_mum

		duel = {
			skill = intrigue
			target = scope:enemy
			50 = {
				modifier = {
					factor = 0.5
					has_trait = chaste
				}
				modifier = {
					factor = 0.1
					OR = { # Lol, no you didn't
						has_trait = celibate
						is_eunuch_trigger = yes
					}
				}
				modifier = {
					add = attraction
				}
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = contest_events.5000.success
				send_interface_toast = {
					title = contest_events.5000.success
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = increase_medium }
					if = {
						limit = {
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = wit
							value = 2
						}
					}
				}
			}
			50 = {
				modifier = {
					add = scope:enemy.attraction
				}
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = contest_events.5000.failure
				send_interface_toast = {
					title = contest_events.5000.failure
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = decrease_medium }
				}
			}
		}
		progress_towards_rival_effect = {
			REASON = rival_recital_insult
			CHARACTER = scope:enemy
			OPINION = default_rival_opinion
		}
		if = {
			limit = { is_eunuch_trigger = yes }
			stress_impact = {   
				base = minor_stress_impact_loss
				vengeful = minor_stress_impact_loss
				lustful = minor_stress_impact_loss
				chaste = medium_stress_impact_gain
				celibate = medium_stress_impact_gain
				forgiving = medium_stress_impact_gain
				compassionate = medium_stress_impact_gain
				honest = medium_stress_impact_gain
			}
		}
		else = {
			stress_impact = {   
				base = minor_stress_impact_loss
				vengeful = minor_stress_impact_loss
				lustful = minor_stress_impact_loss
				chaste = medium_stress_impact_gain
				celibate = medium_stress_impact_gain
				forgiving = medium_stress_impact_gain
				compassionate = medium_stress_impact_gain
			}
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = chaste
					has_trait = celibate
					has_trait = forgiving
					has_trait = compassionate
				}
			}		
		}
	}

	# Call them a ho
	option = {
		name = contest_events.5000.licentious
		duel = {
			skills = { diplomacy intrigue }
			target = scope:enemy
			50 = {
				modifier = { # The comment actually has a basis
					factor = 2
					scope:enemy = {
						OR = {
							is_concubine = yes
							has_trait = rakish
							has_trait = seducer
							has_trait = lustful
							has_trait = deviant
							has_trait = adulterer
							has_trait = fornicator
							has_trait = sodomite
						}
					}
				}
				modifier = { # It's a bit of a self-burn
					factor = 0.5
					root = {
						OR = {
							is_concubine = yes
							has_trait = rakish
							has_trait = seducer
							has_trait = lustful
							has_trait = deviant
							has_trait = adulterer
							has_trait = fornicator
							has_trait = sodomite
						}
					}
				}
				modifier = { # The crowd doesn't believe being lustful is bad
					factor = 0.5
					root.location.county.faith = {
						trait_is_virtue = lustful
					}
				}
				modifier = { # It is bad for them to be lecherous
					add = 5
					scope:enemy = {
						OR = {
							AND = {
								is_female = yes
								faith = { NOT = { has_doctrine_parameter = adultery_female_accepted } }
							}
							AND = {
								is_male = yes
								faith = { NOT = { has_doctrine_parameter = adultery_male_accepted } }
							}
						}
					}
				}
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = contest_events.5000.success
				send_interface_toast = {
					title = contest_events.5000.success
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = increase_medium }
					if = {
						limit = {
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = wit
							value = 10
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = contest_events.5000.failure
				send_interface_toast = {
					title = contest_events.5000.failure
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = decrease_medium }
				}
			}
		}
		progress_towards_rival_effect = {
			REASON = rival_recital_insult
			CHARACTER = scope:enemy
			OPINION = default_rival_opinion
		}
		stress_impact = {   
			base = minor_stress_impact_loss
			vengeful = minor_stress_impact_loss
			chaste = minor_stress_impact_loss
			lustful = medium_stress_impact_gain
			rakish = medium_stress_impact_gain
			deviant = medium_stress_impact_gain
			sodomite = medium_stress_impact_gain
			fornicator = medium_stress_impact_gain
			adulterer = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = rakish
					has_trait = deviant
					has_trait = sodomite
					has_trait = fornicator
					has_trait = adulterer
				}
			}		
		}
	}

	# Call them stupid
	option = {
		name = contest_events.5000.stupid
		duel = {
			skill = learning
			target = scope:enemy
			50 = {
				modifier = { # The comment actually has a basis
					factor = 2
					scope:enemy = {
						OR = {
							has_trait = dull
							has_trait = intellect_bad
						}
					}
				}
				modifier = { # It's a bit of a self-burn
					factor = 0.5
					root = {
						OR = {
							has_trait = dull
							has_trait = intellect_bad
						}
					}
				}
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = contest_events.5000.success
				send_interface_toast = {
					title = contest_events.5000.success
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = increase_medium }
					if = {
						limit = {
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = wit
							value = 2
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = contest_events.5000.failure
				send_interface_toast = {
					title = contest_events.5000.failure
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = decrease_medium }
				}
			}
		}
		progress_towards_rival_effect = {
			REASON = rival_recital_insult
			CHARACTER = scope:enemy
			OPINION = default_rival_opinion
		}
		stress_impact = {   
			base = minor_stress_impact_loss
			vengeful = minor_stress_impact_loss
			chaste = minor_stress_impact_loss
			dull = medium_stress_impact_gain
			intellect_bad_1 = medium_stress_impact_gain
			intellect_bad_2 = medium_stress_impact_gain
			intellect_bad_3 = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = dull
					has_trait = intellect_bad
				}
			}		
		}
	}

	# Call them ugly
	option = {
		name = contest_events.5000.ugly
		duel = {
			skill = diplomacy
			target = scope:enemy
			50 = {
				modifier = { # The comment actually has a basis
					factor = 2
					scope:enemy = {
						has_trait = beauty_bad
					}
				}
				modifier = { # It's a bit of a self-burn
					factor = 0.5
					root = {
						has_trait = beauty_bad
					}
				}
				modifier = { # You're actually like so hot omg
					add = attraction
				}
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = contest_events.5000.success
				send_interface_toast = {
					title = contest_events.5000.success
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = increase_medium }
					if = {
						limit = {
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = wit
							value = 2
						}
					}
				}
			}
			50 = {
				modifier = {
					add = scope:enemy.attraction
				}
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = contest_events.5000.failure
				send_interface_toast = {
					title = contest_events.5000.failure
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = decrease_medium }
				}
			}
		}
		progress_towards_rival_effect = {
			REASON = rival_recital_insult
			CHARACTER = scope:enemy
			OPINION = default_rival_opinion
		}
		stress_impact = {   
			base = minor_stress_impact_loss
			vengeful = minor_stress_impact_loss
			chaste = minor_stress_impact_loss
			humble = medium_stress_impact_gain
			beauty_bad_1 = medium_stress_impact_gain
			beauty_bad_2 = medium_stress_impact_gain
			beauty_bad_3 = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = humble
					has_trait = beauty_bad
				}
			}		
		}
	}
}

# You speak a different language to your opponent and you have no idea what they just said
# By James Beaumont
contest_events.5010 = {
	type = activity_event
	title = contest_events.5010.t
	desc = contest_events.5010.desc
	theme = tournament_contest
	window = widget_activity_locale_fullscreen_event
	left_portrait = {
		character = root
		animation = disbelief
	}
	right_portrait = {
		character = scope:enemy
		animation = schadenfreude
	}
	cooldown = { years = 1 }

	trigger = {
		scope:activity = {
			any_guest_subset_current_phase = {
				name = qualified
				contest_event_general_contestant_valid_trigger = yes
				NOT = { root = { knows_language_of_culture = prev.culture } }
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset_current_phase = {
				name = qualified
				limit = {
					contest_event_general_contestant_valid_trigger = yes
					NOT = { root = { knows_language_of_culture = prev.culture } }
				}
				save_scope_as = enemy
			}
		}
	}

	# Insult them?
	option = {
		name = contest_events.5010.a
		duel = {
			skill = intrigue
			target = scope:enemy
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = contest_events.5000.success
				send_interface_toast = {
					title = contest_events.5000.success
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = increase_minor }
					if = {
						limit = {
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = wit
							value = 10
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = contest_events.5000.failure
				send_interface_toast = {
					title = contest_events.5000.failure
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = decrease_medium }
				}
			}
		}
		progress_towards_rival_effect = {
			REASON = rival_recital_insult
			CHARACTER = scope:enemy
			OPINION = default_rival_opinion
		}
		stress_impact = {   
			base = minor_stress_impact_loss
			vengeful = minor_stress_impact_loss
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = forgiving
					has_trait = compassionate
				}
			}		
		}
	}

	# Try to guess what they meant
	option = {
		name = contest_events.5010.b
		duel = {
			skill = learning
			value = high_skill_rating
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = contest_events.5000.success
				send_interface_toast = {
					title = contest_events.5000.success
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = increase_major }
					if = {
						limit = {
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = wit
							value = 10
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = contest_events.5000.failure
				send_interface_toast = {
					title = contest_events.5000.failure
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = decrease_medium }
				}
			}
		}
		stress_impact = {   
			base = minor_stress_impact_loss
			dull = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
			vengeful = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = dull
					has_trait = impatient
					has_trait = vengeful
				}
			}		
		}
	}
}

# Your poem goes well, push your luck?
# By James Beaumont
contest_events.5020 = {
	type = activity_event
	title = contest_events.5020.t
	desc = contest_events.5020.desc
	theme = tournament_contest
	window = widget_activity_locale_fullscreen_event
	left_portrait = {
		character = root
		animation = ecstasy
	}
	cooldown = { years = 1 }

	trigger = {
		scope:activity = {
			any_guest_subset_current_phase = {
				name = qualified
				contest_event_general_contestant_valid_trigger = yes
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset_current_phase = {
				name = qualified
				limit = { contest_event_general_contestant_valid_trigger = yes }
				save_scope_as = enemy
			}
		}
		hidden_effect = { # Set up the scopes for the poem loc
			root = {
				select_poem_subject_gender_effect = {
					SUBJECT = flag:specific
					SUBJECT_TARGET = scope:enemy
				}
			}
		}
	}

	# Push your luck
	option = {
		name = contest_events.5020.a
		duel = {
			skill = diplomacy
			target = scope:enemy
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = contest_events.5000.success
				send_interface_toast = {
					title = contest_events.5000.success
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = increase_massive }
					if = {
						limit = {
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = wit
							value = 10
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = contest_events.5000.failure
				send_interface_toast = {
					title = contest_events.5000.failure
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = decrease_medium }
				}
			}
		}
		stress_impact = {   
			content = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = content
					has_trait = humble
				}
			}		
		}
	}

	# Play it safe and take a bow
	option = {
		name = contest_events.5020.b
		activity_tournament_change_contestant_score_effect = { SCORE = increase_minor }
		stress_impact = {   
			ambitious = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = ambitious
					has_trait = arrogant
					has_trait = stubborn
				}
			}
		}
	}
}

# Your poem goes poorly, try to salvage it?
# By James Beaumont
contest_events.5030 = {
	type = activity_event
	title = contest_events.5030.t
	desc = contest_events.5030.desc
	theme = tournament_contest
	window = widget_activity_locale_fullscreen_event
	left_portrait = {
		character = root
		animation = ecstasy
	}
	cooldown = { years = 1 }

	trigger = {
		scope:activity = {
			any_guest_subset_current_phase = {
				name = qualified
				contest_event_general_contestant_valid_trigger = yes
			}
		}
	}

	immediate = {
		scope:activity = {
			random_guest_subset_current_phase = {
				name = qualified
				limit = { contest_event_general_contestant_valid_trigger = yes }
				save_scope_as = enemy
			}
		}
	}

	# Push your luck
	option = {
		name = contest_events.5030.a
		duel = {
			skill = diplomacy
			target = scope:enemy
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = contest_events.5000.success
				send_interface_toast = {
					title = contest_events.5000.success
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = increase_medium }
					if = {
						limit = {
							has_trait = tourney_participant
						}
						add_trait_xp = {
							trait = tourney_participant
							track = wit
							value = 10
						}
					}
				}
			}
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = contest_events.5000.failure
				send_interface_toast = {
					title = contest_events.5000.failure
					right_icon = scope:enemy
					activity_tournament_change_contestant_score_effect = { SCORE = decrease_major }
				}
			}
		}
		stress_impact = {   
			content = medium_stress_impact_gain
			humble = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = content
					has_trait = humble
				}
			}		
		}
	}

	# Play it safe and take a bow
	option = {
		name = contest_events.5030.b
		activity_tournament_change_contestant_score_effect = { SCORE = decrease_minor }
		stress_impact = {   
			ambitious = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = ambitious
					has_trait = arrogant
					has_trait = stubborn
				}
			}
		}
	}
}
