########################################
# Flavor Events for Tuscany
#
# Scripted and written by Sara Wendel-rtqvist
# and Petter Vilberg
########################################

namespace = flavor_tus 
normal_or_historical_nations = yes

# Michelangelo
country_event = {
	id = flavor_tus.1
	title = "flavor_tus.EVTNAME1"
	desc = "flavor_tus.EVTDESC1"
	picture = PAINTER_ARTIST_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		OR = {
			AND = {
				tag = TUS
				tag = LAN # florence
				NOT = {
					VEN = { has_country_flag = ven_access_italian_events_flag }
				}
			}
			has_country_flag = ven_access_italian_events_flag
		}
		is_year = 1500
		NOT = { is_year = 1550 }
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_tus.EVTOPTA1"
		define_advisor = {
			type = artist
			skill = 3
			cost_multiplier = 0.25
			name = "0000000"
		}
	}
}




#The emperor condemns the Duchy's elevation
country_event = {
	id = flavor_tus.2
	title = flavor_tus.2.t
	desc = flavor_tus.2.d
	picture = REFORM_eventPicture

	fire_only_once = yes
	
	trigger = {
		tag = TUS
		NOT = {
			is_year = 1600
		}
		is_emperor = no
		NOT = {
			reverse_has_opinion = {
				who = emperor
				value = 75 
			}
		}
		reverse_has_opinion = {
			who = PAP
			value = 50
		}
		religion = catholic
		NOT = {
			num_of_cities = 6
		}
		government = monarchy
	}

	option = {
		name = flavor_tus.2.a
		ai_chance = {
			factor = 80
		}
		emperor = {
			add_opinion = {
				who = TUS
				modifier = opinion_emperor_tus_refused
			}
		}
		PAP = {
			add_opinion = {
				who = TUS
				modifier = opinion_papal_tus_refused
			}
		}
		add_legitimacy = -10
		add_prestige = 10
		add_country_modifier = {
			name = emperor_condemns_tuscany
			duration = 7300
		}
	}

	option = {
		name = flavor_tus.2.b 	#We yield to the emperor
		add_prestige = -15
		emperor = {
			add_opinion = {
				who = TUS
				modifier = opinion_emperor_tus_yielded
			}
		}
		PAP = {
			add_opinion = {
				who = TUS
				modifier = opinion_papal_tus_yielded
			}
		}
	}
}

#Emperor Confirms The Grand Duchy's Elevation
country_event = {
	id = flavor_tus.3
	title = flavor_tus.3.t
	desc = flavor_tus.3.d
	picture = GOOD_WITH_MONARCH_eventPicture

	fire_only_once = yes

	trigger = {
		has_country_modifier = emperor_condemns_tuscany
		reverse_has_opinion = {
				who = emperor
				value = 100
		}
	}

	mean_time_to_happen = {
		months = 3
	}

	option = {
		name = flavor_tus.3.a
		emperor = {
			remove_opinion = {
				who = TUS
				modifier = opinion_emperor_tus_refused
			}
		}
		add_legitimacy = 10
		add_stability_or_adm_power = yes
		remove_country_modifier = emperor_condemns_tuscany
	}
}


#Fernandino's Construction Projects
country_event = {
	id = flavor_tus.4
	title = flavor_tus.4.t
	desc = flavor_tus.4.d
	picture = CITY_DEVELOPMENT_eventPicture

	fire_only_once = yes

	trigger = {
		OR = {
			AND = {
				tag = TUS
				tag = LAN # florence
				NOT = {
					VEN = { has_country_flag = ven_access_italian_events_flag }
				}
			}
			has_country_flag = ven_access_italian_events_flag
		}
		is_year = 1550
		owns = 115
		NOT = {
			is_year = 1610
		}
		is_at_war = no
	}

	mean_time_to_happen = {
		months = 600 # previous mtth was extreme
		modifier = {
			factor = 0.8
			has_idea_group = economic_ideas
		}
		modifier = {
			factor = 0.8
			has_idea_group = trade_ideas
		}
	}

	option = {
		name = flavor_tus.4.a
		115 = {
			add_base_production = 2
		}
		add_country_modifier = {
			name = tuscany_fernandino_construction
			duration = 3650
		}
	}
}


