tr_est_mechanicum_adopt = {
	unlocks_agenda = agenda_est_mechanicum
	modifier = {
		ship_hull_mult = 0.10
		ship_armor_mult = 0.10
	}

	tradition_swap = {
		name = tr_est_mechanicum_adopt_robots
		inherit_name = yes
		trigger = {
			est_uses_robots = yes
			Not = { has_ethic = ethic_gestalt_consciousness }
		}
		modifier = {
			planet_pops_robotics_upkeep_mult = -0.15
		}
		weight = { factor = 1 }
	}
}

tr_est_mechanicum_finish = {
	modifier = {	
		planet_technician_energy_produces_add = 3
		ascension_perks_add = 1
	}
}


tr_est_mechanicum_1 = {
	custom_tooltip = tr_est_mechanicum_1_desc

	on_enabled = {
		every_owned_ship = {
			if = {
				limit = {
					is_ship_class = shipclass_constructor
				}
				add_modifier = {
					modifier = "mod_est_mechanicum_1"
				}
			}
		}
	}
	
	modifier = {
		station_gatherers_cost_mult = -0.20
	}

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

	ai_weight = { factor = 5000 }
}

tr_est_mechanicum_2 = {
	possible = {
		has_tradition = tr_est_mechanicum_1
	}
	
	modifier = {
		country_engineering_tech_research_speed = 0.15
	}

	tradition_swap = {
		name = tr_est_mechanicum_2_robots
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			is_machine_empire = no
			est_uses_robots = yes
		}
		modifier = {
			ROBOT_species_trait_points_add = 1
		}
		weight = { factor = 1 }
	}

	tradition_swap = {
		name = tr_est_mechanicum_2_machines
		inherit_icon = yes
		trigger = { is_machine_empire = yes }
		modifier = {
			MACHINE_species_trait_points_add = 1
		}
		weight = { factor = 1 }
	}
	
	tradition_swap = {
		name = tr_est_mechanicum_2_GC
		inherit_effects = yes
		inherit_icon = yes
		trigger = {
			is_hive_empire = yes
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_mechanicum_3 = {
	custom_tooltip = tr_est_mechanicum_3_desc

	on_enabled = {
		give_technology = {
			tech = tech_est_mechanical_knights
			message = no
		}
	}
	
	modifier = {
		army_damage_mult = 0.10
	}

	ai_weight = { factor = 5000 }
}

tr_est_mechanicum_4 = {
	possible = {
		has_tradition = tr_est_mechanicum_3
	}
	
	modifier = {
		shipclass_starbase_hull_mult = 0.33
	}

	tradition_swap = {
		name = tr_est_mechanicum_4_GC
		inherit_effects = yes
		inherit_icon = yes
		trigger = {
			has_ethic = ethic_gestalt_consciousness
			Not = {
				has_ascension_perk = ap_voidborn
				est_uses_megastructures = yes
			}
		}
		weight = { factor = 1 }
	}
	tradition_swap = {
		name = tr_est_mechanicum_4_megastruct
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			Not = {
				has_ethic = ethic_gestalt_consciousness
			}
			Or = {
				has_ascension_perk = ap_voidborn
				est_uses_megastructures = yes
			}
		}
		modifier = {
			megastructure_build_speed_mult = 0.20
			megastructures_cost_mult = -0.10
		}
		weight = { factor = 1 }
	}

	tradition_swap = {
		name = tr_est_mechanicum_4_megastruct_GC
		inherit_icon = yes
		trigger = {
			has_ethic = ethic_gestalt_consciousness
			Or = {
				has_ascension_perk = ap_voidborn
				est_uses_megastructures = yes
			}
		}
		modifier = {
			megastructure_build_speed_mult = 0.2
			megastructures_cost_mult = -0.1
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}

tr_est_mechanicum_5 = {
	custom_tooltip = tr_est_mechanicum_5_desc

	possible = {
		has_tradition = tr_est_mechanicum_2
		has_tradition = tr_est_mechanicum_3
	}

	tradition_swap = {
		custom_tooltip = tr_est_mechanicum_5_robots_desc
	
		name = tr_est_mechanicum_5_robots
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			is_machine_empire = no
			est_uses_robots = yes
		}
		weight = { factor = 1 }
	}

	tradition_swap = {
		name = tr_est_mechanicum_5_GC
		trigger = { is_machine_empire = yes }
		modifier = {
			ship_hull_regen_add_perc = 0.05
			ship_armor_regen_add_perc = 0.05
		}
		weight = { factor = 1 }
	}

	ai_weight = { factor = 5000 }
}