﻿test_value = 5
test_bool = yes

#Gold stuff
tiny_gold_value_check = 10
#tiny_gold_value = 10
minor_gold_value_check = 30
#minor_gold_value = 30
medium_gold_value_check = 100
#medium_gold_value = 100
major_gold_value_check = 300
#major_gold_value = 300


#Dynamic gold stuff
tiny_gold_min_value = 5
tiny_gold_max_value = 50
minor_gold_min_value = 15
minor_gold_max_value = 150
medium_gold_min_value = 50
medium_gold_max_value = 300
major_gold_min_value = 75
major_gold_max_value = 500
massive_gold_min_value = 100
massive_gold_max_value = 750
monumental_gold_min_value = 200
monumental_gold_max_value = 1500

tiny_income_multiplier_value = 1.2
minor_income_multiplier_value = 3
medium_income_multiplier_value = 6
major_income_multiplier_value = 12
massive_income_multiplier_value = 18
monumental_income_multiplier_value = 36

current_gold_value = {
	value = gold
	floor = yes
}

# TIMERS
default_event_cooldown_duration = 730
long_event_cooldown_duration = 1200
default_favor_duration = 3650

#SKILL RATINGS
average_skill_rating = 8 #Tracks what we see as "typical". For use in duels, etc.

low_skill_rating = 5
mediocre_skill_rating = 8
medium_skill_rating = 10
decent_skill_rating = 12
high_skill_rating = 15
very_high_skill_rating = 18
extremely_high_skill_rating = 20
inverted_low_skill_rating = {
	value = 0
	subtract = low_skill_rating
}
inverted_mediocre_skill_rating = {
	value = 0
	subtract = mediocre_skill_rating
}
inverted_medium_skill_rating = {
	value = 0
	subtract = medium_skill_rating
}
inverted_decent_skill_rating = {
	value = 0
	subtract = decent_skill_rating
}
inverted_high_skill_rating = {
	value = 0
	subtract = high_skill_rating
}
inverted_very_high_skill_rating = {
	value = 0
	subtract = very_high_skill_rating
}
inverted_extremely_high_skill_rating = {
	value = 0
	subtract = extremely_high_skill_rating
}


# SKILL BONUS/PENALTIES
minor_skill_bonus = 1
minor_skill_penalty = -1
medium_skill_bonus = 2
medium_skill_penalty = -2
major_skill_bonus = 3
major_skill_penalty = -3
massive_skill_bonus = 4
massive_skill_penalty = -4


#TEMPLATE SKILLS
skill_variance = 2

guest_template_average_skill = 6

min_guest_template_skill = {
	add = guest_template_average_skill
	subtract = skill_variance
}
max_guest_template_skill = {
	add = guest_template_average_skill
	add = skill_variance
}

min_template_low_skill = {
	add = low_skill_rating
	subtract = skill_variance
}
max_template_low_skill = {
	add = low_skill_rating
	add = skill_variance
}

min_template_average_skill = {
	add = average_skill_rating
	subtract = skill_variance
}
max_template_average_skill = {
	add = average_skill_rating
	add = skill_variance
}

min_template_decent_skill = {
	add = decent_skill_rating
	subtract = skill_variance
}
max_template_decent_skill = {
	add = decent_skill_rating
	add = skill_variance
}

min_template_high_skill = {
	add = high_skill_rating
	subtract = skill_variance
}
max_template_high_skill = {
	add = high_skill_rating
	add = skill_variance
}

# SKILL LEVELS
#Relates to the skill levels in the defines: DO NOT UPDATE THESE WITHOUT CHANGING THOSE, and vice versa.
#Each level is everything below it that isn't part of another level, apart from excellency, which is everything at that number and above.
terrible_skill_level = 3
poor_skill_level = 7
average_skill_level = 11
good_skill_level = 15
excellent_skill_level = 16







#Piety ratings
low_piety_level = 1
medium_piety_level = 2
high_piety_level = 3
very_high_piety_level = 4
max_piety_level = 5

#Prestige levels
low_prestige_level = 1
medium_prestige_level = 2
high_prestige_level = 3
very_high_prestige_level = 4
max_prestige_level = 5

# HEALTH
miniscule_health_penalty = -0.25
minor_health_penalty = -0.5
medium_health_penalty = -1
major_health_penalty = -1.5
massive_health_penalty = -2
monumental_health_penalty = -3