#The $MONARCHTITLE$'s treasury
country_event = {
	id = flavor_tus.5
	title = flavor_tus.5.t
	desc = flavor_tus.5.d
	picture = ARTWORK_eventPicture

	fire_only_once = yes

	trigger = {
		OR = {
			tag = TUS
			tag = LAN
		}
		government = monarchy
		dynasty = "000000"
	}

	mean_time_to_happen = {
		months = 240
	}

	option = {
		name = flavor_tus.5.a
		add_prestige = 5
		add_ruler_modifier = {
			name = tuscany_duke_treasury
			duration = 7300
		}
	}

	option = {
		name = flavor_tus.5.b
		add_prestige = -5
		add_ruler_modifier = {
			name = tuscany_state_treasury
			duration = 7300
		}
	}
}


#Reforms of Peter Leopold
country_event = {
	id = flavor_tus.6
	title = flavor_tus.6.t
	desc = flavor_tus.6.d
	picture = REFORM_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		OR = {
			tag = TUS
			tag = LAN
		}
		is_year = 1760
		NOT = {
			is_year = 1790
		}
		is_at_war = no
	}
	
	mean_time_to_happen = {
		months = 240
		modifier = {
			factor = 0.8
			has_idea_group = innovativeness_ideas
		}
		modifier = {
			factor = 1.3
			NOT = {
				ADM = 3
			}
		}
	}

	option = {
		name = flavor_tus.6.a
		add_stability = -1
		add_country_modifier = {
			name = peter_tuscan_reforms
			duration = -1
		}
	}

	option = {
		name = flavor_tus.6.b
		add_stability_or_adm_power = yes
		add_adm_power = 50
		add_legitimacy = 10
	}
}

#Accademia del Cimento
country_event = {
	id = flavor_tus.7
	title = flavor_tus.7.t
	desc = flavor_tus.7.d
	picture = GREAT_BUILDING_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		OR = {
			AND = {
				tag = TUS
				tag = LAN # florence
				NOT = {
					VEN = { has_country_flag = ven_access_italian_events_flag }
				}
			}
			has_country_flag = ven_access_italian_events_flag
		}
		is_year = 1650
		NOT = {
			is_year = 1670
		}
		owns = 116
	}
	
	mean_time_to_happen = {
		months = 180
		modifier = {
			factor = 0.75
			advisor = natural_scientist
		}
		modifier = {
			factor = 0.8
			ADM = 4
		}
	}
	
	option = {
		name = flavor_tus.7.a
		add_country_modifier = {
			name = accademia_cimento
			duration = 3650
		}
	}
	option = {
		name = flavor_tus.7.b
		add_treasury = -25
		add_country_modifier = {
			name = institution_cimento
			duration = 3650
		}
	}
}


#Medici Oriental Press
country_event = {
	id = flavor_tus.8
	title = flavor_tus.8.t
	desc = flavor_tus.8.d
	picture = BIG_BOOK_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		OR = {
			AND = {
				tag = TUS
				tag = LAN # florence
				NOT = {
					VEN = { has_country_flag = ven_access_italian_events_flag }
				}
			}
			has_country_flag = ven_access_italian_events_flag
		}
		has_institution = printing_press
		is_at_war = no
	}
	mean_time_to_happen = {
		months = 200
		modifier = {
			factor = 0.8
			has_idea_group = innovativeness_ideas
		}
	}
	option = {
		name = flavor_tus.8.a
		add_country_modifier = {
			name = oriental_press
			duration = 10950
		}
	}
}

################ Bonfire of the Vanities Disaster ################

