﻿rtd_value_piety_cost_very_cheap = 0
rtd_value_piety_cost_cheap = 1000
rtd_value_piety_cost_default = 1500
rtd_value_piety_cost_expensive = 2000
rtd_value_piety_cost_very_expensive = 2500

rtd_value_cooldown_none = 0
rtd_value_cooldown_short = 10
rtd_value_cooldown_default = 15
rtd_value_cooldown_long = 20
rtd_value_cooldown_very_long = 25

rtd_value_same_heritage_counties_none = 0
rtd_value_same_heritage_counties_default = 3
rtd_value_same_heritage_counties_many = 5

rtd_value_coexistence_limit_unique = 1
rtd_value_coexistence_limit_few = 3
rtd_value_coexistence_limit_many = 5

rtd_min_template_skill_bonus_worst = 2
rtd_max_template_skill_bonus_worst = 4
rtd_min_template_skill_bonus_bad = 5
rtd_max_template_skill_bonus_bad = 7
rtd_min_template_skill_bonus_plain = 8
rtd_max_template_skill_bonus_plain = 10
rtd_min_template_skill_bonus_good = 11
rtd_max_template_skill_bonus_good = 13
rtd_min_template_skill_bonus_best = 14
rtd_max_template_skill_bonus_best = 16
rtd_min_template_skill_bonus_random = 0
rtd_max_template_skill_bonus_random = 18

rtd_value_piety_cost = {
	if = {
		limit = { has_game_rule = rtd_rule_piety_cost_very_cheap }
		value = rtd_value_piety_cost_none
	}
	else_if = {
		limit = { has_game_rule = rtd_rule_piety_cost_cheap }
		value = rtd_value_piety_cost_cheap
	}
	else_if = {
		limit = { has_game_rule = rtd_rule_piety_cost_expensive }
		value = rtd_value_piety_cost_expensive
	}
	else_if = {
		limit = { has_game_rule = rtd_rule_piety_cost_very_expensive }
		value = rtd_value_piety_cost_very_expensive
	}
	else = {
		value = rtd_value_piety_cost_default
	}
}

rtd_value_cooldown = {
	if = {
		limit = { has_game_rule = rtd_rule_cooldown_very_short }
		value = rtd_value_cooldown_none
	}
	else_if = {
		limit = { has_game_rule = rtd_rule_cooldown_short }
		value = rtd_value_cooldown_short
	}
	else_if = {
		limit = { has_game_rule = rtd_rule_cooldown_long }
		value = rtd_value_cooldown_long
	}
	else_if = {
		limit = { has_game_rule = rtd_rule_cooldown_very_long }
		value = rtd_value_cooldown_very_long
	}
	else = {
		value = rtd_value_cooldown_default
	}
}

rtd_value_same_heritage_counties = {
	if = {
		limit = { has_game_rule = rtd_rule_same_heritage_counties_few }
		value = rtd_value_same_heritage_counties_none
	}
	else_if = {
		limit = { has_game_rule = rtd_rule_same_heritage_counties_many }
		value = rtd_value_same_heritage_counties_many
	}
	else = {
		value = rtd_value_same_heritage_counties_default
	}
}

rtd_value_coexistence_limit = {
	if = {
		limit = { has_game_rule = rtd_rule_coexistence_limit_few }
		value = rtd_value_coexistence_limit_few
	}
	else_if = {
		limit = { has_game_rule = rtd_rule_coexistence_limit_many }
		value = rtd_value_coexistence_limit_many
	}
	else = {
		value = rtd_value_coexistence_limit_unique
	}
}

rtd_value_num_of_alter_egos = { #scope: the_reincarnated
	var:reincarnation_of = { save_temporary_scope_as = rtd_value_scope_ancestor }
	value = 0
	every_in_global_list = {
		variable = living_reincarnated
		limit = {
			var:reincarnation_of = scope:rtd_value_scope_ancestor
		}
		add = 1
	}
}

rtd_value_num_of_scions = { #scope: the_ancestor
	save_temporary_scope_as = rtd_value_scope_ancestor
	value = 0
	every_in_global_list = {
		variable = living_reincarnated
		limit = {
			var:reincarnation_of = scope:rtd_value_scope_ancestor
		}
		add = 1
	}
}