﻿namespace = diplomacy_generic

# Diplomacy (Generic) Events:
	#0012 - 0014: Social Manipulation (Put a vassal in their place by manipulating them), by Mathilda Bjarnehed

#############################
# Social Manipulation		#
# 0012 - 0015				#
# by Mathilda Bjarnehed		#
#############################

scripted_trigger diplomacy_generic_0012_disobedient_subject = {
	is_available_adult = yes
	OR = {
		opinion = {
			target = root
			value < 10
		}
		AND = {
			opinion = {
				target = root
				value < 30
			}
			OR = {
				has_trait = ambitious
				has_trait = greedy
				has_trait = wrathful
				has_trait = arrogant
				has_trait = deceitful
				has_trait = paranoid
				has_trait = stubborn
				has_trait = vengeful
			}
		}
	}
	NOT = {
		has_trait = content
	}
	root = {
		NOT = {
			has_hook = prev #Because there's a chance to gain a hook (added in diplomacy_generic_0012_good_outcome_effect)
		}
	}
}

scripted_trigger diplomacy_generic_0012_weak_to_make_invisible = {
	OR = {
		ai_energy <= medium_negative_energy
		ai_boldness <= medium_negative_boldness
		ai_greed <= medium_negative_greed
		has_personality_introverted_trigger = yes
	}
}

scripted_trigger diplomacy_generic_0012_resistant_to_make_invisible = {
	OR = {
		ai_energy >= medium_positive_energy
		ai_boldness >= medium_positive_boldness
		ai_greed >= medium_positive_energy
		has_personality_extroverted_trigger = yes
	}
}

scripted_trigger diplomacy_generic_0012_weak_to_ridicule = {
	OR = {
		ai_rationality <= medium_negative_rationality
		ai_compassion >= medium_positive_compassion
		has_personality_emotional_trigger = yes
		has_personality_annoying_trigger = yes
		has_trait = leper
		has_trait = maimed
		has_trait = disfigured
		has_trait = infirm
		has_trait = eunuch
		has_trait = blind
		has_trait = beauty_bad_1
		has_trait = beauty_bad_2
		has_trait = beauty_bad_3
		has_trait = physique_bad_2
		has_trait = physique_bad_3
		has_trait = clubfooted
		has_trait = hunchbacked
		has_trait = lisping
		has_trait = stuttering
		has_trait = dwarf
		has_trait = giant
		has_trait = weak
		has_trait = spindly
		has_trait = scaly
		has_trait = albino
		has_trait = wheezing
	}
}

scripted_trigger diplomacy_generic_0012_resistant_to_ridicule = {
	OR = {
		AND = {
			diplomacy_generic_0012_weak_to_ridicule = no
			OR = {
				ai_rationality >= medium_positive_rationality
				ai_compassion <= medium_negative_compassion
			}
		}
		has_personality_levelheaded_trigger = yes
	}
}

scripted_trigger diplomacy_generic_0012_weak_to_withhold_information = {
	OR = {
		ai_rationality <= medium_negative_rationality
		has_personality_introverted_trigger = yes
	}
}

scripted_trigger diplomacy_generic_0012_resistant_to_withhold_information = {
	OR = {
		ai_rationality >= medium_positive_rationality
		has_personality_extroverted_trigger = yes
	}
}

scripted_trigger diplomacy_generic_0012_weak_to_impossible_task = {
	OR = {
		ai_energy >= medium_positive_energy
		ai_rationality >= medium_positive_rationality
		ai_greed >= medium_positive_greed
	}
}

scripted_trigger diplomacy_generic_0012_resistant_to_impossible_task = {
	OR = {
		ai_energy <= medium_negative_energy
		ai_rationality <= medium_negative_rationality
		ai_greed <= medium_negative_greed
	}
}

scripted_trigger diplomacy_generic_0012_weak_to_shame = {
	OR = {
		ai_honor >= medium_positive_honor
		ai_compassion >= medium_positive_compassion
		has_personality_submissive_trigger = yes
	}
}

