tr_est_mystery_adopt = {
	unlocks_agenda = agenda_est_mystery
	modifier = {
		intel_encryption_add = 2
	}
}

tr_est_mystery_finish = {
	modifier = {
		job_est_shadow_administrator_per_pop = 0.02
		ascension_perks_add = 1
	}
}


tr_est_mystery_1 = {
	modifier = {
		espionage_hostile_operation_difficulty_add = 1
		pop_factions_produces_mult = 0.20
	}

	tradition_swap = {
		name = tr_est_mystery_1_democratic
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			has_authority = auth_democratic
			NOT = { has_civic = civic_shadow_council }
		}
		modifier = {
			country_election_cost_mult = -0.25
			espionage_hostile_operation_difficulty_add = 1
		}
		weight = { factor = 1 }
	}
	tradition_swap = {
		name = tr_est_mystery_1_oligarchic
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			has_authority = auth_oligarchic
			NOT = { has_civic = civic_shadow_council }
		}
		modifier = {
			country_election_cost_mult = -0.50
			espionage_hostile_operation_difficulty_add = 1
		}
		weight = { factor = 1 }
	}
	tradition_swap = {
		name = tr_est_mystery_1_dictatorial
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			has_authority = auth_dictatorial
			NOT = { has_civic = civic_shadow_council }
		}
		modifier = {
			country_election_cost_mult = -0.75
			espionage_hostile_operation_difficulty_add = 1
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_mystery_2 = {
	possible = { has_tradition = tr_est_mystery_1 }

	modifier = {
		country_nanites_produces_mult = 0.33
		country_sr_dark_matter_produces_mult = 0.33
		country_sr_zro_produces_mult = 0.33
		country_sr_living_metal_produces_mult = 0.33
	}

	ai_weight = { factor = 5000 }
}

tr_est_mystery_3 = {
	possible = { has_tradition = tr_est_mystery_1 }

	modifier = {
		country_physics_tech_research_speed = 0.15
	}

	ai_weight = { factor = 5000 }
}

tr_est_mystery_4 = {

	modifier = {
		ship_disengage_chance_mult = 0.33
	}

	ai_weight = { factor = 5000 }
}

tr_est_mystery_5 = {
	custom_tooltip = tr_est_mystery_5_desc

	possible = {
		has_tradition = tr_est_mystery_3
		has_tradition = tr_est_mystery_4
	}

	on_enabled = {	
		every_owned_leader = {
			limit = {
				NOR = {
#					has_trait =	leader_trait_admiral_est_mystic
#					has_trait =	leader_trait_general_est_mystic
					has_trait =	leader_trait_official_est_mystic
					has_trait =	leader_trait_scientist_est_mystic
#					has_trait =	leader_trait_ruler_est_mystic
				}
			}
#			if = { #(Ben_D): The traits shouldn't be assigned before the sub-class is determined
#				limit = { leader_class = commander }
#				add_trait = leader_trait_admiral_est_mystic
#				add_trait = leader_trait_ruler_est_mystic
#			}
			if = {
				limit = { leader_class = official }
				add_trait = leader_trait_official_est_mystic
#				add_trait = leader_trait_ruler_est_mystic
			}
			if = {
				limit = { leader_class = scientist }
				add_trait = leader_trait_scientist_est_mystic
#				add_trait = leader_trait_ruler_est_mystic
			}
#			if = {
#				limit = { leader_class = ruler }
#				add_trait = leader_trait_ruler_est_mystic
#				add_ruler_trait = leader_trait_ruler_est_mystic
#			}
		}
		every_pool_leader = {
			limit = {
				NOR = {
#					has_trait = leader_trait_admiral_est_mystic
#					has_trait = leader_trait_general_est_mystic
					has_trait = leader_trait_official_est_mystic
					has_trait = leader_trait_scientist_est_mystic
#					has_trait = leader_trait_ruler_est_mystic
				}
			}
#			if = {
#				limit = { leader_class = commander }
#				add_trait = leader_trait_admiral_est_mystic
#				add_trait = leader_trait_ruler_est_mystic
#			}
			if = {
				limit = { leader_class = official }
				add_trait = leader_trait_official_est_mystic
#				add_trait = leader_trait_ruler_est_mystic
			}
			if = {
				limit = { leader_class = scientist }
				add_trait = leader_trait_scientist_est_mystic
#				add_trait = leader_trait_ruler_est_mystic
			}
		}	
	}

	ai_weight = { factor = 5000 }
}