#Savonarola Rises
country_event = {
	id = flavor_tus.9
	title = flavor_tus.9.t
	desc = flavor_tus.9.d
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = RELIGIOUS_TURMOIL_eventPicture
	}

	fire_only_once = yes
	is_triggered_only = yes	
	
	immediate = {
		hidden_effect = {
			set_country_flag = savonarola_disaster_flag
			set_variable = {
				which = savonarola_support_variable
				value = 0
			}
			set_variable = {
				which = savonarola_decisions_variable
				value = 0
			}
			set_country_flag = bonfire_of_the_vanities_disaster_flag
		}
	}
		
	#Ruling Family Flees!
	option = {
		name = flavor_tus.9.a
		ai_chance = {
			factor = 75
		}
		if = {
			limit = {
				government = monarchy
			}
			hidden_effect = {
				if = {
					limit = {
						has_heir = yes
					}
					exile_heir_as = flo_exiled_heir
					set_country_flag = flo_exiled_heir_flag
				}
				exile_ruler_as = { name = flo_exiled_ruler }
			}
			define_ruler = {
				name = "Girolamo"
				dynasty = "Savonarola"
				age = 40
				ADM = 5
				DIP = 5
				MIL = 3
				claim = 50
			}
			hidden_effect = {
				add_ruler_personality = infertile_personality
				add_ruler_personality_ancestor = { key = zealot }
			}
		}
		else = {
			exile_ruler_as = { name = flo_exiled_ruler }
			define_ruler = {
				name = "0000000000000"
				age = 40
				ADM = 5
				DIP = 5
				MIL = 3
			}
			hidden_effect = {
				add_ruler_personality_ancestor = { key = zealot }
			}
			add_government_reform = millenarian_theocracy_reform
		}
		set_ruler_flag = savonarola_flag
		add_republican_tradition = 20
	}
}

#Bonfire of the Vanities
country_event = {
	id = flavor_tus.10
	title = flavor_tus.10.t
	desc = flavor_tus.10.d
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = STATUE_eventPicture
	}

	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			change_variable = {
				which = savonarola_decisions_variable
				value = 1
			}
		}
	}

	#We Will Convince the People to Burn Their Sin
	option = {
		name = flavor_tus.10.a
		add_adm_power = -20
		custom_tooltip = add_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = 1
			}
		}
	}

	#Seize Their Vanities!
	option = {
		name = flavor_tus.10.b
		ai_chance = { factor = 100 }
		add_republican_tradition = -5
		add_legitimacy = -5
		custom_tooltip = lose_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = -1
			}
		}
	}
}


#Medici Agents
country_event = {
	id = flavor_tus.11
	title = flavor_tus.11.t
	desc = flavor_tus.11.d
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = SPY_eventPicture
	}

	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			change_variable = {
				which = savonarola_decisions_variable
				value = 1
			}
		}
	}

	#Whatever it Takes to Root Them Out
	option = {
		name = flavor_tus.11.a
		add_dip_power = -20
		custom_tooltip = add_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = 1
			}
		}
	}

	#Expel anyone who might have loyalties to the Medicis!
	option = {
		name = flavor_tus.11.b
		ai_chance = { factor = 100 }
		add_republican_tradition = -5
		add_legitimacy = -5
		custom_tooltip = lose_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = -1
			}
		}
	}
}


#The People Expect Revelations
country_event = {
	id = flavor_tus.12
	title = flavor_tus.12.t
	desc = flavor_tus.12.d
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = RELIGION_eventPicture
	}

	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			change_variable = {
				which = savonarola_decisions_variable
				value = 1
			}
		}
	}

	#Fire and brimstone will rain from the sky!
	option = {
		name = flavor_tus.12.a
		add_stability = -1
		custom_tooltip = add_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = 1
			}
		}
	}

	#Invent something a little calmer
	option = {
		name = flavor_tus.12.b
		ai_chance = { factor = 100 }
		add_republican_tradition = -10
		add_legitimacy = -10
		custom_tooltip = lose_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = -1
			}
		}
	}
}


#The People Follow God!
country_event = {
	id = flavor_tus.13
	title = flavor_tus.13.t
	desc = flavor_tus.13.d
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = RELIGION_eventPicture
	}

	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			change_variable = {
				which = savonarola_decisions_variable
				value = 1
			}
		}
	}

	#God cares for his flock!
	option = {
		name = flavor_tus.13.a
		add_stability_or_adm_power = yes
		custom_tooltip = add_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = 1
			}
		}
	}
}