#Pregnancy, Wounds, & Disease
pregnancy_chance = 30 #Chance of becoming pregnant from the had_sex_with_effect
seduce_pregnancy_chance = 50
wound_treatment_success_duration = 1095
wound_treatment_success_duration_plus_1 = 1096
wound_treatment_failure_duration = 365
wound_treatment_failure_duration_plus_1 = 366
disease_treatment_short_duration = 365
disease_treatment_short_duration_plus_1 = 366
disease_treatment_long_duration = 1825
disease_treatment_long_duration_plus_1 = 1826


# FERTILITY
minor_fertility_penalty = -0.05
minor_fertility_bonus = 0.05

#Fertility rating
low_fertility = 0.3
medium_fertility = 0.5
high_fertility = 0.8

#Dread
minor_dread_loss = -10
medium_dread_loss = -20
major_dread_loss = -30
massive_dread_loss = -30
minor_dread_gain = 10
medium_dread_gain = 20
major_dread_gain = 30
massive_dread_gain = 50

torture_interaction_minor_dread_gain = 5
torture_interaction_medium_dread_gain = 10
torture_interaction_major_dread_gain = 15
torture_interaction_massive_dread_gain = 20

#DREAD VALUE
low_dread = 20
medium_dread = 40
high_dread = 80

#PRESTIGE

#Note! These are base values, use loss/gain below
miniscule_prestige_value = 35
minor_prestige_value = 75
medium_prestige_value = 150
major_prestige_value = 350
massive_prestige_value = 750
monumental_prestige_value = 1500


miniscule_prestige_loss = {
	value = 0
	subtract = miniscule_prestige_value
}
minor_prestige_loss = {
	value = 0
	subtract = minor_prestige_value
}
medium_prestige_loss = {
	value = 0
	subtract = medium_prestige_value
}
major_prestige_loss = {
	value = 0
	subtract = major_prestige_value
}
massive_prestige_loss = {
	value = 0
	subtract = massive_prestige_value
}

miniscule_prestige_gain = miniscule_prestige_value
minor_prestige_gain = minor_prestige_value
medium_prestige_gain = medium_prestige_value
major_prestige_gain = major_prestige_value
massive_prestige_gain = massive_prestige_value
monumental_prestige_gain = monumental_prestige_value

knight_prestige_gain_on_wound = {
	value = minor_prestige_gain
	if = {
		limit = {
			exists = scope:enemy_knight.primary_title
			scope:enemy_knight.primary_title.tier > 0
		}
		multiply = scope:enemy_knight.primary_title.tier
	}
	if = {
		limit = {
			exists = scope:enemy_knight
			scope:enemy_knight = {
				is_lowborn = yes
			}
		}
		divide = 2
	}
}

knight_prestige_gain_on_kill = {
	value = medium_prestige_gain
	if = {
		limit = {
			exists = scope:enemy_knight.primary_title
			scope:enemy_knight.primary_title.tier > 0
		}
		multiply = scope:enemy_knight.primary_title.tier
	}
	if = {
		limit = {
			exists = scope:enemy_knight
			scope:enemy_knight = {
				is_lowborn = yes
			}
		}
		divide = 2
	}
}

knight_prestige_gain_on_wound_inverse = {
	value = minor_prestige_gain
	if = {
		limit = {
			exists = root.primary_title
			root.primary_title.tier > 0
		}
		multiply = root.primary_title.tier
	}
	if = {
		limit = {
			root = {
				is_lowborn = yes
			}
		}
		divide = 2
	}
}

knight_prestige_gain_on_kill_inverse = {
	value = medium_prestige_gain
	if = {
		limit = {
			exists = root.primary_title
			root.primary_title.tier > 0
		}
		multiply = root.primary_title.tier
	}
	if = {
		limit = {
			root = {
				is_lowborn = yes
			}
		}
		divide = 2
	}
}

#PIETY
miniscule_piety_value = 25
minor_piety_value = 50
medium_piety_value = 100
major_piety_value = 250
massive_piety_value = 500


miniscule_piety_loss = {
	value = 0
	subtract = miniscule_piety_value
}
minor_piety_loss = {
	value = 0
	subtract = minor_piety_value
}
medium_piety_loss = {
	value = 0
	subtract = medium_piety_value
}
major_piety_loss = {
	value = 0
	subtract = major_piety_value
}
massive_piety_loss = {
	value = 0
	subtract = massive_piety_value
}

