tr_modularity_adopt = {
	possible = {
		custom_tooltip = {
			fail_text = REQUIRES_FINISHED_TRANSFORMATION
			has_country_flag = modularity_traditions_unlocked
		}
	}
	on_enabled = {
		hidden_effect = {
			update_node_portraits_if_gestalt_effect = yes
		}
	}
	modifier = {
		planet_metallurgists_sr_living_metal_produces_add = 0.15
	}
	unlocks_agenda = agenda_modularity_reshape_form
}

tr_modularity_finish = {
	on_enabled = {
		hidden_effect = {
			country_event = { id = cybernetics.5080 }
			country_event = { id = timeline.82 }
		}
	}
	modifier = {
		planet_jobs_upkeep_mult = -0.15
		ascension_perks_add = 1
	}
	custom_tooltip_with_modifiers = tr_modularity_finish_modifier_desc
}

tr_modularity_1 = {
	possible = {
		has_tradition = tr_modularity_adopt
	}
	modifier = {
		planet_jobs_worker_produces_mult = 0.2
		auto_mod_monthly_add = 400
	}
	ai_weight = {
		factor = 1000
	}
}

tr_modularity_2 = {
	possible = {
		has_tradition = tr_modularity_1
	}
	tradition_swap = {
		name = tr_modularity_2_gestalt
		inherit_icon = yes
		trigger = {
			is_gestalt = yes
		}
		modifier = {
			planet_pop_assemblers_sr_living_metal_upkeep_add = 0.15
		}
		custom_tooltip_with_modifiers = tr_modularity_2_modifier_gestalt_desc
	}
	modifier = {
		planet_pop_assemblers_sr_living_metal_upkeep_add = 0.15
	}
	custom_tooltip_with_modifiers = tr_modularity_2_modifier_desc
	ai_weight = {
		factor = 1000
	}
}

tr_modularity_3 = {
	possible = {
		has_tradition = tr_modularity_1
	}
	tradition_swap = {
		name = tr_modularity_3_gestalt
		inherit_icon = yes
		trigger = {
			is_gestalt = yes
		}
		modifier = {
			planet_stability_add = 5
			army_damage_mult = 0.5
		}
		custom_tooltip_with_modifiers = tr_modularity_3_modifier_gestalt_desc
	}
	modifier = {
		planet_stability_add = 5
		army_damage_mult = 0.5
	}
	custom_tooltip_with_modifiers = tr_modularity_3_modifier_desc

	ai_weight = {
		factor = 1000
	}
}

tr_modularity_4 = {
	possible = {
		has_tradition = tr_modularity_2
	}
	tradition_swap = {
		inherit_name = yes
		inherit_icon = yes
		trigger = {
			has_valid_civic = civic_machine_servitor
		}
		modifier = {
			planet_bio_trophies_unity_produces_add = 1.5
		}
	}
	custom_tooltip_with_modifiers = tr_modularity_4_modifier_desc
		modifier = {
			planet_bureaucrats_stability_produces_add = 0.2
		}
	ai_weight = {
		factor = 1000
	}
}

tr_modularity_5 = {
	possible = {
		has_tradition = tr_modularity_3
	}
	modifier = {
		MACHINE_species_trait_points_add = 4
		MACHINE_species_trait_picks_add = 4
		modify_species_cost_mult = -0.5
	}
	custom_tooltip_with_modifiers = tr_modularity_5_modifier_desc
	ai_weight = {
		factor = 1000
	}
}