#Reforming the Republic
country_event = {
	id = flavor_tus.14
	title = flavor_tus.14.t
	desc = flavor_tus.14.d
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = REFORM_eventPicture
	}

	is_triggered_only = yes
	
	trigger = {
		NOT = { government = monarchy }
	}
	
	immediate = {
		hidden_effect = {
			change_variable = {
				which = savonarola_decisions_variable
				value = 1
			}
		}
	}

	#We govern for the people of Florence
	option = {
		name = flavor_tus.14.a
		add_adm_power = -25
		add_republican_tradition = 10
		custom_tooltip = add_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = 1
			}
		}
	}

	#The people need strict guidance
	option = {
		name = flavor_tus.14.b
		ai_chance = { factor = 100 }
		add_adm_power = 25
		add_republican_tradition = -10
		custom_tooltip = lose_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = -1
			}
		}
	}
}


#The People Turn Against Savonarola
country_event = {
	id = flavor_tus.15
	title = flavor_tus.15.t
	desc = flavor_tus.15.d
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = LIBERUM_VETO_eventPicture
	}
	
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		OR = {
			NOT = {
				check_variable = {
					which = savonarola_support_variable
					value = -5
				}
			}
			check_variable = {
				which = savonarola_decisions_variable
				value = 8
			}
		}
	}

	#Let him walk the Trial by Fire
	option = {
		name = flavor_tus.15.a
		random_list = {
			98 = {
				set_ruler = flo_exiled_ruler
				if = {
					limit = {
						has_country_flag = flo_exiled_heir_flag
						government = monarchy
					}
					set_heir = flo_exiled_heir
				}
			}
			2 = {
				change_government = theocracy
				#set_legacy_government = theocratic_government
				add_government_reform = leading_clergy_reform
			}
		}
	}
}


#Savonarola Leaves This World
country_event = {
	id = flavor_tus.16
	title = flavor_tus.16.t
	desc = flavor_tus.16.d
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = KING_SICK_IN_BED_eventPicture
	}

	is_triggered_only = yes
	fire_only_once = yes
	
	trigger = {
		has_ruler_flag = savonarola_flag
		had_country_flag = {
			flag = savonarola_disaster_flag
			days = 183
		}
	}
	
	immediate = {
		set_country_flag = savonarola_dead
	}

	option = {
		name = flavor_tus.16.a
		trigger = {
			government = republic
		}
		set_ruler = flo_exiled_ruler
		remove_government_reform = millenarian_theocracy_reform
	}

	option = {
		name = flavor_tus.16.b
		trigger = {
			government = monarchy
		}
		add_legitimacy = 10
		set_ruler = flo_exiled_ruler
		if = {
			limit = {
				has_country_flag = flo_exiled_heir_flag
			}
			set_heir = flo_exiled_heir
		}
		remove_government_reform = millenarian_theocracy_reform
	}
}

# End of disaster
country_event = {
	id = flavor_tus.17
	title = flavor_tus.17.t
	desc = {
		trigger = {
			NOT = { has_ruler_flag = savonarola_flag }
		}
		desc = flavor_tus.17.d
	}
	desc = {
		trigger = {
			has_ruler_flag = savonarola_flag
		}
		desc = flavor_tus.17.d2
	}
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = LIBERUM_VETO_eventPicture
	}
	
	is_triggered_only = yes
	fire_only_once = yes

	immediate = {
		on_non_estate_disaster_end = yes
	}
	
	option = {
		name = flavor_tus.17.a
		add_stability_or_adm_power = yes
	}
}

# Fanatic Support for Savanarola
country_event = {
	id = flavor_tus.18
	title = flavor_tus.18.t
	desc = flavor_tus.18.d
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = RELIGIOUS_TURMOIL_eventPicture
	}
	
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		check_variable = {
			which = savonarola_support_variable
			value = 6
		}
	}
	
	option = {
		name = flavor_tus.18.a
		change_government = theocracy
		add_government_reform = leading_clergy_reform
	}
}