scripted_trigger diplomacy_generic_0012_resistant_to_shame = {
	OR = {
		ai_honor <= medium_negative_honor
		ai_compassion <= medium_negative_compassion
		has_personality_dominant_trigger = yes
	}	
}

scripted_trigger diplomacy_generic_0012_weak_to_objectification = {
	OR = {
		AND = {
			sex_opposite_of = root
			attraction >= 10
		}
		has_trait = beauty_good_2
		has_trait = beauty_good_3
		has_trait = lustful
		has_trait = strong
	}
}

scripted_trigger diplomacy_generic_0012_weak_to_threat = {
	OR = {
		ai_boldness <= medium_negative_boldness
		ai_vengefulness <= medium_negative_vengefulness
	}
}

scripted_trigger diplomacy_generic_0012_resistant_to_threat = {
	OR = {
		ai_boldness >= medium_positive_boldness
		ai_vengefulness >= medium_positive_vengefulness
	}
}

scripted_effect diplomacy_generic_0012_good_outcome_effect = {
	scope:suppressor = {
		if = { #If you've gained a hook on them during this chain that needs to be caught
			limit = {
				has_hook = scope:disobedient_subject
			}
			add_prestige = major_prestige_gain
			if = {
				limit = { root = scope:suppressor }
				reverse_add_opinion = {
					target = scope:disobedient_subject
					modifier = respect_opinion
					opinion = 40
				}
			}
			else = {
				hidden_effect = { #Hide this part if the viewer isn't suppressor = doesn't care
					reverse_add_opinion = {
						target = scope:disobedient_subject
						modifier = respect_opinion
						opinion = 40
					}
				}
			}
		}
		else = { #But if you didn't get a magical hook during the time of this chain, go ahead and add one.
			add_hook = { #We first check that you don't have a hook on disobedient subject in statecraft_ongoing_0012_disobedient_subject trigger
				type = manipulation_hook
				target = scope:disobedient_subject
			}
			if = {
				limit = { root = scope:suppressor }
				reverse_add_opinion = {
					target = scope:disobedient_subject
					modifier = respect_opinion
					opinion = 20
				}
			}
			else = {
				hidden_effect = { #Hide this part if the viewer isn't suppressor = doesn't care
					reverse_add_opinion = {
						target = scope:disobedient_subject
						modifier = respect_opinion
						opinion = 20
					}
				}
			}
		}
	}
}

scripted_effect diplomacy_generic_0012_bad_outcome_effect = {
	scope:suppressor = {
		if = {
			limit = { root = scope:suppressor }
			reverse_add_opinion = {
				target = scope:disobedient_subject
				opinion = -15
				modifier = cruelty_opinion
			}
		}
		else = {
			hidden_effect = { #Hide this part if the viewer isn't suppressor = doesn't care
				reverse_add_opinion = {
					target = scope:disobedient_subject
					opinion = -15
					modifier = cruelty_opinion
				}
			}
		}
		if = {
			limit = {
				can_set_relation_potential_rival_trigger = { CHARACTER = scope:disobedient_subject }
			}
			hidden_effect = { set_relation_potential_rival = scope:disobedient_subject }
		}
	}
}

scripted_effect diplomacy_generic_0012_terrible_outcome_effect = {
	scope:suppressor = {
		add_prestige = medium_prestige_loss
		if = {
			limit = { root = scope:suppressor }
			reverse_add_opinion = {
				target = scope:disobedient_subject
				opinion = -15
				modifier = cruelty_opinion
			}
		}
		else = {
			hidden_effect = { #Hide this part if the viewer isn't suppressor = doesn't care
				reverse_add_opinion = {
					target = scope:disobedient_subject
					opinion = -15
					modifier = cruelty_opinion
				}
			}
		}
	}
	scope:disobedient_subject = {
		if = {
			limit = { root = scope:disobedient_subject }
			add_prestige = medium_prestige_gain
			reverse_add_opinion = {
				target = scope:suppressor
				modifier = respect_opinion
				opinion = 10
			}
		}
		else = {
			hidden_effect = { #Hide this part if the viewer isn't suppressor = doesn't care
				add_prestige = medium_prestige_gain
				reverse_add_opinion = {
					target = scope:suppressor
					modifier = respect_opinion
					opinion = 10
				}
			}
		}
	}
}



