# Mutagenic Spas Initial Setup
# Buildings Added:
#	* Mutagenic Spa for regular empires
#	* Mutagenic Permutation Pool for hive empires
#	* Hyper Lubrication Basin for machine empires

if = {
	limit = {
		owner? = {
			is_toxic_baths_empire = yes
			is_nomadic = no
			OR = {
				AND = {
					is_regular_empire = yes
					is_individual_machine = no
				}
				has_valid_civic = civic_machine_servitor
			}
		}
	}
	add_building = {
		zone = zone_industrial
		building = building_toxic_bath
	}
}

if = {
	limit = {
		owner? = {
			is_hive_empire = yes
			is_toxic_baths_empire = yes
			is_nomadic = no
		}
	}
	add_building = {
		zone = zone_foundry
		building = building_toxic_bath_hive
	}
}

if = {
	limit = {
		owner? = {
			NOT = {
				has_valid_civic = civic_machine_servitor
			}
			OR = {
				is_machine_empire = yes
				is_individual_machine = yes
			}
			is_toxic_baths_empire = yes
			is_nomadic = no
		}
	}
	if = {
		limit = {
			has_zone = {
				zone = zone_industrial
			}
		}
		add_building = {
			zone = zone_industrial
			building = building_toxic_bath_machine
		}
	}
	else = {
		add_building = {
			zone = zone_foundry
			building = building_toxic_bath_machine
		}
	}
}

if = {
	limit = {
		owner? = {
			is_nomadic = yes
			is_toxic_baths_empire = yes
			OR = {
				AND = {
					is_regular_empire = yes
					is_individual_machine = no
				}
				has_valid_civic = civic_machine_servitor
			}
		}
	}
	add_building = {
		zone = zone_ark_industrial
		building = building_toxic_bath
	}
}

if = {
	limit = {
		owner? = {
			is_hive_empire = yes
			is_toxic_baths_empire = yes
			is_nomadic = yes
		}
	}
	add_building = {
		zone = zone_ark_foundry
		building = building_toxic_bath_hive
	}
}

if = {
	limit = {
		owner? = {
			NOT = {
				has_valid_civic = civic_machine_servitor
			}
			OR = {
				is_machine_empire = yes
				is_individual_machine = yes
			}
			is_nomadic = yes
			is_toxic_baths_empire = yes
		}
	}
	if = {
		limit = {
			has_zone = {
				zone = zone_ark_industrial
			}
		}
		add_building = {
			zone = zone_ark_industrial
			building = building_toxic_bath_machine
		}
	}
	else = {
		add_building = {
			zone = zone_ark_foundry
			building = building_toxic_bath_machine
		}
	}
}
