﻿#EK NOTE: perks grant xp on unlock for certain cultures

faithful_perk = {
	lifestyle = learning_lifestyle
	tree = theology
	position = { 1 0 }
	icon = node_learning
	
	auto_selection_weight = {
		value = 11
		if = {
			limit = {
				has_education_learning_trigger = yes
			}
			add = 1989
		}
		if = {
			limit = {
				has_focus = learning_theology_focus
			}
			multiply = 5
		}
		if = {
			limit = {
				can_start_new_lifestyle_tree_trigger = no
			}
			multiply = 0
		}
	}
	
	doctrine_character_modifier = {
		doctrine = doctrine_theocracy_lay_clergy
		zealot_opinion = 10
	}
	doctrine_character_modifier = {
		doctrine = doctrine_theocracy_temporal
		clergy_opinion = 10
	}
	effect = {
		#EK ADDITION: Learn liturgical language
		custom_description_no_bullet = {
			text = enable_ek_learn_liturgical_language_scheme
		}
		trigger_event = ek_learn_liturgical_language_ongoing.0001
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}	
			custom_tooltip = {
				text = adventurer_faithful_perk_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = theologian_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}

zealous_proselytizer_perk = {
	lifestyle = learning_lifestyle
	tree = theology
	position = { 0 1 }
	icon = node_learning
	
	parent = faithful_perk
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = zealous_proselytizer_perk_adventurer_name
			}
			desc = zealous_proselytizer_perk_name
		}
	}
	
	effect = {
		if = {
			limit = {
				NOR = {
					government_has_flag = government_is_landless_adventurer
					government_has_flag = government_is_nomadic
				}
			}
			custom_description_no_bullet = {
				text = zealous_proselytizer_perk_effect
			}
		}
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}	
			custom_tooltip = {
				text = adventurer_zealous_proselytizer_perk_effect
			}
		}
		if = {
			limit = {
				government_has_flag = government_is_nomadic
			}	
			custom_description_no_bullet = {
				text = nomadic_zealous_proselytizer_inspire_conversion_effect
			}
			custom_description_no_bullet = {
				text = nomadic_zealous_proselytizer_stargazer_effect
			}
		}
		#EK ADDITION: xp for unlocking perk	
		if = {
            limit = { culture = { has_cultural_parameter = theologian_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}

religious_icon_perk = {
	lifestyle = learning_lifestyle
	tree = theology
	position = { 0 2 }
	icon = node_learning
	
	parent = zealous_proselytizer_perk
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = religious_icon_perk_adventurer_name
			}
			desc = religious_icon_perk_name
		}
	}
	
	effect = {
		if = {
			limit = {
				NOR = {
					government_has_flag = government_is_landless_adventurer
					government_has_flag = government_is_nomadic
				}
			}
			custom_description_no_bullet = {
				text = religious_icon_perk_effect
			}
		}
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}	
			custom_tooltip = {
				text = adventurer_religious_icon_perk_effect
			}
		}
		if = {
			limit = {
				government_has_flag = government_is_nomadic
			}	
			custom_description_no_bullet = {
				text = religious_icon_nomadic_perk_effect
			}	
		}
		#EK ADDITION: xp for unlocking perk	
		if = {
            limit = { culture = { has_cultural_parameter = theologian_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}

prophet_perk = {
	lifestyle = learning_lifestyle
	tree = theology
	position = { 0 3 }
	icon = node_learning
	
	parent = religious_icon_perk
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = prophet_perk_adventurer_name
			}
			desc = prophet_perk_name
		}
	}
	
	character_modifier = {
		monthly_piety_gain_per_knight_mult = 0.02
		faith_creation_piety_cost_mult = -0.5
	}
	
	effect = {
		if = {
			limit = {
				government_allows = state_faith
			}
			custom_description_no_bullet = {
				text = cheaper_change_state_faith_cost_effect
			}
		}

		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}	
			custom_tooltip = {
				text = adventurer_prophet_perk_effect
			}	
			custom_tooltip = {
				text = adventurer_prophet_perk_2_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = theologian_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}

