# Tankbound Initial Setup
# Replace up to 3 Farming Districts by Generator Districts

if = {
	limit = {
		owner? = {
			is_tankbound_empire = yes
		}
	}

	while = {
		count = 2
		if = {
			limit = {
				check_variable = {
					which = farming_districts
					value > 0
				}
			}
			change_variable = {
				which = farming_districts
				value = -1
			}
			change_variable = {
				which = energy_districts
				value = 1
			}
		}
	}
}

# Tankbound Void Dweller Habitat Setup
# For individual machine Void Dwellers, farming_districts = 0 so the above has no effect.
# Replace up to 2 Mining Districts with Generator Districts instead.

if = {
	limit = {
		owner? = {
			is_tankbound_empire = yes
			has_origin = origin_void_dwellers
			is_individual_machine = yes
		}
	}

	while = {
		count = 2
		if = {
			limit = {
				check_variable = {
					which = mining_districts
					value > 0
				}
			}
			change_variable = {
				which = mining_districts
				value = -1
			}
			change_variable = {
				which = energy_districts
				value = 1
			}
		}
	}
}