scripted_effect diplomacy_generic_0012_tooltip_effect = {
	add_diplomacy_lifestyle_xp = minor_lifestyle_xp
	show_as_tooltip = {
		random_list = {
			1 = {
				desc = diplomacy_generic.0012.good_outcome.desc
				show_chance = no
				diplomacy_generic_0012_good_outcome_effect = yes
			}
			1 = {
				desc = diplomacy_generic.0012.bad_outcome.desc
				show_chance = no
				diplomacy_generic_0012_bad_outcome_effect = yes
			}
			1 = {
				desc = diplomacy_generic.0012.terrible_outcome.desc
				show_chance = no
				diplomacy_generic_0012_terrible_outcome_effect = yes
			}
		}
	}
}



diplomacy_generic.0012 = {
	type = character_event
	title = diplomacy_generic.0012.t
	desc = {
		desc = diplomacy_generic.0012.start.desc
		random_valid = {
			triggered_desc = {
				trigger = { scope:disobedient_subject = { is_normal_councillor = yes } }
				desc = diplomacy_generic.0012.council.desc
			}
			triggered_desc = {
				trigger = { scope:disobedient_subject = { is_normal_councillor = no } }
				desc = diplomacy_generic.0012.vassal.desc
			}
		}
		desc = diplomacy_generic.0012.end.desc
	}
	theme = diplomacy
	override_background = {
		trigger = { scope:disobedient_subject = { is_normal_councillor = yes } }
		event_background = council_chamber
	}
	left_portrait = scope:disobedient_subject
	
	trigger = {
		NOT = { has_character_flag = had_event_diplomacy_generic_0012 }
		OR = {
			any_vassal = {
				diplomacy_generic_0012_disobedient_subject = yes
			}
			any_normal_councillor = {
				diplomacy_generic_0012_disobedient_subject = yes
			}
		}
	}

	immediate = {
		add_character_flag = {
			flag = had_event_diplomacy_generic_0012
			days = 1825
		}
		if = {
			limit = {
				is_ai = no
			}
			add_character_flag = {
				flag = had_recent_lifestyle_ongoing_event_diplomacy
				years = ongoing_lifestyle_event_delay
			}
		}
		else = {
			add_character_flag = {
				flag = had_recent_lifestyle_ongoing_event
				years = ongoing_lifestyle_event_delay
			}
		}
		save_scope_as = suppressor
		#Find all potential troublemakers
		every_vassal = {
			limit = { diplomacy_generic_0012_disobedient_subject = yes }
			add_to_temporary_list = disobedient_subject_options
		}
		every_normal_councillor = {
			limit = { diplomacy_generic_0012_disobedient_subject = yes }
			add_to_temporary_list = disobedient_subject_options
		}

		#Pick the troublemaker
		random_in_list = {
			list = disobedient_subject_options
			weight = {
				base = 1
				opinion_modifier = {
					opinion_target = root
					multiplier = -0.3 #Adds 30 for -100 opinion
					min = 1
				}
				modifier = {
					add = 10
					OR = {
						ai_greed >= medium_positive_greed
						ai_rationality <= medium_negative_rationality
						ai_vengefulness >= medium_positive_vengefulness
					}
				}
				modifier = {
					add = 20
					OR = {
						diplomacy_generic_0012_weak_to_make_invisible = yes
						diplomacy_generic_0012_weak_to_ridicule = yes
						diplomacy_generic_0012_weak_to_withhold_information = yes
						diplomacy_generic_0012_weak_to_impossible_task = yes
						diplomacy_generic_0012_weak_to_shame = yes
						diplomacy_generic_0012_weak_to_objectification = yes
						diplomacy_generic_0012_weak_to_threat = yes
					}
				}
				modifier = {
					add = 50
					is_powerful_vassal = yes
				}
			}
			save_scope_as = disobedient_subject

			hidden_effect = {
				if = {	
					limit = {
						can_set_relation_potential_rival_trigger = { CHARACTER = root }
					}
					set_relation_potential_rival = root
				}
			}
		}

		#Select the 3 available supression techniques (one good, one bad, one random)
		random_list = {
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_weak_to_make_invisible = yes } }
				add_character_flag = { flag = make_invisible_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_weak_to_ridicule = yes } }
				add_character_flag = { flag = ridicule_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_weak_to_withhold_information = yes } }
				add_character_flag = { flag = withhold_information_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_weak_to_impossible_task = yes } }
				add_character_flag = { flag = impossible_task_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_weak_to_shame = yes } }
				add_character_flag = { flag = shame_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_weak_to_objectification = yes } }
				add_character_flag = { flag = objectification_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_weak_to_threat = yes } }
				add_character_flag = { flag = threat_option days = 30 }
			}
			1 = {
				add_character_flag = { flag = make_invisible_option days = 30 } #Fallback
			}
		}
		random_list = {
			100 = {
				trigger = {
					scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_make_invisible = yes }
					NOT = { has_character_flag = make_invisible_option }
				}
				add_character_flag = { flag = make_invisible_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_ridicule = yes } }
				add_character_flag = { flag = ridicule_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_withhold_information = yes } }
				add_character_flag = { flag = withhold_information_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_impossible_task = yes } }
				add_character_flag = { flag = impossible_task_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_shame = yes } }
				add_character_flag = { flag = shame_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_weak_to_objectification = no } }
				add_character_flag = { flag = objectification_option days = 30 }
			}
			100 = {
				trigger = { scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_threat = yes } }
				add_character_flag = { flag = threat_option days = 30 }
			}
			1 = {
				add_character_flag = { flag = ridicule_option days = 30 } #Fallback
			}
		}
		random_list = {
			100 = {
				trigger = { NOT = { has_character_flag = make_invisible_option } }
				add_character_flag = { flag = make_invisible_option days = 30 }
			}
			100 = {
				trigger = { NOT = { has_character_flag = ridicule_option } }
				add_character_flag = { flag = ridicule_option days = 30 }
			}
			100 = {
				trigger = { NOT = { has_character_flag = withhold_information_option } }
				add_character_flag = { flag = withhold_information_option days = 30 }
			}
			100 = {
				trigger = { NOT = { has_character_flag = impossible_task_option } }
				add_character_flag = { flag = impossible_task_option days = 30 }
			}
			100 = {
				trigger = { NOT = { has_character_flag = shame_option } }
				add_character_flag = { flag = shame_option days = 30 }
			}
			100 = {
				trigger = { NOT = { has_character_flag = objectification_option } }
				add_character_flag = { flag = objectification_option days = 30 }
			}
			100 = {
				trigger = { NOT = { has_character_flag = threat_option } }
				add_character_flag = { flag = threat_option days = 30 }
			}
		}
	}

	#Make invisible
	option = {
		trigger = { has_character_flag = make_invisible_option }
		name = diplomacy_generic.0012.a
		flavor = make_invisible_option.tt
		diplomacy_generic_0012_tooltip_effect = yes

		save_scope_value_as = { name = technique value = flag:make_invisible }

		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			craven = minor_stress_impact_gain
		}
	}

	#Ridicule
	option = {
		trigger = { has_character_flag = ridicule_option }
		name = diplomacy_generic.0012.b
		flavor = ridicule_option.tt
		diplomacy_generic_0012_tooltip_effect = yes

		save_scope_value_as = { name = technique value = flag:ridicule }

		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			craven = minor_stress_impact_gain
		}
	}
	
	#Withhold information
	option = {
		trigger = { has_character_flag = withhold_information_option }
		name = diplomacy_generic.0012.c
		flavor = withhold_information_option.tt
		diplomacy_generic_0012_tooltip_effect = yes

		save_scope_value_as = { name = technique value = flag:withhold_information }

		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			craven = minor_stress_impact_gain
		}
	}

	#Impossible task
	option = {
		trigger = { has_character_flag = impossible_task_option }
		name = diplomacy_generic.0012.d
		flavor = impossible_task_option.tt
		diplomacy_generic_0012_tooltip_effect = yes

		save_scope_value_as = { name = technique value = flag:impossible_task }

		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			craven = minor_stress_impact_gain
		}
	}

	#Put to shame
	option = {
		trigger = { has_character_flag = shame_option }
		name = diplomacy_generic.0012.e
		flavor = shame_option.tt
		diplomacy_generic_0012_tooltip_effect = yes

		save_scope_value_as = { name = technique value = flag:shame }

		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			craven = minor_stress_impact_gain
		}
	}

	#Objectification
	option = {
		trigger = { has_character_flag = objectification_option }
		name = diplomacy_generic.0012.f
		flavor = objectification_option.tt
		diplomacy_generic_0012_tooltip_effect = yes

		save_scope_value_as = { name = technique value = flag:objectification }

		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			chaste = minor_stress_impact_gain
		}
	}

	#Threat of force
	option = {
		trigger = { has_character_flag = threat_option }
		name = diplomacy_generic.0012.g
		flavor = threat_option.tt
		diplomacy_generic_0012_tooltip_effect = yes

		save_scope_value_as = { name = technique value = flag:threat }

		stress_impact = {
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			craven = minor_stress_impact_gain
		}
	}

	#Shut up, I'm the king
	option = {
		name = diplomacy_generic.0012.h
		flavor = diplomacy_generic.0012.tt

		stress_impact = {
			compassionate =minor_stress_impact_gain
			calm = minor_stress_impact_gain
			deceitful = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
			shy = minor_stress_impact_gain
			fickle = minor_stress_impact_gain
			craven = minor_stress_impact_gain
		}
		
		reverse_add_opinion = {
			target = scope:disobedient_subject
			opinion = -5
			modifier = scared_opinion
		}
		add_dread = minor_dread_gain
	}

	#First success/fail check (weak = "guaranteed" success, resistant = "guaranteed" failure, otherwise 60/40)
	after = {
		hidden_effect = {
			remove_character_flag = make_invisible_option
			remove_character_flag = ridicule_option
			remove_character_flag = withhold_information_option
			remove_character_flag = impossible_task_option
			remove_character_flag = shame_option
			remove_character_flag = objectification_option
			remove_character_flag = threat_option

			random_list = {
				300 = { #Success
					trigger = {
						exists = scope:technique
					}
					modifier = {
						#They are resistant to this technique (extremely low chance of success)
						OR = {
							AND = {
								scope:technique = flag:make_invisible
								scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_make_invisible = yes }
							}
							AND = {
								scope:technique = flag:ridicule
								scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_ridicule = yes }
							}
							AND = {
								scope:technique = flag:withhold_information
								scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_withhold_information = yes }
							}
							AND = {
								scope:technique = flag:impossible_task
								scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_impossible_task = yes }
							}
							AND = {
								scope:technique = flag:shame
								scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_shame = yes }
							}
							AND = {
								scope:technique = flag:objectification
								scope:disobedient_subject = { diplomacy_generic_0012_weak_to_objectification = no } #There's no "resistant to objectification"
							}
							AND = {
								scope:technique = flag:threat
								scope:disobedient_subject = { diplomacy_generic_0012_resistant_to_threat = yes }
							}
						}
						factor = 0.01
					}
					scope:disobedient_subject = { trigger_event = { id = diplomacy_generic.0013 days = { 5 10 } } }
				}
				200 = { #Failure
					trigger = {
						exists = scope:technique
					}
					modifier = { #They are weak to this technique (extremely low chance of failure)
						OR = {
							AND = {
								scope:technique = flag:make_invisible
								scope:disobedient_subject = { diplomacy_generic_0012_weak_to_make_invisible = yes }
							}
							AND = {
								scope:technique = flag:ridicule
								scope:disobedient_subject = { diplomacy_generic_0012_weak_to_ridicule = yes }
							}
							AND = {
								scope:technique = flag:withhold_information
								scope:disobedient_subject = { diplomacy_generic_0012_weak_to_withhold_information = yes }
							}
							AND = {
								scope:technique = flag:impossible_task
								scope:disobedient_subject = { diplomacy_generic_0012_weak_to_impossible_task = yes }
							}
							AND = {
								scope:technique = flag:shame
								scope:disobedient_subject = { diplomacy_generic_0012_weak_to_shame = yes }
							}
							AND = {
								scope:technique = flag:objectification
								scope:disobedient_subject = { diplomacy_generic_0012_weak_to_objectification = yes }
							}
							AND = {
								scope:technique = flag:threat
								scope:disobedient_subject = { diplomacy_generic_0012_weak_to_threat = yes }
							}
						}
						factor = 0.01
					}
					send_interface_toast = {
						left_icon = scope:disobedient_subject
						title = diplomacy_generic.0012.failure.desc
						diplomacy_generic_0012_bad_outcome_effect = yes
					}
				}
			}
		}
	}
}	

