
tr_nanotech_adopt = {
	possible = {
		custom_tooltip = {
			fail_text = REQUIRES_FINISHED_TRANSFORMATION
			has_country_flag = nanotech_traditions_unlocked
		}
	}
	triggered_modifier = {
		potential = {
			is_nomadic = no
		}
		stations_produces_mult = 0.25
	}
	triggered_modifier = {
		potential = {
			is_nomadic = yes
		}
		starbase_collected_system_resources_mult = 0.25
	}
	custom_tooltip_with_modifiers = tr_nanotech_adopt_modifier_desc
	unlocks_agenda = agenda_nanotech_unstoppable_swarm
	#Unlocks nanolab 1 and Starbase building
}

tr_nanotech_finish = {
	on_enabled = {
		hidden_effect = {
			country_event = { id = timeline.83 }
		}
	}
	custom_tooltip_with_modifiers = tr_nanotech_finish_modifier_desc

	triggered_modifier = {
		potential = {
			is_nomadic = no
			is_megacorp = no
			is_sovereign_guardianship_empire = no
		}
		empire_size_colonies_mult = -0.5
		ascension_perks_add = 1
	}
	triggered_modifier = {
		potential = { OR = { 
			is_nomadic = yes
			is_megacorp = yes
			is_sovereign_guardianship_empire = yes
		} }
		empire_size_colonies_mult = -0.75
		ascension_perks_add = 1
	}
}

tr_nanotech_1 = {
	custom_tooltip_with_modifiers = tr_nanotech_1_modifier_desc
	#Unlocks nanolab 2 and buffs nano research units
	triggered_modifier = {
		potential = {
			is_nomadic = no
		}
		planet_farmers_food_produces_add = -2
		planet_farmers_nanites_produces_add = 0.5
		planet_miners_minerals_produces_add = -2
		planet_miners_nanites_produces_add = 0.5
	}
	triggered_modifier = {
		potential = {
			is_nomadic = yes
		}
		planet_farmers_food_produces_add = -3
		planet_farmers_nanites_produces_add = 0.75
	}
	ai_weight = {
		factor = 1000
	}
}

tr_nanotech_2 = {
	custom_tooltip = tr_nanotech_2_modifier_desc
	#Unlocks the Cauldron and the Nanite Transmutation Tech option
	on_enabled = {
		add_research_option = tech_nanite_transmutation
		add_tech_progress = {
			tech = tech_nanite_transmutation
			progress = 0.33
		}
	}
	ai_weight = {
		factor = 1000
	}
}

tr_nanotech_3 = {
	possible = {
		has_tradition = tr_nanotech_1
	}
	custom_tooltip = tr_nanotech_3_modifier_desc
	#Unlocks Starbase Building and Make Nanite World Decision
	ai_weight = {
		factor = 1000
	}
	tradition_swap = {
		name = tr_nanotech_3_nomad
		inherit_name = yes
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}

		custom_tooltip = tr_nanotech_3_modifier_nomadic_desc
		weight = {
			factor = 1000
		}
	}
}

tr_nanotech_4 = {
	possible = {
		has_tradition = tr_nanotech_2
	}
	on_enabled = {
		add_research_option = tech_nanite_repair_system
		add_research_option = tech_nanite_autocannon
		add_research_option = tech_nanite_flak_batteries
	}
	modifier = {
		starbase_shipyard_build_speed_mult = 0.15
		starbase_shipyard_build_cost_mult = -0.05
	}
	ai_weight = {
		factor = 1000
	}
}

tr_nanotech_5 = {
	possible = {
		has_tradition = tr_nanotech_3
		has_tradition = tr_nanotech_4
	}
	custom_tooltip_with_modifiers = tr_nanotech_5_modifier_desc
	#Unlocks the nanite edicts
	#Every 5 years, double the size of orbital nanite deposits that you're harvesting, up to a max of 50 OR spawns a number of nanite swarmers depending on the size of the deposit
	ai_weight = {
		factor = 1000
	}
}
