﻿mandala_vassal_obligation_cooldown_years = 15

convert_to_mandala_government_tribal_value = 500

convert_to_mandala_government_nontribal_value = {
	value = convert_to_mandala_government_tribal_value
	multiply = 2
}

num_mandala_subject_value = {
	value = 0
	every_tributary = { add = 1 }
	every_vassal = { add = 1 }
	min = 0
}

num_mandala_is_mandala_subject_value = {
	value = 0
	every_tributary = {
		limit = { government_has_flag = government_is_mandala }
		add = 1
	}
	every_vassal = {
		limit = { government_has_flag = government_is_mandala }
		add = 1
	}
}

mandala_capital_tier_2_subject_threshold_value = 6
mandala_capital_tier_3_subject_threshold_value = 10
mandala_capital_tier_4_subject_threshold_value = 15
mandala_capital_tier_5_subject_threshold_value = 20

mandala_vassal_opinion_bonus_piety_0_value = -15
mandala_vassal_opinion_bonus_piety_1_value = -10
mandala_vassal_opinion_bonus_piety_2_value = -5
mandala_vassal_opinion_bonus_piety_3_value = 0
mandala_vassal_opinion_bonus_piety_4_value = 10
mandala_vassal_opinion_bonus_piety_5_value = 20
mandala_vassal_opinion_bonus_piety_6_value = 30
mandala_vassal_opinion_bonus_piety_7_value = 40
mandala_vassal_opinion_bonus_piety_8_value = 50

mandala_tributary_opinion_bonus_piety_0_value = -5
mandala_tributary_opinion_bonus_piety_1_value = 0
mandala_tributary_opinion_bonus_piety_2_value = 5
mandala_tributary_opinion_bonus_piety_3_value = 10
mandala_tributary_opinion_bonus_piety_4_value = 15
mandala_tributary_opinion_bonus_piety_5_value = 20
mandala_tributary_opinion_bonus_piety_6_value = 25
mandala_tributary_opinion_bonus_piety_7_value = 30
mandala_tributary_opinion_bonus_piety_8_value = 35

assimilation_legitimacy_payout_t1 = medium_legitimacy_gain
assimilation_legitimacy_payout_t2 = major_legitimacy_gain
assimilation_legitimacy_payout_t3 = massive_legitimacy_gain

assimilation_piety_payout_t1 = medium_piety_value
assimilation_piety_payout_t2 = major_piety_value
assimilation_piety_payout_t3 = massive_piety_value

assimilation_payout_years = 5

reassert_stickiness_months = 12

cheaper_mandala_government_conversion_years = 10

regular_subject_value = 1

mandala_subject_value = 2

#MANDALA CAPITAL GP
mandala_capitals_per_dejure_kingdom = 2

mandala_capitals_per_dejure_kingdom_minus_one = {
	value = mandala_capitals_per_dejure_kingdom
	subtract = 1
	min = 1
}

mandala_contribution_low_gold_cost = {
	value = minor_gold_value
}
mandala_contribution_mid_gold_cost = {
	value = medium_gold_value
}
mandala_contribution_high_gold_cost = { 
	value = medium_gold_value
	multiply = 2.5
	#Rounds up to the closest number divisible by 5
	divide = 5
	ceiling = yes
	multiply = 5
}
mandala_contribution_huge_gold_cost = { 
	value = massive_gold_value
	#Rounds up to the closest number divisible by 5
	divide = 5
	ceiling = yes
	multiply = 5
}
mandala_contribution_mega_gold_cost = { 
	value = monumental_gold_value
	#Rounds up to the closest number divisible by 5
	divide = 5
	ceiling = yes
	multiply = 5
}

mandala_contribution_low_piety_cost = { value = medium_piety_value }
mandala_contribution_mid_piety_cost = { value = major_piety_value }

