﻿namespace = trait_specific_interactions

##################################################
# #Poetry Interaction Events
# 0001 - 0010	Romance
# 0011 - 0020	Mourning
# 0021 - 0030	Legacy
# 0031 - 0040	Strife
# 0041 - 0050	Incompetence
# 0051 - 0060	RESERVED
# 0061 - 0070	RESERVED
# 0071 - 0080	RESERVED
# 0081 - 0090	RESERVED
# 0091 - 0100	RESERVED
#	
##################################################

##################################################
# #Single combat Interaction Events
# 0101 - 0110	Wrathful
# 0111 - 0120	RESERVED
# 0121 - 0130	RESERVED
# 0131 - 0140	RESERVED
# 0141 - 0150	RESERVED
# 0151 - 0160	RESERVED
# 0161 - 0170	RESERVED
# 0171 - 0180	RESERVED
# 0181 - 0190	RESERVED
# 0191 - 0200	RESERVED
#	
##################################################










##################################################
# Poetry Interactions
# by Ewan Cowhig Croft
# 0001 - 0100
##################################################

#	A romantic poem has been sent to you.
trait_specific_interactions.0001 = {
	type = character_event
	title = trait_specific_interactions.0001.t
	desc = {
		desc = trait_specific_interactions.0001.desc.intro
		desc = trait_specific_interactions.0001.desc.poem
		desc = trait_specific_interactions.0001.desc.outro
	}
	theme = diplomacy
	left_portrait = {
		character = scope:recipient
		animation = personality_rational
	}
	right_portrait = {
		character = scope:actor
		animation = chancellor
	}
	override_background = { reference = study }

	# Diplomacy duel against scope:actor to negate the poem's publication.
	option = {
		name = trait_specific_interactions.0001.a

		# Enter the appropriate duel.
		send_poem_romance_duel_effect = { POV_TARGET = scope:actor }

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# Standard option, should always be picked by the AI.
			base = 100
			modifier = {
				factor = 0
				opinion = {
					target = scope:actor
					value >= high_positive_opinion
				}
			}
		}
	}

	# Accept the effects.
	option = {
		name = trait_specific_interactions.0001.b

		# Skip straight to the victory effects.
		send_poem_romance_duel_victory_notification_effect = yes

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# AI shouldn't pick this option...
			base = 0
			# ... without a high enough positive opinion that it becomes an auto-pick.
			trait_specific_poet_good_relations_modifier = yes
		}
	}

	# Reject the effects.
	option = {
		name = trait_specific_interactions.0001.c
		# Player-only option.
		trigger = { is_ai = no }

		# Skip straight to the defeat effects.
		send_poem_romance_duel_defeat_notification_effect = yes

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# Option unavailable for the AI.
			base = 0
		}
	}

	# Sort the general clean-up.
	after = {
		scope:actor = { cleanup_poem_effect = yes }
	}
}

#	A mournful poem has been sent to you.
trait_specific_interactions.0011 = {
	type = character_event
	title = trait_specific_interactions.0011.t
	desc = {
		desc = trait_specific_interactions.0011.desc.intro
		desc = trait_specific_interactions.0011.desc.poem
		desc = trait_specific_interactions.0011.desc.outro
	}
	theme = diplomacy
	left_portrait = {
		character = scope:recipient
		animation = sadness
	}
	right_portrait = {
		character = scope:actor
		animation = chancellor
	}
	override_background = { reference = study }

	# Diplomacy duel against scope:actor to negate the poem's publication.
	option = {
		name = trait_specific_interactions.0011.a

		# Enter the appropriate duel.
		send_poem_mourning_duel_effect = { POV_TARGET = scope:actor }

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# Standard option, should always be picked by the AI.
			base = 100
			modifier = {
				factor = 0
				opinion = {
					target = scope:actor
					value >= high_positive_opinion
				}
			}
		}
	}
	
	# Accept the effects.
	option = {
		name = trait_specific_interactions.0011.b

		# Skip straight to the victory effects.
		send_poem_mourning_duel_victory_notification_effect = yes

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# AI shouldn't pick this option...
			base = 0
			# ... without a high enough positive opinion that it becomes an auto-pick.
			trait_specific_poet_good_relations_modifier = yes
		}
	}

	# Reject the effects.
	option = {
		name = trait_specific_interactions.0011.c
		# Player-only option.
		trigger = { is_ai = no }

		# Skip straight to the defeat effects.
		send_poem_mourning_duel_defeat_notification_effect = yes

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# Option unavailable for the AI.
			base = 0
		}
	}

	# Sort the general clean-up.
	after = {
		scope:actor = { cleanup_poem_effect = yes }
	}
}

