realgray-stellaris-mod/common/scripted_effects/RG_gray_init_effects.txt

686 lines
14 KiB
Plaintext
Raw Normal View History

2024-09-23 10:24:21 +08:00
#Country event_target:gray_owner
2023-06-03 17:46:32 +08:00
#灰风舰船刷新位置检测
rg_global_gray_location_check = {
if = {
2023-06-08 13:11:05 +08:00
limit = {
2024-09-23 10:24:32 +08:00
RG_gray_scientist_active_trigger = yes
2023-06-08 13:11:05 +08:00
}
2023-06-03 17:46:32 +08:00
if = {
2023-06-08 13:11:05 +08:00
limit = {
exists = event_target:global_gray_constship
}
2023-06-03 17:46:32 +08:00
event_target:global_gray_constship = {
save_global_event_target_as = global_gray_location
}
2023-06-08 13:11:05 +08:00
}
else = {
2023-06-03 17:46:32 +08:00
random_owned_fleet = {
2023-06-08 13:11:05 +08:00
limit = {
has_fleet_flag = gray_constship
}
2023-06-03 17:46:32 +08:00
save_global_event_target_as = global_gray_location
}
}
}
else_if = {
2023-06-08 13:11:05 +08:00
limit = {
2024-09-23 10:24:32 +08:00
RG_gray_warship_active_trigger = yes
2023-06-08 13:11:05 +08:00
}
2023-06-03 17:46:32 +08:00
if = {
2023-06-08 13:11:05 +08:00
limit = {
exists = event_target:gray_warship
}
2023-06-03 17:46:32 +08:00
event_target:gray_warship = {
save_global_event_target_as = global_gray_location
}
2023-06-08 13:11:05 +08:00
}
else = {
2023-06-03 17:46:32 +08:00
random_owned_fleet = {
2023-06-08 13:11:05 +08:00
limit = {
has_fleet_flag = gray_fleet
}
2023-06-03 17:46:32 +08:00
save_global_event_target_as = global_gray_location
}
}
}
else_if = {
2023-06-08 13:11:05 +08:00
limit = {
has_country_flag = gray_juggernaut_active
}
2023-06-03 17:46:32 +08:00
if = {
2023-06-08 13:11:05 +08:00
limit = {
exists = event_target:gray_juggernaut
}
2023-06-03 17:46:32 +08:00
event_target:gray_juggernaut = {
save_global_event_target_as = global_gray_location
}
2023-06-08 13:11:05 +08:00
}
else = {
2023-06-03 17:46:32 +08:00
random_controlled_fleet = {
2023-06-08 13:11:05 +08:00
limit = {
has_fleet_flag = gray_juggernaut_fleet
}
2023-06-03 17:46:32 +08:00
save_global_event_target_as = global_gray_location
}
}
}
else_if = {
2023-06-08 13:11:05 +08:00
limit = {
2024-09-23 10:24:32 +08:00
RG_gray_official_active_trigger = yes
2023-06-08 13:11:05 +08:00
}
2023-06-03 17:46:32 +08:00
if = {
2023-06-08 13:11:05 +08:00
limit = {
any_owned_planet = {
2024-09-22 20:17:00 +08:00
exists = leader
leader = {
is_same_value = event_target:gray_official
2023-06-08 13:11:05 +08:00
}
2023-06-03 17:46:32 +08:00
}
}
random_owned_planet = {
limit = {
2024-09-22 20:17:00 +08:00
exists = leader
leader = {
is_same_value = event_target:gray_official
2023-06-08 13:11:05 +08:00
}
2023-06-03 17:46:32 +08:00
}
2024-09-22 20:17:00 +08:00
save_event_target_as = global_gray_location
2023-06-03 17:46:32 +08:00
}
}
else = {
2023-06-08 13:11:05 +08:00
capital_scope = {
2024-09-22 20:17:00 +08:00
save_event_target_as = global_gray_location
2023-06-08 13:11:05 +08:00
}
2023-06-03 17:46:32 +08:00
}
2023-06-08 13:11:05 +08:00
}
2023-06-03 17:46:32 +08:00
else_if = {
2023-06-08 13:11:05 +08:00
limit = {
2024-09-23 10:24:32 +08:00
RG_gray_army_active_trigger = yes
2023-06-08 13:11:05 +08:00
}
2023-06-03 17:46:32 +08:00
if = {
limit = {
any_owned_army = {
army_type = gray_army
exists = planet
}
}
random_owned_army = {
2023-06-08 13:11:05 +08:00
limit = {
army_type = gray_army
}
planet = {
save_global_event_target_as = global_gray_location
}
2023-06-03 17:46:32 +08:00
}
}
else = {
random_owned_army = {
2023-06-08 13:11:05 +08:00
limit = {
army_type = gray_army
}
fleet = {
save_global_event_target_as = global_gray_location
}
2023-06-03 17:46:32 +08:00
}
}
}
2024-08-31 10:31:22 +08:00
else_if = {
limit = {
2024-09-23 10:24:32 +08:00
RG_gray_harbitat_active_trigger = yes
2024-08-31 10:31:22 +08:00
}
if = {
limit = {exists = event_target:rg_gray_habitat_target}
event_target:rg_gray_habitat_target = {
save_global_event_target_as = global_gray_location
}
}
}
2023-06-03 17:46:32 +08:00
else = {
2023-06-08 13:11:05 +08:00
capital_scope = {
save_global_event_target_as = global_gray_location
}
2023-06-03 17:46:32 +08:00
}
}
2023-06-08 13:11:05 +08:00
2024-09-23 10:24:21 +08:00
#Country event_target:gray_owner
#存储当前领袖等级
rg_save_gray_leader_level_effect = {
every_owned_leader = {
if = {
###等级检测
limit = {
has_leader_flag = rg_gray_leader
NOT = {
has_leader_flag = rg_gray_leader_temp
}
}
#导出等级到暂存
export_trigger_value_to_variable = {
trigger = has_skill
variable = rg_gray_level_temp
}
#导入变量
owner = {
set_variable = {
which = rg_gray_level
value = prev.rg_gray_level_temp
}
}
#清理暂存区
clear_variable = rg_gray_level_temp
}
}
}
#Country event_target:gray_owner
#把所有种类的小灰领袖都送回娘家
rg_sent_gray_back_to_home_effect = {
every_owned_leader = {
limit = {
has_leader_flag = rg_gray_leader
}
set_owner = event_target:rg_gray_country
set_leader_flag = rg_gray_leader_temp
# kill_leader = { show_notification = no }
}
}
2024-09-23 10:24:32 +08:00
#Country event_target:gray_owner
#小灰领袖标识清理
rg_clear_gray_active_flag_effect = {
remove_country_flag = gray_warship_active
remove_country_flag = gray_constship_active
remove_country_flag = gray_army_active
remove_country_flag = gray_official_active
remove_country_flag = gray_governor_active #旧版flag
}
#Country event_target:gray_owner
#小灰总督启用标识
rg_set_gray_official_active_effect = {
set_country_flag = gray_official_active #新版flag
set_country_flag = gray_governor_active #旧版flag
}
#Country event_target:gray_owner
#小灰战舰启用标识
rg_set_gray_warship_active_effect = {
set_country_flag = gray_warship_active
}
#Country event_target:gray_owner
#小灰科学家启用标识
rg_set_gray_scientist_active_effect = {
set_country_flag = gray_official_active #新版flag
set_country_flag = gray_governor_active #旧版flag
}
#Country event_target:gray_owner
#小灰陆军启用标识
rg_set_gray_army_active_effect = {
set_country_flag = gray_army_active
}
#Country event_target:gray_owner
#小灰科学家启用标识
rg_set_gray_scientist_active_effect = {
set_country_flag = gray_constship_active
}
#Country event_target:gray_owner
#小灰纳米空间站启用标识
rg_set_gray_harbitat_active_effect = {
set_country_flag = rg_habitat_enabled
}
#Country event_target:gray_owner
#删除小灰科学家
rg_clear_gray_science_ship_effect = {
every_owned_fleet = {
limit = {
has_fleet_flag = gray_constship
}
delete_fleet = {
target = this
kill_leader = no
destroy_template = yes
}
}
}
#Country event_target:gray_owner
#删除小灰陆军
rg_clear_gray_army_effect = {
every_owned_army = {
limit = {
army_type = gray_army
}
if = {
limit = {
exists = leader
}
unassign_leader = leader
}
remove_army = yes
}
}
#Country event_target:gray_owner
#删除小灰战舰
rg_clear_gray_warship_effect = {
every_owned_fleet = {
limit = {
has_fleet_flag = gray_fleet
}
delete_fleet = {
target = this
kill_leader = no
destroy_template = yes
}
}
}
#Country event_target:gray_owner
#删除小灰纳米空间站
rg_clear_harbitat = {
remove_country_flag = rg_habitat_enabled
event_target:rg_gray_habitat_target = {
remove_planet = yes
}
}
#Country event_target:gray_owner
#等级导入,把存储的领袖等级赋予到领袖身上
rg_set_varible_as_leader_level_effect = {
random_owned_leader = {
limit = {
has_leader_flag = rg_gray_leader
}
set_skill = owner.rg_gray_level
}
}
#Country event_target:gray_owner
#创造灰风总督
2024-08-31 10:31:22 +08:00
rg_create_gray_governor = {
2023-06-08 13:11:05 +08:00
if = {
limit = {
2024-09-23 10:24:32 +08:00
RG_gray_official_active_trigger = yes
2023-06-08 13:11:05 +08:00
}
}
2023-06-06 11:03:08 +08:00
else = {
#延迟执行
optimize_memory
#删除战舰
every_owned_fleet = {
2023-06-08 13:11:05 +08:00
limit = {
has_fleet_flag = gray_fleet
}
2023-06-06 11:03:08 +08:00
delete_fleet = {
target = this
kill_leader = no
destroy_template = yes
}
}
#删除科学舰
every_owned_fleet = {
2023-06-08 13:11:05 +08:00
limit = {
has_fleet_flag = gray_constship
}
2023-06-06 11:03:08 +08:00
delete_fleet = {
target = this
kill_leader = no
destroy_template = yes
}
}
#删除陆军
every_owned_army = {
2023-06-08 13:11:05 +08:00
limit = {
army_type = gray_army
}
2023-06-06 11:03:08 +08:00
if = {
2023-06-08 13:11:05 +08:00
limit = {
exists = leader
}
2023-06-06 11:03:08 +08:00
unassign_leader = leader
}
remove_army = yes
}
2023-06-08 13:11:05 +08:00
2023-06-24 15:07:12 +08:00
#存储当前领袖等级
2024-09-23 10:24:21 +08:00
rg_save_gray_leader_level_effect = yes
2023-06-24 15:07:12 +08:00
#把所有种类的小灰领袖都送回娘家
2024-09-23 10:24:32 +08:00
rg_sent_gray_back_to_home_effect = yes
2023-06-24 15:07:12 +08:00
#把娘家的总督领袖接回来
if = {
limit = {
exists = event_target:gray_governor
}
event_target:gray_governor = {
set_owner = event_target:gray_owner
remove_leader_flag = rg_gray_leader_temp
}
}
#如果不存在总督备份,现场变一个
else = {
rg_gray_govener_init = yes
}
#更新灰风形态
2024-09-23 10:24:32 +08:00
rg_clear_gray_active_flag_effect = yes
#设置总督已启用标识
rg_set_gray_official_active_effect = yes
2024-09-17 02:27:18 +08:00
2023-06-24 15:07:12 +08:00
#等级导入,把存储的领袖等级赋予到领袖身上
2024-09-23 10:24:32 +08:00
rg_set_varible_as_leader_level_effect = yes
2023-06-24 15:07:12 +08:00
}
}
2024-09-23 10:24:32 +08:00
#Country event_target:gray_owner
#创造灰风战舰
rg_create_gray_warship = {
2023-06-08 13:11:05 +08:00
if = {
limit = {
2024-09-23 10:24:32 +08:00
RG_gray_warship_active_trigger = yes
2023-06-08 13:11:05 +08:00
}
}
2023-06-06 11:03:08 +08:00
else = {
optimize_memory
#舰船刷新位置检测
rg_global_gray_location_check = yes
2024-09-23 10:24:32 +08:00
#存储当前领袖等级
2024-09-23 10:24:21 +08:00
rg_save_gray_leader_level_effect = yes
2024-09-23 10:24:32 +08:00
#把所有种类的小灰领袖都送回娘家
rg_sent_gray_back_to_home_effect = yes
#把娘家的指挥官领袖接回来
2023-06-06 11:03:08 +08:00
if = {
2023-06-08 13:11:05 +08:00
limit = {
2023-06-06 11:03:08 +08:00
exists = event_target:gray_leader_admiral
}
2023-06-08 13:11:05 +08:00
event_target:gray_leader_admiral = {
set_owner = event_target:gray_owner
2023-06-06 11:03:08 +08:00
remove_leader_flag = rg_gray_leader_temp
}
}
2023-06-06 11:03:08 +08:00
else = {
2023-11-17 03:46:51 +08:00
rg_gray_commander_init = yes
}
2024-09-23 10:24:32 +08:00
2023-06-06 11:03:08 +08:00
if = {
limit = {
has_country_flag = rg_gray_level_2
}
2023-06-11 12:36:05 +08:00
rg_warship_init_mod1 = yes
2023-06-06 11:03:08 +08:00
}
else_if = {
limit = {
has_country_flag = rg_gray_level_3
NOT = {
has_country_flag = gray_warship_is_juggernaut
}
}
2023-06-11 12:36:05 +08:00
rg_warship_init_mod2 = yes
}
2023-06-06 11:03:08 +08:00
else_if = {
limit = {
has_country_flag = gray_warship_is_juggernaut
}
2023-06-11 12:36:05 +08:00
rg_warship_init_mod3 = yes
2023-06-06 11:03:08 +08:00
}
else = {
2023-06-11 12:36:05 +08:00
rg_warship_init_mod0 = yes
2023-06-06 11:03:08 +08:00
}
2024-09-23 10:24:32 +08:00
#删除科学舰
rg_clear_gray_science_ship_effect = yes
#删除陆军
rg_clear_gray_army_effect = yes
#更新灰风形态
rg_clear_gray_active_flag_effect = yes
#设置战舰已启用标识
rg_set_gray_warship_active_effect = yes
#导入变量到等级
rg_set_varible_as_leader_level_effect = yes
2023-06-06 11:03:08 +08:00
}
}
2023-06-08 13:11:05 +08:00
2024-09-23 10:24:32 +08:00
#Country event_target:gray_owner
2023-06-06 11:03:08 +08:00
#创造灰风地面单位
rg_create_gray_army = {
2023-06-08 13:11:05 +08:00
if = {
limit = {
2024-09-23 10:24:32 +08:00
RG_gray_army_active_trigger = yes
2023-06-08 13:11:05 +08:00
}
}
2023-06-06 11:03:08 +08:00
else = {
optimize_memory
#舰船刷新位置检测
rg_global_gray_location_check = yes
2024-09-23 10:24:32 +08:00
#存储当前领袖等级
2024-09-23 10:24:21 +08:00
rg_save_gray_leader_level_effect = yes
2024-09-23 10:24:32 +08:00
#把所有种类的小灰领袖都送回娘家
rg_sent_gray_back_to_home_effect = yes
#把娘家的指挥官领袖接回来
2023-06-06 11:03:08 +08:00
if = {
2023-06-08 13:11:05 +08:00
limit = {
2023-06-06 11:03:08 +08:00
exists = event_target:gray_leader_general
}
2023-06-08 13:11:05 +08:00
event_target:gray_leader_general = {
set_owner = event_target:gray_owner
2023-06-06 11:03:08 +08:00
remove_leader_flag = rg_gray_leader_temp
}
}
else = {
2023-11-17 03:46:51 +08:00
rg_gray_commander_init = yes
2023-06-06 11:03:08 +08:00
}
2024-09-23 10:24:32 +08:00
rg_army_transport_ship_init = yes
rg_clear_gray_warship_effect = yes
rg_clear_gray_science_ship_effect = yes
rg_clear_gray_active_flag_effect = yes
rg_set_gray_army_active_effect = yes
rg_set_varible_as_leader_level_effect = yes
}
2023-06-06 11:03:08 +08:00
}
2023-06-08 13:11:05 +08:00
2024-09-23 10:24:32 +08:00
#Country event_target:gray_owner
2023-06-06 11:03:08 +08:00
#创造灰风科学舰
rg_create_gray_const = {
2023-06-08 13:11:05 +08:00
if = {
limit = {
2024-09-23 10:24:32 +08:00
RG_gray_scientist_active_trigger = yes
2023-06-08 13:11:05 +08:00
}
}
else = {
2023-06-06 11:03:08 +08:00
optimize_memory
#舰船刷新位置检测
rg_global_gray_location_check = yes
2024-09-23 10:24:32 +08:00
#存储当前领袖等级
2024-09-23 10:24:21 +08:00
rg_save_gray_leader_level_effect = yes
2024-09-23 10:24:32 +08:00
#把所有种类的小灰领袖都送回娘家
rg_sent_gray_back_to_home_effect = yes
#把娘家的科学家领袖接回来
2023-06-06 11:03:08 +08:00
if = {
2023-06-08 13:11:05 +08:00
limit = {
2023-06-06 11:03:08 +08:00
exists = event_target:gray_leader_scientist
}
2023-06-08 13:11:05 +08:00
event_target:gray_leader_scientist = {
set_owner = event_target:gray_owner
2023-06-06 11:03:08 +08:00
remove_leader_flag = rg_gray_leader_temp
}
}
else = {
rg_gray_scientist_init = yes
}
2024-08-31 10:31:22 +08:00
2024-09-23 10:24:32 +08:00
rg_scientist_ship_init = yes
rg_clear_gray_warship_effect = yes
rg_clear_gray_army_effect = yes
rg_clear_gray_active_flag_effect = yes
rg_set_gray_scientist_active_effect = yes
rg_set_varible_as_leader_level_effect = yes
}
2024-08-31 10:31:22 +08:00
}
2024-09-23 10:24:32 +08:00
#Country event_target:gray_owner
#计算纳米空间站行星规模 基本10+小灰领袖等级rg_gray_level*2
2024-09-18 17:16:32 +08:00
rg_harbitar_size_calculate = {
set_variable = {
which = rg_habitat_size
value = 10
}
set_variable = {
which = rg_habitat_size_temp
value = rg_gray_level
}
multiply_variable = {
which = rg_habitat_size_temp
value = 2
}
change_variable = {
which = rg_habitat_size_temp
value = 10
}
set_variable = {
which = rg_habitat_size
value = rg_habitat_size_temp
}
}
2024-08-31 10:31:22 +08:00
2024-09-23 10:24:32 +08:00
#Country event_target:gray_owner
#创造灰风纳米空间站
2024-08-31 10:31:22 +08:00
rg_juggernaut_habitat_init = {
if = {
limit = {
2024-09-23 10:24:32 +08:00
RG_gray_harbitat_active_trigger = yes
2024-08-31 10:31:22 +08:00
}
}
else = {
optimize_memory
rg_global_gray_location_check = yes
2024-09-18 17:16:32 +08:00
rg_harbitar_size_calculate = yes
2024-08-31 10:31:22 +08:00
event_target:global_gray_location = {
solar_system = {
spawn_planet = {
class = pc_rg_grayhabitat
location = event_target:global_gray_location
orbit_location = yes
orbit_angle = 225
orbit_distance = 360
orbit_angle_offset = 45
orbit_distance_offset = 9.899
2024-09-18 17:16:32 +08:00
size = 10
2024-08-31 10:31:22 +08:00
has_ring = no
init_effect = {
2024-09-18 17:16:32 +08:00
prevent_anomaly = yes
2024-08-31 10:31:22 +08:00
set_planet_entity = {
entity = "grey_tempesttw_orbital_habitat_entity"
}
set_surveyed = {
surveyed = yes
surveyor = FROM
}
set_all_comms_surveyed = yes
clear_blockers = yes
set_owner = root
set_controller = root
create_colony = {
owner = root
species = owner_main_species
ethos = owner
}
2024-09-17 02:27:18 +08:00
if = {
limit = {
NOT = {
exists = event_target:rg_owner_main_maid_species
}
}
every_owned_pop = {
rg_event_effect_planet2027_spawn_maid_species = yes
2024-09-17 02:27:18 +08:00
}
}
2024-08-31 10:31:22 +08:00
set_name = "NAME_rg_gray_habitat_base"
if = {
2024-09-17 13:32:31 +08:00
limit = {
event_target:gray_owner = {
OR = {
has_country_flag = gray_official_active
has_country_flag = gray_governor_active #旧版flag
}
}
2024-08-31 10:31:22 +08:00
}
assign_leader = event_target:gray_governor
}
2024-09-18 17:16:32 +08:00
set_planet_size = owner.rg_habitat_size
2024-08-31 10:31:22 +08:00
2024-09-17 05:18:40 +08:00
generate_start_buildings_and_districts = yes
2024-09-18 17:16:32 +08:00
while = {
count = 1
add_district = district_rg_generator
}
while = {
count = 1
add_district = district_rg_mining
}
while = {
count = 1
add_district = district_rg_farming
}
while = {
count = 1
add_district = district_rg_industrial
}
if = {
limit = {
exists = owner
owner = { is_hive_empire = yes }
}
while = {
count = 1
add_district = district_rg_hive
}
}
if = {
limit = {
exists = owner
owner = { is_regular_empire = yes }
}
while = {
count = 1
add_district = district_rg_city
}
}
if = {
limit = {
exists = owner
from = { is_machine_empire = yes }
}
while = {
count = 1
add_district = district_rg_nexus
}
}
2024-08-31 10:31:22 +08:00
while = {
count = 5
create_pop = {
species = owner_main_species
}
}
2024-09-18 17:16:32 +08:00
2024-08-31 10:31:22 +08:00
set_planet_flag = megastructure
set_planet_flag = habitat
set_planet_flag = advanced_habitat
set_planet_flag = advanced_habitat_2
set_planet_flag = rg_gray_habitat
save_global_event_target_as = rg_gray_habitat_target
}
}
}
}
2024-09-23 10:24:32 +08:00
rg_set_gray_harbitat_active_effect = yes
2024-08-31 10:31:22 +08:00
}
}
2024-09-23 10:24:32 +08:00
2024-09-18 17:16:32 +08:00