mandala_contribution_high_piety_cost = {
	value = major_piety_value
	multiply = 1.5
	#Rounds up to the closest number divisible by 5
	divide = 5
	ceiling = yes
	multiply = 5
}
mandala_contribution_huge_piety_cost = { value = massive_piety_value }
mandala_contribution_mega_piety_cost = { value = monumental_piety_value }


#Dynasty
mandala_contribution_minor_dynasty_reward = { 
	value = {
		add = minor_dynasty_prestige_value
		divide = 2
		#Rounds up to the closest number divisible by 5
		divide = 5
		ceiling = yes
		multiply = 5
	}
}
mandala_contribution_medium_dynasty_reward = { value = medium_dynasty_prestige_value } #medium_piety_value #Unop: Use the intended value
mandala_contribution_major_dynasty_reward = { 
	value = {
		add = medium_dynasty_prestige_value #Unop: Use the intended value
		multiply = 2
		#Rounds up to the closest number divisible by 5
		divide = 5
		ceiling = yes
		multiply = 5
	}
}

mandala_contribution_medium_piety_reward = { value = medium_piety_value }
mandala_contribution_major_piety_reward = {
	value = {
		add = medium_piety_value
		multiply = 2
		#Rounds up to the closest number divisible by 5
		divide = 5
		ceiling = yes
		multiply = 5
	}
}

#Legitimacy
mandala_contribution_miniscule_legitimacy_reward = {
	value = minor_legitimacy_gain
	divide = 2
	#Rounds up to the closest number divisible by 5
	divide = 5
	ceiling = yes
	multiply = 5
}
mandala_contribution_minor_legitimacy_reward = { value = minor_legitimacy_gain }
mandala_contribution_medium_legitimacy_reward = { value = medium_legitimacy_gain }
#Prestige
mandala_contribution_minor_prestige_reward = { value = minor_prestige_value }
mandala_contribution_medium_prestige_reward = { value = medium_prestige_value }
mandala_contribution_major_prestige_reward = { value = major_prestige_value }


## WORTHINESS TRIGGER VALUES
#Creation
num_female_creation_mandala_children_born = 5

num_male_creation_mandala_children_born = 10

mandala_creation_child_counter = {
	every_child = {
		even_if_dead = yes
		add = 1
	}
}

num_creation_mandala_buildings_built_t2 = 5
num_creation_mandala_buildings_built_t3 = 10
num_creation_mandala_buildings_built_t4 = 15
num_creation_mandala_buildings_built_t5 = 20

num_buildings_built_value = {
	value = 0
	if = {
		limit = {
			house = {
				has_variable = num_buildings_built
			}
		}
		add = house.var:num_buildings_built
	}
}

num_creation_mandala_commissioned_artifacts_t3 = 1
num_creation_mandala_commissioned_artifacts_t4 = 3
num_creation_mandala_commissioned_artifacts_t5 = 5

creation_mandala_stashed_gold_t2 = 250
creation_mandala_stashed_gold_t3 = 500
creation_mandala_stashed_gold_t4 = 750
creation_mandala_stashed_gold_t5 = 1000

num_creation_mandala_house_size_t3 = 15
num_creation_mandala_house_size_t4 = 25
num_creation_mandala_house_size_t5 = 40

#Serenity
num_serenity_mandala_highend_alliances_had = 2

num_serenity_mandala_years_of_peace_t1 = 1
num_serenity_mandala_years_of_peace_t2 = 5
num_serenity_mandala_years_of_peace_t3 = 10
num_serenity_mandala_years_of_peace_t4 = 15
num_serenity_mandala_years_of_peace_t5 = 25

num_subject_friends = {
	every_vassal = {
		limit = { has_relation_friend = root }
		add = 1
	}
	every_tributary = {
		limit = { has_relation_friend = root }
		add = 1
	}
}

num_years_of_peace_devotion = {
	value = miniscule_piety_gain
	add = 5 #Let's not be the same number as the generic boon
}

num_years_of_peace_devotion_payout = {
	value = num_years_of_peace_devotion
	multiply = {
		if = {
			limit = { has_variable = serenity_mandala_years_of_non_aggression_war }
			add = var:serenity_mandala_years_of_non_aggression_war
		}
		min = 1
	}
}