miniscule_piety_gain = miniscule_piety_value
minor_piety_gain = minor_piety_value
medium_piety_gain = medium_piety_value
major_piety_gain = major_piety_value
massive_piety_gain = massive_piety_value

#FAME

#Note! These are base values, use loss/gain below
miniscule_fame_value = 20
minor_fame_value = 50
medium_fame_value = 100
major_fame_value = 200
massive_fame_value = 350
monumental_fame_value = 500


miniscule_fame_loss = {
	value = 0
	subtract = miniscule_fame_value
}
minor_fame_loss = {
	value = 0
	subtract = minor_fame_value
}
medium_fame_loss = {
	value = 0
	subtract = medium_fame_value
}
major_fame_loss = {
	value = 0
	subtract = major_fame_value
}
massive_fame_loss = {
	value = 0
	subtract = massive_fame_value
}

miniscule_fame_gain = miniscule_fame_value
minor_fame_gain = minor_fame_value
medium_fame_gain = medium_fame_value
major_fame_gain = major_fame_value
massive_fame_gain = massive_fame_value
monumental_fame_gain = monumental_fame_value

#DEVOTION

#Note! These are base values, use loss/gain below
miniscule_devotion_value = 10
minor_devotion_value = 25
medium_devotion_value = 50
major_devotion_value = 100
massive_devotion_value = 250


miniscule_devotion_loss = {
	value = 0
	subtract = miniscule_devotion_value
}
minor_devotion_loss = {
	value = 0
	subtract = minor_devotion_value
}
medium_devotion_loss = {
	value = 0
	subtract = medium_devotion_value
}
major_devotion_loss = {
	value = 0
	subtract = major_devotion_value
}
massive_devotion_loss = {
	value = 0
	subtract = massive_devotion_value
}

miniscule_devotion_gain = miniscule_devotion_value
minor_devotion_gain = minor_devotion_value
medium_devotion_gain = medium_devotion_value
major_devotion_gain = major_devotion_value
massive_devotion_gain = massive_devotion_value

#FERVOR
miniscule_fervor_value = 10
minor_fervor_value = 15
medium_fervor_value = 25
major_fervor_value = 50
massive_fervor_value = 100


miniscule_fervor_loss = {
	value = 0
	subtract = miniscule_fervor_value
}
minor_fervor_loss = {
	value = 0
	subtract = minor_fervor_value
}
medium_fervor_loss = {
	value = 0
	subtract = medium_fervor_value
}
major_fervor_loss = {
	value = 0
	subtract = major_fervor_value
}
massive_fervor_loss = {
	value = 0
	subtract = massive_fervor_value
}

miniscule_fervor_gain = miniscule_fervor_value
minor_fervor_gain = minor_fervor_value
medium_fervor_gain = medium_fervor_value
major_fervor_gain = major_fervor_value
massive_fervor_gain = massive_fervor_value

#OPINION
very_high_positive_opinion = 80 # This is someone that trusts you quite a bit, and will be on your side regardless of if it's a major breach of their character - unless it's something that directly opposes them, of course.
high_positive_opinion = 60 #A loyal subject, stalwart ally or respectful ruler. You shouldn't have much to fear from someone with this level of opinion, but they still won't support you should it be a major breach of character for them to do so.
medium_positive_opinion = 40 #At this level a character would be more likely to support you than to keep the status quo, but they could still decide to undermine you should it be in line with their character.
low_positive_opinion = 20 #Someone who has a degree of respect for you. While they are more likely to support you than undermine you, they'd rather prefer to keep the status quo than support you.
neutral_opinion = 0 #Indifferent to you. Will want to keep the status quo, or actively undermine you.
low_negative_opinion = -20 #Someone who doesn't care for you. They'd be amenable to join others in undermining you, but are not interested in starting anything themselves - unless it's something that would mean a great gain for them.
medium_negative_opinion = -40 #Light contempt. These characters would actively work against you given the chance, though they would still need a reason for doing so. They might also not want to, for example, ruin the realm during an active war should they be your vassal.
high_negative_opinion = -60 #Contempt. These characters will often work to undermine you, unless there are extreme circumstances (such as them being your parent).
very_high_negative_opinion = -80 #This is someone who hates you. They will want to do anything in their power to undermine you, and frequently so. (edited)



