﻿

#courtier and guests
brand_criminal_interaction = {
	icon = icon_scheme_convert_to_witchcraft
	category = interaction_category_hostile
 #	common_interaction = yes
	interface_priority = 60

	desc = brand_criminal_interaction_desc

	cooldown = { years = 1 }
	cooldown_against_recipient = { years = 3 }

	is_shown = {
		has_game_rule = GPT_interactions_enabled
		NOT = { scope:recipient = scope:actor }
		
		scope:actor = {
			highest_held_title_tier >= 2
			is_adult = yes
			NOT = {
				has_imprisonment_reason = scope:recipient
			}
		}

		scope:recipient = {
			is_adult = yes
			OR = {
			 #	is_vassal_or_below_of = scope:actor
				is_courtier_of = scope:actor
				is_foreign_court_or_pool_guest_of = scope:actor
			}
		}
	}

	is_valid_showing_failures_only = {
		scope:actor.intrigue >= 12
		scope:actor.prestige >= 0
		scope:actor = { NOT = { has_trait = just } }
		scope:actor = { NOT = { has_trait = honest } }
		scope:recipient = { basic_is_available_ai = yes }
	}

	on_auto_accept = {
		#scope:recipient = {
			#trigger_event = char_interaction.0120
		#}
	}

	cost = {
		prestige = {
			value = 50
			multiply = scope:actor.highest_held_title_tier
		}
	}

	on_accept = {
		scope:actor = {
			duel = {
				skill = intrigue
				target = scope:recipient
				50 = {
					desc = gpt_imputecrime_interaction_tt.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -20
					}
					send_interface_toast = {
						title = freehold_brand_criminal_interaction_notification_title
						left_icon = scope:actor
						right_icon = scope:recipient

						show_as_tooltip = {
							custom_tooltip = {
								text = freehold_brand_criminal_interaction_toast
							}
						}
					}

					scope:actor = {
						stress_impact = {
							just = 40
							honest = 40
							forgiving = 30
							content = 20
							compassionate = 20
						}

						stress_impact = {
							arbitrary = -16
							deceitful = -16
							vengeful = -12
							ambitious = -8
							sadistic = -8
						}

						add_opinion = {
							target = scope:recipient
							modifier = branded_criminal_crime
							opinion = -20
						}	
					}

					scope:recipient = {
						# Forgiving characters lose a little less.
						if = {
							limit = { has_trait = forgiving }
							add_opinion = {
								target = scope:actor
								modifier = gpt_brand_crim_op1
								opinion = -15
							}
						}
						# Otherwise, folks do be mad.
						else = {
							add_opinion = {
								target = scope:actor
								modifier = gpt_brand_crim_op2
								opinion = -30
							}
						}
					}
				}
				
				50 = {
					desc = gpt_imputecrimes_interaction_tt.failure.actor
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -20
					}
					
					send_interface_toast = {
						title = gpt_imputecrimes_interaction_tt.failure.actor2
						left_icon = scope:recipient

						scope:recipient = {
							if = {
								limit = { has_trait = forgiving }
								add_opinion = {
									target = scope:actor
									modifier = disappointed_opinion
									opinion = -15
								}
							}
							# Otherwise, folks do be mad.
							else = {
								add_opinion = {
									target = scope:actor
									modifier = trust_opinion
									opinion = -30
								}
							}
						}
					}
				}
			}
		}
	}
	
	ai_will_do = {
		base = 0 #The AI should never do this!
	}

	auto_accept = yes
}

#vassals
brand_criminal_interaction2 = {
	icon = icon_scheme_convert_to_witchcraft
	category = interaction_category_hostile
 #	common_interaction = yes
	interface_priority = 60

	desc = brand_criminal_interaction_desc2

	cooldown = { years = 1 }
	cooldown_against_recipient = { years = 3 }

	is_shown = {
		has_game_rule = GPT_interactions_enabled
		NOT = { scope:recipient = scope:actor }
		
		scope:actor = {
			highest_held_title_tier >= 2
			is_adult = yes
			NOT = {
				has_imprisonment_reason = scope:recipient
			}
		}

		scope:recipient = {
			is_adult = yes
			OR = {
			 	is_vassal_or_below_of = scope:actor
			 #	is_courtier_of = scope:actor
			 #	is_foreign_court_or_pool_guest_of = scope:actor
			}
		}
	}

	is_valid_showing_failures_only = {
		scope:actor.intrigue >= 12
		scope:actor.prestige >= 0
		scope:recipient = { basic_is_available_ai = yes }
	}

	on_auto_accept = {
		#scope:recipient = {
			#trigger_event = char_interaction.0120
		#}
	}

	cost = {
		prestige = {
			value = 100
			multiply = scope:actor.highest_held_title_tier
		}
	}

	on_accept = {
		scope:actor = {
			duel = {
				skill = intrigue
				target = scope:recipient
				30 = {
					desc = gpt_imputecrime_interaction_tt.success
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -20
					}
					send_interface_toast = {
						title = freehold_brand_criminal_interaction_notification_title
						left_icon = scope:actor
						right_icon = scope:recipient

						show_as_tooltip = {
							custom_tooltip = {
								text = freehold_brand_criminal_interaction_toast
							}
						}
					}

					add_opinion = {
						target = scope:recipient
						modifier = branded_criminal_crime
						opinion = -20
					}	

					scope:recipient = {
						# Forgiving characters lose a little less.
						if = {
							limit = { has_trait = forgiving }
							add_opinion = {
								target = scope:actor
								modifier = gpt_brand_crim_op1
								opinion = -10
							}
						}
						# Otherwise, folks do be mad.
						else = {
							add_opinion = {
								target = scope:actor
								modifier = gpt_brand_crim_op2
								opinion = -20
							}
						}
					}
				}
				
				70 = {
					desc = gpt_imputecrimes_interaction_tt.failure.actor
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -20
					}
					
					send_interface_toast = {
						title = gpt_imputecrimes_interaction_tt.failure.actor2
						left_icon = scope:recipient

						scope:recipient = {
							if = {
								limit = { has_trait = forgiving }
								add_opinion = {
									target = scope:actor
									modifier = disappointed_opinion
									opinion = -10
								}
							}
							# Otherwise, folks do be mad.
							else = {
								add_opinion = {
									target = scope:actor
									modifier = trust_opinion
									opinion = -20
								}
							}
						}
					}
				}
			}
		}
	}
	
	ai_will_do = {
		base = 0 #The AI should never do this!
	}

	auto_accept = yes
}











