﻿
### LEARNING - SCHOLARSHIP PERKS
#EK NOTE: perks grant xp on unlock for certain cultures

# Pedagogy
pedagogy_perk = {
	lifestyle = learning_lifestyle
	tree = scholarship
	position = { 0 0 }
	icon = node_learning
	
	auto_selection_weight = {
		value = 11
		if = {
			limit = {
				has_education_learning_trigger = yes
			}
			add = 1989
		}
		if = {
			limit = {
				has_focus = learning_scholarship_focus
			}
			multiply = 5
		}
		if = {
			limit = {
				can_start_new_lifestyle_tree_trigger = no
				NOT = { has_perk = scientific_perk }
			}
			multiply = 0
		}
	}
	
	effect = {
		custom_description_no_bullet = {
			text = pedagogy_perk_effect
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = scholar_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}


# Open Minded
open_minded_perk = {
	lifestyle = learning_lifestyle
	tree = scholarship
	position = { 0 1 }
	icon = node_learning
	
	parent = pedagogy_perk
	
	character_modifier = {
		different_culture_opinion = 15
	}
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		invert_check = yes
		minority_opinion = 15
		cultural_head_acceptance_gain_mult = 0.2
	}
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		learn_language_scheme_phase_duration_add = -120
	}
	
	effect = {
		custom_description_no_bullet = {
			text = open_minded_perk_effect
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = scholar_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}


# Apostate
apostate_perk = {
	lifestyle = learning_lifestyle
	tree = scholarship
	position = { 0 2 }
	icon = node_learning
	
	parent = open_minded_perk
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = apostate_perk_adventurer_name
			}
			desc = apostate_perk_name
		}
	}
	
	character_modifier = {
		different_faith_opinion = 15
		faith_conversion_piety_cost_mult = -0.75
	}
	
	effect = {
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}	
			custom_tooltip = {
				text = adventurer_apostate_perk_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = scholar_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}


# Scientific
scientific_perk = {
	lifestyle = learning_lifestyle
	tree = scholarship
	position = { 2 0 }
	icon = node_learning
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = scientific_perk_adventurer_name
			}
			desc = scientific_perk_name
		}
	}
	
	auto_selection_weight = {
		value = 11
		if = {
			limit = {
				has_education_learning_trigger = yes
			}
			add = 1989
		}
		if = {
			limit = {
				has_focus = learning_scholarship_focus
			}
			multiply = 5
		}
		if = {
			limit = {
				can_start_new_lifestyle_tree_trigger = no
				NOT = { has_perk = pedagogy_perk }
			}
			multiply = 0
		}
	}
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		invert_check = yes
		cultural_head_fascination_mult = 0.20
	}
	government_character_modifier = {
		flag = government_is_landless_adventurer
		counter_efficiency = 0.25
		siege_phase_time = -0.15
	}
	
	effect = {
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}
			custom_tooltip = {
				text = adventurer_scientific_perk_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = scholar_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}


# Planned Cultivation
planned_cultivation_perk = {
	lifestyle = learning_lifestyle
	tree = scholarship
	position = { 2 1 }
	icon = node_learning
	
	parent = scientific_perk
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = planned_cultivation_perk_adventurer_name
			}
			desc = planned_cultivation_perk_name
		}
	}
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		trait_track_travel_xp_gain_mult = 1
		men_at_arms_recruitment_cost = -0.25
	}
	
	government_character_modifier = {
		flag = government_is_nomadic
		county_fertility_growth_mult = 0.15
	}
	
	effect = {
		if = {
			limit = {
				NOR = {
					government_has_flag = government_is_landless_adventurer
					government_has_flag = government_is_nomadic
				}
			}
			custom_description_no_bullet = {
				text = planned_cultivation_perk_effect
			}
		}
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}
			custom_tooltip = {
				text = adventurer_planned_cultivation_perk_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = scholar_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}


# Scholarly Circles
scholarly_circles_perk = {
	lifestyle = learning_lifestyle
	tree = scholarship
	position = { 2 2 }
	icon = node_learning
	
	parent = planned_cultivation_perk
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = scholarly_circles_perk_adventurer_name
			}
			desc = scholarly_circles_perk_name
		}
	}
	
	character_modifier = {
		learning_per_piety_level = 1
	}
	government_character_modifier = {
		flag = government_is_landless_adventurer
		enemy_terrain_advantage = -0.5
		knight_effectiveness_per_learning = 0.005
		learning_per_piety_level = -1
	}

	effect = {
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = scholar_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}


# Learn on the Job
learn_on_the_job_perk = {
	lifestyle = learning_lifestyle
	tree = scholarship
	position = { 1 3 }
	icon = node_learning
	
	parent = apostate_perk
	parent = scholarly_circles_perk
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = learn_on_the_job_perk_adventurer_name
			}
			desc = learn_on_the_job_perk_name
		}
	}
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		trait_track_danger_xp_gain_mult = 2
	}
	
	effect = {
		if = {
			limit = {
				NOT = { government_has_flag = government_is_landless_adventurer }
			}
			custom_description_no_bullet = {
				text = learn_on_the_job_perk_effect
			}
		}
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}	
			custom_tooltip = {
				text = adventurer_learn_on_the_job_perk_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = scholar_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}


# Sanctioned Loopholes
sanctioned_loopholes_perk = {
	lifestyle = learning_lifestyle
	tree = scholarship
	position = { 1 4 }
	icon = node_learning
	
	parent = learn_on_the_job_perk
	
	name = {
		first_valid = {
			triggered_desc = {
				trigger = { is_landless_adventurer = yes }
				desc = sanctioned_loopholes_perk_adventurer_name
			}
			desc = sanctioned_loopholes_perk_name
		}
	}
	
	government_character_modifier = {
		flag = government_is_landless_adventurer
		artifact_decay_reduction_mult = -0.75
	}
	
	effect = {
		if = {
			limit = {
				NOT = { government_has_flag = government_is_landless_adventurer }
			}
			custom_description_no_bullet = {
				text = sanctioned_loopholes_perk_effect
			}
		}
		if = {
			limit = {
				government_has_flag = government_is_landless_adventurer
			}	
			custom_tooltip = {
				text = adventurer_sanctioned_loopholes_perk_effect
			}
		}
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = scholar_xp_rebate } }
            add_learning_lifestyle_xp = 330
        }
	}
}


# Scholar
scholar_perk = {
	lifestyle = learning_lifestyle
	tree = scholarship
	position = { 1 5 }
	icon = trait_scholar
	
	parent = sanctioned_loopholes_perk
	
	trait = scholar
	effect = {
		add_trait_force_tooltip = scholar
		#EK ADDITION: xp for unlocking perk
		if = {
            limit = { culture = { has_cultural_parameter = scholar_xp_rebate } }
            add_learning_lifestyle_xp = 500
        }
	}
}