# Event about Papal disapproval
country_event = {
	id = flavor_tus.19
	title = flavor_tus.19.t
	desc = flavor_tus.19.d
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BONFIRE_OF_THE_VANITIES_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = POPE_PREACHING_eventPicture
	}
	
	is_triggered_only = yes
	fire_only_once = yes
	
	trigger = {
		has_ruler_flag = savonarola_flag
		had_country_flag = {
			flag = bonfire_of_the_vanities_disaster_flag
			days = 90
		}
	}
	
	option = { # Declare the Pope a heretic
		name = flavor_tus.19.a
		ai_chance = { factor = 100 }
		excommunicate = ROOT
		add_papal_influence = -200
		if = {
			limit = {
				PAP = {
					owns = 118
				}
			}
			118 = { add_claim = ROOT }
		}
		custom_tooltip = lose_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = -1
			}
		}
	}
	option = { # Assure the people that the Pope is simply misguided
		name = flavor_tus.19.b
		excommunicate = ROOT
		add_papal_influence = -200
		custom_tooltip = add_savanarola_support_tt
		hidden_effect = {
			change_variable = {
				which = savonarola_support_variable
				value = 1
			}
		}
	}
}

### The Pazzi Conspiracy ###
country_event = {
	id = flavor_tus.20
	title = flavor_tus.20.t
	desc = flavor_tus.20.d
	picture = ASSASSINATION_eventPicture

	fire_only_once = yes
	
	trigger = {
		OR = {
			tag = LAN
			tag = TUS
		}
		has_government_attribute = enables_nepotism
		is_year = 1475
		NOT = { is_year = 1480 }
		NOT = { dynasty = "de' Pazzi" }
	}
	
	mean_time_to_happen = {
		months = 36
	}
	
	option = { # Signoria is strengthened
		name = flavor_tus.20.a
		add_stability = -1
		give_estate_land_share_massive = { estate = all }
		set_country_flag = strengthened_signoria_flag
		custom_tooltip = strengthened_signoria_tt
	}
	option = { # Pazzi take over the Signoria
		name = flavor_tus.20.b
		add_stability = -2
		custom_tooltip = signoria_leader_dies_tt
		define_ruler = {
			name = "Jacopo de' Pazzi"
		}
	}
}

#

country_event = {
	id = flavor_tus.21
	title = "flavor_tus.EVTNAME21"
	desc = "flavor_tus.EVTDESC21"
	picture = GOOD_WITH_MONARCH_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = "flavor_tus.EVTOPTA21" # Our government is magnificent as it is!
		if = {
			limit = {
				stability = 2
				NOT = { stability = 3 }
			}
			add_stability = 1
		}
		else_if = {
			limit = {
				stability = 1
				NOT = { stability = 2 }
			}
			add_stability = 2
		}
		else_if = {
			limit = {
				NOT = { stability = 1 }
			}
			add_stability = 3
		}
		else = {
			add_adm_power = 100
		}
	}
	option = {
		name = "flavor_tus.EVTOPTB21" # Our crowning glory shall be a crown!
		trigger = {
			NOT = { government = monarchy }
		}
		change_government = monarchy
		add_government_reform = autocracy_reform
	}
	option = {
		name = "flavor_tus.EVTOPTC21" # It is time for the People to be heard!
		trigger = {
			OR = {
				AND = {
					government = republic
					has_government_attribute = enables_nepotism
				}
				NOT = { government = republic }
			}
		}
		if = {
			limit = {
				NOT = { government = republic }
			}
			change_government = republic
		}
		if = {
			limit = {
				has_reform = signoria_reform
			}
			remove_government_reform = signoria_reform
			add_government_reform = noble_elite_reform
		}
		if = {
			limit = {
				has_reform = nepotism_reform
			}
			remove_government_reform = nepotism_reform
			add_government_reform = republicanism_reform
		}
	}
}

