tr_est_spaceborn_adopt = {
	unlocks_agenda = agenda_est_spaceborn
	modifier = {
		country_starbase_capacity_mult = 0.20
	}
}

tr_est_spaceborn_finish = {
	modifier = {
#		station_researchers_cost_mult = -0.25 #(Ben_D): Depricated by Paradox
		station_gatherers_cost_mult = -0.25
		station_researchers_produces_mult = 0.1
		ascension_perks_add = 1
	}
}


tr_est_spaceborn_1 = {
	modifier = {
		country_naval_cap_mult = 0.15
		starbase_shipyard_build_cost_mult = -0.05
	}

	tradition_swap = {
		name = tr_est_spaceborn_1_GC
		inherit_effects = yes
		inherit_icon = yes
		trigger = { has_ethic = ethic_gestalt_consciousness }
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_spaceborn_2 = {
	possible = { has_tradition = tr_est_spaceborn_1 }
	
	modifier = {
#		starbases_cost_mult = -0.02 #(Ben_D): Depricated by Paradox
		starbase_outpost_cost_mult = -0.20 #(Ben_D): Added
		starbase_upgrade_cost_mult = -0.20
	}

	ai_weight = { factor = 5000 }
}

tr_est_spaceborn_3 = {
	possible = { has_tradition = tr_est_spaceborn_2 }
	
	modifier = {
		ship_speed_mult = 0.25
		ship_interstellar_speed_mult = 0.25
	}

	ai_weight = { factor = 5000 }
}

tr_est_spaceborn_4 = {
	custom_tooltip = tr_est_spaceborn_4_desc

	possible = { has_tradition = tr_est_spaceborn_3 }
	
	on_enabled = {
		every_system_within_border = {
			random_system_planet = {
				limit = {
					Or = {
						is_planet_class = pc_b_star
						is_planet_class = pc_a_star
						is_planet_class = pc_f_star
						is_planet_class = pc_g_star
						is_planet_class = pc_k_star
						is_planet_class = pc_m_star
						is_planet_class = pc_m_giant_star
						is_planet_class = pc_t_star
					}
					has_resource = { 
						type = energy
						amount > 0 
					}
					Not = {
						has_deposit = d_est_spaceborn_4_sun				
					}
				}
				add_deposit = d_est_spaceborn_4_sun
			}
		}
	}

	ai_weight = { factor = 5000 }
}

tr_est_spaceborn_5 = {
	possible = {
		has_tradition = tr_est_spaceborn_3
	}
	
	modifier = {		
		starbase_buildings_cost_mult = -0.20
		starbase_building_build_speed_mult = 0.50
		starbase_modules_cost_mult  = -0.20
		starbase_module_build_speed_mult = 0.50
	}

	tradition_swap = {
		name = tr_est_spaceborn_5_megastruct
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			est_uses_megastructures = yes
			Not = { has_ascension_perk = ap_voidborn	 }
		}
		modifier = {
			megastructure_build_speed_mult = 0.33
			starbase_buildings_cost_mult = -0.20
			starbase_building_build_speed_mult = 0.50
		}
		weight = { factor = 1 }
	}

	tradition_swap = {
		custom_tooltip = tr_est_spaceborn_5_habitat_desc
	
		name = tr_est_spaceborn_5_habitat
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			has_ascension_perk = ap_voidborn		
			est_uses_megastructures = no
		}
		modifier = {
			starbase_modules_cost_mult = -0.20
			starbase_module_build_speed_mult = 0.50
		}
		on_enabled = {
			every_owned_planet = {
				limit = {
					is_planet_class = pc_habitat
					is_colony = yes
				}
				add_modifier = {
					modifier = mod_est_spaceborn_5_habitat
					days = -1
				}
			}
		}
		weight = { factor = 1 }
	}

	tradition_swap = {
		custom_tooltip = tr_est_spaceborn_5_habitat_megastruct_desc
	
		name = tr_est_spaceborn_5_habitat_megastruct
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			has_ascension_perk = ap_voidborn	
			est_uses_megastructures = yes
		}		
		on_enabled = {
			every_owned_planet = {
				limit = {
					is_planet_class = pc_habitat
					is_colony = yes
				}
				add_modifier = {
					modifier = mod_est_spaceborn_5_habitat
					days = -1
				}
			}
		}
		modifier = {
			megastructure_build_speed_mult = 0.33
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}