#WAR VALUES
break_truce_prestige_loss = -250
break_truce_prestige_level_loss = -1
attack_ally_prestige_loss = -250
attack_ally_prestige_level_loss = -1

#TYRANNY VALUES
minor_tyranny_gain = 5
medium_tyranny_gain = 10
major_tyranny_gain = 20
massive_tyranny_gain = 30

low_tyranny = 10
medium_tyranny = 40
high_tyranny = 80

imprisonment_tyranny_gain = 20
execution_tyranny_gain = 10
banishment_tyranny_gain = 5
revoke_title_tyranny_gain = 20
revoke_vassal_tyranny_gain = 5

#TRAIT VALUES
commander_trait_limit = 3
childhood_personality_trait_gain_limit = 3 #Trigger in a compare modifier in child_personaluity.9999
childhood_fourth_personality_trait_chance = 5 #Percentage in a random chance in child_personaluity.9999

personality_trait_minimum = 2
personality_trait_standard = 3
personality_trait_limit = 4


#LIFESTYLE VALUES
lifestyle_rank_up_1_threshold = 30
lifestyle_rank_up_2_threshold = 50
lifestyle_rank_up_3_threshold = 70
minimum_event_rank_up_threshold = 3
decline_rank_up_cost = -5
reimburse_declined_rank_up_cost = 2 #1 lower to prevent a new event from firing immediately
standard_lifestyle_focus_progress = 1
ongoing_lifestyle_event_delay = 1
#Reveler rank up thresholds
reveler_rank_up_1_threshold = 5
reveler_rank_up_2_threshold = 6
reveler_rank_up_3_threshold = 8
#Hunter rank up thresholds
hunter_rank_up_1_threshold = 5
hunter_rank_up_2_threshold = 6
hunter_rank_up_3_threshold = 8
#Seduce progress chances and values
monthly_seduce_lifestyle_progress_chance = 20
seduce_lifestyle_seduction_success_base_progress = 8
seduce_lifestyle_3_tiers_above_progress_multiplier = 2.5
seduce_lifestyle_2_tiers_above_progress_multiplier = 1.8
seduce_lifestyle_1_tier_above_progress_multiplier =  1.25
seduce_lifestyle_1_tier_below_progress_multiplier = 0.6
seduce_lifestyle_2_tiers_below_progress_multiplier = 0.4
seduce_lifestyle_3_tiers_below_progress_multiplier = 0.15

#BUILDINGS
minor_building_cost = 400
medium_building_cost = 500
major_building_cost = 600

#ATTRACTION
low_positive_attraction = 10
medium_positive_attraction = 20
high_positive_attraction = 30
low_negative_attraction = -10
medium_negative_attraction = -20
high_negative_attraction = -30


#DEVELOPMENT LEVEL VALUES
terrible_development_level = 10
bad_development_level = 20
medium_development_level = 40
good_development_level = 60
great_development_level = 80
max_development_level = 100

#DEVELOPMENT CHANGE VALUES
minor_development_level_loss = -10
medium_development_level_loss = -20
major_development_level_loss = -30
minor_development_level_gain = 10
medium_development_level_gain = 20
major_development_level_gain = 30

#DEVELOPMENT PROGRESS VALUES
minor_development_progress_loss = -20
medium_development_progress_loss = -40
major_development_progress_loss = -80
minor_development_progress_gain = 20
medium_development_progress_gain = 40
major_development_progress_gain = 80

#DEVELOPMENT GROWTH VALUES
tiny_development_growth_gain = 0.05
small_development_growth_gain = 0.1
medium_development_growth_gain = 0.2
large_development_growth_gain = 0.3
very_large_development_growth_gain = 0.5

tiny_development_growth_loss = -0.1
small_development_growth_loss = -0.2
medium_development_growth_loss = -0.3
large_development_growth_loss = -0.5
very_large_development_growth_loss = -0.8

#HEALTH
excellent_health = 7
good_health = 5
medium_health = 4
fine_health = 3 #The names of these should be updated to match the defines (HEALTH_STATE_LEVELS_VALUES, HEALTH_STATE_LEVELS_TEXTS)
poor_health = 1
dying_health = 0

death_chance_starts_health = 3
death_chance_dying_health = 1.5