num_serenity_mandala_friends_t1 = {
	value = {
		if = {
			limit = {
				exists = this
				is_ai = yes
			}
			add = 1
		}
		else = { add = 3 }
	}
}
num_serenity_mandala_friends_t2 = {
	value = {
		if = {
			limit = {
				exists = this
				is_ai = yes
			}
			add = 3
		}
		else = { add = 5 }
	}
}
num_serenity_mandala_friends_t3 = {
	value = {
		if = {
			limit = {
				exists = this
				is_ai = yes
			}
			add = 5
		}
		else = { add = 10 }
	}
}
num_serenity_mandala_friends_t4 = {
	value = {
		if = {
			limit = {
				exists = this
				is_ai = yes
			}
			add = 7
		}
		else = { add = 15 }
	}
}
num_serenity_mandala_friends_t5 = {
	value = {
		if = {
			limit = {
				exists = this
				is_ai = yes
			}
			add = 10
		}
		else = { add = 20 }
	}
}

num_serenity_mandala_feasts_hosted_t2 = 3
num_serenity_mandala_feasts_hosted_t3 = 5
num_serenity_mandala_feasts_hosted_t4 = 7
num_serenity_mandala_feasts_hosted_t5 = 10

#Destruction
num_wars_won = {
	every_memory = {
		memory_type = war_won
		add = 1
	}
}

num_wars_lost = {
	every_memory = {
		memory_type = war_lost
		add = 1
	}
}

num_battles_won = {
	every_memory = {
		memory_type = battle_won_memory
		add = 1
	}
}

num_destruction_mandala_wars_won_t1 = {
	value = {
		if = {
			limit = {
				exists = this
				is_ai = yes
			}
			add = 1
		}
		else = { add = 3 }
	}
}
num_destruction_mandala_wars_won_t2 = {
	value = {
		if = {
			limit = {
				exists = this
				is_ai = yes
			}
			add = 3
		}
		else = { add = 6 }
	}
}
num_destruction_mandala_wars_won_t3 = {
	value = {
		if = {
			limit = {
				exists = this
				is_ai = yes
			}
			add = 5
		}
		else = { add = 9 }
	}
}
num_destruction_mandala_wars_won_t4 = {
	value = {
		if = {
			limit = {
				exists = this
				is_ai = yes
			}
			add = 8
		}
		else = { add = 12 }
	}
}
num_destruction_mandala_wars_won_t5 = {
	value = {
		if = {
			limit = {
				exists = this
				is_ai = yes
			}
			add = 10
		}
		else = { add = 15 }
	}
}

num_destruction_mandala_battles_won_t1 = 5
num_destruction_mandala_battles_won_t2 = 10
num_destruction_mandala_battles_won_t3 = 15
num_destruction_mandala_battles_won_t4 = 20
num_destruction_mandala_battles_won_t5 = 30

num_destruction_martial_skill_t1 = 10
num_destruction_martial_skill_t2 = 15
num_destruction_martial_skill_t3 = 20
num_destruction_martial_skill_t4 = 25
num_destruction_martial_skill_t5 = 30

num_destruction_prowess_skill_t1 = 5
num_destruction_prowess_skill_t2 = 10
num_destruction_prowess_skill_t3 = 15
num_destruction_prowess_skill_t4 = 20
num_destruction_prowess_skill_t5 = 25

num_prowess_knights_t2 = 3
num_prowess_knights_t3 = 6
num_prowess_knights_t4 = 9
num_prowess_knights_t5 = 12

#Trickster
num_successful_schemes_devotion_payout = {
	value = num_years_of_peace_devotion
	multiply = var:num_successful_schemes
}

num_trickster_mandala_successful_schemes_t1 = 5
num_trickster_mandala_successful_schemes_t2 = 10
num_trickster_mandala_successful_schemes_t3 = 20
num_trickster_mandala_successful_schemes_t4 = 35
num_trickster_mandala_successful_schemes_t5 = 50