#	A poem about your legacy has been sent to you.
trait_specific_interactions.0021 = {
	type = character_event
	title = trait_specific_interactions.0021.t
	desc = {
		desc = trait_specific_interactions.0021.desc.intro
		desc = trait_specific_interactions.0021.desc.poem
		desc = trait_specific_interactions.0021.desc.outro
	}
	theme = diplomacy
	left_portrait = {
		character = scope:recipient
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:actor
		animation = chancellor
	}
	override_background = { reference = study }

	# Diplomacy duel against scope:actor to negate the poem's publication.
	option = {
		name = trait_specific_interactions.0021.a

		# Enter the appropriate duel.
		send_poem_legacy_duel_effect = { POV_TARGET = scope:actor }

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# Standard option, should always be picked by the AI.
			base = 100
			modifier = {
				factor = 0
				opinion = {
					target = scope:actor
					value >= high_positive_opinion
				}
			}
		}
	}
	
	# Accept the effects.
	option = {
		name = trait_specific_interactions.0021.b

		# Skip straight to the victory effects.
		send_poem_legacy_duel_victory_notification_effect = yes

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# AI shouldn't pick this option...
			base = 0
			# ... without a high enough positive opinion that it becomes an auto-pick.
			trait_specific_poet_good_relations_modifier = yes
		}
	}

	# Sort the general clean-up.
	after = {
		scope:actor = { cleanup_poem_effect = yes }
	}
}

#	A poem about strife & war has been sent to you.
trait_specific_interactions.0031 = {
	type = character_event
	title = trait_specific_interactions.0031.t
	desc = {
		desc = trait_specific_interactions.0031.desc.intro
		desc = trait_specific_interactions.0031.desc.poem
		desc = trait_specific_interactions.0031.desc.outro
	}
	theme = diplomacy
	left_portrait = {
		character = scope:recipient
		animation = personality_vengeful
	}
	right_portrait = {
		character = scope:actor
		animation = chancellor
	}
	override_background = { reference = study }

	# Diplomacy duel against scope:actor to negate the poem's publication.
	option = {
		name = trait_specific_interactions.0031.a

		# Enter the appropriate duel.
		send_poem_strife_duel_effect = { POV_TARGET = scope:actor }

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# Standard option, should always be picked by the AI.
			base = 100
			modifier = {
				factor = 0
				opinion = {
					target = scope:actor
					value >= high_positive_opinion
				}
			}
		}
	}
	
	# Accept the effects.
	option = {
		name = trait_specific_interactions.0031.b

		# Skip straight to the victory effects.
		send_poem_strife_duel_victory_notification_effect = yes

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# AI shouldn't pick this option...
			base = 0
			# ... without a high enough positive opinion that it becomes an auto-pick.
			trait_specific_poet_good_relations_modifier = yes
		}
	}

	# Sort the general clean-up.
	after = {
		scope:actor = { cleanup_poem_effect = yes }
	}
}

#	A poem tacitly accusing you of incompetence has been sent to you.
trait_specific_interactions.0041 = {
	type = character_event
	title = trait_specific_interactions.0041.t
	desc = {
		desc = trait_specific_interactions.0041.desc.intro
		desc = trait_specific_interactions.0041.desc.poem
		desc = trait_specific_interactions.0041.desc.outro
	}
	theme = diplomacy
	left_portrait = {
		character = scope:recipient
		animation = anger
	}
	right_portrait = {
		character = scope:actor
		animation = chancellor
	}
	override_background = { reference = study }

	# Diplomacy duel against scope:actor to negate the poem's publication.
	option = {
		name = trait_specific_interactions.0041.a

		# Enter the appropriate duel.
		send_poem_incompetence_duel_effect = { POV_TARGET = scope:actor }

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# Standard option, should always be picked by the AI.
			base = 100
			modifier = {
				factor = 0
				opinion = {
					target = scope:actor
					value >= high_positive_opinion
				}
			}
		}
	}
	
	# Accept the effects.
	option = {
		name = trait_specific_interactions.0041.b

		# Skip straight to the victory effects.
		send_poem_incompetence_duel_victory_notification_effect = yes

		# No stress impact outside of the duel's actual effects.
		ai_chance = {
			# AI shouldn't pick this option...
			base = 0
			# ... without a high enough positive opinion that it becomes an auto-pick.
			trait_specific_poet_good_relations_modifier = yes
		}
	}

	# Sort the general clean-up.
	after = {
		scope:actor = { cleanup_poem_effect = yes }
	}
}


#	Wrathful duel: Initiate imprison sequence
trait_specific_interactions.0151 = {
	hidden = yes

	immediate = {
		# Fire the follow-up stuff; delay this by a day so the toasts appear _after_ the final event.
		trigger_event = {
			id = trait_specific_interactions.0152
			days = 1
		}
	}
}

