﻿# used in the courtier marriage proposals

lmf_extoll_trait = {
	type = character

	text = {
		trigger = {
			NOT = { has_variable = is_extoll_character }
			is_female = yes
			has_trait = beauty_good_3
		}
		localization_key = lmf_extoll_beauty_good_3
	}
	text = {
		trigger = {
			NOT = { has_variable = is_extoll_character }
			has_trait = intellect_good_3
		}
		localization_key = lmf_extoll_intellect_good_3
	}
	text = {
		trigger = {
			NOT = { has_variable = is_extoll_character }
			has_trait = beauty_good_2
		}
		localization_key = lmf_extoll_beauty_good_2
	}
	text = {
		trigger = {
			OR = {
				has_trait = intellect_good_2
				AND = {
					has_trait = intellect_good_2
					has_variable = is_extoll_character
				}
			}
		}
		localization_key = lmf_extoll_intellect_good_2
	}
	text = {
		trigger = {
			NOT = { has_variable = is_extoll_character }
			is_female = yes
			has_trait = beauty_good_1
		}
		localization_key = lmf_extoll_beauty_good_1
	}
	text = {
		trigger = {
			has_trait = intellect_good_1
		}
		localization_key = lmf_extoll_intellect_good_1
	}
	text = {
		trigger = {
			is_male = yes
			has_trait = physique_good_3
		}
		localization_key = lmf_extoll_physique_good_3
	}
	text = {
		trigger = {
			is_male = yes
			has_trait = physique_good_2
		}
		localization_key = lmf_extoll_physique_good_2
	}
	text = {
		trigger = {
			has_trait = physique_good_1
		}
		localization_key = lmf_extoll_physique_good_1
	}
	text = {
		trigger = {
			has_trait = shrewd
		}
		localization_key = lmf_extoll_shrewd
	}
	text = {
		trigger = {
			has_trait = strong
		}
		localization_key = lmf_extoll_strong
	}
	text = {
		fallback = yes
		localization_key = lmf_extoll_trait_nothing
	}
}