num_trickster_mandala_secrets_known_t1 = 3
num_trickster_mandala_secrets_known_t2 = 6
num_trickster_mandala_secrets_known_t3 = 9
num_trickster_mandala_secrets_known_t4 = 12
num_trickster_mandala_secrets_known_t5 = 15

num_trickster_mandala_house_married_to_rulers_t1 = 2
num_trickster_mandala_house_married_to_rulers_t2 = 4
num_trickster_mandala_house_married_to_rulers_t3 = 6
num_trickster_mandala_house_married_to_rulers_t4 = 8
num_trickster_mandala_house_married_to_rulers_t5 = 10

trickster_mandala_house_married_to_rulers = {
	save_temporary_scope_as = root_scope
	house = {
		every_house_member = {
			every_spouse = {
				limit = {
					is_landed = yes
					top_overlord != scope:root_scope
					this != scope:root_scope
					primary_title.tier >= tier_duchy
				}	
				add = 1
			}
		}
	}	
}

num_trickster_mandala_strong_hooks_t2 = 2
num_trickster_mandala_strong_hooks_t3 = 5
num_trickster_mandala_strong_hooks_t4 = 10
num_trickster_mandala_strong_hooks_t5 = 15

trickster_mandala_gold_ransomed_t2 = 200
trickster_mandala_gold_ransomed_t3 = 600
trickster_mandala_gold_ransomed_t4 = 1200
trickster_mandala_gold_ransomed_t5 = 2000

num_trickster_mandala_house_rulers_t4 = 3
num_trickster_mandala_house_rulers_t5 = 6


