﻿#Events relating to Rivals

namespace = rivalry

##################################################
# Spiteful Acts
# by Sean Hughes
# 1010-1025
##################################################

#I decide that my rival's aggravating behavior has gone on long enough!##CHANGED TO SPREAD RUMOUR
rivalry.1010 = {
	type = character_event
	title = rivalry.1010.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					has_trait = patient
				}
				desc = rivalry.1010.desc.patient
			}
			desc = rivalry.1010.desc
		}
		desc = rivalry.1010.desc.end
	}
	theme = rival_relation
	override_background = { reference = council_chamber }
	left_portrait = {
		character = root
		animation = rage
	}
	right_portrait = {
		character = scope:rival
		animation = schadenfreude
	}

	trigger = {
		is_adult = yes

		any_relation = {
			type = rival
			is_available_healthy_adult = yes
		}

		NOT = {
			has_character_flag = had_event_rivalry_1010
		}
	}
	weight_multiplier = {
		base = 5 
	}
	

	immediate = {
		save_scope_as = from_rival
		add_character_flag = {
			flag = had_event_rivalry_1010
			years = 5
		}

		random_relation = {
			type = rival
			limit = {
				is_available_healthy_adult = yes
			}
			if = {
				limit = { root = { is_ai = no }	}
				assign_quirk_effect = yes
			}
			save_scope_as = rival
		}
	}

	option = {
		name = rivalry.1010.a
		duel = {
			skill = intrigue
			target = scope:rival

			15 = {		
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
					min = -14
				}
				scope:rival = {
					trigger_event = rivalry.1011 #The rumors take off.
				}
				custom_tooltip = rivalry.1010.a.success.tt
			}
			20 = {		
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.25
					min = -19
				}
				trigger_event = rivalry.1014 #The rumors are seen as unbelievable.
				custom_tooltip = rivalry.1010.a.failure.tt
			}
			10 = {		
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.75
					min = -9
				}
				add_character_flag = {
					flag = rivalry_1010_exposed
					days = 15
				}
				scope:rival = {
					trigger_event = rivalry.1012 #The rumors are seen as unbelievable, and everyone knows I made them up!
				}
				custom_tooltip = rivalry.1010.a.failure.tt
				custom_tooltip = rivalry.1010.a.badfailure.tt
			}
		}
		ai_chance = {
			base = 100

			modifier = {
				diplomacy >= intrigue
				add = 100
			}

			ai_value_modifier = {
				ai_honor = -1
				ai_boldness = 0.5
			}
		}
	}

	option = {
		name = rivalry.1010.b
		add_character_flag = {
			flag = rivalry_1010_wrote_poem
			days = 15
		}
		duel = {
			skill = diplomacy
			target = scope:rival

			13 = {		
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.25
					min = -14
				}
				scope:rival = {
					trigger_event = rivalry.1011 #The poem is a success!
				}				
				custom_tooltip = rivalry.1010.b.success.tt
			}
			20 = {		
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.25
				}
				trigger_event = rivalry.1016 #The poem is seen as drivel.
				custom_tooltip = rivalry.1010.b.failure.tt
			}
			8 = {		
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.75
					min = -7
				}
				add_character_flag = {
					flag = rivalry_1010_exposed
					days = 15
				}
				scope:rival = {
					trigger_event = rivalry.1012 #The poem is seen as drivel, and everyone knows I wrote it!
				}
				custom_tooltip = rivalry.1010.b.failure.tt
				custom_tooltip = rivalry.1010.b.badfailure.tt
			}
		}
		ai_chance = {
			base = 100

			modifier = {
				intrigue >= diplomacy
				add = 100
			}

			ai_value_modifier = {
				ai_honor = -1
				ai_boldness = 0.5
			}
		}
	}

	option = {
		name = rivalry.1010.c
		scope:rival = {
			trigger_event = rivalry.1017 #My rival reacts directly to my insult!
		}
		custom_tooltip = rivlary.1010.c.tt

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_boldness = 2
				ai_energy = 0.5
			}
		}
	}
}

#My rival learns that I am successful in defaming them!
rivalry.1011 = {
	type = character_event
	title = rivalry.1011.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:from_rival = {
						has_character_flag = rivalry_1010_wrote_poem
					}
				}
				desc = rivalry.1011.desc.poem
			}
			desc = rivalry.1011.desc.rumors
		}
	}
	theme = rival_relation
	
	override_background = { reference = council_chamber }
	left_portrait = {
		character = root
		animation = rage
	}
	right_portrait = {
		character = scope:from_rival
		animation = schadenfreude
	}

	immediate = {
		get_quirk_character_effect = yes
		add_prestige = medium_prestige_loss
	}

	option = {
		name = rivalry.1011.a
		trigger_event = acquaintance.9006
		scope:from_rival = {
			if = {
				limit = {
					has_character_flag = rivalry_1010_wrote_poem
				}
				trigger_event = { id = rivalry.1015 }
			}
			else = {
				trigger_event = { id = rivalry.1013 }
			}
		}
	}
}
