﻿lmf_odds_seduce_scheme_misc_value = {
	add = {
		value = 0
		desc = scheme_odds.misc_modifiers
			
		if = {
			limit = {
				scope:owner = {
					exists = var:wnight_seduce_memento_var
					var:wnight_seduce_memento_var = scope:target
				}
			}
			add = 20
		}
		if = {
			limit = {
				scope:owner = { NOT = { knows_language_of_culture = scope:target.culture } }
			}
			add = -5
		}
		if = {
			limit = {
				scope:target = { NOT = { knows_language_of_culture = scope:owner.culture } }
			}
			add = -5
		}
		if = {
			limit = {
				scope:owner = { has_perk = home_advantage_perk }
				scope:target = {
					OR = {
						is_courtier_of = scope:owner
						is_pool_guest_of = scope:owner
						is_foreign_court_guest_of = scope:owner
					}
				}
			}
			add = home_advantage_perk_bonus
		}
		if = {
			limit = {
				scope:owner = { has_perk = smooth_operator_perk }
			}
			add = smooth_operator_perk_bonus
		}
		if = {
			limit = {
				scope:owner = {
					exists = dynasty
					dynasty = {
						has_dynasty_perk = fp1_adventure_legacy_2
					}
				}
			}
			add = fp1_adventure_legacy_2_success_chance_seduction
		}
		if = {
			limit = {
				scope:owner = { has_trait = seducer }
			}
			add = 25
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_good_1 }
			}
			add = 10
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_good_2 }
			}
			add = 15
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_good_3 }
			}
			add = 20
		}
		if = {
			limit = {
				scope:owner = { has_trait = physique_good_1 }
			}
			add = 5
		}
		if = {
			limit = {
				scope:owner = { has_trait = physique_good_2 }
			}
			add = 10
		}
		if = {
			limit = {
				scope:owner = { has_trait = physique_good_3 }
			}
			add = 15
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_bad_1 }
			}
			add = -10
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_bad_2 }
			}
			add = -15
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_bad_3 }
			}
			add = -20
		}
		if = {
			limit = {
				scope:owner = { has_trait = great_pox }
			}
			add = -50
		}
		if = {
			limit = {
				scope:owner = { has_trait = lovers_pox }
			}
			add = -25
		}
		if = {
			limit = {
				scope:owner = { has_trait = early_great_pox }
			}
			add = -25
		}		
		if = {
			limit = {
				scope:owner = {
					NOR = {
						is_attracted_to_gender_of = scope:target
						has_perk = unshackled_lust_perk
					}
				}
			}
			add = -25
		}

		#TARGET
		if = {
			limit = { scope:target.ai_boldness < low_negative_ai_value }
			add = -10
		}
		if = {
			limit = {
				scope:target = { has_trait = lifestyle_reveler }
			}
			add = 5
		}
		if = {
			limit = {
				scope:target = { has_trait = lustful }
			}
			add = 20
		}
		if = {
			limit = {
				scope:target = {
					OR = {
						has_trait = seducer
						has_trait = rakish		
						is_deviant_trigger = yes
						has_focus = intrigue_temptation_focus
						faith = { trait_is_virtue = lustful }
						has_trait = maiden
					}
					NOR = {
						has_trait = chaste
						has_trait = celibate
					}
				}
			}
			add = 10
		}
		if = {
			limit = {
				scope:target = { has_trait = drunkard }
			}
			add = 5
		}
		if = {
			limit = {
				scope:target = { has_trait = celibate }
			}
			add = -25
		}
		if = {
			limit = {
				scope:target = { has_trait = reclusive }
			}
			add = -10
		}
		if = {
			limit = {
				scope:target = { has_trait = depressed }
			}
			add = -5
		}
		if = {
			limit = {
				scope:target = {
					has_trait = honest
					OR = {
						AND = {
							is_betrothed = yes
							NOT = { betrothed = scope:owner }
						}
						AND = {
							is_married = yes
							NOT = { is_consort_of = scope:owner }
						}
						AND = {
							num_of_relation_lover > 0
							NOR = {
								is_consort_of = scope:owner
								has_relation_lover = scope:owner
							}
						}
						AND = {
							is_ruler = no
							exists = liege
							is_close_family_of = scope:target.liege
						}
					}
				}
			}
			add = -10
		}
		if = {
			limit = {
				scope:target = {
					OR = {
						is_clergy = yes
						has_council_position = councillor_court_chaplain
					}
					ai_zeal >= 0
					faith = {
						NOR = {
							has_doctrine_parameter = clergy_can_marry
							trait_is_virtue = lustful
						}
					}
				}
			}
			add = {
				value = 20
				if = {
					limit = { scope:target.ai_zeal > 20 }
					value = scope:target.ai_zeal
				}
				multiply = -0.5
			}
		}
		if = {
			limit = {
				scope:target = {
					has_trait = chaste
					NOT = { is_consort_of = scope:owner }
					trait_is_shunned_or_criminal_in_faith_trigger = { TRAIT = trait:fornicator FAITH = scope:target.faith GENDER_CHARACTER = scope:target }
				}
			}
			add = {
				value = 15
				if = {
					limit = { scope:target.ai_zeal > 15 }
					value = scope:target.ai_zeal
				}
				multiply = -1
				if = {
					limit = {
						trait_is_criminal_in_faith_trigger = { TRAIT = trait:fornicator FAITH = scope:target.faith GENDER_CHARACTER = scope:target }
					}
					multiply = 2
				}
			}
		}
		if = {
			limit = {
				scope:target = {
					has_trait = chaste
					OR = {
						is_consort_of = scope:owner
						NOT = { trait_is_shunned_or_criminal_in_faith_trigger = { TRAIT = trait:fornicator FAITH = scope:target.faith GENDER_CHARACTER = scope:target } }
					}
				}
			}
			add = -10
		}
		if = {
			limit = {
				scope:target = { has_trait = shy }
			}
			add = -10
		}
		if = {
			limit = {
				scope:target = {
					is_consort_of = scope:owner
					NOT = { has_relation_rival = scope:owner }
				}
			}
			add = 20
		}
		if = {
			limit = {
				scope:target = {
					is_married = yes
					OR = {
						ai_honor > 0
						ai_boldness < 0
					}
					NOT = { is_consort_of = scope:owner }
					trait_is_criminal_in_faith_trigger = { TRAIT = trait:adulterer FAITH = scope:target.faith GENDER_CHARACTER = scope:target }
				}
			}
			add = {
				value = 40
				if = {
					limit = { scope:target.ai_honor > 40 }
					value = scope:target.ai_honor
				}
				if = {
					limit = {
						scope:target.ai_cowardice > scope:target.ai_honor
						scope:target.ai_cowardice > 40
					}
					value = scope:target.ai_cowardice
				}
				multiply = -0.5
				round = yes
			}
		}
		if = {
			limit = {
				scope:target = {
					is_married = yes
					ai_honor > 0
					NOT = { is_consort_of = scope:owner }
					trait_is_shunned_in_faith_trigger = { TRAIT = trait:adulterer FAITH = scope:target.faith GENDER_CHARACTER = scope:target }
				}
			}
			add = {
				value = 20
				if = {
					limit = { scope:target.ai_honor > 20 }
					value = scope:target.ai_honor
				}
				multiply = -0.5
				round = yes
			}
		}
		if = {
			limit = {
				scope:target = {
					is_married = no
					OR = {
						ai_honor > 0
						ai_boldness < 0
					}
					trait_is_criminal_in_faith_trigger = { TRAIT = trait:fornicator FAITH = scope:target.faith GENDER_CHARACTER = scope:target }
				}
			}
			add = {
				value = 40
				if = {
					limit = { scope:target.ai_honor > 40 }
					value = scope:target.ai_honor
				}
				if = {
					limit = {
						scope:target.ai_cowardice > scope:target.ai_honor
						scope:target.ai_cowardice > 40
					}
					value = scope:target.ai_cowardice
				}
				multiply = -0.5
				round = yes
			}
		}
		if = {
			limit = {
				scope:target = {
					is_married = no
					ai_honor > 0
					trait_is_shunned_in_faith_trigger = { TRAIT = trait:fornicator FAITH = scope:target.faith GENDER_CHARACTER = scope:target }
				}
			}
			add = {
				value = 20
				if = {
					limit = { scope:target.ai_honor > 20 }
					value = scope:target.ai_honor
				}
				multiply = -0.5
				round = yes
			}
		}
		if = {
			limit = {
				scope:target = {
					exists = primary_spouse
					NOT = { is_consort_of = scope:owner }
					primary_spouse = { has_strong_hook = scope:target }
				}
			}
			add = -100
		}
		if = {
			limit = {
				scope:target = {
					is_married = no
					is_betrothed = no
					is_ruler = no
					can_marry_trigger = yes
					age < 25
					NOR = {
						num_of_relation_lover > 0
						is_close_family_of = scope:owner
						likely_to_take_lover_trigger = yes
						has_trait = impatient
					}
					exists = liege
					is_close_family_of = scope:target.liege
				}
			}
			add = -10
		}
		if = {
			limit = {
				scope:target = {
					relation_with_character_is_sodomy_in_my_or_lieges_faith_trigger = { CHARACTER = scope:owner }
					trait_is_shunned_or_criminal_in_faith_trigger = { TRAIT = trait:sodomite FAITH = scope:target.faith GENDER_CHARACTER = scope:target }
					NOR = {
						freely_accepts_sodomy_with_trigger = { CHARACTER = scope:owner }
						has_perk = unshackled_lust_perk
					}
				}
			}
			add = {
				value = 40
				if = {
					limit = { scope:target.ai_honor > 40 }
					value = scope:target.ai_honor
				}
				if = {
					limit = {
						scope:target.ai_cowardice > scope:target.ai_honor
						scope:target.ai_cowardice > 40
						trait_is_criminal_in_faith_trigger = { TRAIT = trait:sodomite FAITH = scope:target.faith GENDER_CHARACTER = scope:target }
					}
					value = scope:target.ai_cowardice
				}
				multiply = -0.5
				round = yes
			}
		}
		if = {
			limit = {
				scope:target = {
					is_female = yes
					relation_with_character_is_samesex_forbidden_in_my_or_lieges_faith_trigger = { CHARACTER = scope:owner }
					ai_honor > 0
				}
			}
			add = {
				value = 20
				if = {
					limit = { scope:target.ai_honor > 20 }
					value = scope:target.ai_honor
				}
				multiply = -0.5
				round = yes
			}
		}
		if = {
			limit = {
				scope:target = {
					is_married = yes
					NOT = { is_consort_of = scope:owner }
					any_spouse = {
						save_temporary_scope_as = partner
						scope:target = {
							NOT = {
								might_cheat_on_partner_trigger = { PARTNER = scope:partner }
							}
						}
					}
				}
			}
			add = {
				value = -50
				if = {
					limit = {
						scope:target = {
							any_spouse = { has_relation_soulmate = scope:target }
						}
					}
					multiply = 5
				}
				if = {
					limit = {
						scope:owner = { is_ai = yes }
					}
					multiply = 2
				}
			}
		}
		if = {
			limit = {
				scope:target = {
					is_married = no
					is_betrothed = yes
					NOR = {
						betrothed = scope:owner
						might_cheat_on_partner_trigger = { PARTNER = scope:target.betrothed }
					}
				}
			}
			add = {
				value = -25
				if = {
					limit = {
						scope:target = { has_relation_soulmate = scope:target.betrothed }
					}
					multiply = 10
				}
				if = {
					limit = {
						scope:owner = { is_ai = yes }
					}
					multiply = 2
				}
			}
		}
		if = {
			limit = {
				scope:target = {
					any_relation = {
						type = lover
						NOR = {
							is_spouse_of = scope:target
							AND = {
								exists = betrothed
								betrothed = scope:target
							}
						}
						save_temporary_scope_as = partner
						scope:target = {
							NOT = {
								might_cheat_on_partner_trigger = { PARTNER = scope:partner }
							}
						}
					}
				}
			}
			add = {
				value = -25
				if = {
					limit = {
						scope:target = {
							any_relation = {
								type = soulmate
								NOR = {
									is_spouse_of = scope:target
									AND = {
										exists = betrothed
										betrothed = scope:target
									}
								}
							}
						}
					}
					multiply = 10
				}
				if = {
					limit = {
						scope:owner = { is_ai = yes }
					}
					multiply = 2
				}
			}
		}
		if = {
			limit = {
				scope:target = {
					is_married = yes
					NOT = { is_consort_of = scope:owner }
					exists = primary_spouse
					primary_spouse = { save_temporary_scope_as = target_spouse }
					might_cheat_on_partner_trigger = { PARTNER = scope:target_spouse }
					opinion = { target = scope:target_spouse value > low_positive_opinion }
				}
			}
			add = {
				value = 0
				scope:target = {
					if = { # Hard block for AI seducers, they don't need the granularity and opinion checks are expensive performance-wise. 
						limit = { scope:owner = { is_ai = yes }}
						add = -1000
					}
					else_if = { # Players get scaling penalties depending on how high their target's opinion is of their primary spouse.
						limit = {
							has_relation_soulmate = scope:target_spouse
						}
						add = -250
					}
					else_if = {
						limit = {
							opinion = {
								target = scope:target_spouse
								value >= high_positive_opinion
							}
						}
						if = {
							limit = {
								opinion = {
									target = scope:target_spouse
									value < very_high_positive_opinion
								}
							}
							# Opinion between 80 and 100
							add = -50
						}
						else = {
							# Opinion between 60 and 80
							add = -35
						}
					}
					else = {
						if = {
							limit = {
								opinion = {
									target = scope:target_spouse
									value >= medium_positive_opinion
								}
							}
							# Opinion between 40 and 60
							add = -25
						}
						else = {
							# Opinion between 0 and 40 (technically -100 and 40 but at below 0 we shouldn't be in this trigger block at all since 'might_cheat_on_partner_trigger' will have passed).
							add = -10
						}
					}
				}
			}
		}
		if = {
			limit = {
				scope:target = {
					is_married = no
					is_betrothed = yes
					exists = betrothed
					NOT = { betrothed = { this = scope:owner } }
					betrothed = { save_temporary_scope_as = target_spouse }
					might_cheat_on_partner_trigger = { PARTNER = scope:target_spouse }
					opinion = { target = scope:target_spouse value > medium_positive_opinion }
				}
			}
			add = {
				value = 0
				scope:target = {
					if = { # Hard block for AI seducers, they don't need the granularity and opinion checks are expensive performance-wise. 
						limit = { scope:owner = { is_ai = yes }}
						add = -1000
					}
					else_if = { # Players get scaling penalties depending on how high their target's opinion is of their primary spouse.
						limit = {
							has_relation_soulmate = scope:target_spouse
						}
						add = -250
					}
					else_if = {
						limit = {
							opinion = {
								target = scope:target_spouse
								value >= high_positive_opinion
							}
						}
						if = {
							limit = {
								opinion = {
									target = scope:target_spouse
									value < very_high_positive_opinion
								}
							}
							# Opinion between 80 and 100
							add = -30
						}
						else = {
							# Opinion between 60 and 80
							add = -20
						}
					}
					else = {
						add = -10
					}
				}
			}
		}
		if = {
			limit = {
				scope:target = {
					faith = scope:owner.faith
					faith = {
						exists = religious_head
						religious_head = {
							this = scope:target
						}
					}
				}
			}
			add = -50
		}
		if = {
			limit = {
				scope:target = {
					relation_with_character_is_incestuous_in_my_or_lieges_faith_trigger = { CHARACTER = scope:owner }
				}
				scope:owner = { # The Subtle Desire Perk nullifies 	this
					NOT = { has_perk = subtle_desire_perk }
				}
			}
			add = -25
		}
		if = {
			limit = {
				scope:target = {
					NOT = { is_consort_of = scope:owner }
					is_close_or_extended_family_of = scope:owner
					NOR = {
						accepts_incest_with_trigger = { CHARACTER = scope:owner } #100% fine with incest with 	owner
						scope:owner = { has_perk = subtle_desire_perk }  # The Subtle Desire 	Perk nullifies this
						guaranteed_under_20_incest_rejection_trigger	 = { # handled by hard block modifier
							TARGET = scope:target
							SEDUCER = scope:owner
						}
					}
				}
			}
			add = {
				if = {
					limit = { scope:target = { is_close_family_of = scope:owner } }
					value = -40
				}
				else_if = {
					limit = { scope:target = { is_extended_family_of = scope:owner } }
					value = -15
				}
				if = {
					limit = { scope:target = { is_deviant_trigger = yes } }
					add = 15
				}
			}
		}
		if = {
			limit = {
				scope:target = {
					personal_scheme_success_compare_target_liege_tier_trigger = no
				}
				scope:owner = {
					tier_difference = {
						target = scope:target
						value >= 1
					}
				}
			}
			add = 12
		}
		if = {
			limit = {
				scope:target = {
					personal_scheme_success_compare_target_liege_tier_trigger = no
				}
				scope:owner = {
					tier_difference = {
						target = scope:target
						value <= -1
					}
				}
			}
			add = -40
		}
		if = {
			limit = {
				scope:target = {
					trait_compatibility = {
						target = scope:owner
						value >= medium_positive_trait_compatibility
					}
				}
			}
			add = 18
		}
		if = {
			limit = {
				scope:target = {
					trait_compatibility = {
						target = scope:owner
						value <= medium_negative_trait_compatibility
					}
				}
			}
			add = -36
		}	
		if = {
			limit = {
				exists = scope:owner.dynasty
				scope:owner.dynasty = {
					has_dynasty_perk = kin_legacy_4
				}
				scope:target.dynasty = scope:owner.dynasty
			}
			add = kin_legacy_4_success_chance
		}
		if = {
			limit = {
				exists = scope:owner.house
				exists = scope:target.house
				scope:owner.culture = {
					has_cultural_parameter = cultural_house_personal_scheme_success_chance
				}
				scope:target.house = scope:owner.house
			}
			add = cultural_house_personal_scheme_success_chance
		}
		if = {
			limit = {
				scope:owner = {
					has_perk = thicker_than_water_perk
				}
				scope:target = {
					is_close_or_extended_family_of = scope:owner
				}
			}
			add = thicker_than_water_bonus
		}
		if = {
			limit = {
				scope:target = {
					exists = host
					host = {
						any_active_accolade = {
							has_accolade_parameter = accolade_court_seduction_vulnerability
						}
					}
				}
			}
			add = accolade_seduction_vulnerability_value
		}
		if = {
			limit = {
				scope:owner = { has_character_modifier = poet_for_seduction_schemes_modifier }
			}
			add = 20
		}
		if = {
			limit = {
				scope:owner = {
					has_variable_list = supporting_personal_schemes
				}
			}
			add = personal_scheme_variable_list_value
		}
		if = {
			limit = {
				scope:owner = { has_character_modifier = personal_schemes_distracted_modifier }
			}
			add = -10
		}
		if = {
			limit = {
				scope:owner.domicile ?= {
					has_domicile_parameter = increased_success_personal_schemes_1
				}
			}
			add = estate_increased_personal_scheme_success_1_value
		}
		if = {
			limit = {
				scope:owner.domicile ?= {
					has_domicile_parameter = increased_success_personal_schemes_2
				}
			}
			add = estate_increased_personal_scheme_success_2_value
		}
		if = {
			limit = {
				scope:owner.domicile ?= {
					has_domicile_parameter = increased_success_personal_schemes_3
				}
			}
			add = estate_increased_personal_scheme_success_3_value
		}
		if = {
			limit = {
				exists = global_var:travel_the_distance_is_loaded
				scope:owner = { is_in_the_same_court_as = scope:target }
			}
			add = 10
		}
	}
}

