# ask_for_excommunication_chance
# ask_for_invasion_chance
# ask_for_divorce_chance
# ask_to_lift_excommunication_chance
# ask_for_money_chance
# ask_for_crusade_chance
# ask_for_claim_chance
# nominate_bishop_chance

# AI logic for how the Pope should respond to the hardcoded Ask for Excommunication action
# ROOT is the asker, FROM is the religious head, FROMFROM is the target
ask_for_excommunication_chance = {
	additive_modifier = {
		value = -50
		localisation_key = AIREASON_BASE_RELUCTANCE
	}

	additive_modifier = { # Slow down the AI
		value = -25
		localisation_key = AIREASON_BASE_RELUCTANCE
		ai = yes
	}

	additive_modifier = { # And Landless Mercenaries overall...
		value = -150
		localisation_key = AIREASON_BASE_RELUCTANCE

		ai = yes
		is_landed = no
	}

	additive_modifier = {
		value = -1000
		localisation_key = AIREASON_EXCOM_TARGET_HAS_REPENTED_SINS

		FROM = {
			has_opinion_modifier = {
				name = opinion_repented_sins
				who = ROOT_FROMFROM
			}
		}
	}
	additive_modifier = {
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_REQUESTED_EXCOM_ALREADY

		reverse_has_opinion_modifier = {
			name = opinion_requested_excommunication
			who = FROM
		}
	}

	# The Papacy will not excommunicate other priests on demand
	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_RULER_NO_PRIEST_EXCOMMUNICATION_DEMANDED

		FROMFROM = { is_theocracy = yes }
		NOT = { character = FROM } # The Pope will excommunicate priests by his own accord, but not on request from other rulers.
	}

	# The Papacy will tend to excommunicate bad priests
	additive_modifier = {
		value = 15

		# No loc needed, it's just for the Pope
		character = FROM

		FROMFROM = {
			higher_real_tier_than = BARON
			is_theocracy = yes
			has_bad_priest_trait_trigger = yes
		}
	}

	# Saintly Bloodline boost
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE

		any_owned_bloodline = {
			has_bloodline_flag = saintly_bloodline
			bloodline_is_active_for = PREV
			NOT = { has_bloodline_flag = wicked_saint }
		}

		NOT = { character = FROM }
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_KINSLAYER

		OR = {
			trait = kinslayer
			trait = familial_kinslayer
			trait = dynastic_kinslayer
		}
	}

	additive_modifier = {
		value = -40
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_SINNER

		OR = {
			has_character_modifier = rampant_sinner_christian
			has_character_modifier = rampant_sinner_dharmic
			has_character_modifier = known_satanist
			has_character_modifier = known_witch
		}
	}

	## Universal modifiers ##
	# Always valid for all Papal actions
	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_IS_EXCOMMUNICATED

		excommunicated_for = FROM
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		NOR = {
			persistent_event_target:baptizing_pope_per = { character = FROM }
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		persistent_event_target:baptizing_pope_per = { character = FROM } # Ruler asking was baptized by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER

		trait = crowned_by_myself
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER

		OR = {
			is_decision_potential = prepare_coronation_ceremony # Vanilla
			is_decision_potential = imperial_coronation # Byzantium - Plus
			is_decision_potential = royal_coronation # All others - Plus
		}

		religion = FROM
		is_adult = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE

		trait = crowned_by_pope
		is_high_crowned_trigger = yes

		NOR = {
			persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME

		trait = crowned_by_pope
		is_high_crowned_trigger = yes
		persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE

		is_liege_of = FROM # Overrides base acceptance
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY

		dynasty = FROM

		NOR = {
			is_close_relative = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE

		is_close_relative = FROM

		NOR = {
			is_parent_of = FROM
			character = FROM # Not on yourself, dirty Pope
		}

	}
	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT

		is_parent_of = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND

		is_friend = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER

		is_lover = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL

		is_rival = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE

		culture = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_cardinal
				who = ROOT
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_pope
				who = ROOT
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE

		has_law = investiture_law_1
		is_ruler = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE

 		is_preparing_crusade = yes
		has_pledged_crusade_participation = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE

		any_war = {
			OR = {
				using_cb = new_crusade
				using_cb = crusade
			}
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	# Influence over Cardinals
	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_fraticelli_cardinal
	}

	# Asker's Piety
	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety < -250
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -250
		piety < -100
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -100
		piety < -50
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 150
		piety < 350
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 350
		piety < 750
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 750
		piety < 1500
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 1500
		piety < 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER
		factor = 0.25 # +100 Opinion = +25 points
		who = ROOT
		this = FROM # The Pope's opinion of ROOT
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS

		trait = zealous

		FROM = {
			NOR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL

		trait = cynical

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL

		trait = lustful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS

		trait = gluttonous
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT  # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY

		trait = greedy
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL

		trait = slothful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH

		trait = wroth
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS

		trait = envious
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD

		trait = proud
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE

		trait = zealous

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	## Modifiers evaluating the Excommunication Target ##
	# Always valid for all Papal actions
	additive_modifier = { # Saintly Bloodline boost
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE_TARGET

		FROMFROM = {
			any_owned_bloodline = {
				has_bloodline_flag = saintly_bloodline
				bloodline_is_active_for = PREV
				NOT = { has_bloodline_flag = wicked_saint }
			}
		}

		NOT = { character = FROM }
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_IS_KINSLAYER

		FROMFROM = {
			OR = {
				trait = kinslayer
				trait = familial_kinslayer
				trait = dynastic_kinslayer
			}
		}
	}

	additive_modifier = {
		value = 40
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_IS_SINNER

		FROMFROM = {
			OR = {
				has_character_modifier = rampant_sinner_christian
				has_character_modifier = rampant_sinner_dharmic
				has_character_modifier = known_satanist
				has_character_modifier = known_witch
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			NOT = { persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } }
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } # Ruler asking was baptized by this very same Pope
		}
	}

	additive_modifier = {
		value = 100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER_TARGET

		FROMFROM = { trait = crowned_by_myself }
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER_TARGET

		FROMFROM = {
			OR = {
				is_decision_potential = prepare_coronation_ceremony # Vanilla
				is_decision_potential = imperial_coronation # Byzantium - Plus
				is_decision_potential = royal_coronation # All others - Plus
			}

			is_adult = yes
			religion = ROOT_FROM
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE_TARGET

		FROMFROM = {
			trait = crowned_by_pope
			is_high_crowned_trigger = yes
			NOT = { persistent_event_target:coronation_priest_per = { character = ROOT_FROM } } # Ruler asking was crowned by this very same Pope
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME_TARGET

		FROMFROM = {
			trait = crowned_by_pope
			is_high_crowned_trigger = yes
			persistent_event_target:coronation_priest_per = { character = ROOT_FROM } # Ruler asking was crowned by this very same Pope
		}
	}

	additive_modifier = {
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE_TARGET
		FROM = { vassal_of = ROOT_FROMFROM } # Overrides base acceptance
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY_TARGET

		FROM = {
			dynasty = ROOT_FROMFROM
			NOT = { is_close_relative = ROOT_FROMFROM }
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE_TARGET

		FROM = {
			is_close_relative = ROOT_FROMFROM
			NOT = { is_child_of = ROOT_FROMFROM }
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT_TARGET

		FROMFROM = { is_parent_of = ROOT_FROM }
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND_TARGET

		FROMFROM = { is_friend = ROOT_FROM }
	}

	additive_modifier = {
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER_TARGET

		FROMFROM = { is_lover = ROOT_FROM }
	}

	additive_modifier = {
		value = 100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL_TARGET

		FROMFROM = { is_rival = ROOT_FROM }
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE_TARGET

		FROMFROM = { culture = ROOT_FROM }
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL_TARGET

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_cardinal
				who = ROOT_FROMFROM
			}
		}
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE_TARGET

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_pope
				who = ROOT_FROMFROM
			}
		}
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE_TARGET

		FROMFROM = {
			has_law = investiture_law_1
			is_ruler = yes
		}
	}

	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE_TARGET

		FROMFROM = {
	 		is_preparing_crusade = yes
			has_pledged_crusade_participation = yes
		}
	}

	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE_TARGET

		FROMFROM = {
			any_war = {
				OR = {
					using_cb = new_crusade
					using_cb = crusade
				}
			}
		}
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS_TARGET
		factor = -2
		min = -45
		value = num_vassals_with_minor_title
		who = FROMFROM
		key = title_cardinal

		FROM = { religion = catholic } # Only your Pope cares
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS_TARGET
		factor = -2
		min = -45
		value = num_vassals_with_minor_title
		who = FROMFROM
		key = title_fraticelli_cardinal

		FROM = { religion = fraticelli } # Only your Pope cares
	}

	# Asker's Piety
	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = { piety < -250 }
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -250
			piety < -100
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -100
			piety < -50
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 150
			piety < 350
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 350
			piety < 750
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 750
			piety < 1500
		}
	}

	additive_modifier = {
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 1500
			piety < 2000
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = { piety >= 2000 }
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER_TARGET
		factor = -0.5 # +100 Opinion = -50 points
		who = FROMFROM
		this = FROM # The Pope's opinion of the target
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_TARGET

		FROMFROM = { trait = zealous }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_TARGET

		FROMFROM = { trait = temperate }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_TARGET

		FROMFROM = { trait = diligent }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_TARGET

		FROMFROM = {
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			trait = humble
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL_TARGET

		FROMFROM = { trait = cynical }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL_TARGET

		FROMFROM = {
			trait = lustful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS_TARGET

		FROMFROM = {
			trait = gluttonous
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY_TARGET

		FROMFROM = {
			trait = greedy
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL_TARGET

		FROMFROM = {
			trait = slothful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH_TARGET

		FROMFROM = {
			trait = wroth
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS_TARGET

		FROMFROM = {
			trait = envious
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD_TARGET

		FROMFROM = {
			trait = proud
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}
		}
	}
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = diligent
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE_TARGET

		FROMFROM = { trait = temperate }

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE_TARGET

		FROMFROM = { trait = zealous }

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}
		}
	}
}

# AI logic for how the Pope should respond to the hardcoded Ask for Invasion action
# ROOT is the asker, FROM is the Pope, FROMFROM is the target title
ask_for_invasion_chance = {
	additive_modifier = {
		value = -50
		localisation_key = AIREASON_BASE_RELUCTANCE
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_KINSLAYER

		OR = {
			trait = kinslayer
			trait = familial_kinslayer
			trait = dynastic_kinslayer
		}
	}

	additive_modifier = {
		value = -40
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_SINNER

		OR = {
			has_character_modifier = rampant_sinner_christian
			has_character_modifier = rampant_sinner_dharmic
			has_character_modifier = known_satanist
			has_character_modifier = known_witch
		}
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROTECTS_ANTIPOPE

		FROMFROM = {
			rightful_religious_head_scope = {
				is_antipope = yes
			}
		}

		FROM = { controls_religion = yes }
	}

	additive_modifier = { # Sexism
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_FEMALE

		is_female = no

		FROMFROM = {
			is_female = yes

			OR = {
				has_law = agnatic_succession
				has_law = cognatic_succession
			}
		}

		NOR = { # Random world woes
			has_religion_feature = religion_equal
			has_religion_feature = religion_matriarchal
			has_religion_feature = religion_feature_bon
		}
	}

	additive_modifier = { # Sexism
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_MALE

		is_female = yes

		FROMFROM = {
			is_female = no

			OR = {
				has_law = enatic_succession
				has_law = enatic_cognatic_succession
			}
		}

		NOR = { # Random world woes
			has_religion_feature = religion_equal
			has_religion_feature = religion_patriarchal
			has_religion_feature = religion_feature_bon
		}
	}

	additive_modifier = { # Ageism
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_BABY

		is_adult = yes
		FROMFROM = { age < 5 }
	}

	additive_modifier = { # Ageism
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_CHILD

		is_adult = yes

		FROMFROM = {
			age >= 5
			is_adult = no
		}
	}

	additive_modifier = { # Ageism
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_HEIRLESSNESS

		is_adult = yes
		practical_age < 40

		NOR = {
			trait = celibate
			trait = eunuch
		}

		FROMFROM = {
			practical_age >= 40
			has_living_children = no
		}
	}

	# The larger ROOT's realm is, the less likely the Pope is to grant the Invasion
	additive_modifier = { # Realm size
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_REALM_SIZE

		realm_size >= 25
		realm_size < 50
	}

	additive_modifier = { # Realm size
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_REALM_SIZE

		realm_size >= 50
		realm_size < 75
	}

	additive_modifier = { # Realm size
		value = -75
		localisation_key = POPE_AIREASON_MODIFIER_REALM_SIZE

		realm_size >= 75
		realm_size < 100
	}

	additive_modifier = { # Realm size
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_REALM_SIZE

		realm_size >= 100
		realm_size < 150
	}

	additive_modifier = { # Realm size
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_REALM_SIZE_IMPERIAL

		realm_size >= 150
	}

	additive_modifier = { # Rank
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_HIGH_TIER_KING

		real_tier = KING
	}

	additive_modifier = { # Rank
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_HIGH_TIER_EMPEROR

		real_tier = EMPEROR
	}

	# The Smaller the target's realm is, the less likely the Pope is to grant the Invasion
	additive_modifier = { # Realm size
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_REALM_SIZE_TARGET_TINY

		FROMFROM = { realm_size < 15 }
	}

	additive_modifier = { # Realm size
		value = -75
		localisation_key = POPE_AIREASON_MODIFIER_REALM_SIZE_TARGET

		FROMFROM = {
			realm_size >= 15
			realm_size < 30
		}
	}

	additive_modifier = { # Realm size
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_REALM_SIZE_TARGET

		FROMFROM = {
			realm_size >= 30
			realm_size < 50
		}
	}

	additive_modifier = { # Claims
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_ON_TARGET

		has_weak_claim = FROMFROM
	}

	additive_modifier = { # CLaims
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_ON_TARGET_STRONG

		has_strong_claim = FROMFROM
	}

	## Universal modifiers ##
	# Always valid for all Papal actions
	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_IS_EXCOMMUNICATED

		excommunicated_for = FROM
	}

	# Saintly Bloodline boost
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE

		any_owned_bloodline = {
			has_bloodline_flag = saintly_bloodline
			bloodline_is_active_for = PREV
			NOT = { has_bloodline_flag = wicked_saint }
		}

		NOT = { character = FROM }
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		NOR = {
			persistent_event_target:baptizing_pope_per = { character = FROM }
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		persistent_event_target:baptizing_pope_per = { character = FROM } # Ruler asking was baptized by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER

		trait = crowned_by_myself
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER

		OR = {
			is_decision_potential = prepare_coronation_ceremony # Vanilla
			is_decision_potential = imperial_coronation # Byzantium - Plus
			is_decision_potential = royal_coronation # All others - Plus
		}

		is_adult = yes
		religion = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE

		trait = crowned_by_pope
		is_high_crowned_trigger = yes

		NOR = {
			persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME

		trait = crowned_by_pope
		is_high_crowned_trigger = yes
		persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE

		is_liege_of = FROM # Overrides base acceptance
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY

		dynasty = FROM

		NOR = {
			is_close_relative = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE

		is_close_relative = FROM

		NOR = {
			is_parent_of = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT

		is_parent_of = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND

		is_friend = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER

		is_lover = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL

		is_rival = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE

		culture = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL

		reverse_has_opinion_modifier = {
			name = opinion_supported_cardinal
			who = ROOT
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE

		reverse_has_opinion_modifier = {
			name = opinion_supported_pope
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE

		has_law = investiture_law_1
		is_ruler = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE

 		is_preparing_crusade = yes
		has_pledged_crusade_participation = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE

		any_war = {
			OR = {
				using_cb = new_crusade
				using_cb = crusade
			}
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	# Influence over Cardinals
	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_fraticelli_cardinal
	}

	# Asker's Piety
	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety < -250
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -250
		piety < -100
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -100
		piety < -50
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 150
		piety < 350
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 350
		piety < 750
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 750
		piety < 1500
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 1500
		piety < 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER
		factor = 0.25 # +100 Opinion = +25 points
		who = ROOT
		this = FROM # The Pope's opinion of ROOT
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS

		trait = zealous

		FROM = {
			NOR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			NOR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL

		trait = cynical

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL

		trait = lustful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS

		trait = gluttonous
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY

		trait = greedy
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL

		trait = slothful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH

		trait = wroth
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS

		trait = envious
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD

		trait = proud
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE

		trait = zealous

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	## Modifiers evaluating the Invasion Target ##
	# Always valid for all Papal actions
	additive_modifier = { # Saintly Bloodline boost
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE_TARGET

		FROMFROM = {
			any_owned_bloodline = {
				has_bloodline_flag = saintly_bloodline
				bloodline_is_active_for = PREV
				NOT = { has_bloodline_flag = wicked_saint }
			}
		}

		NOT = { character = FROM }
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_IS_KINSLAYER

		FROMFROM = {
			OR = {
				trait = kinslayer
				trait = familial_kinslayer
				trait = dynastic_kinslayer
			}
		}
	}

	additive_modifier = {
		value = 40
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_IS_SINNER

		FROMFROM = {
			OR = {
				has_character_modifier = rampant_sinner_christian
				has_character_modifier = rampant_sinner_dharmic
				has_character_modifier = known_satanist
				has_character_modifier = known_witch
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			NOT = { persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } }
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } # Ruler asking was baptized by this very same Pope
		}
	}

	additive_modifier = {
		value = 100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER_TARGET

		FROMFROM = { trait = crowned_by_myself }
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER_TARGET

		FROMFROM = {
			OR = {
				is_decision_potential = prepare_coronation_ceremony # Vanilla
				is_decision_potential = imperial_coronation # Byzantium - Plus
				is_decision_potential = royal_coronation # All others - Plus
			}

			is_adult = yes
			religion = ROOT_FROM
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE_TARGET

		FROMFROM = {
			trait = crowned_by_pope
			is_high_crowned_trigger = yes
			NOT = { persistent_event_target:coronation_priest_per = { character = ROOT_FROM } } # Ruler asking was crowned by this very same Pope
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME_TARGET

		FROMFROM = {
			trait = crowned_by_pope
			is_high_crowned_trigger = yes
			persistent_event_target:coronation_priest_per = { character = ROOT_FROM } # Ruler asking was crowned by this very same Pope
		}
	}

	additive_modifier = {
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE_TARGET

		FROMFROM = { is_liege_of = ROOT_FROM }
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY_TARGET

		FROMFROM = {
			dynasty = ROOT_FROM
			NOT = { is_close_relative = ROOT_FROM }
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE_TARGET

		FROMFROM = {
			is_close_relative = ROOT_FROM
			NOT = { is_child_of = ROOT_FROM }
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT_TARGET

		FROMFROM = { is_parent_of = ROOT_FROM }
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND_TARGET

		FROMFROM = { is_friend = ROOT_FROM }
	}

	additive_modifier = {
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER_TARGET

		FROMFROM = { is_lover = ROOT_FROM }
	}

	additive_modifier = {
		value = 100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL_TARGET

		FROMFROM = { is_rival = ROOT_FROM }
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE_TARGET

		FROMFROM = { culture = ROOT_FROM }
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL_TARGET

		FROM = {
			has_opinion_modifier = {
				who = ROOT_FROMFROM
				name = opinion_supported_cardinal
			}
		}
	}
	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE_TARGET

		FROM = {
			has_opinion_modifier = {
				who = ROOT_FROMFROM
				name = opinion_supported_pope
			}
		}
	}
	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE_TARGET

		FROMFROM = {
			has_law = investiture_law_1
			is_ruler = yes
		}
	}

	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE_TARGET

		FROMFROM = {
	 		is_preparing_crusade = yes
			has_pledged_crusade_participation = yes
		}
	}

	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE_TARGET

		FROMFROM = {
			any_war = {
				OR = {
					using_cb = new_crusade
					using_cb = crusade
				}
			}
		}
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS_TARGET
		factor = -2
		min = -45
		value = num_vassals_with_minor_title
		who = FROMFROM
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS_TARGET
		factor = -2
		min = -45
		value = num_vassals_with_minor_title
		who = FROMFROM
		key = title_fraticelli_cardinal
	}

	# Asker's Piety
	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = { piety < -250 }
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -250
			piety < -100
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -100
			piety < -50
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 150
			piety < 350
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 350
			piety < 750
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 750
			piety < 1500
		}
	}

	additive_modifier = {
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 1500
			piety < 2000
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = { piety >= 2000 }
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER_TARGET
		factor = -0.5 # +100 Opinion = -50 points
		who = FROMFROM
		this = FROM # The Pope's opinion of target
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_TARGET

		FROMFROM = { trait = zealous }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_TARGET

		FROMFROM = { trait = temperate }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_TARGET

		FROMFROM = { trait = diligent }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL_TARGET

		FROMFROM = { trait = cynical }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL_TARGET

		FROMFROM = {
			trait = lustful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS_TARGET

		FROMFROM = {
			trait = gluttonous
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY_TARGET

		FROMFROM = {
			trait = greedy
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL_TARGET

		FROMFROM = {
			trait = slothful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH_TARGET

		FROMFROM = {
			trait = wroth
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS_TARGET

		FROMFROM = {
			trait = envious
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD_TARGET

		FROMFROM = {
			trait = proud
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = diligent
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE_TARGET

		FROMFROM = { trait = temperate }

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE_TARGET

		FROMFROM = { trait = zealous }

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}
		}
	}
}

# AI logic for how the Pope should respond to the hardcoded Ask for Divorce action
# ROOT is the asker, FROM is the Pope, FROMFROM is the spouse
ask_for_divorce_chance = {
	additive_modifier = {
		value = -50
		localisation_key = AIREASON_BASE_RELUCTANCE
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_MARRIAGE_INCESTUOUS

		dynasty = FROMFROM
		NOT = { is_close_relative = FROMFROM }

		FROM = {
			NOT = { has_religion_feature = religion_holy_family }
		}
	}

	additive_modifier = {
		value = 40
		localisation_key = POPE_AIREASON_MODIFIER_MARRIAGE_INCESTUOUS

		dynasty = FROMFROM
		is_close_relative = FROMFROM

		FROM = {
			NOT = { has_religion_feature = religion_holy_family }
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_MARRIAGE_INCESTUOUS

		dynasty = FROMFROM
		NOT = { is_close_relative = FROMFROM }
		FROM = { has_religion_feature = religion_holy_family }
	}

	additive_modifier = {
		value = -40
		localisation_key = POPE_AIREASON_MODIFIER_MARRIAGE_INCESTUOUS

		dynasty = FROMFROM
		is_close_relative = FROMFROM
		FROM = { has_religion_feature = religion_holy_family }
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MARRIAGE_BARE_WOMB

		FROMFROM = {
			is_female = yes
			is_pregnant = no
			has_children = no
			practical_age >= 25
		}
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MARRIAGE_EUNUCH

		FROMFROM = {
			is_female = no
			trait = eunuch
		}
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_SPOUSE_UNFAITHFUL

		FROMFROM = {
			OR = {
				has_character_modifier = adulterer
				has_character_modifier = adulteress
				has_character_modifier = incestuous_adulterer
				has_character_modifier = incestuous_adulteress
			}
		}
	}

	additive_modifier = {
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_SPOUSE_FAITHFUL

		FROMFROM = {
			trait = chaste

			NOR = {
				has_character_modifier = adulterer
				has_character_modifier = adulteress
				has_character_modifier = incestuous_adulterer
				has_character_modifier = incestuous_adulteress
			}
		}
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_SPOUSE_HEATHEN

		FROMFROM = {
			NOT = { religion = ROOT_FROM }
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_KINSLAYER

		OR = {
			trait = kinslayer
			trait = familial_kinslayer
			trait = dynastic_kinslayer
		}
	}

	additive_modifier = {
		value = -40
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_SINNER

		OR = {
			has_character_modifier = rampant_sinner_christian
			has_character_modifier = rampant_sinner_dharmic
			has_character_modifier = known_satanist
			has_character_modifier = known_witch
		}
	}

	## Universal modifiers ##
	# Always valid for all Papal actions
	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_IS_EXCOMMUNICATED

		excommunicated_for = FROM
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		NOR = {
			persistent_event_target:baptizing_pope_per = { character = FROM }
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		persistent_event_target:baptizing_pope_per = { character = FROM } # Ruler asking was baptized by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER

		trait = crowned_by_myself
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER

		OR = {
			is_decision_potential = prepare_coronation_ceremony # Vanilla
			is_decision_potential = imperial_coronation # Byzantium - Plus
			is_decision_potential = royal_coronation # All others - Plus
		}

		is_adult = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE

		trait = crowned_by_pope
		is_high_crowned_trigger = yes

		NOR = {
			persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME

		trait = crowned_by_pope
		is_high_crowned_trigger = yes
		persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE

		is_liege_of = FROM # Overrides base acceptance
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY

		dynasty = FROM

		NOR = {
			is_close_relative = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE

		is_close_relative = FROM

		NOR = {
			is_parent_of = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT

		is_parent_of = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND

		is_friend = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER

		is_lover = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL

		is_rival = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE

		culture = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL

		reverse_has_opinion_modifier = {
			name = opinion_supported_cardinal
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE

		reverse_has_opinion_modifier = {
			name = opinion_supported_pope
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE

		has_law = investiture_law_1
		is_ruler = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE

 		is_preparing_crusade = yes
		has_pledged_crusade_participation = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE

		any_war = {
			OR = {
				using_cb = new_crusade
				using_cb = crusade
			}
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	# Influence over Cardinals
	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_fraticelli_cardinal
	}

	# Asker's Piety
	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety < -250
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -250
		piety < -100
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -100
		piety < -50
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 150
		piety < 350
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 350
		piety < 750
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 750
		piety < 1500
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 1500
		piety < 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER
		factor = 0.25 # +100 Opinion = +25 points
		who = ROOT
		this = FROM # The Pope's opinion of ROOT
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS

		trait = zealous

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL

		trait = cynical

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL

		trait = lustful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS

		trait = gluttonous
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY

		trait = greedy
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL

		trait = slothful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH

		trait = wroth
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS

		trait = envious
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD

		trait = proud
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE

		trait = zealous

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	## Modifiers evaluating the Divorce Target ##
	# Always valid for all Papal actions
	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_IS_KINSLAYER

		FROMFROM = {
			OR = {
				trait = kinslayer
				trait = familial_kinslayer
				trait = dynastic_kinslayer
			}
		}
	}

	additive_modifier = {
		value = 40
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_IS_SINNER

		FROMFROM = {
			OR = {
				has_character_modifier = rampant_sinner_christian
				has_character_modifier = rampant_sinner_dharmic
				has_character_modifier = known_satanist
				has_character_modifier = known_witch
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			NOT = { persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } }
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } # Ruler asking was baptized by this very same Pope
		}
	}

	additive_modifier = {
		value = 100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER_TARGET

		FROMFROM = { trait = crowned_by_myself }
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER_TARGET

		FROMFROM = {
			OR = {
				is_decision_potential = prepare_coronation_ceremony # Vanilla
				is_decision_potential = imperial_coronation # Byzantium - Plus
				is_decision_potential = royal_coronation # All others - Plus
			}

			is_adult = yes
			religion = ROOT_FROM
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE_TARGET

		FROMFROM = {
			trait = crowned_by_pope
			is_high_crowned_trigger = yes
			NOT = { persistent_event_target:coronation_priest_per = { character = ROOT_FROM } } # Ruler asking was crowned by this very same Pope
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME_TARGET

		FROMFROM = {
			trait = crowned_by_pope
			is_high_crowned_trigger = yes
			persistent_event_target:coronation_priest_per = { character = ROOT_FROM } # Ruler asking was crowned by this very same Pope
		}
	}

	additive_modifier = {
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE_TARGET

		FROMFROM = { is_liege_of = ROOT_FROM }
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY_TARGET

		FROMFROM = {
			dynasty = ROOT_FROM
			NOT = { is_close_relative = ROOT_FROM }
		}
	}
	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE_TARGET

		FROMFROM = {
			is_close_relative = ROOT_FROMF
			NOT = { is_child_of = ROOT_FROM }
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT_TARGET

		FROM = { is_child_of = ROOT_FROMFROM }
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND_TARGET

		FROMFROM = { is_friend = ROOT_FROM }
	}

	additive_modifier = {
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER_TARGET

		FROMFROM = { is_lover = ROOT_FROM }
	}

	additive_modifier = {
		value = 100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL_TARGET

		FROMFROM = { is_rival = ROOT_FROM }
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE_TARGET

		FROMFROM = { culture = ROOT_FROM }
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL_TARGET

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_cardinal
				who = ROOT_FROMFROM
			}
		}
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE_TARGET

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_pope
				who = ROOT_FROMFROM
			}
		}
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE_TARGET

		FROMFROM = {
			has_law = investiture_law_1
			is_ruler = yes
		}
	}

	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE_TARGET

		FROMFROM = {
	 		is_preparing_crusade = yes
			has_pledged_crusade_participation = yes
		}
	}

	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE_TARGET

		FROMFROM = {
			any_war = {
				OR = {
					using_cb = new_crusade
					using_cb = crusade
				}
			}
		}
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS_TARGET
		factor = -2
		min = -45
		value = num_vassals_with_minor_title
		who = FROMFROM
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS_TARGET
		factor = -2
		min = -45
		value = num_vassals_with_minor_title
		who = FROMFROM
		key = title_fraticelli_cardinal
	}

	# Asker's Piety
	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = { piety < -250 }
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -250
			piety < -100
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -100
			piety < -50
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 150
			piety < 350
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 350
			piety < 750
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 750
			piety < 1500
		}
	}

	additive_modifier = {
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 1500
			piety < 2000
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = { piety >= 2000 }
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER_TARGET
		factor = -0.5 # +100 Opinion = -50 points
		who = FROMFROM
		this = FROM # The Pope's opinion of target
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_TARGET

		FROMFROM = { trait = zealous }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_TARGET

		FROMFROM = { trait = temperate }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_TARGET

		FROMFROM = { trait = diligent }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL_TARGET

		FROMFROM = { trait = cynical }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL_TARGET

		FROMFROM = {
			trait = lustful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS_TARGET

		FROMFROM = {
			trait = gluttonous
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY_TARGET

		FROMFROM = {
			trait = greedy
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL_TARGET

		FROMFROM = {
			trait = slothful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH_TARGET

		FROMFROM = {
			trait = wroth
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS_TARGET

		FROMFROM = {
			trait = envious
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD_TARGET

		FROMFROM = {
			trait = proud
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = diligent
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE_TARGET

		FROMFROM = { trait = temperate }

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE_TARGET

		FROMFROM = { trait = zealous }

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}
		}
	}
}

# AI logic for how the Pope should respond to the hardcoded Ask for Ask to Lift Excommunication action
# ROOT is the asker, FROM is the Pope, FROMFROM is the target
ask_to_lift_excommunication_chance = {
	additive_modifier = {
		value = -50
		localisation_key = AIREASON_BASE_RELUCTANCE
	}

	# Never allow on yourself. Use the new decision instead.
	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_LIFT_EX_ON_YOURSELF

		character = FROMFROM
	}

	additive_modifier = { # Waging war against me right now.
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_LIFT_EX_WHILE_WARRING

		war_with = FROMFROM
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_KINSLAYER

		OR = {
			trait = kinslayer
			trait = familial_kinslayer
			trait = dynastic_kinslayer
		}
	}
	additive_modifier = {
		value = -40
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_SINNER

		OR = {
			has_character_modifier = rampant_sinner_christian
			has_character_modifier = rampant_sinner_dharmic
			has_character_modifier = known_satanist
			has_character_modifier = known_witch
		}
	}

	## Universal modifiers ##
	# Always valid for all Papal actions
	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_IS_EXCOMMUNICATED

		excommunicated_for = FROM
		NOT = { character = FROMFROM } # Redundant
	}

	additive_modifier = { # Saintly Bloodline boost
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE_TARGET

		any_owned_bloodline = {
			has_bloodline_flag = saintly_bloodline
			bloodline_is_active_for = PREV
			NOT = { has_bloodline_flag = wicked_saint }
		}

		NOT = { character = FROM }
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		NOR = {
			persistent_event_target:baptizing_pope_per = { character = FROM }
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		persistent_event_target:baptizing_pope_per = { character = FROM } # Ruler asking was baptized by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER

		trait = crowned_by_myself
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER

		OR = {
			is_decision_potential = prepare_coronation_ceremony # Vanilla
			is_decision_potential = imperial_coronation # Byzantium - Plus
			is_decision_potential = royal_coronation # All others - Plus
		}

		is_adult = yes
		religion = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE

		trait = crowned_by_pope
		is_high_crowned_trigger = yes

		NOR = {
			persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME

		trait = crowned_by_pope
		is_high_crowned_trigger = yes
		persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE

		is_liege_of = FROM # Overrides base acceptance
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY

		dynasty = FROM

		NOR = {
			is_close_relative = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE

		is_close_relative = FROM

		NOR = {
			is_parent_of = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT

		is_parent_of = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND

		is_friend = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER

		is_lover = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL

		is_rival = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE

		culture = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL

		reverse_has_opinion_modifier = {
			name = opinion_supported_cardinal
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE

		reverse_has_opinion_modifier = {
			name = opinion_supported_pope
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE

		has_law = investiture_law_1
		is_ruler = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE

 		is_preparing_crusade = yes
		has_pledged_crusade_participation = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE

		any_war = {
			OR = {
				using_cb = new_crusade
				using_cb = crusade
			}
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	# Influence over Cardinals
	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_fraticelli_cardinal
	}

	# Asker's Piety
	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety < -250
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -250
		piety < -100
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -100
		piety < -50
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 150
		piety < 350
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 350
		piety < 750
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 750
		piety < 1500
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 1500
		piety < 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER
		factor = 0.25 # +100 Opinion = +25 points
		who = ROOT
		this = FROM # The Pope's opinion of ROOT
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS

		trait = zealous

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL

		trait = cynical

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL

		trait = lustful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS

		trait = gluttonous
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY

		trait = greedy
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL

		trait = slothful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH

		trait = wroth
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS

		trait = envious
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD

		trait = proud
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE

		trait = zealous

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	## Modifiers evaluating the Excommunication Target ##
	# Always valid for all Papal actions
	additive_modifier = { # Saintly Bloodline boost
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE_TARGET

		FROMFROM = {
			any_owned_bloodline = {
				has_bloodline_flag = saintly_bloodline
				bloodline_is_active_for = PREV
				NOT = { has_bloodline_flag = wicked_saint }
			}
		}

		NOT = { character = FROM }
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			NOR = {
				persistent_event_target:baptizing_pope_per = { character = ROOT_FROM }
				character = ROOT # Don't check against yourself, silly AI
			}
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } # Ruler asking was baptized by this very same Pope
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER_TARGET

		FROMFROM = {
			trait = crowned_by_myself
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER_TARGET

		FROMFROM = {
			OR = {
				is_decision_potential = prepare_coronation_ceremony # Vanilla
				is_decision_potential = imperial_coronation # Byzantium - Plus
				is_decision_potential = royal_coronation # All others - Plus
			}

			religion = ROOT_FROM
			is_feudal = yes
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE_TARGET

		FROMFROM = {
			trait = crowned_by_pope
			is_high_crowned_trigger = yes

			NOR = {
				persistent_event_target:coronation_priest_per = { character = ROOT_FROM } # Ruler asking was crowned by this very same Pope
				character = ROOT # Don't check against yourself, silly AI
			}
		}
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME_TARGET

		FROMFROM = {
			trait = crowned_by_pope
			is_high_crowned_trigger = yes
			persistent_event_target:coronation_priest_per = { character = ROOT_FROM } # Ruler asking was crowned by this very same Pope
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE_TARGET

		FROMFROM = {
			is_liege_of = ROOT_FROM # Overrides base acceptance
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY_TARGET

		FROMFROM = {
			dynasty = ROOT_FROM

			NOR = {
				is_close_relative = ROOT_FROM
				character = ROOT # Don't check against yourself, silly AI
			}
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE_TARGET

		FROMFROM = {
			is_close_relative = ROOT_FROM

			NOR = {
				is_parent_of = ROOT_FROM
				character = ROOT # Don't check against yourself, silly AI
			}
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT_TARGET

		FROMFROM = {
			is_parent_of = ROOT_FROM
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND_TARGET

		FROMFROM = {
			is_friend = ROOT_FROM
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER_TARGET

		FROMFROM = {
			is_lover = ROOT_FROM
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL_TARGET

		FROMFROM = {
			is_rival = ROOT_FROM
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE_TARGET

		FROMFROM = {
			culture = ROOT_FROM
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL_TARGET

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_cardinal
				who = ROOT_FROMFROM
			}
		}

		NOT = { character = FROMFROM } # Don't check against yourself, silly AI
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE_TARGET

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_pope
				who = ROOT_FROMFROM
			}
		}

		NOT = { character = FROMFROM } # Don't check against yourself, silly AI
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE_TARGET

		FROMFROM = {
			has_law = investiture_law_1
			is_ruler = yes
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE_TARGET

		FROMFROM = {
			is_preparing_crusade = yes
			has_pledged_crusade_participation = yes
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 100
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE_TARGET

		FROMFROM = {
			any_war = {
				OR = {
					using_cb = new_crusade
					using_cb = crusade
				}
			}

			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	# Asker's Piety
	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety < -250
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -250
			piety < -100
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -100
			piety < -50
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 150
			piety < 350
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 350
			piety < 750
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 750
			piety < 1500
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 1500
			piety < 2000
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 2000
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_TARGET

		FROMFROM = {
			trait = zealous
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			NOR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_TARGET

		FROMFROM = {
			trait = temperate
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_TARGET

		FROMFROM = {
			trait = diligent
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL_TARGET

		FROMFROM = {
			trait = cynical
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL_TARGET

		FROMFROM = {
			trait = lustful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS_TARGET

		FROMFROM = {
			trait = gluttonous
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY_TARGET

		FROMFROM = {
			trait = greedy
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL_TARGET

		FROMFROM = {
			trait = slothful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH_TARGET

		FROMFROM = {
			trait = wroth
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS_TARGET

		FROMFROM = {
			trait = envious
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD_TARGET

		FROMFROM = {
			trait = proud
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = diligent
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE_TARGET

		FROMFROM = {
			trait = temperate
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE_TARGET

		FROMFROM = {
			trait = zealous
			NOT = { character = ROOT } # Don't check against yourself, silly AI
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}
		}
	}
}

# AI logic for how the Pope should respond to the hardcoded Ask for Money action
# ROOT is the asker, FROM is the Pope
ask_for_money_chance = {
	additive_modifier = {
		value = -50
		localisation_key = AIREASON_BASE_RELUCTANCE
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_KINSLAYER

		OR = {
			trait = kinslayer
			trait = familial_kinslayer
			trait = dynastic_kinslayer
		}
	}

	additive_modifier = {
		value = -40
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_SINNER

		OR = {
			has_character_modifier = rampant_sinner_christian
			has_character_modifier = rampant_sinner_dharmic
			has_character_modifier = known_satanist
			has_character_modifier = known_witch
		}
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_OPPOSES_EXCOMMUNICATED_LIEGE

		in_faction = faction_claimant
		liege = { excommunicated_for = FROM }
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_FACTIONS_AGAINST_ANTIPOPE

		in_faction = faction_antiking

		FROM = { is_antipope = no }
	}

	additive_modifier = {
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_ASKED_MONEY_ALREADY

		reverse_has_opinion_modifier = {
			name = asked_for_money
			who = FROM
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_LOAN_RULER_IS_RICH

		wealth >= 150
		wealth < 250
	}

	additive_modifier = {
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_LOAN_RULER_IS_RICH

		wealth >= 250
		wealth < 400
	}

	additive_modifier = {
		value = -75
		localisation_key = POPE_AIREASON_MODIFIER_LOAN_RULER_IS_RICH

		wealth >= 400
		wealth < 600
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_LOAN_RULER_IS_RICH

		wealth >= 600
	}

	additive_modifier = {
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_LOAN_CHURH_IS_BANKRUPT

		FROM = {
			wealth >= 100
			wealth < 250
		}
	}

	additive_modifier = {
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_LOAN_CHURCH_IS_BANKRUPT

		FROM = {
			wealth >= 50
			wealth < 100
		}
	}

	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_LOAN_CHURCH_IS_BANKRUPT_REALLY

		FROM = { wealth < 50 }
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_LOAN_POPE_GREEDY

		FROM = { trait = greedy }
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_LOAN_POPE_NO_REFUNDS

		reverse_has_opinion_modifier = {
			name = opinion_coronation_money_refund
			who = FROM
		}
	}

	## Universal modifiers ##
	# Always valid for all Papal actions
	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_IS_EXCOMMUNICATED

		excommunicated_for = FROM
	}

	additive_modifier = { # Saintly Bloodline boost
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE_TARGET

		any_owned_bloodline = {
			has_bloodline_flag = saintly_bloodline
			bloodline_is_active_for = PREV
			NOT = { has_bloodline_flag = wicked_saint }
		}

		NOT = { character = FROM }
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		NOR = {
			persistent_event_target:baptizing_pope_per = { character = FROM }
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		persistent_event_target:baptizing_pope_per = { character = FROM } # Ruler asking was baptized by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER

		trait = crowned_by_myself
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER

		OR = {
			is_decision_potential = prepare_coronation_ceremony # Vanilla
			is_decision_potential = imperial_coronation # Byzantium - Plus
			is_decision_potential = royal_coronation # All others - Plus
		}

		is_adult = yes
		religion = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE

		trait = crowned_by_pope
		is_high_crowned_trigger = yes

		NOR = {
			persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME

		trait = crowned_by_pope
		is_high_crowned_trigger = yes
		persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE

		is_liege_of = FROM # Overrides base acceptance
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY

		dynasty = FROM

		NOR = {
			is_close_relative = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE

		is_close_relative = FROM

		NOR = {
			is_parent_of = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT

		is_parent_of = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND

		is_friend = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER

		is_lover = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL

		is_rival = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE

		culture = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL

		reverse_has_opinion_modifier = {
			name = opinion_supported_cardinal
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE

		reverse_has_opinion_modifier = {
			name = opinion_supported_pope
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE

		has_law = investiture_law_1
		is_ruler = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE

 		is_preparing_crusade = yes
		has_pledged_crusade_participation = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE

		any_war = {
			OR = {
				using_cb = new_crusade
				using_cb = crusade
			}
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	# Influence over Cardinals
	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_fraticelli_cardinal
	}

	# Asker's Piety
	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety < -250
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -250
		piety < -100
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -100
		piety < -50
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 150
		piety < 350
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 350
		piety < 750
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 750
		piety < 1500
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 1500
		piety < 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER
		factor = 0.25 # +100 Opinion = +25 points
		who = ROOT
		this = FROM # The Pope's opinion of ROOT
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS

		trait = zealous

		FROM = {
			NOR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL

		trait = cynical

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL

		trait = lustful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS

		trait = gluttonous
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY

		trait = greedy
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL

		trait = slothful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH

		trait = wroth
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS

		trait = envious
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD

		trait = proud
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE

		trait = zealous

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}
}

# AI logic for how the Pope should respond to the hardcoded Ask for Crusade action
# ROOT is the asker, FROM is the Pope
ask_for_crusade_chance = {
	additive_modifier = {
		value = -50
		localisation_key = AIREASON_BASE_RELUCTANCE
	}

	additive_modifier = {
		value = 100
		localisation_key = POPE_AIREASON_MODIFIER_CRUSADE_ZEALOUS_POPE

		FROM = { trait = zealous }
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_KINSLAYER

		OR = {
			trait = kinslayer
			trait = familial_kinslayer
			trait = dynastic_kinslayer
		}
	}

	additive_modifier = {
		value = -40
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_SINNER

		OR = {
			has_character_modifier = rampant_sinner_christian
			has_character_modifier = rampant_sinner_dharmic
			has_character_modifier = known_satanist
			has_character_modifier = known_witch
		}
	}

#	additive_modifier = {
#		value = -25
#		localisation_key = POPE_AIREASON_MODIFIER_CRUSADE_POPE_SYMPATHETIC
#
#		trigger_if = {
#			limit = { FROM = { trait = sympathy_pagans }
#			FROMFROM = { religion_group = pagan_group }
#		}
#		trigger_else_if = {
#			limit = { FROM = { trait = sympathy_zoroastrianism }
#			FROMFROM = { religion_group = zoroastrian_group }
#		}
#		trigger_else_if = {
#			limit = { FROM = { trait = sympathy_islam }
#			FROMFROM = { religion_group = muslim }
#		}
#		trigger_else_if = {
#			limit = { FROM = { trait = sympathy_judaism }
#			FROMFROM = { religion_group = jewish_group }
#		}
#		trigger_else_if = {
#			limit = { FROM = { trait = sympathy_indian }
#			FROMFROM = { religion_group = indian_group }
#		}
#	}
#
#	additive_modifier = {
#		value = 25
#		localisation_key = POPE_AIREASON_MODIFIER_CRUSADE_HOLY_LAND
#
#		FROMFROM = { completely_controls = d_jerusalem }
#	}
#
#	additive_modifier = {
#		value = 50
#		localisation_key = POPE_AIREASON_MODIFIER_CRUSADE_ROME
#
#		FROMFROM = { completely_controls = d_latium }
#	}
#
#	# The Smaller the target's realm is, the less likely the Pope is to grant the Crusade.
#	additive_modifier = { # Realm size
#		value = -50
#		localisation_key = POPE_AIREASON_MODIFIER_CRUSADE_REALM_SIZE_TARGET_TINY
#
#		FROMFROM = { realm_size < 10 }
#	}
#
#	additive_modifier = { # Realm size
#		value = -25
#		localisation_key = POPE_AIREASON_MODIFIER_CRUSADE_REALM_SIZE_TARGET
#
#		FROMFROM = {
#			realm_size >= 10
#			realm_size < 25
#		}
#	}
#
#	additive_modifier = { # Realm size
#		value = -5
#		localisation_key = POPE_AIREASON_MODIFIER_REALM_SIZE_TARGET
#
#		FROMFROM = {
#			realm_size >= 25
#			realm_size < 50
#		}
#	}

	## Universal modifiers ##
	# Always valid for all Papal actions
	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_IS_EXCOMMUNICATED

		excommunicated_for = FROM
	}

	additive_modifier = { # Saintly Bloodline boost
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE_TARGET

		any_owned_bloodline = {
			has_bloodline_flag = saintly_bloodline
			bloodline_is_active_for = PREV
			NOT = { has_bloodline_flag = wicked_saint }
		}

		NOT = { character = FROM }
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_FAITH_THREATENED

		religion_authority >= 0.50
		NOT = { religion_authority >= 0.70 }
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_FAITH_THREATENED

		religion_authority >= 0.25
		NOT = { religion_authority >= 0.50 }
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_FAITH_THREATENED_FORREALS

		religion_authority >= 0.25
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		NOR = {
			persistent_event_target:baptizing_pope_per = { character = FROM }
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		persistent_event_target:baptizing_pope_per = { character = FROM } # Ruler asking was baptized by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER

		trait = crowned_by_myself
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER

		OR = {
			is_decision_potential = prepare_coronation_ceremony # Vanilla
			is_decision_potential = imperial_coronation # Byzantium - Plus
			is_decision_potential = royal_coronation # All others - Plus
		}

		is_adult = yes
		religion = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE

		trait = crowned_by_pope
		is_high_crowned_trigger = yes

		NOR = {
			persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME

		trait = crowned_by_pope
		is_high_crowned_trigger = yes
		persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE

		is_parent_of = FROM # Overrides base acceptance
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY

		dynasty = FROM

		NOR = {
			is_close_relative = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE

		is_close_relative = FROM

		NOR = {
			is_parent_of = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT

		is_parent_of = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND

		is_friend = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER

		is_lover = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL

		is_rival = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE

		culture = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL

		reverse_has_opinion_modifier = {
			name = opinion_supported_cardinal
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE

		reverse_has_opinion_modifier = {
			name = opinion_supported_pope
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE

		has_law = investiture_law_1
		is_ruler = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE

 		is_preparing_crusade = yes
		has_pledged_crusade_participation = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE

		any_war = {
			OR = {
				using_cb = new_crusade
				using_cb = crusade
			}
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	# Influence over Cardinals
	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 4
		max = 80
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 4
		max = 80
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_fraticelli_cardinal
	}

	# Asker's Piety
	additive_modifier = {
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety < -250
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -250
		piety < -100
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -100
		piety < -50
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 150
		piety < 350
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 350
		piety < 750
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 750
		piety < 1500
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 40
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 1500
		piety < 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 80
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER
		factor = 0.5 # +100 Opinion = +50 points
		who = ROOT
		this = FROM # The Pope's opinion of ROOT
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS

		trait = zealous

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND

		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}
		trait = kind

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL

		trait = cynical

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL

		trait = lustful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS

		trait = gluttonous
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY

		trait = greedy
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL

		trait = slothful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH

		trait = wroth
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS

		trait = envious
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD

		trait = proud
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE

		trait = zealous

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}
}

# AI logic for how the Pope should respond to the hardcoded Ask for Claim action
# ROOT is the asker, FROM is the Pope, FROMFROM is the target character, FROMFROMFROM is the target title
ask_for_claim_chance = {
	additive_modifier = {
		value = -50
		localisation_key = AIREASON_BASE_RELUCTANCE
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_KINSLAYER

		OR = {
			trait = kinslayer
			trait = familial_kinslayer
			trait = dynastic_kinslayer
		}
	}

	additive_modifier = {
		value = -40
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_SINNER

		OR = {
			has_character_modifier = rampant_sinner_christian
			has_character_modifier = rampant_sinner_dharmic
			has_character_modifier = known_satanist
			has_character_modifier = known_witch
		}
	}

	additive_modifier = { # Title history
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_TITLE_HELD_BY_DYNASTY

		real_tier = EMPEROR

		FROMFROMFROM = {
			any_previous_holder = { dynasty = ROOT }
		}
	}

	additive_modifier = { # Culture
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_CULTURE_AS_TARGET

		culture = FROMFROM
	}

	additive_modifier = { # Dynasty
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_DYNASTY_AS_TARGET

		dynasty = FROMFROM
		is_lowborn = no
	}

	additive_modifier = { # Close Relative
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_CLOSE_RELATIVE_OF_TARGET
		is_close_relative = FROMFROM
	}

	additive_modifier = { # Bullying
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_LOWER_TIER_THAN_TARGET

		real_tier = COUNT
		higher_real_tier_than = FROMFROM
	}

	additive_modifier = { # Bullying
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_LOWER_TIER_THAN_TARGET

		real_tier = DUKE
		higher_real_tier_than = FROMFROM
	}

	additive_modifier = { # Bullying
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_LOWER_TIER_THAN_TARGET

		real_tier = KING
		FROMFROM = { real_tier = DUKE }
	}

	additive_modifier = { # Bullying
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_LOWER_TIER_THAN_TARGET

		real_tier = KING
		FROMFROM = { real_tier = COUNT }
	}

	additive_modifier = { # Bullying
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_LOWER_TIER_THAN_TARGET

		real_tier = KING
		FROMFROM = { real_tier = BARON }
	}

	additive_modifier = { # Bullying
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_LOWER_TIER_THAN_TARGET

		real_tier = EMPEROR
		FROMFROM = { real_tier = KING }
	}

	additive_modifier = { # Bullying
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_LOWER_TIER_THAN_TARGET

		real_tier = EMPEROR
		FROMFROM = { real_tier = DUKE }
	}

	additive_modifier = { # Bullying
		value = -35
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_LOWER_TIER_THAN_TARGET

		real_tier = EMPEROR
		FROMFROM = { real_tier = COUNT }
	}

	additive_modifier = { # Bullying
		value = -40
		localisation_key = POPE_AIREASON_MODIFIER_CLAIM_SAME_LOWER_TIER_THAN_TARGET

		real_tier = EMPEROR
		FROMFROM = { real_tier = BARON }
	}

	additive_modifier = { # Sexism
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_OF_CLAIM_IS_FEMALE

		is_female = no
		FROMFROM = { is_female = yes }

		FROMFROMFROM = {
			OR = {
				has_law = agnatic_succession
				has_law = cognatic_succession
			}
		}

		NOR = { # Random world woes
			has_religion_feature = religion_equal
			has_religion_feature = religion_matriarchal
			has_religion_feature = religion_feature_bon
		}
	}

	additive_modifier = { # Sexism
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_OF_CLAIM_IS_MALE

		is_female = yes
		FROMFROM = { is_female = no }

		FROMFROMFROM = {
			OR = {
				has_law = enatic_succession
				has_law = enatic_cognatic_succession
			}
		}

		NOR = { # Random world woes
			has_religion_feature = religion_equal
			has_religion_feature = religion_patriarchal
			has_religion_feature = religion_feature_bon
		}
	}

	additive_modifier = { # Ageism
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_BABY

		is_adult = yes
		FROMFROM = { age < 5 }
	}

	additive_modifier = { # Ageism
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_IS_CHILD

		is_adult = yes

		FROMFROM = {
			age >= 5
			is_adult = no
		}
	}

	additive_modifier = { # Ageism
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_HEIRLESSNESS

		is_adult = yes
		practical_age < 40

		NOR = {
			trait = celibate
			trait = eunuch
		}

		FROMFROM = {
			practical_age >= 40
			has_living_children = yes
		}
	}

	## Universal modifiers ##
	# Always valid for all Papal actions
	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_IS_EXCOMMUNICATED

		excommunicated_for = FROM
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		NOR = {
			persistent_event_target:baptizing_pope_per = { character = FROM }
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		persistent_event_target:baptizing_pope_per = { character = FROM } # Ruler asking was baptized by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER

		trait = crowned_by_myself
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER

		OR = {
			is_decision_potential = prepare_coronation_ceremony # Vanilla
			is_decision_potential = imperial_coronation # Byzantium - Plus
			is_decision_potential = royal_coronation # All others - Plus
		}

		is_adult = yes
		religion = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE

		trait = crowned_by_pope
		is_high_crowned_trigger = yes

		NOR = {
			persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME

		trait = crowned_by_pope
		is_high_crowned_trigger = yes
		persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE

		is_liege_of = FROM # Overrides base acceptance
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY

		dynasty = FROM

		NOR = {
			is_close_relative = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE

		is_close_relative = FROM

		NOR = {
			is_parent_of = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT

		is_parent_of = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND

		is_friend = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER

		is_lover = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL

		is_rival = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL

		reverse_has_opinion_modifier = {
			name = opinion_supported_cardinal
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE

		reverse_has_opinion_modifier = {
			name = opinion_supported_pope
			who = FROM
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE

		has_law = investiture_law_1
		is_ruler = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE

 		is_preparing_crusade = yes
		has_pledged_crusade_participation = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE

		any_war = {
			OR = {
				using_cb = new_crusade
				using_cb = crusade
			}
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	# Influence over Cardinals
	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_fraticelli_cardinal
	}

	# Asker's Piety
	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety < -250
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -250
		piety < -100
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -100
		piety < -50
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 150
		piety < 350
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 350
		piety < 750
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 750
		piety < 1500
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 1500
		piety < 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER
		factor = 0.25 # +100 Opinion = +25 points
		who = ROOT
		this = FROM # The Pope's opinion of ROOT
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS

		trait = zealous

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL

		trait = cynical

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL

		trait = lustful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS

		trait = gluttonous
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY

		trait = greedy
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL

		trait = slothful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH

		trait = wroth
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS

		trait = envious
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD

		trait = proud
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE

		trait = zealous

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	## Modifiers evaluating the Claim Target Holder ##
	# Always valid for all Papal actions
	additive_modifier = { # Saintly Bloodline boost
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE_TARGET

		FROMFROM = {
			any_owned_bloodline = {
				has_bloodline_flag = saintly_bloodline
				bloodline_is_active_for = PREV
				NOT = { has_bloodline_flag = wicked_saint }
			}
		}

		NOT = { character = FROM }
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_IS_KINSLAYER

		FROMFROM = {
			OR = {
				trait = kinslayer
				trait = familial_kinslayer
				trait = dynastic_kinslayer
			}
		}
	}

	additive_modifier = {
		value = 40
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_IS_SINNER

		FROMFROM = {
			OR = {
				has_character_modifier = rampant_sinner_christian
				has_character_modifier = rampant_sinner_dharmic
				has_character_modifier = known_satanist
				has_character_modifier = known_witch
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			NOT = { persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } }
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } # Ruler asking was baptized by this very same Pope
		}
	}

	additive_modifier = {
		value = 100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER_TARGET

		FROMFROM = { trait = crowned_by_myself }
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER_TARGET

		FROMFROM = {
			OR = {
				is_decision_potential = prepare_coronation_ceremony # Vanilla
				is_decision_potential = imperial_coronation # Byzantium - Plus
				is_decision_potential = royal_coronation # All others - Plus
			}

			is_adult = yes
			religion = ROOT_FROM
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE_TARGET

		FROMFROM = {
			trait = crowned_by_pope
			is_high_crowned_trigger = yes
			NOT = { persistent_event_target:coronation_priest_per = { character = ROOT_FROM } } # Ruler asking was crowned by this very same Pope
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME_TARGET

		FROMFROM = {
			trait = crowned_by_pope
			is_high_crowned_trigger = yes
			persistent_event_target:coronation_priest_per = { character = ROOT_FROM } # Ruler asking was crowned by this very same Pope
		}
	}

	additive_modifier = {
		value = -50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE_TARGET

		FROMFROM = { is_liege_of = ROOT_FROM } # Overrides base acceptance
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY_TARGET

		FROMFROM = {
			dynasty = ROOT_FROM
			NOT = { is_close_relative = ROOT_FROM }
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE_TARGET

		FROMFROM = {
			is_close_relative = ROOT_FROM
			NOT = { is_child_of = ROOT_FROM }
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT_TARGET

		FROMFROM = { is_parent_of = ROOT_FROM }
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND_TARGET

		FROMFROM = { is_friend = ROOT_FROM }
	}

	additive_modifier = {
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER_TARGET

		FROMFROM = { is_lover = ROOT_FROM }
	}

	additive_modifier = {
		value = 100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL_TARGET

		FROMFROM = { is_rival = ROOT_FROM }
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE_TARGET

		FROMFROM = { culture = ROOT_FROM }
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL_TARGET

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_cardinal
				who = ROOT_FROMFROM
			}
		}
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE_TARGET

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_pope
				who = ROOT_FROMFROM
			}
		}
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE_TARGET

		FROMFROM = {
			has_law = investiture_law_1
			is_ruler = yes
		}
	}

	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE_TARGET

		FROMFROM = {
	 		is_preparing_crusade = yes
			has_pledged_crusade_participation = yes
		}
	}

	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE_TARGET

		FROMFROM = {
			any_war = {
				OR = {
					using_cb = new_crusade
					using_cb = crusade
				}
			}
		}
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS_TARGET
		factor = -2
		min = -45
		value = num_vassals_with_minor_title
		who = FROMFROM
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS_TARGET
		factor = -2
		min = -45
		value = num_vassals_with_minor_title
		who = FROMFROM
		key = title_fraticelli_cardinal
	}

	# Target's Piety
	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = { piety < -250 }
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -250
			piety < -100
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -100
			piety < -50
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 150
			piety < 350
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 350
			piety < 750
		}
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 750
			piety < 1500
		}
	}

	additive_modifier = {
		value = -20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 1500
			piety < 2000
		}
	}

	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = { piety >= 2000 }
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER_TARGET
		factor = -0.25 # +100 Opinion = -25 points
		who = ROOT
		this = FROMFROM # The Pope's opinion of ROOT
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_TARGET

		FROMFROM = { trait = zealous }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_TARGET

		FROMFROM = { trait = temperate }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_TARGET

		FROMFROM = { trait = diligent }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL_TARGET

		FROMFROM = { trait = cynical }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL_TARGET

		FROMFROM = {
			trait = lustful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS_TARGET

		FROMFROM = {
			trait = gluttonous
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY_TARGET

		FROMFROM = {
			trait = greedy
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL_TARGET

		FROMFROM = {
			trait = slothful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH_TARGET

		FROMFROM = {
			trait = wroth
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS_TARGET

		FROMFROM = {
			trait = envious
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD_TARGET

		FROMFROM = {
			trait = proud
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = diligent
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE_TARGET

		FROMFROM = { trait = temperate }

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE_TARGET

		FROMFROM = { trait = zealous }

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}
		}
	}
}

# AI logic for how the Pope should respond to the hardcoded Nominate Bishop action
# ROOT is the asker, FROM is the Pope, FROMFROM is the potential bishop
nominate_bishop_chance = {
	additive_modifier = {
		value = -50
		localisation_key = AIREASON_BASE_RELUCTANCE
	}

	additive_modifier = { # Theological education
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BISHOP_EDUCATION

		FROMFROM = { has_education_learning_trigger = yes }
	}

	# Tiered learning
	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_BISHOP_LEARNING

		FROMFROM = { learning < 5 }
	}

	additive_modifier = {
		value = 2
		localisation_key = POPE_AIREASON_MODIFIER_BISHOP_LEARNING

		FROMFROM = {
			learning >= 5
			learning < 8
		}
	}

	additive_modifier = {
		value = 4
		localisation_key = POPE_AIREASON_MODIFIER_BISHOP_LEARNING

		FROMFROM = {
			learning >= 8
			learning < 12
		}
	}

	additive_modifier = {
		value = 6
		localisation_key = POPE_AIREASON_MODIFIER_BISHOP_LEARNING

		FROMFROM = {
			learning >= 12
			learning < 16
		}
	}

	additive_modifier = {
		value = 8
		localisation_key = POPE_AIREASON_MODIFIER_BISHOP_LEARNING

		FROMFROM = {
			learning >= 16
			learning < 20
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BISHOP_LEARNING

		FROMFROM = { learning >= 20 }
	}

	## Universal modifiers ##
	# Always valid for all Papal actions
	additive_modifier = {
		value = -1000
		localisation_key = POPE_AIREASON_MODIFIER_IS_EXCOMMUNICATED

		excommunicated_for = FROM
	}

	additive_modifier = { # Saintly Bloodline boost
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE_TARGET

		any_owned_bloodline = {
			has_bloodline_flag = saintly_bloodline
			bloodline_is_active_for = PREV
			NOT = { has_bloodline_flag = wicked_saint }
		}

		NOT = { character = FROM }
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		NOR = {
			persistent_event_target:baptizing_pope_per = { character = FROM }
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME

		OR = {
			trait = baptized_by_pope
			trait = baptized_by_patriarch
		}

		persistent_event_target:baptizing_pope_per = { character = FROM } # Ruler asking was baptized by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_NAPOLEON_RULER

		trait = crowned_by_myself
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_UNCROWNED_RULER

		OR = {
			is_decision_potential = prepare_coronation_ceremony # Vanilla
			is_decision_potential = imperial_coronation # Byzantium - Plus
			is_decision_potential = royal_coronation # All others - Plus
		}

		is_adult = yes
		religion = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_POPE

		trait = crowned_by_pope
		is_high_crowned_trigger = yes

		NOR = {
			persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_CROWNED_BY_ME

		trait = crowned_by_pope
		is_high_crowned_trigger = yes
		persistent_event_target:coronation_priest_per = { character = FROM } # Ruler asking was crowned by this very same Pope
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 50
		localisation_key = POPE_AIREASON_MODIFIER_PET_POPE

		is_liege_of = FROM # Overrides base acceptance
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY

		dynasty = FROM

		NOR = {
			is_close_relative = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE

		is_close_relative = FROM

		NOR = {
			is_parent_of = FROM
			character = FROM # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT

		is_parent_of = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND

		is_friend = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER

		is_lover = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL

		is_rival = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE

		culture = FROM
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_cardinal
				who = ROOT
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_pope
				who = ROOT
			}

			NOT = { character = ROOT } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -30
		localisation_key = POPE_AIREASON_MODIFIER_FREE_INVESTITURE

		has_law = investiture_law_1
		is_ruler = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_PLEDGED_TO_CRUSADE

 		is_preparing_crusade = yes
		has_pledged_crusade_participation = yes
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_WAGING_CRUSADE

		any_war = {
			OR = {
				using_cb = new_crusade
				using_cb = crusade
			}
		}

		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	# Influence over Cardinals
	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_cardinal
	}

	additive_exported_value_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_CONTROLLED_CARDINALS
		factor = 2
		max = 45
		value = num_vassals_with_minor_title
		who = ROOT
		key = title_fraticelli_cardinal
	}

	# Asker's Piety
	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety < -250
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -250
		piety < -100
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= -100
		piety < -50
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 150
		piety < 350
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 350
		piety < 750
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 750
		piety < 1500
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 1500
		piety < 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY

		piety >= 2000
		NOT = { character = FROM } # Not on yourself, dirty Pope
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER
		factor = 0.25 # +100 Opinion = +25 points
		who = ROOT
		this = FROM # The Pope's opinion of ROOT
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS

		trait = zealous

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL

		trait = cynical

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = cynical
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL

		trait = lustful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = lustful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS

		trait = gluttonous
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = gluttonous
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY

		trait = greedy
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = greedy
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL

		trait = slothful
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = slothful
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH

		trait = wroth
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = wroth
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS

		trait = envious
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = envious
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD

		trait = proud
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			has_bad_priest_trait_trigger = no

			NOR = {
				trait = proud
				character = ROOT # Not on yourself, dirty Pope
			}
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE

		trait = humble
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}

			NOT = {	character = FROM } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE

		trait = kind
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}

			NOT = {	character = FROM } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE

		trait = patient
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}

			NOT = {	character = FROM } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE

		trait = diligent
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}

			NOT = {	character = FROM } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE

		trait = charitable
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}

			NOT = {	character = FROM } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE

		trait = temperate
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}

			NOT = {	character = FROM } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE

		trait = chaste
		religion_group = christian # Reformed Pagans shouldn't use these

		trigger_if = {
			limit = { is_alternate_start = yes }

			has_alternate_start_parameter = { key = religion_features value = historical }
			has_alternate_start_parameter = { key = religion_names value = historical }
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}

			NOT = {	character = FROM } # Not on yourself, dirty Pope
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE

		trait = zealous

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}

			NOT = {	character = FROM } # Not on yourself, dirty Pope
		}
	}

	## Modifiers evaluating the potential Bishop ##
	# Always valid for all Papal actions
	additive_modifier = {
		value = -25
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_IS_KINSLAYER

		FROMFROM = {
			OR = {
				trait = kinslayer
				trait = familial_kinslayer
				trait = dynastic_kinslayer
			}
		}
	}

	additive_modifier = {
		value = -40
		localisation_key = POPE_AIREASON_MODIFIER_TARGET_IS_SINNER

		FROMFROM = {
			OR = {
				has_character_modifier = rampant_sinner_christian
				has_character_modifier = rampant_sinner_dharmic
				has_character_modifier = known_satanist
				has_character_modifier = known_witch
			}
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_CHILD_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			NOT = { persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } }
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_BAPTIZED_BY_ME_TARGET

		FROMFROM = {
			OR = {
				trait = baptized_by_pope
				trait = baptized_by_patriarch
			}

			persistent_event_target:baptizing_pope_per = { character = ROOT_FROM } # Ruler asking was baptized by this very same Pope
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_DYNASTY_TARGET

		FROMFROM = {
			dynasty = ROOT_FROM
			NOT = { is_close_relative = ROOT_FROM }
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_CLOSE_RELATIVE_TARGET

		FROMFROM = {
			is_close_relative = ROOT_FROM
			NOT = { is_child_of = ROOT_FROM }
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_PARENT_TARGET

		FROMFROM = { is_parent_of = ROOT_FROM }
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MY_FRIEND_TARGET

		FROMFROM = { is_friend = ROOT_FROM }
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_MY_LOVER_TARGET

		FROMFROM = { is_lover = ROOT_FROM }
	}

	additive_modifier = {
		value = -100
		localisation_key = POPE_AIREASON_MODIFIER_MY_RIVAL_TARGET

		FROMFROM = { is_rival = ROOT_FROM }
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_SAME_CULTURE_TARGET

		FROMFROM = { culture = ROOT_FROM }
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_CARDINAL_TARGET

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_cardinal
				who = ROOT_FROMFROM
			}
		}
	}

	additive_modifier = {
		value = 30
		localisation_key = POPE_AIREASON_MODIFIER_MADE_ME_POPE_TARGET

		FROM = {
			has_opinion_modifier = {
				name = opinion_supported_pope
				who = ROOT_FROMFROM
			}
		}
	}

	# Asker's Piety
	additive_modifier = {
		value = -15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = { piety < -250 }
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -250
			piety < -100
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= -100
			piety < -50
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 150
			piety < 350
		}
	}

	additive_modifier = {
		value = 10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 350
			piety < 750
		}
	}

	additive_modifier = {
		value = 15
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 750
			piety < 1500
		}
	}

	additive_modifier = {
		value = 20
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = {
			piety >= 1500
			piety < 2000
		}
	}

	additive_modifier = {
		value = 25
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PIETY_TARGET

		FROMFROM = { piety >= 2000 }
	}

	additive_opinion_modifier = {
		localisation_key = POPE_AIREASON_MODIFIER_OPINION_RULER_TARGET
		factor = -0.5 # +100 Opinion = -50 points
		who = FROMFROM
		this = FROM # The Pope's opinion of ROOT
	}

	additive_modifier = { # Saintly Bloodline boost
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HAS_SAINTLY_BLOODLINE_TARGET

		FROMFROM = {
			any_owned_bloodline = {
				has_bloodline_flag = saintly_bloodline
				bloodline_is_active_for = PREV
				NOT = { has_bloodline_flag = wicked_saint }
			}
		}

		NOT = { character = FROM }
	}

	# Modifiers vs Virtuous Pope
	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_TARGET

		FROMFROM = { trait = zealous }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_TARGET

		FROMFROM = { trait = temperate }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_TARGET

		FROMFROM = { trait = diligent }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = 5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CYNICAL_TARGET

		FROMFROM = { trait = cynical }

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = cynical }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_LUSTFUL_TARGET

		FROMFROM = {
			trait = lustful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = lustful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GLUTTONOUS_TARGET

		FROMFROM = {
			trait = gluttonous
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = gluttonous }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_GREEDY_TARGET

		FROMFROM = {
			trait = greedy
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = greedy }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_SLOTHFUL_TARGET

		FROMFROM = {
			trait = slothful
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = slothful }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_WROTH_TARGET

		FROMFROM = {
			trait = wroth
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = wroth }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ENVIOUS_TARGET

		FROMFROM = {
			trait = envious
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = envious }
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PROUD_TARGET

		FROMFROM = {
			trait = proud
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			has_bad_priest_trait_trigger = no
			NOT = { trait = proud }
		}
	}

	# Modifiers vs Wicked Pope
	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_HUMBLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = humble
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = proud
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_KIND_NEGATIVE_TARGET

		FROMFROM = {
			trait = kind
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = envious
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_PATIENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = patient
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = wroth
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_DILIGENT_NEGATIVE_TARGET

		FROMFROM = {
			trait = diligent
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = slothful
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHARITABLE_NEGATIVE_TARGET

		FROMFROM = {
			trait = charitable
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = greedy
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_TEMPERATE_NEGATIVE_TARGET

		FROMFROM = { trait = temperate }

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = gluttonous
			}
		}
	}

	additive_modifier = {
		value = -5
		localisation_key = POPE_AIREASON_MODIFIER_RULER_CHASTE_NEGATIVE_TARGET

		FROMFROM = {
			trait = chaste
			religion_group = christian # Reformed Pagans shouldn't use these

			trigger_if = {
				limit = { is_alternate_start = yes }

				has_alternate_start_parameter = { key = religion_features value = historical }
				has_alternate_start_parameter = { key = religion_names value = historical }
			}
		}

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = lustful
			}
		}
	}

	additive_modifier = {
		value = -10
		localisation_key = POPE_AIREASON_MODIFIER_RULER_ZEALOUS_NEGATIVE_TARGET

		FROMFROM = { trait = zealous }

		FROM = {
			OR = {
				has_bad_priest_trait_trigger = yes
				trait = cynical
			}
		}
	}
}