rg_machine_maid_trait = {
	cost = {
		base = 0
	}
	custom_tooltip = rg_machine_maid_trait_effect_tooltip
	initial = no
	species_potential_add = {
		FROM = {
			RG_tradition5_or_gray_owner_trigger = yes
		}
	}
	species_possible_remove = {
		FROM = {
			RG_tradition5_or_gray_owner_trigger = yes
		}
	}
	species_possible_merge_add = {
		FROM = {
			RG_tradition5_or_gray_owner_trigger = yes
		}
	}
	species_possible_merge_remove = {
		FROM = {
			RG_tradition5_or_gray_owner_trigger = yes
		}
	}
	randomized = no
	allowed_archetypes = { ROBOT MACHINE BIOLOGICAL LITHOID RG_MACHINE }
	sorting_priority = 20
	potential_crossbreeding_chance = 1.0

	opposites = {
	}

	modifier = {
		habitability_floor_add = 0.25
		pop_housing_usage_mult = -0.9
	}

	assembling_modifier = {
		planet_pop_assemblers_nanites_upkeep_add = 0.1
	}
	
	# 在灰风主人国家工作提供加成
	triggered_pop_modifier = {
		potential = {
			exists = planet
			planet = {
				exists = owner
				owner = { has_country_flag = gray_owner }
			}
		}
		planet_jobs_produces_mult = 0.1
	}

	ai_weight = {
		weight = 0
	}
	
	assembly_score = {
		modifier = {
			add = 3
			from.owner = { is_same_value = event_target:gray_owner }
		}
		modifier = {
			mult = 0
			from.owner = { 
				NOT = {
					is_same_value = event_target:gray_owner
				}
			}
		}
	}
	
	slave_cost = {
		energy = 1000
	}
}

trait_rg_machine_unit = {
	cost = 0
	sorting_priority = 20
	initial = no
	randomized = no
	species_potential_add = {
		always = no
	}
	species_possible_remove = {
		always = no
	}

	species_possible_merge_add = {
		FROM = {
			RG_tradition5_or_gray_owner_trigger = yes
		}
	}

	species_possible_merge_remove = {
		FROM = {
			RG_tradition5_or_gray_owner_trigger = yes
		}
	}

	icon = "gfx/interface/icons/traits/trait_machine_unit.dds"
	allowed_archetypes = { ROBOT MACHINE BIOLOGICAL LITHOID RG_MACHINE }

	immortal_leaders = no

	modifier = {
		pc_machine_habitability = 1
		leader_lifespan_add = 10
		habitability_floor_add = 0.5
	}

	triggered_planet_growth_habitability_modifier = {
		potential = {
			exists = owner
			owner = {
				OR = {
					has_active_tradition = tr_nanotech_adopt
					has_active_tradition = tr_rg_nanotech_adopt
				}
			}
		}
		pc_nanotech_habitability = 1
	}

	leader_age_min = 5
	leader_age_max = 10

	custom_tooltip_with_modifiers = TRAIT_MACHINE_UNIT_EFFECT
}