tr_domestication_adopt = {
	possible = {
	OR = {
		has_origin = origin_here_be_dragons
		has_origin = origin_fruitful
		has_origin = origin_tree_of_life
		has_origin = origin_wilderness
		has_origin = origin_evolutionary_predators
		is_beastmasters_empire = yes
		has_technology = tech_alien_cloning
		}
	}
	unlocks_agenda = agenda_galactic_trawling
	modifier = {
		planet_farmers_produces_mult = 0.2
		starbase_shipyard_space_fauna_build_cost_mult = -0.2
	}
	on_enabled = {
		if = {
			limit = {
				NOT = {
					has_technology = tech_alien_cloning
				}
			}
			give_technology = { tech = tech_alien_cloning message = yes }
		}
	}
	tradition_swap = {
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			OR = {
				is_individual_machine = yes
				is_machine_empire = yes
			}
		}

		modifier = {
			planet_farmers_food_produces_add = 1.5
			starbase_shipyard_space_fauna_build_cost_mult = -0.15
		}
		on_enabled = {
		if = {
				limit = {
					NOT = {
						has_technology = tech_alien_cloning
					}
				}
			give_technology = { tech = tech_alien_cloning message = yes }
			}
		}
	}
}

tr_domestication_finish = {
	custom_tooltip_with_modifiers = tr_domestication_finish_desc1
	modifier = {
		space_fauna_experience_gain_mult = @domestication_finish_exp_bonus
		space_fauna_growth_rate_mult = 0.5
		space_fauna_monthly_increased_breeding_chance_add = 1	
		ascension_perks_add = 1
	}

	on_enabled = {
		if = {
			limit = {
				NOT = {
					has_origin = origin_primal_calling
				}
			}
			country_event = { id = grand_archive.7010 days = 1 }
		}
	}

	tradition_swap = {
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			is_nomadic = yes
		}

		modifier = {
			space_fauna_monthly_increased_breeding_chance_add = 1
			ship_amoeba_physics_research_produces_add = 1
			ship_voidworm_society_research_produces_add = 1
			ship_tiyanki_engineering_research_produces_add = 1
			ship_crystalline_entity_rare_crystals_produces_add = 0.25
			ship_cutholoid_volatile_motes_produces_add = 0.25
			ascension_perks_add = 1
		}
	}
}

tr_domestication_containment_protocols = {
	modifier = {
		country_vivarium_max_capacity_mult = 0.25
		country_capture_chance_add = 0.25
		planet_biologists_society_research_produces_add = 0.25
	}

	on_enabled = {
		custom_tooltip = tr_domestication_containment_protocols_tt
		set_country_flag = containment_protocols_unlocked
	}

	ai_weight = {
		factor = 1000
	}
}

tr_domestication_bio_repurposing = {
	custom_tooltip_with_modifiers = tr_domestication_bio_repurposing_tt
	modifier = {
		category_biology_research_speed_mult = 0.15
		planet_clear_blocker_speed_mult = 0.35
	}


	tradition_swap = {
		inherit_icon = yes
		inherit_name = yes
		custom_tooltip_with_modifiers = tr_domestication_bio_repurposing_reanimator_tt
		trigger = {
			is_reanimator = yes
		}

		modifier = {
			category_biology_research_speed_mult = 0.15
			planet_clear_blocker_speed_mult = 0.35
			space_fauna_reanimation_cost_mult = -0.15
		}
	}

	tradition_swap = {
		name = tr_domestication_bio_repurposing_nomads
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}

		modifier = {
			ship_tiyanki_food_produces_add = 1
			ship_amoeba_food_produces_add = 1
			ship_crystalline_entity_minerals_produces_add = 1
			ship_cutholoid_minerals_produces_add = 1
			ship_voidworm_energy_produces_add = 1
		}
	}

	ai_weight = {
		factor = 1000
		modifier = {
			factor = 10
			is_at_war = yes
		}
	}
}

tr_domestication_astrozoology = {
	possible = {
		has_tradition = tr_domestication_containment_protocols
	}
	custom_tooltip_with_modifiers = tr_domestication_astrozoology_tt
	modifier = {
		planet_farmers_society_research_produces_add = 0.5
		pop_livestock_bonus_workforce_mult = 0.5
		pop_livestock_lithoid_bonus_workforce_mult = 0.5
		pop_livestock_infernal_bonus_workforce_mult = 0.5
	}

	ai_weight = {
		factor = 5000
	}
}

tr_domestication_metabolic_regulation = {
	possible = {
		has_tradition = tr_domestication_containment_protocols
		has_tradition = tr_domestication_bio_repurposing
	}

	modifier = {
		founder_species_growth_mult = 0.05
		starbase_shipyard_space_fauna_build_speed_mult = 0.25
		space_fauna_culling_reward_mult = 0.5
	}
	custom_tooltip_with_modifiers = tr_domestication_metabolic_regulation_tt

	tradition_swap = {
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			OR = {
				is_machine_empire = yes
				is_individual_machine = yes
			}
		}
		modifier = {
			planet_pop_assembly_mult = 0.05
			starbase_shipyard_space_fauna_build_speed_mult = 0.25
			space_fauna_culling_reward_mult = 0.5
		}
		custom_tooltip_with_modifiers = tr_domestication_metabolic_regulation_tt

		weight = {
			factor = 1
		}
	}

	tradition_swap = {
		inherit_icon = yes
		inherit_name = yes
		trigger = {
			is_wilderness_empire = yes
		}
		modifier = {
			building_time_mult = -0.05
			starbase_shipyard_space_fauna_build_speed_mult = 0.25
			space_fauna_culling_reward_mult = 0.5
		}
		custom_tooltip_with_modifiers = tr_domestication_metabolic_regulation_tt

		weight = {
			factor = 1
		}
	}

	ai_weight = {
		factor = 5000
	}
}

tr_domestication_killer_instinct = {
	possible = {
		has_tradition = tr_domestication_bio_repurposing
	}

	modifier = {
		space_fauna_ship_damage_mult = 0.15
		space_fauna_ship_armor_mult = 0.15
		space_fauna_ship_speed_mult = 0.5
	}

	tradition_swap = {
		name = tr_domestication_killer_instinct_homicidal
		inherit_effects = yes
		inherit_name = yes
		inherit_icon = yes
		trigger = {
			is_homicidal = yes
		}

		weight = {
			factor = 1
		}
	}

	ai_weight = {
		factor = 5000
		modifier = {
			factor = 10
			is_at_war = yes
		}
	}
}