#Incest Opinion Values
close_relative_known_incest_opinion_loss_value = -25
same_dynasty_known_incest_opinion_loss_value = -15
known_incest_opinion_loss_value = -10


#SIEGE VALUES
siege_capture_chance = 50

#Relation values
friend_opinion_impact = 50
rival_opinion_impact = -50
mentor_opinion_impact = 15
student_opinion_impact = 30
lover_opinion_impact = 40
guardian_opinion_impact = 15
ward_opinion_impact = 5
bully_opinion_impact = -30
victim_opinion_impact = -40
crush_opinion_impact = 30

#DYNASTY PRESTIGE

#Note! These are base values, use loss/gain below
miniscule_dynasty_prestige_value = 25
minor_dynasty_prestige_value = 50
medium_dynasty_prestige_value = 75
major_dynasty_prestige_value = 150
massive_dynasty_prestige_value = 250
monumental_dynasty_prestige_value = 1000

miniscule_dynasty_prestige_loss = {
	value = 0
	subtract = miniscule_dynasty_prestige_value
}
minor_dynasty_prestige_loss = {
	value = 0
	subtract = minor_dynasty_prestige_value
}
medium_dynasty_prestige_loss = {
	value = 0
	subtract = medium_dynasty_prestige_value
}
major_dynasty_prestige_loss = {
	value = 0
	subtract = major_dynasty_prestige_value
}
massive_dynasty_prestige_loss = {
	value = 0
	subtract = massive_prestige_value
}
monumental_dynasty_prestige_loss = {
	value = 0
	subtract = monumental_dynasty_prestige_value
}

miniscule_dynasty_prestige_gain = miniscule_dynasty_prestige_value
minor_dynasty_prestige_gain = minor_dynasty_prestige_value
medium_dynasty_prestige_gain = medium_dynasty_prestige_value
major_dynasty_prestige_gain = major_dynasty_prestige_value
massive_dynasty_prestige_gain = massive_dynasty_prestige_value
monumental_dynasty_prestige_gain = monumental_dynasty_prestige_value

max_dynasty_prestige_level = 10
high_dynasty_prestige_level = 7
medium_dynasty_prestige_level = 4
low_dynasty_prestige_level = 2
min_dynasty_prestige_level = 0

#RANGES

#For use in "squared_distance" triggers
diplomatic_range = 1000000

#DE JURE DRIFT
medium_de_jure_drift_progress_gain = 15
medium_de_jure_drift_progress_loss = -15

#Send Gift
send_gift_opinion = {
	value = 5
	if = {
		limit = {
			scope:actor.diplomacy > 0
		}
		add = {
			value = scope:actor.diplomacy
			multiply = 3
		}
	}
	if = {
		limit = {
			scope:recipient.ai_greed > 0
		}
		add = {
			value = scope:recipient.ai_greed
			divide = 3
		}
	}
	if = {
		limit = {
			scope:recipient.liege = scope:actor
		}
		divide = 1.5
	}
	if = {
		limit = {
			scope:recipient = scope:actor.faith.religious_head
		}
		divide = 3
	}
	if = {
		limit = {
			scope:actor = { has_perk = thoughtful_perk }
		}
		multiply = 2
	}
}


#POOL VALUES

full_pool_size = 30

# CULTURE VALUES
convert_to_local_culture_base_cost = 300


# Sexuality

default_heterosexuality_chance = {
	value = 100
	subtract = define:NCharacter|PERCENTAGE_HOMOSEXUAL
	subtract = define:NCharacter|PERCENTAGE_BISEXUAL
	subtract = define:NCharacter|PERCENTAGE_ASEXUAL
}

heterosexuality_chance = {
	if = {
		limit = { has_game_rule = sexuality_distribution_default }
		value = default_heterosexuality_chance
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_equal }
		value = 25
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_homosexuality }
		value = define:NCharacter|PERCENTAGE_HOMOSEXUAL #Swapping with homosexual
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_bisexuality }
		value = define:NCharacter|PERCENTAGE_BISEXUAL #Swapping with bisexual
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_asexuality }
		value = define:NCharacter|PERCENTAGE_ASEXUAL #Swapping with asexuality
	}
}