##MANDALA RADIANCE
# USED IN CODE, DO NOT RENAME OR REMOVE
#Total: 118 score
mandala_radiance_value = {
	if = {
		limit = { has_mandala_capital_trigger = no }
		value = 0
	}
	else = {
		#Piety Level
		#Total: 50 score [(8) 12 10 8 6 5 4 3 2]
		if = {
			limit = {
				piety_level >= max_piety_level_plus_3
			}
			add = {
				value = 50
				desc = PIETY_LEVEL_CONCEPT
			}
		}
		else_if = {
			limit = {
				piety_level >= max_piety_level_plus_2
			}
			add = {
				value = 38
				desc = PIETY_LEVEL_CONCEPT
			}
		}
		else_if = {
			limit = {
				piety_level >= max_piety_level_plus_1
			}
			add = {
				value = 28
				desc = PIETY_LEVEL_CONCEPT
			}
		}
		else_if = {
			limit = {
				piety_level >= max_piety_level
			}
			add = {
				value = 20
				desc = PIETY_LEVEL_CONCEPT
			}
		}
		else_if = {
			limit = {
				piety_level >= very_high_piety_level
			}
			add = {
				value = 14
				desc = PIETY_LEVEL_CONCEPT
			}
		}
		else_if = {
			limit = {
				piety_level >= high_piety_level
			}
			add = {
				value = 9
				desc = PIETY_LEVEL_CONCEPT
			}
		}
		else_if = {
			limit = {
				piety_level >= medium_piety_level
			}
			add = {
				value = 5
				desc = PIETY_LEVEL_CONCEPT
			}
		}
		else_if = {
			limit = {
				piety_level >= low_piety_level
			}
			add = {
				value = 2
				desc = PIETY_LEVEL_CONCEPT
			}
		}
		else = {
			add = {
				value = -5
				desc = PIETY_LEVEL_CONCEPT
			}
		}
		#Aspect Level
		#Total: 20 score [(5) 7 6 4 2 1]
		if = {
			limit = { has_mandala_aspect_level_5_trigger = yes }
			add = {
				value = 20
				desc = MANDALA_ASPECT_DESC
			}
		}
		else_if = {
			limit = { has_mandala_aspect_level_4_trigger = yes }
			add = {
				value = 13
				desc = MANDALA_ASPECT_DESC
			}
		}
		else_if = {
			limit = { has_mandala_aspect_level_3_trigger = yes }
			add = {
				value = 7
				desc = MANDALA_ASPECT_DESC
			}
		}
		else_if = {
			limit = { has_mandala_aspect_level_2_trigger = yes }
			add = {
				value = 3
				desc = MANDALA_ASPECT_DESC
			}
		}
		else_if = {
			limit = { has_mandala_aspect_level_1_trigger = yes }
			add = {
				value = 1
				desc = MANDALA_ASPECT_DESC
			}
		}
		#Mandala Capital Level
		#Total: 30 score [(5) 10 8 6 4 2]
		if = {
			limit = { has_unruined_mandala_capital_trigger = yes }
			if = {
				limit = {
					capital_province = { has_building_with_flag = final_tier_mandala_capital_building }
				}
				add = {
					value = 30
					desc = building_mandala_capital_05
				}
			}
			else_if = {
				limit = {
					capital_province = { has_building_with_flag = fourth_tier_mandala_capital_building }
				}
				add = {
					value = 20
					desc = building_mandala_capital_04
				}
			}
			else_if = {
				limit = {
					capital_province = { has_building_with_flag = third_tier_mandala_capital_building }
				}
				add = {
					value = 12
					desc = building_mandala_capital_03
				}
			}
			else_if = {
				limit = {
					capital_province = { has_building_with_flag = second_tier_mandala_capital_building }
				}
				add = {
					value = 6
					desc = building_mandala_capital_02
				}
			}
			else_if = {
				limit = {
					capital_province = { has_building_with_flag = first_tier_mandala_capital_building }
				}
				add = {
					value = 2
					desc = building_mandala_capital_01
				}
			}
		}
		#Mandala Lifestyle Perks
		#Total: 15 score
		if = {
			limit = { has_perk = a_life_of_glory_perk }
			add = {
				value = 3
				desc = a_life_of_glory_perk_radiance
			}
		}
		if = {
			limit = { has_perk = absolute_control_perk }
			add = {
				value = 3
				desc = absolute_control_perk_radiance
			}
		}
		if = {
			limit = { has_perk = honored_to_serve_perk }
			add = {
				value = 3
				desc = honored_to_serve_perk_radiance
			}
		}
		if = {
			limit = { has_perk = mortal_adoration_perk }
			add = {
				value = 3
				desc = mortal_adoration_perk_radiance
			}
		}
		if = {
			limit = { has_perk = of_the_people_perk }
			add = {
				value = 3
				desc = of_the_people_perk_radiance
			}
		}
		#Perk Dread
		if = {
			limit = {
				OR = {
					has_perk = forever_infamous_perk
					has_perk = firm_hand_perk
				}
			}
			if = {
				limit = { 
					dread > 0
					dread <= 30
				}
				add = {
					value = 1
					desc = mandala_dread_perk_radiance
				}
			}
			if = {
				limit = { 
					dread > 30
					dread <= 60
				}
				add = {
					value = 2
					desc = mandala_dread_perk_radiance
				}
			}
			if = {
				limit = { 
					dread > 60
				}
				add = {
					value = 3
					desc = mandala_dread_perk_radiance
				}
			}
		}
		### MODIFIERS (don't overdo it)
		#You rebuilt your razed temple capital
		if = {
			limit = { has_character_modifier = mandala_rise_from_the_ashes_modifier }
			add = {
				value = 5
				desc = ROSE_FROM_THE_ASHES
			}
		}
		### MALUSES
		#You literally serve another god king, not very impressive
		if = {
			limit = {
				is_tributary = yes
				suzerain = { government_has_flag = government_is_mandala }
			}
			add = {
				value = -15
				desc = I_AM_A_TRIBUTARY_OF_A_MANDALA
			}
		}
		#You're a vassal and obey someone else
		if = {
			limit = { is_independent_ruler = no }
			add = {
				value = -15
				desc = I_AM_A_VASSAL
			}
		}
		#You lost a tyranny war
		if = { 
			limit = { has_character_modifier = recently_tarnished_mandala_modifier }
			add = {
				value = -15
				desc = TARNISHED_MANDALA
			}
		}
		#Your Capital Temple has been ruined, notify the player
		if = {
			limit = { has_unruined_mandala_capital_trigger = no }
			add = {
				value = -100
				desc = RUINED_MANDALA_CAPITAL
			}
		}
	}
	max = 100
	min = 0
}

