##	同步追踪|全部	scripted_triggers	|can_enter_system_by_jump_trigger|
#_|规则同步|	can_enter_system_by_jump
#_|UGRC跃迁星系|	ACOT/seooc/wsg/kuat/cglbu/cgelf/Alily/arkn/spth/kzvoy/dsc
# SCOPE=<cntr>	尝试进入星系的cntr
# This = system being targeted
can_enter_system_by_jump_trigger = {
	custom_tooltip = {
		#success_text = "debug: can jump"
		fail_text = cannot_jump_to_system
		OR = {
			###	|绝对通行|	FW
			$SCOPE$ = {
				OR = {
					has_country_flag = FW_flg_cntr_CHT_orrery_ON		# 璀璨星图
					has_country_flag = FW_flg_cntr_CHT_beacon_ON		# 永恒星炬
					prev.space_owner? = { is_variable_set = UGRC_var_cntr_RULE_jump_self	is_same_value = prev }	# 我的盘我做主
				}
			}
			###	|特殊通行|	+AAR/TAC/cglbu	/IFE/wsg/cgelf
			#	拥有特殊的机制, 除了mod限制的星系需同步|基础条件|, 他们想去哪就去哪
			#	跳过|原版block|		跳过|Giga/cgelf|相关条件
			$SCOPE$ = {
				##	特权国家
				OR = {
					has_country_flag = AAR_flg_cntr_WEBWAY_relic_ON		# |AAR|网道行者relic
					has_country_flag = TAC_traveler						# |TAC|
					has_country_flag = wtmnb_order						# |cglbu|wtmnb
				}
				##	限制星系条件
				prev = {
					NOR = {
						#	UGRC跃迁星系
						has_star_flag = UGRC_flg_sstm_RULE_jump_block
						#	IFE
						AND = { has_star_flag = scfe_shaded_colony_system		$SCOPE$ = { scfe_can_jump_in_shaded_system = no } }
						#	wsg
						space_owner? = { is_country_type = monolith_crisis_country }
					}
				}
			}
			
			###_|基础条件|	+IFE/wsg/Giga/cgelf
			AND = {
				##	封印星系	########################################################
				OR = {
					NOT = { has_star_flag = sealed_system }
					AND = {
						$SCOPE$ = { has_country_flag = entered_sealed_system }
						has_star_flag = sealed_system
					}
				}
				##	限制星系条件	########################################################
				NOR = {
					##	V
					has_star_flag = lcluster
					has_star_flag = formless_system
					has_star_flag = hyperthermia_system

					##	UGRC跃迁星系
					has_star_flag = UGRC_flg_sstm_RULE_jump_block
					#	IFE
					AND = { has_star_flag = scfe_shaded_colony_system		$SCOPE$ = { scfe_can_jump_in_shaded_system = no } }
					#	wsg
					space_owner? = { is_country_type = monolith_crisis_country }
				}

				##	Giga	########################################################
				if = { limit = { has_global_flag = gigastructures_enabled }
					OR = {
						NOR = {
							has_star_flag = lcluster
							has_star_flag = ehof_compound_system
							has_star_flag = giga_core_03
							cohesive_system = yes
							urmazin_system = yes
							everchanging_system = yes
							katzen_jump_blocked_system = yes
							has_star_flag = maginot_anti_jump_star # Maginot World subspace disruption
							has_star_flag = siegfried_anti_jump_star # Katzen version
						}
						#This is gonna be a bit annoying, BUT it needs to be done for eager explorers
						AND = {
							cohesive_system = yes
							$SCOPE$ = { is_eager_explorer_empire = yes }
							has_star_flag = ehof_system_created_by_@$SCOPE$
						}
						AND = {
							$SCOPE$ = { has_country_flag = entered_sealed_system }
							has_star_flag = sealed_system
						}
					}
				}
				##	cgelf	精灵亚空间
				if = { limit = { has_star_flag = ELF_Singularity_System }
					$SCOPE$ = { has_country_flag = ELF_Singularity_System_entry_permit }
				}
				#	精灵ai禁止跳跃星系
				if = { limit = { has_star_flag = ELF_ai_no_entry_system }
					$SCOPE$ = { is_ai = no }
				}
			}
		}
	}
}