homosexuality_chance = {
	if = {
		limit = { has_game_rule = sexuality_distribution_default }
		value = define:NCharacter|PERCENTAGE_HOMOSEXUAL
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_equal }
		value = 25
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_homosexuality }
		value = default_heterosexuality_chance #Swapped with heterosexuality
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_bisexuality }
		value = define:NCharacter|PERCENTAGE_HOMOSEXUAL
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_asexuality }
		value = define:NCharacter|PERCENTAGE_HOMOSEXUAL
	}
}

bisexuality_chance = {
	if = {
		limit = { has_game_rule = sexuality_distribution_default }
		value = define:NCharacter|PERCENTAGE_BISEXUAL
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_equal }
		value = 25
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_homosexuality }
		value = define:NCharacter|PERCENTAGE_BISEXUAL
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_bisexuality }
		value = default_heterosexuality_chance #Swapped with heterosexuality
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_asexuality }
		value = define:NCharacter|PERCENTAGE_BISEXUAL
	}
}

asexuality_chance = {
	if = {
		limit = { has_game_rule = sexuality_distribution_default }
		value = define:NCharacter|PERCENTAGE_ASEXUAL
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_equal }
		value = 25
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_homosexuality }
		value = define:NCharacter|PERCENTAGE_ASEXUAL
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_bisexuality }
		value = define:NCharacter|PERCENTAGE_ASEXUAL
	}
	else_if = {
		limit = { has_game_rule = sexuality_distribution_most_common_asexuality }
		value = default_heterosexuality_chance #Swapped with heterosexuality
	}
}

