tr_mt_swarm_adopt = {
	unlocks_agenda = agenda_MT_swarm # Sublight Speed
	modifier = {
		shipsize_corvette_build_speed_mult = 0.5
		ship_corvette_cost_mult = -0.1
		shipsize_corvette_hull_mult = 0.1
	}
	
	triggered_modifier = {
		potential = { has_ascension_perk = ap_become_the_crisis }
		shipsize_crisis_corvette_build_speed_mult = 0.5
		shipsize_crisis_corvette_hull_mult = 0.1
	}
	
	tradition_swap = {
		name = tr_mt_swarm_adopt_bioship
		inherit_effects = no
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		custom_tooltip = tr_mt_swarm_adopt_bioship_desc
		modifier = {
			ship_mauler_cost_mult = -0.1
			shipsize_mauler_stage_1_hull_mult = 0.1
			shipsize_mauler_stage_2_hull_mult = 0.1
			shipsize_mauler_stage_3_hull_mult = 0.1
			shipsize_mauler_stage_1_build_speed_mult = 0.5
			shipsize_mauler_stage_2_build_speed_mult = 0.5
			shipsize_mauler_stage_3_build_speed_mult = 0.5
		}
		# Bioship empires get no crisis ship bonuses since those are mechanical
		weight = {
			factor = 1
		}
	}
}

# 
tr_mt_swarm_finish = {
	#custom_tooltip = tr_swarm_finish_desc
	modifier = {
		country_naval_cap_mult = 0.25
		ascension_perks_add = 1
	}
}

# Extra firepower to small weapons
tr_mt_swarm_thousand_cuts = {

	modifier = {
		s_slot_weapon_fire_rate_mult = 0.2
		s_slot_weapon_damage_mult = 0.1
	}

	ai_weight = {
		factor = 1000
	}
}

# Whenever a ship is destroyed, the one that destroyed it gains 50% damage for some time
tr_mt_swarm_feast = {
	
	custom_tooltip = tr_mt_swarm_feast_effects

	ai_weight = {
		factor = 1000
	}
}

# When one dies, another takes its place # Whenever a ship is destroyed, repair another ship in the fleet by 10%
tr_mt_swarm_always_more = {
	
	possible = {
		has_tradition = tr_mt_swarm_feast
	}
	
	custom_tooltip_with_modifiers = tr_mt_swarm_always_more_effects
	
	modifier = {
		strike_craft_regeneration_mult = 0.2
	}

	ai_weight = {
		factor = 1000
	}
}

# Engagement range and speed
tr_mt_swarm_endless_pursuit = {

	possible = {
		has_tradition = tr_mt_swarm_thousand_cuts
	}
	
	modifier = {
		ship_engagement_range_mult = 0.5
		ship_speed_mult = 0.05
	}

	ai_weight = {
		factor = 1000
	}
}

# Ambush!
tr_mt_swarm_ambush = {

	possible = {
		has_tradition = tr_mt_swarm_feast
	}

	custom_tooltip = tr_mt_swarm_ambush_effects

	tradition_swap = {
		name = tr_mt_swarm_ambush_no_cloaking
		inherit_effects = no
		inherit_icon = no
		inherit_name = no
		trigger = {
			has_first_contact_dlc = no
		}
		modifier = {
			ship_tracking_add = 10
		}
		weight = {
			factor = 1
		}
	}

	ai_weight = {
		factor = 1000
	}
}
