﻿#Scripted Modifiers used for the Pets Expanded mod


pets_expanded_pet_death_modifier = {
	modifier = {
		add = 100
		var:age_variable >= $PET_TYPE$_max_age_value
	}
	modifier = {
		add = {
			value = $PET_TYPE$_dif_to_max_age_value
			divide = $PET_TYPE$_max_age_value
			multiply = 0.7
			multiply = 100
		}
		#If they're too young, we don't factor this in
		$PET_TYPE$_dif_to_max_age_value >= 0.3
	}
	modifier = {
		factor = 1.2
		exists = var:health
		var:health = flag:bad
	}

	modifier = {
		factor = 0
		exists = var:health
		var:health = flag:good
		var:age_variable < $PET_TYPE$_max_age_value
		story_owner = { is_ai = no }
	}

	#Sorry, AI, your pets live shorter lives...
	modifier = {
		factor = 0.5
		exists = var:health
		var:health = flag:good
		var:age_variable < $PET_TYPE$_max_age_value
		story_owner = { is_ai = yes }
	}

	#Sorry, AI, your pets live shorter lives...
	modifier = {
		add = 25
		story_owner = { is_ai = yes }
		$PET_TYPE$_dif_to_max_age_value >= 0.7
	}
	#Sorry, AI, your pets live shorter lives...
	modifier = {
		add = 50
		story_owner = { is_ai = yes }
		$PET_TYPE$_dif_to_max_age_value >= 0.9
	}
}

pet_receiver_event_weight_modifier = {
	modifier = {
		add = 10
		has_relation_potential_friend = root
	}
	modifier = {
		add = 10
		has_relation_potential_lover = root
	}
	modifier = {
		add = 10
		is_of_major_interest_to_root_trigger = yes
	}
	modifier = {
		add = 5
		is_of_minor_interest_to_root_trigger = yes
	}
	modifier = {
		opinion = {
			target = root
			value > low_positive_opinion
		}
		add = 5
	}
	modifier = {
		opinion = {
			target = root
			value > medium_positive_opinion
		}
		add = 15
	}
}