count_obligation_improvements_for_vassal = {
	value = 0
	# Levies and taxes are a linear scale, moving up adds and moving down subtracts
	if = {
		limit = {
			local_var:feudal_government_taxes != vassal_contract_obligation_level:feudal_government_taxes
		}
		add = {
			value = vassal_contract_obligation_level:feudal_government_taxes
			subtract = local_var:feudal_government_taxes
		}
	} 
	if = {
		limit = {
			local_var:feudal_government_levies != vassal_contract_obligation_level:feudal_government_levies
		}
		add = {
			value = vassal_contract_obligation_level:feudal_government_levies
			subtract = local_var:feudal_government_levies
		}
	}
	# Any non-default fine print contract takes subtracts one
	# special_contract intentionally has no effect
	if = {
		limit = {
			local_var:religious_rights != vassal_contract_obligation_level:religious_rights
		}
		if = {
			limit = { local_var:religious_rights != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:fortification_rights != vassal_contract_obligation_level:fortification_rights
		}
		if = {
			limit = { local_var:fortification_rights != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:coinage_rights != vassal_contract_obligation_level:coinage_rights
		}
		if = {
			limit = { local_var:coinage_rights != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:succession_rights != vassal_contract_obligation_level:succession_rights
		}
		if = {
			limit = { local_var:succession_rights = 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:war_declaration_rights != vassal_contract_obligation_level:war_declaration_rights
		}
		if = {
			limit = { local_var:war_declaration_rights != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:council_rights != vassal_contract_obligation_level:council_rights
		}
		if = {
			limit = { local_var:council_rights != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:title_revocation_rights != vassal_contract_obligation_level:title_revocation_rights
		}
		if = {
			limit = { local_var:title_revocation_rights != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:knight_rights != vassal_contract_obligation_level:knight_rights
		}
		if = {
			limit = { local_var:knight_rights != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:cultural_rights != vassal_contract_obligation_level:cultural_rights
		}
		if = {
			limit = { local_var:cultural_rights != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:commercial_fairs_rights != vassal_contract_obligation_level:commercial_fairs_rights
		}
		if = {
			limit = { local_var:commercial_fairs_rights != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:tithe_rights != vassal_contract_obligation_level:tithe_rights
		}
		if = {
			limit = { local_var:tithe_rights != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:wrath_of_heaven != vassal_contract_obligation_level:wrath_of_heaven
		}
		if = {
			limit = { local_var:wrath_of_heaven != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:peace_tax != vassal_contract_obligation_level:peace_tax
		}
		if = {
			limit = { local_var:peace_tax != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:ora_et_labora != vassal_contract_obligation_level:ora_et_labora
		}
		if = {
			limit = { local_var:ora_et_labora != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:town_chart != vassal_contract_obligation_level:town_chart
		}
		if = {
			limit = { local_var:town_chart != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:mob_razzias != vassal_contract_obligation_level:mob_razzias
		}
		if = {
			limit = { local_var:mob_razzias != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:high_spheres != vassal_contract_obligation_level:high_spheres
		}
		if = {
			limit = { local_var:high_spheres != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:glory_leeway != vassal_contract_obligation_level:glory_leeway
		}
		if = {
			limit = { local_var:glory_leeway != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:capitulare_devillis != vassal_contract_obligation_level:capitulare_devillis
		}
		if = {
			limit = { local_var:capitulare_devillis != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:kind_tax != vassal_contract_obligation_level:kind_tax
		}
		if = {
			limit = { local_var:kind_tax != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:patronize_the_7_arts != vassal_contract_obligation_level:patronize_the_7_arts
		}
		if = {
			limit = { local_var:patronize_the_7_arts != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:spread_local_tales != vassal_contract_obligation_level:spread_local_tales
		}
		if = {
			limit = { local_var:spread_local_tales != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:missi_dominici != vassal_contract_obligation_level:missi_dominici
		}
		if = {
			limit = { local_var:missi_dominici != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:property_survey != vassal_contract_obligation_level:property_survey
		}
		if = {
			limit = { local_var:property_survey != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:conscripted_souls != vassal_contract_obligation_level:conscripted_souls
		}
		if = {
			limit = { local_var:conscripted_souls != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:solemn_brotherhood != vassal_contract_obligation_level:solemn_brotherhood
		}
		if = {
			limit = { local_var:solemn_brotherhood != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:godshouse != vassal_contract_obligation_level:godshouse
		}
		if = {
			limit = { local_var:godshouse != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:divine_will != vassal_contract_obligation_level:divine_will
		}
		if = {
			limit = { local_var:divine_will != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:corvea != vassal_contract_obligation_level:corvea
		}
		if = {
			limit = { local_var:corvea != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:vatican_embassy != vassal_contract_obligation_level:vatican_embassy
		}
		if = {
			limit = { local_var:vatican_embassy != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
	if = {
		limit = {
			local_var:eden_gardens != vassal_contract_obligation_level:eden_gardens
		}
		if = {
			limit = { local_var:eden_gardens != 0 }
			add = 1
		}
		else = {
			subtract = 1
		}
	}
}

count_total_obligation_changes = {
	value = 0
	if = {
		limit = {
			local_var:feudal_government_taxes != vassal_contract_obligation_level:feudal_government_taxes
		}
		add = 1
	}
	if = {
		limit = {
			local_var:feudal_government_levies != vassal_contract_obligation_level:feudal_government_levies
		}
		add = 1
	}
	if = {
		limit = {
			local_var:fortification_rights != vassal_contract_obligation_level:fortification_rights
		}
		add = 1
	}
	if = {
		limit = {
			local_var:coinage_rights != vassal_contract_obligation_level:coinage_rights
		}
		add = 1
	}
	if = {
		limit = {
			local_var:succession_rights != vassal_contract_obligation_level:succession_rights
		}
		add = 1
	}
	if = {
		limit = {
			local_var:war_declaration_rights != vassal_contract_obligation_level:war_declaration_rights
		}
		add = 1
	}
	if = {
		limit = {
			local_var:council_rights != vassal_contract_obligation_level:council_rights
		}
		add = 1
	}
	if = {
		limit = {
			local_var:title_revocation_rights != vassal_contract_obligation_level:title_revocation_rights
		}
		add = 1
	}
	if = {
		limit = {
			local_var:knight_rights != vassal_contract_obligation_level:knight_rights
		}
		add = 1
	}
	if = {
		limit = {
			local_var:special_contract != vassal_contract_obligation_level:special_contract
		}
		add = 1
	}
	if = {
		limit = {
			local_var:cultural_rights != vassal_contract_obligation_level:cultural_rights
		}
		add = 1
	}if = {
		limit = {
			local_var:commercial_fairs_rights != vassal_contract_obligation_level:commercial_fairs_rights
		}
		add = 1
	}
	if = {
		limit = {
			local_var:special_contract1 != vassal_contract_obligation_level:special_contract1
		}
		add = 1
	}
	if = {
		limit = {
			local_var:religious_rights != vassal_contract_obligation_level:religious_rights
		}
		add = 1
	}
	if = {
		limit = {
			local_var:tithe_rights != vassal_contract_obligation_level:tithe_rights
		}
		add = 1
	}
	if = {
		limit = {
			local_var:wrath_of_heaven != vassal_contract_obligation_level:wrath_of_heaven
		}
		add = 1
	}
	if = {
		limit = {
			local_var:special_contract2 != vassal_contract_obligation_level:special_contract2
		}
		add = 1
	}
	if = {
		limit = {
			local_var:peace_tax != vassal_contract_obligation_level:peace_tax
		}
		add = 1
	}
	if = {
		limit = {
			local_var:ora_et_labora != vassal_contract_obligation_level:ora_et_labora
		}
		add = 1
	}
	if = {
		limit = {
			local_var:town_chart != vassal_contract_obligation_level:town_chart
		}
		add = 1
	}
	if = {
		limit = {
			local_var:mob_razzias != vassal_contract_obligation_level:mob_razzias
		}
		add = 1
	}
	if = {
		limit = {
			local_var:high_spheres != vassal_contract_obligation_level:high_spheres
		}
		add = 1
	}
	if = {
		limit = {
			local_var:glory_leeway != vassal_contract_obligation_level:glory_leeway
		}
		add = 1
	}
	if = {
		limit = {
			local_var:capitulare_devillis != vassal_contract_obligation_level:capitulare_devillis
		}
		add = 1
	}
	if = {
		limit = {
			local_var:kind_tax != vassal_contract_obligation_level:kind_tax
		}
		add = 1
	}
	if = {
		limit = {
			local_var:patronize_the_7_arts != vassal_contract_obligation_level:patronize_the_7_arts
		}
		add = 1
	}
	if = {
		limit = {
			local_var:spread_local_tales != vassal_contract_obligation_level:spread_local_tales
		}
		add = 1
	}
	if = {
		limit = {
			local_var:missi_dominici != vassal_contract_obligation_level:missi_dominici
		}
		add = 1
	}
	if = {
		limit = {
			local_var:property_survey != vassal_contract_obligation_level:property_survey
		}
		add = 1
	}
	if = {
		limit = {
			local_var:conscripted_souls != vassal_contract_obligation_level:conscripted_souls
		}
		add = 1
	}
	if = {
		limit = {
			local_var:solemn_brotherhood != vassal_contract_obligation_level:solemn_brotherhood
		}
		add = 1
	}
	if = {
		limit = {
			local_var:godshouse != vassal_contract_obligation_level:godshouse
		}
		add = 1
	}
	if = {
		limit = {
			local_var:divine_will != vassal_contract_obligation_level:divine_will
		}
		add = 1
	}
	if = {
		limit = {
			local_var:corvea != vassal_contract_obligation_level:corvea
		}
		add = 1
	}
	if = {
		limit = {
			local_var:vatican_embassy != vassal_contract_obligation_level:vatican_embassy
		}
		add = 1
	}
	if = {
		limit = {
			local_var:eden_gardens != vassal_contract_obligation_level:eden_gardens
		}
		add = 1
	}
}


# Requires local_var:<obligation_type> to be set for feudal obligations
# Requires scope:recipient to be set
# This = Person who's obligation we are checking
count_obligation_improvements_for_vassal_include_hook = {
	value = count_obligation_improvements_for_vassal
	if = {
		limit = { always = scope:hook }
		subtract = 1
	}
}

vassal_obligation_increase_tyranny_gain_base = 20

# Requires scope:recipient to bet set
# Requires local_var:<obligation_type> to be set for feudal obligations
vassal_obligation_increase_tyranny_gain_multiplier = {
	subtract = scope:recipient.count_obligation_improvements_for_vassal # Good for vassal is bad for liege
	if = {
		limit = {
			always = scope:hook
		}
		subtract = 1
	}
	min = 0
}

# Requires scope:recipient to bet set
# Requires local_var:<obligation_type> to be set for feudal obligations
# Use in the scope of the person getting tyranny
vassal_obligation_increase_tyranny_gain = {
	value = vassal_obligation_increase_tyranny_gain_base
	multiply = vassal_obligation_increase_tyranny_gain_multiplier
}


#FOR DIVORCE
divorce_cost = 100

#PERKS 
sound_foundations_max = 5
embassies_max = 5
friendly_counsel_max = 5