#My liege used a suppression technique on me
diplomacy_generic.0013 = {
	type = character_event
	title = diplomacy_generic.0013.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:technique = flag:make_invisible }
				desc = diplomacy_generic.0013.make_invisible.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:ridicule }
				desc = diplomacy_generic.0013.ridicule.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:withhold_information }
				desc = diplomacy_generic.0013.withhold_information.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:impossible_task }
				desc = diplomacy_generic.0013.impossible_task.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:shame }
				desc = diplomacy_generic.0013.shame.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:objectification }
				desc = diplomacy_generic.0013.objectification.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:threat }
				desc = diplomacy_generic.0013.threat.desc
			}
		}
	}
	theme = diplomacy
	override_background = {
		trigger = { scope:disobedient_subject = { is_normal_councillor = yes } }
		event_background = council_chamber
	}
	left_portrait = scope:suppressor

	trigger = {
		scope:suppressor = { is_alive = yes }
	}

	#Fight back
	option = {
		name = diplomacy_generic.0013.a
		
		duel = {
			skill = diplomacy
			target = scope:suppressor
			15 = { #Success 		
				compare_modifier = {
					value = scope:duel_value
					multiplier = 1
				}
				desc = diplomacy_generic.0013.a.success.tt
				send_interface_toast = {
					left_icon = scope:suppressor
					title = diplomacy_generic.0013.a.success.tt
					show_as_tooltip = { diplomacy_generic_0012_terrible_outcome_effect = yes }
					scope:suppressor = {
						hidden_effect = {
							trigger_event = { id = diplomacy_generic.0015 }
						}
					}
				}
			}
			15 = { #Failure 		
				compare_modifier = {
					value = scope:duel_value
					multiplier = -1
				}
				modifier = {
					factor = 2
					OR = {
						AND = {
							diplomacy_generic_0012_weak_to_make_invisible = yes
							scope:technique = flag:make_invisible
						}
						AND = {
							diplomacy_generic_0012_weak_to_ridicule = yes
							scope:technique = flag:ridicule
						}
						AND = {
							diplomacy_generic_0012_weak_to_withhold_information = yes
							scope:technique = flag:withhold_information
						}
						AND = {
							diplomacy_generic_0012_weak_to_impossible_task = yes
							scope:technique = flag:impossible_task
						}
						AND = {
							diplomacy_generic_0012_weak_to_shame = yes
							scope:technique = flag:shame
						}
						AND = {
							diplomacy_generic_0012_weak_to_objectification = yes
							scope:technique = flag:objectification
						}
						AND = {
							diplomacy_generic_0012_weak_to_threat = yes
							scope:technique = flag:threat
						}
					}
				}


				desc = diplomacy_generic.0013.a.failure.tt
				send_interface_toast = {
					left_icon = scope:suppressor
					title = diplomacy_generic.0013.a.failure.tt
				
					show_as_tooltip = { diplomacy_generic_0012_good_outcome_effect = yes }
					add_prestige = medium_prestige_loss #Additional penalty for trying

					scope:suppressor = {
						hidden_effect = {
							trigger_event = { id = diplomacy_generic.0014 }
						}
					}
				}
			}
		}

		ai_chance = {
			base = 50
			ai_value_modifier = {
				ai_boldness = high_chance_impact_positive_boldness
				ai_greed = low_chance_impact_positive_greed
			}
			modifier = {
				diplomacy > scope:suppressor.diplomacy
				add = 50
			}
		}
	}

	#Accept defeat
	option = {
		name = diplomacy_generic.0013.b

		show_as_tooltip = { diplomacy_generic_0012_good_outcome_effect = yes }
		reverse_add_opinion = { #A bonus for giving up
			target = scope:suppressor
			modifier = pleased_opinion
			opinion = 15
		}

		hidden_effect = {
			scope:suppressor = {
				trigger_event = diplomacy_generic.0014
			}
		}

		ai_chance = {
			base = 150
		}
	}
}