lmf_extoll_virtues = {
	type = character

	random_valid = yes

	text = {
		trigger = {
			prowess >= decent_skill_rating
			can_be_knight_trigger = { ARMY_OWNER = scope:second }
			scope:second = {
				OR = {
					number_of_knights < max_number_of_knights
					any_knight = { prowess < root.prowess }
				}
			}
		}
		weight_multiplier = {
			base = 10
			modifier = {
				add = 10
				prowess >= very_high_skill_rating
			}
		}
		localization_key = lmf_extoll_knight
	}

	text = {
		trigger = {
			is_capable_adult = yes
			aptitude:court_physician_court_position >= average_effectiveness
			scope:second = {
				OR = {
					can_employ_court_position_type = court_physician_court_position
					employs_court_position = court_physician_court_position
				}
				OR = {
					any_court_position_holder = {
						type = court_physician_court_position
						aptitude:court_physician_court_position < root.aptitude:court_physician_court_position
					}
					any_court_position_holder = {
						type = court_physician_court_position
						count < 1
					}
				}
			}
		}
		weight_multiplier = {
			base = 10
			modifier = {
				add = 10
				aptitude:court_physician_court_position >= good_effectiveness
			}
		}
		localization_key = lmf_extoll_physician
	}

	text = {
		trigger = {
			is_capable_adult = yes
			aptitude:court_tutor_court_position >= average_effectiveness
			scope:second = {
				OR = {
					can_employ_court_position_type = court_tutor_court_position
					employs_court_position = court_tutor_court_position
				}
				OR = {
					any_court_position_holder = {
						type = court_tutor_court_position
						aptitude:court_tutor_court_position < root.aptitude:court_tutor_court_position
					}
					any_court_position_holder = {
						type = court_tutor_court_position
						count < 1
					}
				}
			}
		}
		weight_multiplier = {
			base = 10
			modifier = {
				add = 10
				aptitude:court_tutor_court_position >= good_effectiveness
			}
		}
		localization_key = lmf_extoll_court_tutor
	}

	text = {
		trigger = {
			is_capable_adult = yes
			aptitude:antiquarian_court_position >= average_effectiveness
			scope:second = {
				OR = {
					can_employ_court_position_type = antiquarian_court_position
					employs_court_position = antiquarian_court_position
				}
				OR = {
					any_court_position_holder = {
						type = antiquarian_court_position
						aptitude:antiquarian_court_position < root.aptitude:antiquarian_court_position
					}
					any_court_position_holder = {
						type = antiquarian_court_position
						count < 1
					}
				}
			}
		}
		weight_multiplier = {
			base = 10
			modifier = {
				add = 10
				aptitude:antiquarian_court_position >= good_effectiveness
			}
		}
		localization_key = lmf_extoll_antiquarian
	}

	text = {
		trigger = {
			is_capable_adult = yes
			aptitude:seneschal_court_position >= average_effectiveness
			scope:second = {
				OR = {
					can_employ_court_position_type = seneschal_court_position
					employs_court_position = seneschal_court_position
				}
				OR = {
					any_court_position_holder = {
						type = seneschal_court_position
						aptitude:seneschal_court_position < root.aptitude:seneschal_court_position
					}
					any_court_position_holder = {
						type = seneschal_court_position
						count < 1
					}
				}
			}
		}
		weight_multiplier = {
			base = 10
			modifier = {
				add = 10
				aptitude:seneschal_court_position >= good_effectiveness
			}
		}
		localization_key = lmf_extoll_seneschal
	}

	text = {
		trigger = {
			is_capable_adult = yes
			aptitude:court_musician_court_position >= average_effectiveness
			scope:second = {
				OR = {
					can_employ_court_position_type = court_musician_court_position
					employs_court_position = court_musician_court_position
				}
				OR = {
					any_court_position_holder = {
						type = court_musician_court_position
						aptitude:court_musician_court_position < root.aptitude:court_musician_court_position
					}
					any_court_position_holder = {
						type = court_musician_court_position
						count < 1
					}
				}
			}
		}
		weight_multiplier = {
			base = 10
			modifier = {
				add = 10
				aptitude:court_musician_court_position >= good_effectiveness
			}
		}
		localization_key = lmf_extoll_musician
	}

	text = {
		trigger = {
			is_capable_adult = yes
			has_trait = lifestyle_poet
			aptitude:court_poet_court_position >= average_effectiveness
			scope:second = {
				OR = {
					can_employ_court_position_type = court_poet_court_position
					employs_court_position = court_poet_court_position
				}
				OR = {
					any_court_position_holder = {
						type = court_poet_court_position
						aptitude:court_poet_court_position < root.aptitude:court_poet_court_position
					}
					any_court_position_holder = {
						type = court_poet_court_position
						count < 1
					}
				}
			}
		}
		weight_multiplier = {
			base = 10
			modifier = {
				add = 10
				aptitude:court_poet_court_position >= good_effectiveness
			}
		}
		localization_key = lmf_extoll_poet
	}

	text = {
		trigger = {
			can_be_spymaster_trigger = { COURT_OWNER = scope:second }
			intrigue >= decent_skill_rating
			scope:second = {
				exists = council_task:councillor_spymaster
				trigger_if = {
					limit = { exists = cp:councillor_spymaster }
					council_task:councillor_spymaster = { can_fire_position = yes }
					cp:councillor_spymaster = {
						intrigue < root.intrigue
						NOT = { is_powerful_vassal_of = scope:second }
					}
				}
			}
		}
		weight_multiplier = {
			base = 10
			modifier = {
				add = 10
				intrigue >= very_high_skill_rating
			}
		}
		localization_key = lmf_extoll_spymaster
	}

	text = {
		trigger = {
			can_be_marshal_trigger = { COURT_OWNER = scope:second }
			martial >= decent_skill_rating
			scope:second = {
				exists = council_task:councillor_marshal
				trigger_if = {
					limit = { exists = cp:councillor_marshal }
					council_task:councillor_marshal = { can_fire_position = yes }
					cp:councillor_marshal = {
						martial < root.martial
						NOT = { is_powerful_vassal_of = scope:second }
					}
				}
			}
		}
		weight_multiplier = {
			base = 50
			modifier = {
				add = 20
				martial >= very_high_skill_rating
			}
		}
		localization_key = lmf_extoll_marshal
	}

	text = {
		trigger = {
			faith = scope:second.faith
			num_virtuous_traits >= 1
			num_sinful_traits < 1
		}
		weight_multiplier = {
			base = 3
			modifier = {
				add = 17
				num_virtuous_traits >= 2
			}
		}
		localization_key = lmf_extoll_virtuous
	}

	text = {
		trigger = {
			diplomacy >= high_skill_rating
		}
		localization_key = lmf_extoll_diplomacy
	}

	text = {
		trigger = {
			can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = scope:second }
			martial >= high_skill_rating
		}
		localization_key = lmf_extoll_martial
	}

	text = {
		trigger = {
			stewardship >= high_skill_rating
		}
		localization_key = lmf_extoll_stewardship
	}

	text = {
		trigger = {
			intrigue >= high_skill_rating
		}
		localization_key = lmf_extoll_intrigue
	}

	text = {
		trigger = {
			learning >= high_skill_rating
		}
		localization_key = lmf_extoll_learning
	}

	text = {
		trigger = {
			has_dynasty = yes
			NOT = { dynasty = scope:second.dynasty }
			OR = {
				dynasty.dynasty_prestige_level > 2
				any_close_or_extended_family_member = {
					is_landed = yes
					highest_held_title_tier > tier_barony
				}
				dynasty = { any_dynasty_member = { count >= 10 } }
			}
		}
		weight_multiplier = {
			base = 5
		}
		localization_key = lmf_extoll_family
	}

	text = {
		trigger = {
			ai_compassion >= high_positive_ai_value
		}
		weight_multiplier = {
			base = 3
		}
		localization_key = lmf_extoll_kind
	}

	text = {
		trigger = {
			ai_honor >= high_positive_ai_value
		}
		weight_multiplier = {
			base = 3
		}
		localization_key = lmf_extoll_honor
	}

	text = {
		trigger = {
			ai_zeal >= high_positive_ai_value
			scope:second = {
				faith = root.faith
				ai_zeal >= 0
			}
		}
		weight_multiplier = {
			base = 3
		}
		localization_key = lmf_extoll_zeal
	}

	text = {
		trigger = {
			NOT = { has_variable = is_extoll_character }
			OR = {
				has_trait = forgiving
				ai_vengefulness <= high_negative_ai_value
			}
		}
		weight_multiplier = {
			base = 3
		}
		localization_key = lmf_extoll_forgiving_them
	}

	text = {
		trigger = {
			has_variable = is_extoll_character
			OR = {
				has_trait = forgiving
				ai_vengefulness <= high_negative_ai_value
			}
		}
		weight_multiplier = {
			base = 3
		}
		localization_key = lmf_extoll_forgiving_me
	}

	text = {
		trigger = {
			OR = {
				has_trait = trusting
				has_trait = loyal
			}
		}
		localization_key = lmf_extoll_loyal
	}

	text = {
		trigger = {
			has_trait = generous
		}
		localization_key = lmf_extoll_generous
	}

	text = {
		trigger = {
			has_trait = just
		}
		localization_key = lmf_extoll_just
	}

	text = {
		trigger = {
			has_trait = diligent
		}
		localization_key = lmf_extoll_diligent
	}

	text = {
		trigger = {
			has_trait = honest
		}
		localization_key = lmf_extoll_honest
	}

	text = {
		trigger = {
			has_trait = brave
		}
		localization_key = lmf_extoll_brave
	}

	text = {
		trigger = {
			has_trait = ambitious
		}
		localization_key = lmf_extoll_ambitious
	}

	text = {
		trigger = {
			NOT = { has_variable = is_extoll_character }
			var:potential_spouse = { has_relation_soulmate = root }
		}
		weight_multiplier = {
			base = 20
		}
		localization_key = lmf_extoll_my_soulmate
	}

	text = {
		trigger = {
			has_variable = is_extoll_character
			var:potential_spouse = { has_relation_soulmate = root }
		}
		weight_multiplier = {
			base = 20
		}
		localization_key = lmf_extoll_their_soulmate
	}

	text = {
		trigger = {
			NOT = { has_variable = is_extoll_character }
			var:potential_spouse = {
				has_relation_lover = root
				NOT = { has_relation_soulmate = root }
			}
		}
		weight_multiplier = {
			base = 5
		}
		localization_key = lmf_extoll_my_lover
	}

	text = {
		trigger = {
			has_variable = is_extoll_character
			var:potential_spouse = {
				has_relation_lover = root
				NOT = { has_relation_soulmate = root }
			}
		}
		weight_multiplier = {
			base = 5
		}
		localization_key = lmf_extoll_their_lover
	}

	text = {
		trigger = { always = no }
		fallback = yes
		localization_key = lmf_extoll_fallback
	}
}

lmf_type_of_request = {
	type = character

	text = {
		trigger = {
			has_personality_submissive_trigger = yes
		}
		localization_key = lmf_request_submissive
	}
	text = {
		trigger = {
			has_personality_benevolent_trigger = yes
		}
		localization_key = lmf_request_benevolent
	}
	text = {
		trigger = {
			has_personality_dominant_trigger = yes
		}
		localization_key = lmf_request_dominant
	}
	text = {
		trigger = {
			has_personality_annoying_trigger = yes
		}
		localization_key = lmf_request_annoying
	}
	text = {
		localization_key = lmf_request_normal
		fallback = yes
	}
}

