tr_cloning_adopt = {
	possible = {
		custom_tooltip = {
			fail_text = REQUIRES_FINISHED_EVOLUTION
			has_country_flag = cloning_tradition_unlocked
		}
	}
	unlocks_agenda = agenda_cloning_replication
	custom_tooltip_with_modifiers = tr_cloning_adopt_tt
	modifier = {
	}

	on_enabled = {
		if = {
			limit = {
				NOT = {
					has_technology = tech_cloning
				}
			}
			give_technology = {
				tech = tech_cloning
				message = no
			}
		}
	}

	tradition_swap = {
		name = tr_cloning_adopt_clone_army
		inherit_name = yes
		inherit_icon = yes
		trigger = {
			has_country_flag = clone_army_full_potential
		}
		modifier = {
		}
		custom_tooltip = tr_cloning_adopt_clone_army_tt
		weight = {
			factor = 1
		}
	}
}

tr_cloning_finish = {
	custom_tooltip_with_modifiers = tr_cloning_finish_tt
	modifier = {
		ascension_perks_add = 1
	}

	on_enabled = {
		hidden_effect = {
			country_event = { id = timeline.80 }
			if = {
				limit = {
					is_hive_empire = no
				}
				country_event = {
					id = bio.175
				}
			}
			else = {
				country_event = {
					id = bio.190
				}
			}
			luminary_speech_effect = yes
		}
	}

	tradition_swap = {
		name = tr_cloning_finish_clone_army
		inherit_name = yes
		inherit_icon = yes
		trigger = {
			has_country_flag = clone_army_full_potential
		}
		custom_tooltip_with_modifiers = tr_cloning_finish_clone_army_tt
		modifier = {
			ascension_perks_add = 1
		}
		on_enabled = {
			hidden_effect = {
				if = {
					limit = {
						is_hive_empire = no
					}
					country_event = {
						id = bio.175
					}
				}
				else = {
					country_event = {
						id = bio.190
					}
				}
			}
		}
		weight = {
			factor = 1
		}
	}
}

tr_cloning_evolutionary_extrapolation = {
	custom_tooltip_with_modifiers = tr_cloning_evolutionary_extrapolation_tt
	modifier = {
		category_biology_research_speed_mult = 0.15
		planet_buildings_clone_vats_upkeep_mult = -0.50
	}

	ai_weight = {
		factor = 5000
	}
}

tr_cloning_somatic_synthesization = {
	custom_tooltip_with_modifiers = tr_cloning_somatic_synthesization_tt
	modifier = {
		BIOLOGICAL_species_trait_points_add = 4
		BIOLOGICAL_species_trait_picks_add = 2
		modify_species_cost_mult = -0.50
	}

	tradition_swap = {
		name = tr_cloning_somatic_synthesization_clone_army
		inherit_name = no
		inherit_icon = yes
		trigger = {
			has_country_flag = clone_army_full_potential
		}
		custom_tooltip_with_modifiers = tr_cloning_somatic_synthesization_clone_army_tt
		modifier = {
			BIOLOGICAL_species_trait_points_add = 4
			BIOLOGICAL_species_trait_picks_add = 2
			modify_species_cost_mult = -0.50
		}
		weight = {
			factor = 1
		}
	}

	ai_weight = {
		factor = 5000
	}
}

tr_cloning_stage_1_swap = {
	possible = {
		has_tradition = tr_cloning_evolutionary_extrapolation
	}
	inline_script = {
		script = traditions/tr_stage_1_tradition_swaps
	}

	ai_weight = {
		factor = 5000
	}
}

tr_cloning_stage_2_swap = {
	possible = {
		has_tradition = tr_cloning_somatic_synthesization
	}
	inline_script = {
		script = traditions/tr_stage_2_tradition_swaps
	}

	ai_weight = {
		factor = 5000
	}
}

tr_cloning_stage_3_swap = {
	possible = {
		has_tradition = tr_cloning_evolutionary_extrapolation
		has_tradition = tr_cloning_somatic_synthesization
	}
	inline_script = {
		script = traditions/tr_stage_3_tradition_swaps
	}

	ai_weight = {
		factor = 5000
	}
}

# Dummy traditions for tooltip generation
tr_cloning_genomic_growth = {
	possible = {
		# Called via tr_stage_1_tradition_swaps
		always = no
	}

	# Effects in the inline script for tooltip generation
	inline_script = {
		script = traditions/tr_cloning_genomic_growth
	}

	ai_weight = {
		factor = 0
	}
}

tr_cloning_artificial_population = {
	possible = {
		# Called via tr_stage_2_tradition_swaps
		always = no
	}

	# Effects in the inline script for tooltip generation
	inline_script = {
		script = traditions/tr_cloning_artificial_population
	}

	ai_weight = {
		factor = 0
	}
}

tr_cloning_biochemical_composure = {
	possible = {
		# Called via tr_stage_3_tradition_swaps
		always = no
	}

	# Effects in the inline script for tooltip generation
	inline_script = {
		script = traditions/tr_cloning_biochemical_composure
	}

	ai_weight = {
		factor = 0
	}
}

tr_cloning_biochemical_composure_clones = {
	possible = {
		# Called via tr_stage_3_tradition_swaps
		always = no
	}

	# Effects in the inline script for tooltip generation
	inline_script = {
		script = traditions/tr_cloning_biochemical_composure_clones
	}

	ai_weight = {
		factor = 0
	}
}