clerical_justifications_perk = {
	lifestyle = learning_lifestyle
	tree = theology
	position = { 2 1 }
	icon = node_learning
	
	parent = faithful_perk
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = {
					OR = { 
						is_landless_adventurer = yes
						government_has_flag = government_is_nomadic
					}
				}
				desc = clerical_justifications_perk_adventurer_name
			}
			desc = clerical_justifications_perk_name
		}
	}
	
	effect = {
		if = {
			limit = {
				NOR = {
					government_has_flag = government_is_landless_adventurer
					government_has_flag = government_is_nomadic
				}
			}
			custom_description_no_bullet = {
				text = clerical_justifications_perk_effect
			}
		}
		if = {
			limit = {
				OR = {
					government_has_flag = government_is_landless_adventurer
					government_has_flag = government_is_nomadic
				}
			}	
			custom_tooltip = {
				text = adventurer_clerical_justifications_perk_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = theologian_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}

church_and_state_perk = {
	lifestyle = learning_lifestyle
	tree = theology
	position = { 2 2 }
	icon = node_learning
	
	parent = clerical_justifications_perk
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = church_and_state_perk_adventurer_name
			}
			desc = church_and_state_perk_name
		}
	}
	
	doctrine_character_modifier = {
		doctrine = doctrine_theocracy_lay_clergy
		monthly_piety_from_buildings_mult = 1
	}
	doctrine_character_modifier = {
		doctrine = doctrine_theocracy_temporal
		realm_priest_opinion = 50
	}
	
	government_character_modifier = {
		flag = government_is_nomadic
		zealot_opinion = 50
		same_faith_opinion = 15
	}
	
	effect = {
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}	
			custom_tooltip = {
				text = adventurer_church_and_state_perk_2_effect
			}
			custom_tooltip = {
				text = adventurer_church_and_state_perk_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = theologian_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}

radiant_perk = {
	lifestyle = learning_lifestyle
	tree = theology
	position = { 2 3 }
	icon = node_learning
	
	parent = church_and_state_perk
		
	character_modifier = {
		piety_level_impact_mult = 1
	}
	government_character_modifier = {
		flag = government_is_landless_adventurer
		martial_per_piety_level = 1
		intrigue_per_piety_level = 1
		prowess_per_piety_level = 1
	}
	effect = {
		#EK ADDITION: this perk grants additional piety level
		custom_description_no_bullet = {
			text = radiant_perk_religions_piety_level_increase_effect
		}
		hidden_effect = { update_religions_piety_level = yes }
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = theologian_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}

defender_of_the_faith_perk = {
	lifestyle = learning_lifestyle
	tree = theology
	position = { 1 4 }
	icon = node_learning
	
	parent = radiant_perk
	parent = prophet_perk
	
	doctrine_character_modifier = {
		doctrine = doctrine_pluralism_fundamentalist
		tolerance_advantage_mod = 10
		prowess_per_piety_level = 2
		clergy_opinion = 20
	}
	doctrine_character_modifier = {
		doctrine = doctrine_pluralism_righteous
		zealot_opinion = 20
		tyranny_gain_mult = -0.25
		zealot_tax_contribution_mult = 0.35
		zealot_levy_contribution_mult = 0.35
	}
	doctrine_character_modifier = {
		doctrine = doctrine_pluralism_pluralistic
		diplomacy_per_piety_level = 1
		monthly_piety_gain_mult = 0.2
	}
	
	effect = {
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}	
			custom_tooltip = {
				text = adventurer_defender_of_the_faith_perk_effect
			}
			custom_tooltip = {
				text = adventurer_defender_of_the_faith_perk_2_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = theologian_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}

theologian_perk = {
	lifestyle = learning_lifestyle
	tree = theology
	position = { 1 5 }
	icon = trait_theologian
	
	parent = defender_of_the_faith_perk
	
	trait = theologian
	effect = {
		add_trait_force_tooltip = theologian
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = theologian_xp_rebate } }
            add_learning_lifestyle_xp = 500
        }
	}
}
