bd_lgate_base = {
	entity = "gatebuilder_01_gateway_entity"
	construction_entity = "gateway_portal_entity"
	portrait = "GFX_megastructure_construction_background"
	place_entity_on_planet_plane = no
	show_galactic_map_icon = no
	build_outside_gravity_well = no	#重力井外建造,启用则会忽略 placement_rules
	construction_blocks_and_blocked_by = self_type	#被同类巨构阻止建造/阻止建造同类巨构
	build_time = 360
	resources = {
		category = megastructures
		cost = {
			alloys = 1500
			influence = 50
		}
	}
	potential = {
		has_technology = tech_bd_can_active_gate
	}
	possible = {
		exists = starbase
		custom_tooltip = {
			fail_text = "requires_inside_border"
			is_inside_border = from
		}
		custom_tooltip = {
			fail_text = "requires_surveyed_system"
			NOT = {
				any_system_planet = {
					is_surveyed = {
						who = prev.from
						status = no
					}
				}
			}
		}
		# custom_tooltip = {
		# 	fail_text = "requires_no_binary_trinary"
		# 	NOR = {
		# 		is_star_class = sc_binary_1
		# 		is_star_class = sc_binary_2
		# 		is_star_class = sc_binary_3
		# 		is_star_class = sc_binary_4
		# 		is_star_class = sc_binary_5
		# 		is_star_class = sc_binary_6
		# 		is_star_class = sc_binary_7
		# 		is_star_class = sc_binary_8
		# 		is_star_class = sc_binary_9
		# 		is_star_class = sc_binary_10
		# 		is_star_class = sc_trinary_1
		# 		is_star_class = sc_trinary_2
		# 		is_star_class = sc_trinary_3
		# 		is_star_class = sc_trinary_4
		# 	}
		# }
		custom_tooltip = {
			fail_text = "requires_no_existing_gateway"
			NOR = {
				# has_megastructure = gateway_0
				# has_megastructure = gateway_ruined
				# has_megastructure = gateway_restored
				# has_megastructure = gateway_final
				has_megastructure = bd_lgate_base
			}
		}
	}

	placement_rules = {
		planet_possible = {
			custom_tooltip = {
				fail_text = "must_build_around_star"
				is_star = yes
			}
			custom_tooltip = {
				fail_text = "requires_no_anomaly"
				NOT = { has_anomaly = yes }
			}
		}
	}
	bypass_type = bd_lgate
	# root = system
	# from = country
	on_build_start = {
	}
	on_build_cancel = {
	}
	on_build_complete = {
		root = {
			set_star_flag = bd_lgate_base
		}
	}
	ai_weight = {
		base = 0
	}
}