diff --git a/common/scripted_effects/RG_scripted_effects.txt b/common/scripted_effects/RG_scripted_effects.txt index f4f24d0..107d506 100644 --- a/common/scripted_effects/RG_scripted_effects.txt +++ b/common/scripted_effects/RG_scripted_effects.txt @@ -2047,8 +2047,11 @@ rg_gray_country_after_init = { rg_timeline_attract_field_init = { #世界线遭到劫持,手动收束关闭其他可能 + ###_清除[distar.8000]产生的flag + #_只有在完成L星门特殊项目后开启[distar.10950]才会用到这些flag, 所以开门前本事件都是可以执行的 if = { limit = { + NOT = { has_global_flag = l_cluster_opened } OR = { has_global_flag = gray_goo_crisis_set has_global_flag = active_gray_goo diff --git a/common/special_projects/!_RG_projects_distant_stars.txt b/common/special_projects/!_RG_projects_distant_stars.txt index 4e7dcf0..c6ee54c 100644 --- a/common/special_projects/!_RG_projects_distant_stars.txt +++ b/common/special_projects/!_RG_projects_distant_stars.txt @@ -19,7 +19,21 @@ special_project = { } on_success = { - owner = { country_event = { id = rg_cluster.2 } } + owner = { + if = { + limit = { + OR = { + has_global_flag = l_cluster_origin # l-cluster plus + has_global_flag = rg_origin_l_cluster # 遥远约定 + has_global_flag = gray_origin_activate # 远星之歌 + } + } + country_event = { id = rg_cluster.2 } + } + else = { + country_event = { id = distar.10950 } + } + } } on_fail = { diff --git a/events/RG_cluster_events.txt b/events/RG_cluster_events.txt index 3fa2114..26c141a 100644 --- a/events/RG_cluster_events.txt +++ b/events/RG_cluster_events.txt @@ -1,5 +1,85 @@ namespace = rg_cluster +# Special project completed (overwrite) +country_event = { + id = rg_cluster.2 + hide_window = yes + + is_triggered_only = yes + + immediate = { + set_country_flag = lcluster_opener + set_global_flag = l_cluster_opened + + every_megastructure = { + limit = { + is_megastructure_type = lgate_base + NOT = { has_megastructure_flag = lgate_activated } + } + activate_gateway = this + set_megastructure_flag = lgate_activated + } + + set_global_flag = lgates_activated_globally + # centralized handling of chain and project clean-up + every_playable_country = { + if = { + limit = { is_researching_technology = tech_lgate_activation } + give_technology = { + tech = tech_lgate_activation + message = no + } + } + } + every_playable_country = { + limit = { + NOR = { + has_event_chain = l_cluster_chain + has_special_project = LCLUSTER_PROJECT + is_same_value = root + } + } + country_event = { id = distar.10954 days = 1 } + } + every_playable_country = { + limit = { + NOR = { + has_special_project = LCLUSTER_PROJECT + is_same_value = root + } + has_event_chain = l_cluster_chain + } + country_event = { id = distar.10953 days = 1 } + } + observer_event = { id = observer.62 } + + every_playable_country = { + if = { + limit = { has_modifier = rg_distant_stars_modifier } + remove_modifier = rg_distant_stars_modifier + } + } + country_event = { id = rg_cluster.10 } + } +} + +# Allow all nanite worlds to be terraformed +country_event = { + id = rg_cluster.3 + hide_window = yes + is_triggered_only = yes + + immediate = { + every_galaxy_planet = { + limit = { is_planet_class = pc_gray_goo } + add_modifier = { + modifier = "terraforming_candidate" + days = -1 + } + } + } +} + # Spawn L-Cluster country_event = { id = rg_cluster.8 @@ -382,84 +462,6 @@ country_event = { } } -# Allow all nanite worlds to be terraformed -country_event = { - id = rg_cluster.3 - hide_window = yes - is_triggered_only = yes - - immediate = { - every_galaxy_planet = { - limit = { is_planet_class = pc_gray_goo } - add_modifier = { - modifier = "terraforming_candidate" - days = -1 - } - } - } -} - -# Special project completed (overwrite) -country_event = { - id = rg_cluster.2 - hide_window = yes - - is_triggered_only = yes - - immediate = { - if = { - limit = { - OR = { - has_global_flag = l_cluster_origin # l-cluster plus - has_global_flag = rg_origin_l_cluster # 遥远约定 - has_global_flag = gray_origin_activate # 远星之歌 - } - } - set_global_flag = l_cluster_opened - - # Activate Terminal Egress L-Gate - event_target:lcluster1 = { - random_system_megastructure = { - activate_gateway = this - set_megastructure_flag = lgate_activated - } - } - every_megastructure = { - limit = { - is_megastructure_type = lgate_base - } - activate_gateway = this - } - set_global_flag = lgates_activated_globally - - every_playable_country = { - if = { - limit = { is_researching_technology = tech_lgate_activation } - give_technology = { - tech = tech_lgate_activation - message = no - } - } - } - - every_playable_country = { - if = { - limit = { has_modifier = rg_distant_stars_modifier } - remove_modifier = rg_distant_stars_modifier - every_owned_ship = { - limit = { has_modifier = rg_distant_stars_modifier } - remove_modifier = rg_distant_stars_modifier - } - } - } - country_event = { id = rg_cluster.10 } - } - else = { - country_event = { id = distar.10950 } - } - } -} - # L-Cluster Opened country_event = { id = rg_cluster.10 diff --git a/events/RG_events.txt b/events/RG_events.txt index 06a0b4f..fcf7227 100644 --- a/events/RG_events.txt +++ b/events/RG_events.txt @@ -18,7 +18,7 @@ country_event = { add_modifier = { modifier = rg_distant_stars_modifier } - + save_global_event_target_as = origin_rg_gray_country } }