#I succeeded with my suppression technique!
diplomacy_generic.0014 = {
	type = character_event
	title = diplomacy_generic.0014.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:technique = flag:make_invisible }
				desc = diplomacy_generic.0014.make_invisible.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:ridicule }
				desc = diplomacy_generic.0014.ridicule.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:withhold_information }
				desc = diplomacy_generic.0014.withhold_information.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:impossible_task }
				desc = diplomacy_generic.0014.impossible_task.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:shame }
				desc = diplomacy_generic.0014.shame.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:objectification }
				desc = diplomacy_generic.0014.objectification.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:threat }
				desc = diplomacy_generic.0014.threat.desc
			}
		}
		desc = diplomacy_generic.0014.end.desc	
	}
	theme = diplomacy
	override_background = {
		trigger = { scope:disobedient_subject = { is_normal_councillor = yes } }
		event_background = council_chamber
	}
	left_portrait = {
		character = scope:disobedient_subject
		animation = shame
	}

	immediate = {
		diplomacy_generic_0012_good_outcome_effect = yes
	}

	option = {
		name = {
			trigger = { ai_compassion < 0 }
			text = diplomacy_generic.0014.a.cruel
		}
		name = {
			trigger = { ai_compassion >= 0 }
			text = diplomacy_generic.0014.a.compassionate
		}
	}
}


#I failed and they manipulated me right back...
diplomacy_generic.0015 = {
	type = character_event
	title = diplomacy_generic.0015.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { scope:technique = flag:make_invisible }
				desc = diplomacy_generic.0015.make_invisible.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:ridicule }
				desc = diplomacy_generic.0015.ridicule.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:withhold_information }
				desc = diplomacy_generic.0015.withhold_information.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:impossible_task }
				desc = diplomacy_generic.0015.impossible_task.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:shame }
				desc = diplomacy_generic.0015.shame.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:objectification }
				desc = diplomacy_generic.0015.objectification.desc
			}
			triggered_desc = {
				trigger = { scope:technique = flag:threat }
				desc = diplomacy_generic.0015.threat.desc
			}
		}
	}
	theme = diplomacy
	left_portrait = {
		character = scope:disobedient_subject
		animation = personality_bold
	}
	
	immediate = {
		diplomacy_generic_0012_terrible_outcome_effect = yes
	}

	option = {
		name = diplomacy_generic.0015.a
	}
}