# Medici Pope
country_event = {
	id = flavor_tus.22
	title = "flavor_tus.EVTNAME22"
	desc = "flavor_tus.EVTDESC22"
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BAD_POPE_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = POPE_PREACHING_eventPicture
	}
	
	is_triggered_only = yes # on monarch death
	fire_only_once = yes
	
	trigger = {
		tag = PAP
		has_country_flag = medici_pope_next
	}
	
	immediate = {
		hidden_effect = {
			clr_country_flag = medici_pope_next
			set_country_flag = current_pope_is_a_medici
			every_country = {
				limit = {
					has_country_flag = our_medici_pope
				}
				save_global_event_target_as = medici_pope_home
			}
			random_list = {
				25 = { add_ruler_personality = embezzler_personality }
				25 = { add_ruler_personality = greedy_personality }
				20 = { add_ruler_personality = sinner_personality }
				15 = { add_ruler_personality_ancestor = { key = architectural_visionary } }
				15 = { add_ruler_personality_ancestor = { key = scholar } }
			}
		}
	}
	
	option = {
		name = flavor_tus.EVTOPTA22
		
		add_reform_desire = 0.025
		event_target:medici_pope_home = {
			reverse_add_opinion = {
				who = PAP
				modifier = opinion_pope_tuscan_homeland
			}
			hidden_effect = {
				country_event = { id = flavor_tus.23 }
			}
		}
		hidden_effect = {
			set_ruler_culture = event_target:medici_pope_home
			set_ai_attitude = {
				attitude = attitude_friendly
				who = event_target:medici_pope_home
				locked = yes
			}
		}
	}
}

# Florence/Tuscany alert when Medici Pope actually takes the throne
country_event = {
	id = flavor_tus.23
	title = "flavor_tus.EVTNAME23"
	desc = "flavor_tus.EVTDESC23"
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BAD_POPE_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = POPE_PREACHING_eventPicture
	}
	
	is_triggered_only = yes
		
	option = {
		name = flavor_tus.EVTOPTA23
		add_country_modifier = {
			name = "medici_pope_modifier"
			duration = 7300
		}
		add_opinion = {
			who = PAP
			modifier = opinion_our_pope_on_throne
		}
		hidden_effect = {
			set_ai_attitude = {
				attitude = attitude_friendly
				who = PAP
				locked = yes
			}
		}
	}
}

# Death of the Medici Pope
country_event = {
	id = flavor_tus.24
	title = "flavor_tus.EVTNAME24"
	desc = "flavor_tus.EVTDESC24"
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BAD_POPE_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = DEATH_OF_HEIR_eventPicture
	}
	
	is_triggered_only = yes # on monarch death
	fire_only_once = yes
	
	trigger = {
		tag = PAP
		has_country_flag = current_pope_is_a_medici
	}
	
	immediate = {
		clr_country_flag = current_pope_is_a_medici
	}
	
	option = {
		name = flavor_tus.EVTOPTA24
		event_target:medici_pope_home = {
			reverse_remove_opinion = {
				who = PAP
				modifier = opinion_pope_tuscan_homeland
			}
			hidden_effect = {
				country_event = { id = flavor_tus.25 }
			}
		}
		hidden_effect = {
			set_ai_attitude = {
				attitude = attitude_neutral
				who = event_target:medici_pope_home
				locked = no
			}
		}
	}
}

country_event = {
	id = flavor_tus.25
	title = "flavor_tus.EVTNAME25"
	desc = "flavor_tus.EVTDESC25"
	picture = {	
		trigger = {
			has_dlc = "Emperor"
		}
		picture = BAD_POPE_eventPicture
	}
	picture = {	
		trigger = {
			NOT = { has_dlc = "Emperor" }
		}
		picture = DEATH_OF_HEIR_eventPicture
	}
	
	is_triggered_only = yes
		
	option = {
		name = flavor_tus.EVTOPTA25
		
		remove_opinion = {
			who = PAP
			modifier = opinion_our_pope_on_throne
		}
		hidden_effect = {
			set_ai_attitude = {
				attitude = attitude_neutral
				who = PAP
				locked = no
			}
		}
	}
}
