########################################
# Flavor Events for Papal States
#
# Scripted by Sara Wendel-rtqvist
########################################

########################
# modified by Aetherum #
########################

namespace = flavorhre
normal_or_historical_nations = yes

# The Commissioning of the Saint Peter's Basilica
country_event = {
	id = flavorhre.1
	title = "flavor_pap.EVTNAME1"
	desc = "flavor_pap.EVTDESC1"
	picture = ST_PETERS_CHURCH_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = HRE
		is_year = 1500
		NOT = { is_year = 1550 }
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_pap.EVTOPTA1"
		add_ruler_modifier = { name = pap_saint_peters_basilica duration = -1 }
	}
	option = {
		name = "flavor_pap.EVTOPTB1"
		add_adm_power = 25
		add_mil_power = 25
		add_dip_power = 25
	}
}

# The Foundation of Societas Jesu
country_event = {
	id = flavorhre.2
	title = "flavor_pap.EVTNAME2"
	desc = "flavor_pap.EVTDESC2"
	picture = RELIGION_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = HRE
		OR = {
			POR = { has_country_modifier = the_societas_jesu }
			SPA = { has_country_modifier = the_societas_jesu }
		}
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_pap.EVTOPTA2"
		random_known_country = {
			limit = {
				tag = POR
				has_country_modifier = the_societas_jesu 
			}
			tooltip = { 
				add_papal_influence = 10 
			}
			country_event = {
				id = flavor_pap.3
			}
		}
		random_known_country = {
			limit = {
				tag = SPA 
				has_country_modifier = the_societas_jesu 
			}
			tooltip = {	
				add_papal_influence = 10 
			}
			country_event = {
				id = flavor_pap.3
			}
		}
		add_prestige = 10
	}
}

# Reorganisation of the Holy Inquisition
country_event = {
	id = flavorhre.4
	title = "flavor_pap.EVTNAME4"
	desc = "flavor_pap.EVTDESC4"
	picture = RELIGION_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = HRE
		NOT = { is_year = 1550 }
		SPA = {
			has_country_flag = spa_holy_inquisition
		}
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_pap.EVTOPTA4"
		add_country_modifier = { 
			name = pap_spanish_inquisition
			duration = 36500
		}
	}
	option = {
		name = "flavor_pap.EVTOPTB4"
		add_country_modifier = { 
			name = pap_moderate_inquisition 
			duration = 36500
		}
	}
}

# Giordano Bruno
country_event = {
	id = flavorhre.5
	title = "flavor_pap.EVTNAME5"
	desc = "flavor_pap.EVTDESC5"
	picture = RELIGION_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = HRE
		is_year = 1600 
		NOT = { is_year = 1650 }
		has_regency = no
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_pap.EVTOPTA5"
		add_ruler_modifier = {
			name = pap_burned_heretic
			duration = -1
		}
	}
	option = {
		name = "flavor_pap.EVTOPTB5"
		add_adm_power = 25
		add_mil_power = 25
		add_dip_power = 25
	}
}

# The Cleansing of the Pontinian Marches
country_event = {
	id = flavorhre.6
	title = "flavor_pap.EVTNAME6"
	desc = "flavor_pap.EVTDESC6"
	picture = RELIGION_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = HRE
		is_year = 1700
		NOT = { is_year = 1800 }
		owns = 118 # Roma
	}
	
	mean_time_to_happen = {
		months = 300
	}
	
	option = {
		name = "flavor_pap.EVTOPTA6"
		118 = { add_base_tax = 1 }
	}
}

# The Counter-Reformation and the Reformation of the Catholic Faith
country_event = {
	id = flavorhre.7
	title = "flavor_pap.EVTNAME7"
	desc = "flavor_pap.EVTDESC7"
	picture = REFORM_eventPicture
	
	fire_only_once = yes
	
	trigger = {
		tag = HRE
		is_year = 1540 
		NOT = { is_year = 1590 }
		OR = {
			POR = { has_country_modifier = the_societas_jesu }
			SPA = { has_country_modifier = the_societas_jesu }
		}
		is_religion_enabled = protestant
		any_known_country = {
			religion = protestant
		}
		any_known_country = {
			religion = catholic
		}
	}
	
	mean_time_to_happen = {
		months = 200
	}
	
	option = {
		name = "flavor_pap.EVTOPTA7"
		add_prestige = 10
		add_years_of_income = -0.5
		if = {
			limit = {
				corruption = 0.01
			}
			add_corruption = -1
		}
		custom_tooltip = flavor_pap.7.tt
		hidden_effect = {
			every_known_country = {
				limit = {
					religion = catholic
					NOT = { war_with = ROOT }
				}
				country_event = {
					id = flavorhre.8
				}
			}
		}
		every_known_country = {
			limit = {
				religion = protestant
				has_opinion = { who = ROOT value = 50 }
				NOT = { war_with = ROOT }
			}
			country_event = {
				id = flavorhre.8
			}
		}
	}
	option = {
		name = "flavor_pap.EVTOPTB7"
		add_reform_desire = 0.1
		add_prestige = -5
	}
}

# The Council of Trient
country_event = {
	id = flavorhre.8
	title = "flavor_pap.EVTNAME8"
	desc = "flavor_pap.EVTDESC8"
	picture = RELIGION_eventPicture
	
	is_triggered_only = yes
	
	option = {
		name = "flavor_pap.EVTOPTA8"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				religion = catholic
				has_opinion = { who = ROOT value = 50 }
			}
			modifier = {
				factor = 0.5
				religion = catholic
				NOT = { has_opinion = { who = ROOT value = 0 } }
			}
			modifier = {
				factor = 0.5
				religion = protestant
				NOT = { has_opinion = { who = ROOT value = 100 } }
			}
		}
		HRE = {
			add_opinion = {
				who = ROOT
				modifier = opinion_good_relations
				years = 30
			}
		}
	}
	option = {
		name = "flavor_pap.EVTOPTB8"
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				religion = catholic
				NOT = { has_opinion = { who = ROOT value = -25 } }
			}
			modifier = {
				factor = 1.5
				religion = protestant
				NOT = { has_opinion = { who = ROOT value = 75 } }
			}
		}
		HRE = {
			add_opinion = {
				who = ROOT
				modifier = opinion_displeased
				years = 30
			}
		}
	}
}