trait_specific_interactions.0152 = {
	hidden = yes

	immediate = {		
		# And to the loser.
		
		# Then execute the actual effects.
		if = {
			limit = {
				scope:sc_victor = scope:sc_initiator
			}
			#Apply the imprisonment
			# Send out a toast to the victor.
			scope:sc_victor = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_succeeded.victor.t
					left_icon = scope:sc_victor
					right_icon = scope:sc_loser
					show_as_tooltip = { 
						hard_imprison_character_effect = {
							TARGET = scope:sc_loser
							IMPRISONER = scope:sc_victor
						}
					}
				}
			}

			scope:sc_loser = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_succeeded.loser.t
					left_icon = scope:sc_loser
					right_icon = scope:sc_victor
					show_as_tooltip = { 
						hard_imprison_character_effect = {
							TARGET = scope:sc_loser
							IMPRISONER = scope:sc_victor
						}
					}
				}
			}

			hard_imprison_character_effect = {
				TARGET = scope:sc_loser
				IMPRISONER = scope:sc_victor
			}
			consume_imprisonment_reasons = scope:sc_loser
		}
		else = {
			scope:sc_victor = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_failed.victor.t
					left_icon = scope:sc_victor
					right_icon = scope:sc_loser
					#add a text
					show_as_tooltip = { 
						scope:sc_loser = { 
							stress_impact = {
								base = massive_stress_impact_gain
							}
						}
					}
				}
			}
			
			#the initiator is stressed out because they lost
			scope:sc_loser = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_failed.loser.t
					left_icon = scope:sc_loser
					right_icon = scope:sc_victor
					
					stress_impact = {
						base = massive_stress_impact_gain
					}
					consume_execute_reasons = scope:sc_victor
				}
			}
		}
	}
}

trait_specific_interactions.0153 = {
	hidden = yes

	immediate = {
		# Fire the follow-up stuff; delay this by a day so the toasts appear _after_ the final event.
		trigger_event = {
			id = trait_specific_interactions.0154
			days = 1
		}
	}
}

trait_specific_interactions.0154 = {
	hidden = yes

	immediate = {		
		# Then execute the actual effects.
		if = {
			limit = {
				scope:sc_victor = scope:sc_initiator
			}
			#Apply the imprisonment
			# Send out a toast to the victor.
			scope:sc_victor = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_succeeded.victor.t
					left_icon = scope:sc_victor
					right_icon = scope:sc_loser
					show_as_tooltip = { 
						scope:sc_loser = {
							banish = yes
						}
					}
				}
			}

			scope:sc_loser = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_succeeded.loser.t
					left_icon = scope:sc_loser
					right_icon = scope:sc_victor
					show_as_tooltip = { 
						scope:sc_loser = {
							banish = yes
						}
					}
				}
			}

			scope:sc_loser = {
				banish_effect = { BANISHER = scope:sc_victor }
			}
			consume_banish_reasons = scope:sc_loser
		}
		else = {
			scope:sc_victor = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_failed.victor.t
					left_icon = scope:sc_victor
					right_icon = scope:sc_loser
					#add a text
					show_as_tooltip = { 
						scope:sc_loser = { 
							stress_impact = {
								base = massive_stress_impact_gain
							}
						}
					}
				}
			}
			
			#the initiator is stressed out because they lost
			scope:sc_loser = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_failed.loser.t
					left_icon = scope:sc_loser
					right_icon = scope:sc_victor
					
					stress_impact = {
						base = massive_stress_impact_gain
					}
					consume_execute_reasons = scope:sc_victor
				}
			}
		}
	}
}


trait_specific_interactions.0155 = {
	hidden = yes

	immediate = {
		# Fire the follow-up stuff; delay this by a day so the toasts appear _after_ the final event.
		trigger_event = {
			id = trait_specific_interactions.0156
			days = 1
		}
	}
}

trait_specific_interactions.0156 = {
	hidden = yes

	immediate = {		
		# Then execute the actual effects.
		if = {
			limit = {
				scope:sc_victor = scope:sc_initiator
			}
			#Apply the imprisonment
			# Send out a toast to the victor.
			scope:sc_victor = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_succeeded.victor.t
					left_icon = scope:sc_victor
					right_icon = scope:sc_loser
					show_as_tooltip = { 
						execute_prisoner_effect = {
							VICTIM = scope:sc_loser
							EXECUTIONER = scope:sc_victor
						}
					}
				}
			}

			scope:sc_loser= {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_succeeded.loser.t
					left_icon = scope:sc_loser
					right_icon = scope:sc_victor
					show_as_tooltip = { 
						execute_prisoner_effect = {
							VICTIM = scope:sc_loser
							EXECUTIONER = scope:sc_victor
						}
					}
				}
			}

			execute_prisoner_effect = {
				VICTIM = scope:sc_loser
				EXECUTIONER = scope:sc_victor
			}
		}
		else = {
			scope:sc_victor = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_failed.victor.t
					left_icon = scope:sc_victor
					right_icon = scope:sc_loser
					#add a text
					show_as_tooltip = { 
						scope:sc_loser = { 
							stress_impact = {
								base = massive_stress_impact_gain
							}
						}
					}
				}
			}
			
			#the initiator is stressed out because they lost
			scope:sc_loser = {
				send_interface_toast = {
					title = force_duel_criminals_interaction.punishment_failed.loser.t
					left_icon = scope:sc_loser
					right_icon = scope:sc_victor
					
					stress_impact = {
						base = massive_stress_impact_gain
					}

					consume_execute_reasons = scope:sc_victor
				}
			}
		}
	}
}