#Dynasty Legacy
tgp_legitimacy_visit_capital_temples_value = 25
tgp_legitimacy_from_pilgrimage = 200
tgp_sea_legacy_tributary_acceptance_value = 10
tgp_sea_legacy_gp_contribution_value = 15

##MANDALA ASPECTS
mandala_years_at_peace_modifier_cap = 10
mandala_creator_modifier_cap = 10
mandala_serenity_force_request_cooldown_value = 5
mandala_recently_contributed_via_request_value = 5

mandala_aspect_piety_cost_first_level = 500

mandala_aspect_piety_cost_second_level = {
	value = mandala_aspect_piety_cost_first_level #1000
	multiply = 2
}
mandala_aspect_prestige_cost_second_level = 250

mandala_aspect_piety_cost_third_level = {
	value = mandala_aspect_piety_cost_second_level #2500
	multiply = 2.5
}
mandala_aspect_prestige_cost_third_level = {
	value = mandala_aspect_prestige_cost_second_level #500
	multiply = 2
}

mandala_aspect_piety_cost_fourth_level = {
	value = mandala_aspect_piety_cost_third_level #5000
	multiply = 2
}
mandala_aspect_prestige_cost_fourth_level = {
	value = mandala_aspect_prestige_cost_third_level #1000
	multiply = 2
}

mandala_aspect_piety_cost_fifth_level = {
	value = mandala_aspect_piety_cost_fourth_level #10 000
	multiply = 2
}
mandala_aspect_prestige_cost_fifth_level = {
	value = mandala_aspect_prestige_cost_fourth_level #2000
	multiply = 2
}

creator_mandala_piety_gain_scale = {
	if = {
		limit = {
			house = { has_house_head_parameter = creator_builder_05 }
		}
		value = 1.5
	}
	else_if = {
		limit = {
			house = { has_house_head_parameter = creator_builder_04 }
		}
		value = 1.2
	}
	else_if = {
		limit = {
			house = { has_house_head_parameter = creator_builder_03 }
		}
		value = 0.9
	}
	else_if = {
		limit = {
			house = { has_house_head_parameter = creator_builder_02 }
		}
		value = 0.6
	}
	else = { value = 0.3 }
}

trickster_mandala_force_agent_bribe_value = {
	value = massive_piety_value
	if = {
		limit = { scope:actor.piety_level = max_piety_level_plus_3 }
		multiply = 3
	}
	else_if = {
		limit = { scope:actor.piety_level = max_piety_level_plus_2 }
		multiply = 2.5
	}
	else_if = {
		limit = { scope:actor.piety_level = max_piety_level_plus_1 }
		multiply = 2
	}
	else_if = {
		limit = { scope:actor.piety_level = max_piety_level }
		multiply = 1.75
	}
	else_if = {
		limit = { scope:actor.piety_level = very_high_piety_level }
		multiply = 1.5
	}
	else_if = {
		limit = { scope:actor.piety_level = high_piety_level }
		multiply = 1.25
	}
}


##MANDALA WARS
mandala_peacemaker_perk_piety_value = {
	value = minor_piety_gain
	multiply = scope:attacker.piety_level
}

# Plunder
mandala_plunder_ai_score_value = {
	value = 100
	scope:attacker = {
		if = {
			limit = { piety < 500 }
			multiply = 2
		}
		add = ai_boldness
		if = {
			limit = { piety > 500 }
			multiply = 0.5
		}
	}
}

