tr_est_archivist_adopt = {
	unlocks_agenda = agenda_est_archivist
	custom_tooltip_with_modifiers = tradition_est_archivist_adopt_effect
	modifier = {
		ship_anomaly_generation_chance_mult = 0.25
	}
}

tr_est_archivist_finish = {
	custom_tooltip = tr_est_archivist_finish_desc

	modifier = {
		ascension_perks_add = 1
	}
}


tr_est_archivist_1 = {
	custom_tooltip = tr_est_archivist_1_desc
	modifier = {
		station_observers_unity_produces_add = 5
		station_observers_society_research_produces_mult = 0.5 #(Ben_D): Added (Terranight): Why 25%? Tooltip says 50%
	}
	
	tradition_swap = {
		name = tr_est_archivist_1_purifier
		inherit_effects = no
		inherit_icon = no
		inherit_name = no
		trigger = {
			OR = {
				has_civic = civic_fanatic_purifiers
				has_civic = civic_machine_terminator
				has_civic = civic_hive_devouring_swarm
			}
		}	
		modifier = {		
			army_damage_mult = 0.15
			ship_weapon_damage = 0.05
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_archivist_2 = {
	custom_tooltip = tr_est_archivist_2_desc
	
	on_enabled = {
		every_owned_leader = {
			limit = {
				AND = {
					leader_class = scientist
					NOT = {
						has_trait = leader_trait_roamer
						has_trait = leader_trait_roamer_2
						has_trait = leader_trait_roamer_3_est
					}
				}
			
			}
			random_list = {
				9 = {}
				1 = {
					random_list = {
						1 = { 
							add_trait = { trait = leader_trait_scientist_est_librarian_mathematics }
						}
						1 = { 
							add_trait = { trait = leader_trait_scientist_est_librarian_taxonomy } 
						}
						1 = { 
							add_trait = { trait = leader_trait_scientist_est_librarian_mechanics } 
						}
					}
				}
			}
		}
		every_pool_leader = {
			limit = {
				leader_class = scientist
			}
			random_list = {
				9 = {}
				1 = {
					random_list = {
						1 = { 
							add_trait = { trait = leader_trait_scientist_est_librarian_mathematics }
						}
						1 = { 
							add_trait = { trait = leader_trait_scientist_est_librarian_taxonomy } 
						}
						1 = { 
							add_trait = { trait = leader_trait_scientist_est_librarian_mechanics } 
						}
					}
				}
			}
		}
	}
	
	tradition_swap = {
		custom_tooltip = tr_est_archivist_2_GC_desc
		
		name = tr_est_archivist_2_GC
		inherit_effects = no
		inherit_icon = yes
		inherit_name = no
		trigger = {
			has_ethic =	ethic_gestalt_consciousness
			is_ai = no
		}	
		on_enabled = {
			every_owned_leader = {
				limit = {
					AND = {
						leader_class = scientist
						NOT = {
							is_ruler = yes
							has_trait = leader_trait_roamer
							has_trait = leader_trait_roamer_2
							has_trait = leader_trait_roamer_3_est
						}
					}
				
				}
				random_list = {
					9 = {}
					1 = {
						random_list = {
							1 = { 
								add_trait = { trait = leader_trait_scientist_est_librarian_mathematics }
							}
							1 = { 
								add_trait = { trait = leader_trait_scientist_est_librarian_taxonomy } 
							}
							1 = { 
								add_trait = { trait = leader_trait_scientist_est_librarian_mechanics } 
							}
						}
					}
				}
			}
			every_pool_leader = {
				limit = {
					leader_class = scientist
				}
				random_list = {
					9 = {}
					1 = {
						random_list = {
							1 = { 
								add_trait = { trait = leader_trait_scientist_est_librarian_mathematics }
							}
							1 = { 
								add_trait = { trait = leader_trait_scientist_est_librarian_taxonomy } 
								}
							1 = { 
								add_trait = { trait = leader_trait_scientist_est_librarian_mechanics } 
							}
						}
					}
				}
			}
		}
		weight = { factor = 1 }
	}

	tradition_swap = {
		name = tr_est_archivist_2_AI
		inherit_icon = yes
		inherit_name = yes
		trigger = { is_ai = yes }	
		modifier = {		
			all_technology_research_speed = 0.10
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_archivist_3 = {
	possible = { has_tradition = tr_est_archivist_2 }
	
	modifier = {
		country_unity_produces_mult = 0.05
		pop_government_ethic_attraction = 0.10
	}
	
	tradition_swap = {
		name = tr_est_archivist_3_GC
		trigger = { is_gestalt = yes }	
		modifier = {		
			country_unity_produces_mult = 0.10
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_archivist_4 = {
	custom_tooltip = tr_est_archivist_4_desc
	
	possible = {
		has_tradition = tr_est_archivist_1
		has_tradition = tr_est_archivist_2
	}

	ai_weight = { factor = 5000 }
}

tr_est_archivist_5 = {
	custom_tooltip = tr_est_archivist_5_desc
	
	on_enabled = {
		set_variable = {
			which = num_surveyed_systems
			value = 1
		}
	}
	
	possible = {
		has_tradition = tr_est_archivist_3
		has_tradition = tr_est_archivist_4
	}
	
	triggered_modifier = {
		potential = { always = yes }
		country_base_unity_produces_add = 1
		mult = num_surveyed_systems
	}

	ai_weight = { factor = 5000 }
}