
# planetmega_eg_gateway_1 = {
# 	entity = "construction_platform_entity"
# 	construction_entity = "construction_platform_entity"
# 	portrait = "GFX_megastructure_construction_background"
# 	place_entity_on_planet_plane = no
# 	show_galactic_map_icon = no
# 	entity_offset = { x = -15 y = -5 }
#
# 	build_time = 1440
# 	resources = {
# 		category = megastructures_gateways
# 		cost = {
# 			alloys = 3000
# 			influence = 100
# 		}
# 	}
# 	construction_blocks_and_blocked_by = self_type
#     custom_tooltip_requirements = "MEGASTRUCTURE_TOOLTIP_REQUIREMENTS_PLNMG_EG_GATEWAY"
#
# 	potential = { always = no }
#     possible = {
#         hidden_trigger = {
#             exists = starbase
#         }
#         custom_tooltip = {
#             fail_text = "requires_inside_border"
#             is_inside_border = from
#         }
#     }
# 	placement_rules = {
# 		planet_possible = {
#             custom_tooltip = {
#                 fail_text = "requires_surveyed_planet"
#                 is_surveyed = { # prevent leaking habitability information
#                     who = prev.from
#                     status = yes
#                 }
#             }
#             custom_tooltip = {
#                 fail_text = "requires_no_anomaly"
#                 NOT = { has_anomaly = yes }
#             }
#             custom_tooltip = {
#                 fail_text = "requires_colonized_planet_orbital_ring"
#                 is_colony = yes
#                 exists = owner
#                 exists = controller
#                 controller = { is_same_value = prev.owner }
#             }
# 			custom_tooltip = {
# 				fail_text = "requires_not_hostile_or_primitive"
# 				NOR = {
# 					planet_is_hostile_or_crisis = yes
# 					AND = {
# 						exists = owner
# 						owner = { is_country_type = primitive }
# 					}
# 				}
# 			}
# 			###originals###
# 			has_deposit = d_plnmg_extra_galaxy
# 			custom_tooltip = {
# 				fail_text = already_has_plnmg_eg_gateway
# 				nor = {
# 					has_planet_flag = has_plnmg_eg_gateway_0
# 					has_planet_flag = has_plnmg_eg_gateway_final
# 					has_planet_flag = has_plnmg_eg_gateway_ruined
# 				}
# 			}
# 		}
# 	}
#
# 	# root = system
# 	# from = country
# 	ai_weight = { factor = 0 }
# 	on_build_complete = {
# 		fromfrom = { save_event_target_as = location_megastructure }
# 		fromfrom.planet = {
#             set_planet_flag = has_plnmg_eg_gateway_0
#             #set_planet_flag = has_megastructure
#         }
# 		from = { country_event = { id = planetmega_exp.1 } }
# 	}
# }

# planetmega_eg_gateway_menu = {
#     entity = "gateway_entity"
#     entity_offset = { x = -27 y = 27 }
#     construction_entity = "gateway_portal_entity"
#     portrait = "GFX_megastructure_construction_background"
#     place_entity_on_planet_plane = no
#     overlord_can_upgrade = no
#     # upgrade_from = { planetmega_eg_gateway_final }
#     # upgrade_desc = hide
#     build_time = 1
#     construction_blocks_and_blocked_by = none
#     potential = { always = no }
#     dismantle_potential = { always = no }
#     ai_weight = { factor = 0 }
#
#     on_build_start = { fromfrom = { finish_upgrade = yes } }
#     on_build_complete = {
#         fromfrom.planet = { save_event_target_as = location_planet }
#         fromfrom = { save_event_target_as = location_megastructure }
#         from = { country_event = { id = planetmega_exp.9 } }
#         # fromfrom = {
#         # 	upgrade_megastructure_to = planetmega_eg_gateway_final
#         # 	finish_upgrade = yes
#         # }
#     }
# }
# planetmega_eg_gateway_menu_restored = {
#     entity = "reactivated_gateway_entity"
#     entity_offset = { x = -27 y = 27 }
#     construction_entity = "gateway_portal_entity"
#     portrait = "GFX_megastructure_construction_background"
#     place_entity_on_planet_plane = no
#     overlord_can_upgrade = no
#     # upgrade_from = { planetmega_eg_gateway_restored }
#     # upgrade_desc = hide
#     build_time = 1
#     construction_blocks_and_blocked_by = none
#     potential = { always = no }
#     dismantle_potential = { always = no }
#     ai_weight = { factor = 0 }
#
#     on_build_start = { fromfrom = { finish_upgrade = yes } }
#     on_build_complete = {
#         fromfrom.planet = { save_event_target_as = location_planet }
#         fromfrom = { save_event_target_as = location_megastructure }
#         from = { country_event = { id = planetmega_exp.9 } }
#         # fromfrom = {
#         # 	upgrade_megastructure_to = planetmega_eg_gateway_restored
#         # 	finish_upgrade = yes
#         # }
#     }
# }

# plnmg_test_space_mega = { #test use
#     entity = "metaverse_concert_stage_entity"
#     construction_entity = "construction_platform_entity"
#     portrait = "GFX_mega_art_installation_background"
#     place_entity_on_planet_plane = no
#     entity_offset = { x = 5 y = 5 }
#     build_time = 1
#
#     #effect set_global_flag = plnmg_test_space_mega
#     potential = { has_global_flag = plnmg_test_space_mega }
#     placement_rules = { planet_possible = { is_star = no } }
#     ai_weight = { weight = 0 }
# }
