﻿impress_intent_vassalization_acceptance_value = { # values synced with offer_vassalization_interaction
	value = -50
	#Perks
	if = {
		limit = {
			has_perk = true_ruler_perk
		}
		add = true_ruler_value
	}
	# Education 5 boost
	if = {
		limit = {
			has_trait_with_flag = offer_vassalisation_25
		}
		add = 25
	}
	if = {
		limit = {
			has_trait_with_flag = offer_vassalisation_25
		}
		add = 25
	}
	#Events
	if = {
		limit = {
			 has_character_modifier = event_bonus_to_vassal_accept
		}
		add = 20
	}
	# STRUGGLES - bonus gained by successful Sway scheme during the Persian Struggle
	if = {
		limit = {
			scope:impress_check = {
				has_opinion_modifier = {
					modifier = scheme_sway_and_compelled_to_submit_opinion
					target = root
				}
			}
		}
		add = 20
	}
	#Rekindler of Iran
	if = {
		limit = {
			dynasty ?= { has_dynasty_modifier = fp3_rekindler_of_iran_modifier }
			scope:impress_check = {
				culture = { has_cultural_pillar = heritage_iranian }
			}
		}
		add = 20
	}
	#Obedience
	if = {
		limit = {
			scope:impress_check = {
				is_obedient_to = prev
			}
		}
		add = 20
	}
	#Cultural Acceptance
	if = {
		limit = {
			NOT = { has_same_culture_as = scope:impress_check }
			culture = {
				cultural_acceptance = { target = scope:impress_check.culture value <= 90 }
			}
		}
		add = offer_vassalage_acceptance_value
	}
	#Has no Available Vassal Limit
	if = {
		limit = { vassal_limit_available < 1 }
		add = -1000
	}
	#Different faith, no pluralism.
	if = { 
		limit = {
			scope:impress_check = {
				NOR = { #Of two different faiths AND the potential vassal's faith is not pluralistic.
					faith = root.faith
					faith = { has_doctrine = doctrine_pluralism_pluralistic }
				}
			}
		}
		add = {
			value = -40
			if = {
				limit = {
					scope:impress_check.faith = {
						faith_hostility_level = {
							target = root.faith
							value >= faith_hostile_level
						}
					}
				}
				add = -40
			}
			if = {
				limit = {
					scope:impress_check.faith = {
						faith_hostility_level = {
							target = root.faith
							value >= faith_evil_level
						}
					}
				}
				add = -40
			}
		}
	}
	#Different faith, pluralism.
	if = {
		limit = {
			scope:impress_check = {
				faith != root.faith
				faith = { has_doctrine = doctrine_pluralism_pluralistic }
			}
			NOT = {
				root.faith = { has_doctrine = doctrine_pluralism_pluralistic }
			}
		}
		add = {
			value = -20
			if = {
				limit = {
					scope:impress_check.faith = {
						faith_hostility_level = {
							target = root.faith
							value >= faith_hostile_level
						}
					}
				}
				add = -20
			}
			if = {
				limit = {
					scope:impress_check.faith = {
						faith_hostility_level = {
							target = root.faith
							value >= faith_evil_level
						}
					}
				}
				add = -20
			}
		}
	}
	#Different faith, both have pluralism.
	if = {
		limit = {
			scope:impress_check = {
				faith != root.faith
				root.faith = { has_doctrine = doctrine_pluralism_pluralistic }
				faith = { has_doctrine = doctrine_pluralism_pluralistic }
			}
		}
		add = {
			value = -10
			if = {
				limit = {
					scope:impress_check.faith = {
						faith_hostility_level = {
							target = root.faith
							value >= faith_hostile_level
						}
					}
				}
				add = -10
			}
			if = {
				limit = {
					scope:impress_check.faith = {
						faith_hostility_level = {
							target = root.faith
							value >= faith_evil_level
						}
					}
				}
				add = -10
			}
		}
	}
	#I am a King! Or Emperor
	if = {
		limit = {
			scope:impress_check = { highest_held_title_tier = tier_kingdom }
		}
		add = {
			value = -50
			if = {
				limit = {
					scope:impress_check = {
						OR = {
							government_has_flag = government_is_republic
							government_has_flag = government_is_theocracy
						}
					}
				}
				add = -50
			}
			if = {
				limit = {
					scope:impress_check.sub_realm_size >= 5
				}
				add = -50
			}
			if = {
				limit = {
					scope:impress_check.sub_realm_size >= 10
				}
				add = -100
			}
			if = {
				limit = {
					scope:impress_check.highest_held_title_tier = tier_empire
				}
				multiply = 1.5
			}
		}
	}
	#We just fought against each other.
	if = {
		limit = {
			scope:impress_check = {
				any_truce_holder = {
					this = root
				}
			}
		}
		add = -50
	}
	#I fought an independence war against you.
	if = {
		limit = {
			scope:impress_check = {
				exists = var:independence_war_former_liege
				var:independence_war_former_liege = root
			}
		}
		add = -200
	}
	# I am Tribal and you are not
	if = {
		limit = {
			scope:impress_check = {
				government_has_flag = government_is_tribal
			}
			root = {
				NOT = { government_has_flag = government_is_tribal }
			}
		}
		add = -20
	}
	# You are Tribal and I am not
	if = {
		limit = {
			root = {
				government_has_flag = government_is_tribal
			}
			scope:impress_check = {
				NOT = { government_has_flag = government_is_tribal }
			}
		}
		add = -20
	}
	# I am Nomadic and you are Nomadic
	if = {
		limit = {
			scope:impress_check = { government_has_flag = government_is_nomadic }
			government_has_flag = government_is_nomadic
		}
		add = -50
	}
	# I am Nomadic and you are not
	if = {
		limit = {
			scope:impress_check = { government_has_flag = government_is_nomadic }
			NOT = { government_has_flag = government_is_nomadic }
		}
		add = -75
	}
	# You are Nomadic and I am not
	if = {
		limit = {
			government_has_flag = government_is_nomadic
			scope:impress_check = { government_has_flag = government_is_nomadic }
		}
		add = -75
	}
	#Isolationist tradition
	if = {
		limit = {
			root.culture != scope:impress_check.culture
			scope:impress_check.culture = {
				has_cultural_tradition = tradition_isolationist
			}
		}
		add = -20
	}
	#Bankrupt
	if = {
		limit = {
			root.gold <= -1
		}
		add = -100
	}
	#Wide difference in rank
	if = {
		limit = {
			root = {
				tier_difference = {
					target = scope:impress_check
					value > 1
				}
			}
		}
		add = 10
	}
	# Is a Hegemon
	if = {
		limit = {
			highest_held_title_tier = tier_hegemony
		}
		add = 10
	}
	# Allied
	if = {
		limit = {
			scope:impress_check = {
				is_allied_to = root
			}
		}
		add = 20
	}
	# Is the Rightful Liege of recipient
	if = {
		limit = {
			is_rightful_liege_of = scope:impress_check
		}
		add = 20
	}
	if = {
		limit = {
			NOT = { is_rightful_liege_of = scope:impress_check }
			root = { is_hre_candidate_ruler = yes }
			scope:impress_check = {
				capital_province = {
					OR = {
						geographical_region = world_europe_west_germania
						geographical_region = custom_northern_italy
						geographical_region = custom_burgundy
					}
				}
			}
		}
		add = 20
	}
	#Is not the Rightful Liege of recipient
	if = {
		limit = {
			NOR = {
				is_rightful_liege_of = scope:impress_check
				AND = {
					root = { is_hre_candidate_ruler = yes }
					scope:impress_check = {
						capital_province = {
							OR = {
								geographical_region = world_europe_west_germania
								geographical_region = custom_northern_italy
								geographical_region = custom_burgundy
							}
						}
					}
				}
			}
		}
		add = -20
	}
	# Encircled
	if = {
		limit = {
			scope:impress_check = {
				NOT = {
					any_neighboring_top_liege_realm_owner = {
						this != root
					}
				}
				NOT = {
					any_realm_county = {
						is_coastal_county = yes
					}
				}
			}
		}
		add = 20
	}
	#Distant Realm — Overseas Connection
	if = {
		limit = {
			root = {
				character_is_realm_neighbor = scope:impress_check
				NOT = { #Ibiza should want to be a vassal of Mallorca, etc.
					character_is_land_realm_neighbor = scope:impress_check
					is_rightful_liege_of = scope:impress_check
				}
			}
		}
		add = -100
	}
	#Distant Realm - No Connection
	if = {
		limit = {
			NOT = {
				character_is_realm_neighbor = scope:impress_check
			}
			scope:impress_check.capital_province = {
				squared_distance = { target = prev.capital_province value < 200000 }
			}
		}
		add = -250
	}
	if = { #Remote Realm.
		limit = {
			NOT = {
				character_is_realm_neighbor = scope:impress_check
			}
			scope:impress_check.capital_province = { squared_distance = { target = prev.capital_province value >= 200000 } }
		}
		add = -500
	}
	#Military Strength
	add = {
		value = 1
		subtract = {
			value = scope:impress_check.max_military_strength # Intended for recipient to use max, to avoid having vassalizations become too easy for weakened realms
			divide = { value = current_military_strength min = 1 }
		}
		multiply = 20
		ceiling = yes
	}
	#Vassal Opinion
	if = {
		limit = {
			number_of_powerful_vassals >= 1
		}
		add = {
			value = 0
			every_powerful_vassal = {
				if = {
					limit = {
						save_temporary_opinion_value_as = {
							name = vassal_opinion
							target = prev
						}
					}
					add = scope:vassal_opinion
				}
			}

			if = {
				limit = {
					number_of_powerful_vassals > 0
				}
				divide = number_of_powerful_vassals
			}
			else = {
				divide = 5
			}

			divide = 5
  		}
	}
	
	#MINOR
	#Friend modifier.
	if = {
		limit = {
			scope:impress_check = {
				has_relation_friend = root
				NOT = { has_relation_best_friend = root }
			}
		}
		add = 10
	}
	#Best Friend modifier.
	if = {
		limit = {
			scope:impress_check = {
				has_relation_best_friend = root
			}
		}
		add = 20
	}
	#Lover modifier.
	if = {
		limit = {
			scope:impress_check = {
				has_relation_lover = root
				NOT = { has_relation_soulmate = root }
			}
		}
		add = 10
	}
	#Soulmate modifier.
	if = {
		limit = {
			scope:impress_check = {
				has_relation_soulmate = root
			}
		}
		add = 20
	}
	#Rivalry modifier.
	if = {
		limit = {
			scope:impress_check = {
				has_relation_rival = root
				NOT = { has_relation_nemesis = root }
			}
		}
		add = -100
	}
	#Nemesis modifier.
	if = {
		limit = {
			scope:impress_check = {
				has_relation_nemesis = root
			}
		}
		add = -1000
	}
	#Same Dynasty modifier.
	if = {
		limit = {
			scope:impress_check = {
				dynasty = root.dynasty
			}
		}
		add = 5
	}
	#Same Dynasty modifier.
	if = {
		limit = {
			scope:impress_check = {
				dynasty = root.dynasty
				capital_province = {
					OR = {
						geographical_region = world_europe_west_germania
						geographical_region = custom_northern_italy
						geographical_region = custom_burgundy
					}
				}
			}
			root = { is_hre_candidate_ruler = yes }
		}
		add = 15
	}
	# Same language
	if = {
		limit = {
			root = {
				knows_language_of_culture = scope:impress_check.culture
			}
		}
		add = 5
	}
	# Iberian Struggle, less likely for outsiders to vassalize inside
	if = {
		limit = {
			root = {
				NOT = {
					any_character_struggle = { is_struggle_type = iberian_struggle }
				}
			}
			scope:impress_check = {
				any_character_struggle = { is_struggle_type = iberian_struggle }
			}
		}
		add = -35
	}
	#Ageism modifier vs kids.
	if = {
		limit = {
			root = {
				age < 12
			}
			scope:impress_check = {
				age > 16
			}
		}
		add = -5
	}
	#Illegitimacy modifier.
	if = {
		limit = {
			OR = {
				AND = {
					root = {
						has_trait = bastard
					}
					scope:impress_check = {
						faith = { NOT = { has_doctrine = doctrine_bastardry_none } }
					}
				}
				has_trait = denounced
				has_trait = disinherited
			}
		}
		add = -10
	}
	#Claimant modifier.
	if = {
		limit = {
			root.primary_title = {
				scope:impress_check = {
					has_claim_on = prev
				}
			}
		}
		add = -20
	}
	# Ambitious
	if = {
		limit = {
			scope:impress_check = {
				has_trait = ambitious
			}
		}
		add = -20
	}
	# Paranoid
	if = {
		limit = {
			scope:impress_check = {
				has_trait = paranoid
			}
		}
		add = -20
	}
	# Arrogant
	if = {
		limit = {
			scope:impress_check = {
				has_trait = arrogant
			}
		}
		add = -20
	}
	# Fickle
	if = {
		limit = {
			scope:impress_check = {
				has_trait = fickle
			}
		}
		add = -10
	}
	# Stubborn
	if = {
		limit = {
			scope:impress_check = {
				has_trait = stubborn
			}
		}
		add = -10
	}
	# Trusting
	if = {
		limit = {
			scope:impress_check = {
				has_trait = trusting
			}
		}
		add = 5
	}
	# Content
	if = {
		limit = {
			scope:impress_check = {
				has_trait = content
			}
		}
		add = 5
	}
	# FP3 modifier.
	if = {
		limit = {
			any_character_struggle = { has_struggle_phase_parameter = piety_level_affects_vassalage_acceptance }
		}
		add = {
			value = {
				value = root.piety_level
				subtract = low_piety_level
			}
			multiply = 10
		}
	}
	# OPINION INFLUENCE
	if = {
		limit = {
			scope:impress_check = {
				has_dread_level_towards = {
					target = prev
					level = 1
				}
			}
		}
		add = {
			value = 10
			if = {
				limit = {
					exists = dynasty
					dynasty = {
						has_dynasty_perk = guile_legacy_5
					}
				}
				multiply = 2
			}
		}
	}
	if = {
		limit = {
			scope:impress_check = {
				has_dread_level_towards = {
					target = prev
					level = 2
				}
			}
		}
		add = {
			value = 20
			if = {
				limit = {
					exists = dynasty
					dynasty = {
						has_dynasty_perk = guile_legacy_5
					}
				}
				multiply = 2
			}
		}
	}
	if = { # DIPLOMATIC COURT GRANDEUR BONUS
		limit = {
			has_royal_court = yes
			has_dlc_feature = royal_court
			has_court_type = court_diplomatic
			court_grandeur_current_level >= 1
		}
		add = {
			value = court_grandeur_current
			if = {
				limit = { # Reduce the bonus if you are below your expected level
					court_grandeur_current_level < court_grandeur_minimum_expected_level
				}
				multiply = 0.15
			}
			else = {
				multiply = 0.3
			}
		}
	}
	# INSPECTION BONUSES
	if = {
		limit = {
			scope:impress_check = {
				has_variable_list = lesser_inspection_bonus
				is_target_in_variable_list = {
					name = lesser_inspection_bonus
					target = prev
				}
			}
		}
		add = 5
	}
	if = {
		limit = {
			scope:impress_check = {
				has_variable_list = inspection_bonus
				is_target_in_variable_list = {
					name = inspection_bonus
					target = prev
				}
			}
		}
		add = 10
	}
	if = {
		limit = {
			scope:impress_check = {
				has_variable_list = inspection_reward
				is_target_in_variable_list = {
					name = inspection_reward
					target = prev
				}
			}
		}
		add = 10
	}
	if = {
		limit = {
			has_character_modifier = inspection_reward_focused_vassal_acceptance
		}
		add = 10
	}

	# LOW LEGITIMACY
	if = {
		limit = {
			has_legitimacy_flag = reduced_vassalization_acceptance
		}
		add = -25
	}
	if = {
		limit = {
			has_legitimacy_flag = very_reduced_vassalization_acceptance
		}
		add = -50
	}
	if = {
		limit = {
			has_legitimacy_flag = massively_reduced_vassalization_acceptance
		}
		add = -75
	}
	# HIGH LEGITIMACY
	if = {
		limit = {
			has_legitimacy_flag = increased_vassalization_acceptance
		}
		add = 25
	}
	if = {
		limit = {
			has_legitimacy_flag = very_increased_vassalization_acceptance
		}
		add = 50
	}
	if = {
		limit = {
			has_legitimacy_flag = extra_increased_vassalization_acceptance
		}
		add = 75
	}

	#HISTORICALLY ADMIN PEOPLES WANT TO BE ADMIN
	if = {
		limit = {
			government_has_flag = government_is_administrative
			scope:impress_check = {
				culture = {
					OR = {
						this = culture:greek
						any_parent_culture_or_above = {
							this = culture:greek
						}
						this = culture:han
						any_parent_culture_or_above = {
							this = culture:han
						}
					}
				}
			}
		}

		add = 30
	}
	
	# AI-only weights, keep the pope from vassalizing too fast
	if = {
		limit = {
			exists = faith:catholic.religious_head
			faith:catholic.religious_head = root
			root = { is_ai = yes }
		}
		add = -50
	}
	
	if = {
		limit = {
			scope:actor ?= {
				has_variable = severed_head_vassalization
				var:severed_head_vassalization = {
					this = scope:impress_check
				}
			}
		}
		add = 200
		desc = COWED_BY_SEVERED_HEAD_MODIFIER
	}

	#Mandala Tributaries should not want to be vassals
	if = {
		limit = {
			government_has_flag = government_is_mandala
			scope:impress_check = { is_tributary_of = scope:actor }
		}
		add = -35
	}

	if = {
		limit = {
			government_has_flag = government_is_mandala
			scope:impress_check = { government_has_flag = government_is_mandala }
		}
		
		add = -25
	}

	#Your Radiance
	if = {
		limit = {
			has_unruined_mandala_capital_trigger = yes
		}
		add = mandala_radiance_value
	}
}