# Raze Capital Structure
mandala_raze_capital_structure_ai_score_value = {
	value = 100
	scope:attacker = {
		if = {
			limit = { 
				house ?= { has_house_aspiration_parameter = aspect_of_destruction } 
			}
			multiply = 2
		}
		add = ai_boldness
	}
}


##MANDALA RITUALS
mandala_max_available_rituals_value = 3

mandala_ritual_cooldown_years = 5

##PIETY
mandala_contract_piety = {
	value = miniscule_piety_gain
	multiply = mandala_contract_aspect_multiplier
	multiply = 2
}

##LEGITIMACY
mandala_contract_legitimacy = {
	value = miniscule_legitimacy_gain
	multiply = mandala_contract_aspect_multiplier
}

##SCHEMES
mandala_contract_aspect_multiplier = {
	value = 1
	if = {
		limit = {
			house = { 
				OR = {
					has_house_aspiration_parameter = aspect_of_creation_05
					has_house_aspiration_parameter = aspect_of_serenity_05
					has_house_aspiration_parameter = aspect_of_destruction_05
					has_house_aspiration_parameter = aspect_of_trickery_05  
				}
			}
		}
		add = 1
	}
	else_if = {
		limit = {
			house = { 
				OR = {
					has_house_aspiration_parameter = aspect_of_creation_04
					has_house_aspiration_parameter = aspect_of_serenity_04
					has_house_aspiration_parameter = aspect_of_destruction_04
					has_house_aspiration_parameter = aspect_of_trickery_04
				}
			}
		}
		add = 0.5
	}
	else_if = {
		limit = {
			house = { 
				OR = {
					has_house_aspiration_parameter = aspect_of_creation_03
					has_house_aspiration_parameter = aspect_of_serenity_03
					has_house_aspiration_parameter = aspect_of_destruction_03
					has_house_aspiration_parameter = aspect_of_trickery_03
				}
			}
		}
		add = 0.3
	}
	else_if = {
		limit = {
			house = { 
				OR = {
					has_house_aspiration_parameter = aspect_of_creation_02
					has_house_aspiration_parameter = aspect_of_serenity_02
					has_house_aspiration_parameter = aspect_of_destruction_02
					has_house_aspiration_parameter = aspect_of_trickery_02
				}
			}
		}
		add = 0.2
	}
	if = {
		limit = {
			house = { has_house_aspiration_parameter = aspect_of_creation }
		}
		add = {
			value = stewardship
			multiply = 0.1
		}
	}
	if = {
		limit = {
			house = { has_house_aspiration_parameter = aspect_of_serenity }
		}
		add = {
			value = diplomacy
			multiply = 0.1
		}
	}
	if = {
		limit = {
			house = { has_house_aspiration_parameter = aspect_of_destruction }
		}
		add = {
			value = martial
			multiply = 0.1
		}
	}
	if = {
		limit = {
			house = { has_house_aspiration_parameter = aspect_of_trickery }
		}
		add = {
			value = intrigue
			multiply = 0.1
		}
	}

	if = {
		limit = {
			culture = {
				has_cultural_parameter = increases_effect_of_mandala_realm_contracts
			}
		}
		add = 0.5
	}
	if = {
		limit = {
			capital_province ?= {
				has_building_with_flag = fourth_tier_mandala_capital_building
			}
		}
		add = 2
	}
	else_if = {
		limit = {
			capital_province ?= {
				has_building_with_flag = third_tier_mandala_capital_building
			}
		}
		add = 1.5
	}
	else_if = {
		limit = {
			capital_province ?= {
				has_building_with_flag = second_tier_mandala_capital_building
			}
		}
		add = 1
	}
	else_if = {
		limit = {
			capital_province ?= {
				has_building_with_flag = first_tier_mandala_capital_building
			}
		}
		add = 0.5
	}
}

mandala_scheme_minor_piety_cost_value = {
	value = minor_piety_value
	multiply = piety_level
}