lmf_odds_romance_scheme_misc_value = {
	add = {
		value = 0
		desc = scheme_odds.misc_modifiers
		if = {
			limit = {
				scope:owner = {
					exists = var:wnight_court_memento_var
					var:wnight_court_memento_var = scope:target
				}
			}
			add = 20
		}
		if = {
			limit = {
				scope:owner = { has_character_modifier = hopeless_romantic_modifier }
			}
			add = 10
		}
		# Thicker Than Water Perk
		if = {
			limit = {
				scope:owner = {
					has_perk = thicker_than_water_perk
				}
				scope:target = {
					is_close_or_extended_family_of = scope:owner
				}
			}
			add = thicker_than_water_bonus
		}
		if = { # Tradition
			limit = {
				scope:owner = {
					has_trait = lifestyle_poet
					culture = {
						has_cultural_parameter = poet_trait_romance_bonuses
					}
				}
			}
			add = 40
		}
		if = {
			limit = {
				scope:target = {
					exists = primary_spouse
					NOT = { is_consort_of = scope:owner }
					OR = {
						primary_spouse = { has_strong_hook = scope:target }
						has_trait = loyal
					}
				}
			}
			add = -100
		}
		# You are a Courteous Knight
		if = {
			limit = {
				scope:owner = {
					has_character_modifier = ep3_courteous_knight_modifier
				}
			}
			add = 50
		}
		if = {
			limit = {
				scope:owner = { has_perk = courtship_perk }
			}
			add = courtship_court_success_chance_bonus_value
		}
		if = {
			limit = {
				scope:owner = {
					is_spouse_of = scope:target
				}
				scope:owner.culture = {
					has_cultural_parameter = romance_scheme_bonus_vs_spouse
				}
			}
			add = 30
		}
		if = {
			limit = {
				scope:owner = { has_character_modifier = poet_for_diplo_schemes_modifier }
			}
			add = 15
		}
		if = {
			limit = {
				scope:owner = {
					has_variable_list = supporting_personal_schemes
				}
			}
			add = personal_scheme_variable_list_value
		}
		if = {
			limit = {
				scope:owner = { has_character_modifier = personal_schemes_distracted_modifier }
			}
			add = -10
		}
		if = {
			limit = {
				scope:owner = { NOT = { knows_language_of_culture = scope:target.culture } }
			}
			add = -10
		}
		if = {
			limit = {
				scope:target = { NOT = { knows_language_of_culture = scope:owner.culture } }
			}
			add = -10
		}
		if = {
			limit = {
				scope:owner.dynasty ?= {
					has_dynasty_perk = kin_legacy_4
				}
				scope:target.dynasty ?= scope:owner.dynasty
			}
			add = kin_legacy_4_success_chance
		}
		if = {
			limit = {
				exists = scope:owner.house
				exists = scope:target.house
				scope:owner.culture = {
					has_cultural_parameter = cultural_house_personal_scheme_success_chance
				}
				scope:target.house = scope:owner.house
			}
			add = cultural_house_personal_scheme_success_chance
		}
		if = {
			limit = {
				scope:owner = { has_trait = gallant }
			}
			add = 30
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_good_1 }
			}
			add = 10
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_good_2 }
			}
			add = 15
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_good_3 }
			}
			add = 20
		}
		if = {
			limit = {
				scope:owner = { has_trait = physique_good_1 }
			}
			add = 5
		}
		if = {
			limit = {
				scope:owner = { has_trait = physique_good_2 }
			}
			add = 10
		}
		if = {
			limit = {
				scope:owner = { has_trait = physique_good_3 }
			}
			add = 15
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_bad_1 }
			}
			add = -10
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_bad_2 }
			}
			add = -15
		}
		if = {
			limit = {
				scope:owner = { has_trait = beauty_bad_3 }
			}
			add = -20
		}
		if = {
			limit = {
				scope:owner = {
					NOR = {
						is_attracted_to_gender_of = scope:target
						has_perk = unshackled_lust_perk
					}
				}
			}
			add = -15
		}
		if = {
			limit = {
				scope:target = {
					relation_with_character_is_incestuous_in_my_or_lieges_faith_trigger = { CHARACTER = scope:owner }
				}
				scope:owner = { # The Subtle Desire Perk nullifies 	this
					NOT = { has_perk = subtle_desire_perk }
					NOT = { has_relation_lover = scope:target }
				}
			}
			add = -25
		}
		if = {
			limit = {
				scope:target = {
					NOT = { is_consort_of = scope:owner }
					is_close_or_extended_family_of = scope:owner
					NOR = {
						accepts_incest_with_trigger = { CHARACTER = scope:owner } #100% fine with incest with 	owner
						scope:owner = { has_perk = subtle_desire_perk }  # The Subtle Desire 	Perk nullifies this
						guaranteed_under_20_incest_rejection_trigger	 = { # handled by hard block modifier
							TARGET = scope:target
							SEDUCER = scope:owner
						}
					}
				}
			}
			add = {
				if = {
					limit = { scope:target = { is_close_family_of = scope:owner } }
					value = -40
				}
				else_if = {
					limit = { scope:target = { is_extended_family_of = scope:owner } }
					value = -15
				}
				if = {
					limit = { scope:target = { is_deviant_trigger = yes } }
					add = 15
				}
			}
		}
		if = {
			limit = {
				scope:target = {
					relation_with_character_is_sodomy_in_my_or_lieges_faith_trigger = { CHARACTER = scope:owner }
					NOT = { freely_accepts_sodomy_with_trigger = { CHARACTER = scope:owner } }
				}
			}
			add = -20
		}
		if = {
			limit = {
				scope:target = {
					personal_scheme_success_compare_target_liege_tier_trigger = no
				}
				scope:owner = {
					tier_difference = {
						target = scope:target
						value >= 1
					}
				}
			}
			add = 12
		}
		if = {
			limit = {
				scope:target = {
					personal_scheme_success_compare_target_liege_tier_trigger = no
				}
				scope:owner = {
					tier_difference = {
						target = scope:target
						value <= -1
					}
				}
			}
			add = -40
		}
		if = {
			limit = {
				scope:target = {
					trait_compatibility = {
						target = scope:owner
						value >= medium_positive_trait_compatibility
					}
				}
			}
			add = 18
		}
		if = {
			limit = {
				scope:target = {
					trait_compatibility = {
						target = scope:owner
						value <= medium_negative_trait_compatibility
					}
				}
			}
			add = -36
		}
		if = {
			limit = {
				exists = scope:target.court_owner
				scope:target.court_owner = {
					NOT = { government_has_flag = government_is_tribal }
				}
				scope:owner = { government_has_flag = government_is_tribal }
			}
			add = -50
		}
		if = {
			limit = {
				scope:target = {
					faith = scope:owner.faith
					faith = {
						exists = religious_head
						religious_head = {
							this = scope:target
						}
					}
				}
			}
			add = -50
		}
		if = {
			limit = {
				scope:owner.domicile ?= {
					has_domicile_parameter = increased_success_personal_schemes_1
				}
			}
			add = estate_increased_personal_scheme_success_1_value
		}
		if = {
			limit = {
				scope:owner.domicile ?= {
					has_domicile_parameter = increased_success_personal_schemes_2
				}
			}
			add = estate_increased_personal_scheme_success_2_value
		}
		if = {
			limit = {
				scope:owner.domicile ?= {
					has_domicile_parameter = increased_success_personal_schemes_3
				}
			}
			add = estate_increased_personal_scheme_success_3_value
		}
		if = {
			limit = {
				scope:target = {
					is_married = yes
					NOT = { is_consort_of = scope:owner }
					exists = primary_spouse
					primary_spouse = { save_temporary_scope_as = target_spouse }
					NOT = { might_cheat_on_partner_trigger = { PARTNER = scope:target_spouse } }
				}
			}
			add = {
				value = 0
				scope:target = {
					if = { # Hard block for AI seducers, they don't need the granularity and opinion checks are expensive performance-wise. 
						limit = { scope:owner = { is_ai = yes }}
						add = -1000
					}
					else_if = { # Players get scaling penalties depending on how high their target's opinion is of their primary spouse.
						limit = {
							has_relation_soulmate = scope:target_spouse
						}
						add = -500
					}
					else_if = {
						limit = {
							opinion = {
								target = scope:target_spouse
								value >= high_positive_opinion
							}
						}
						if = {
							limit = {
								opinion = {
									target = scope:target_spouse
									value < very_high_positive_opinion
								}
							}
							# Opinion between 80 and 100
							add = -100
						}
						else = {
							# Opinion between 60 and 80
							add = -75
						}
					}
					else = {
						if = {
							limit = {
								opinion = {
									target = scope:target_spouse
									value >= medium_positive_opinion
								}
							}
							# Opinion between 40 and 60
							add = -50
						}
						else = {
							# Opinion between 0 and 40 (technically -100 and 40 but at below 0 we shouldn't be in this trigger block at all since 'might_cheat_on_partner_trigger' will have passed).
							add = -25
						}
					}
				}
			}
		}
		if = {
			limit = {
				exists = global_var:travel_the_distance_is_loaded
				scope:owner = { is_in_the_same_court_as = scope:target }
			}
			add = 10
		}
	}
}

lmf_base_seduce_odds_prediction_target_is_char_value = {
	scope:target ?= { save_temporary_scope_as = temp_target }
	add = lmf_base_seduce_odds_prediction_guts_value
}

lmf_base_seduce_odds_prediction_guts_value = {
	add = {
		value = {
			scope:temp_target = { value = "opinion(scope:owner)" }
			multiply = 1.5
			floor = yes
			min = -50
			max = 50
		}
		desc = scheme_odds.target.opinion_of_owner
	}
}

lmf_odds_skill_contribution_diplomacy_value = {
	add = {
		value = scope:owner.diplomacy
		desc = scheme_odds.diplomacy.owner
	}
}

lmf_odds_skill_contribution_intrigue_value = {
	add = {
		value = scope:owner.intrigue
		desc = scheme_odds.intrigue.owner
		multiply = 3
	}
	scope:target ?= {
		add = {
			value = scope:target.intrigue
			desc = scheme_odds.intrigue.target
			multiply = -1
		}
	}
}

