彻底混乱的天机工程

This commit is contained in:
FA507RM-KALOSPA\Kalo 2023-05-29 21:23:34 +08:00
parent 2ead818343
commit 69f2d6d2b4
4 changed files with 91 additions and 931 deletions

View File

@ -1,794 +0,0 @@
rg_create_gray_const = {
optimize_memory
if = {
limit = { has_country_flag = gray_warship_active }
if = {
limit = { exists = event_target:gray_warship }
event_target:gray_warship = {
save_event_target_as = gray_constship_location
}
} else = {
random_controlled_fleet = {
limit = { has_fleet_flag = gray_fleet }
save_event_target_as = gray_constship_location
}
}
}
else_if = {
limit = { has_country_flag = gray_juggernaut_active }
if = {
limit = { exists = event_target:gray_juggernaut }
event_target:gray_juggernaut = {
save_event_target_as = gray_constship_location
}
} else = {
random_controlled_fleet = {
limit = { has_fleet_flag = gray_juggernaut_fleet }
save_event_target_as = gray_constship_location
}
}
}
else_if = {
limit = { has_country_flag = gray_army_active }
if = {
limit = {
any_owned_army = {
army_type = gray_army
exists = planet
}
}
random_owned_army = {
limit = { army_type = gray_army }
planet = { save_event_target_as = gray_constship_location }
}
}
else = {
random_owned_army = {
limit = { army_type = gray_army }
fleet = { save_event_target_as = gray_constship_location }
}
}
}
else_if = {
limit = { has_country_flag = gray_governor_active }
if = {
limit = { any_owned_planet = {
exists = sector.leader
sector.leader = { has_leader_flag = gray_governor }
}
}
random_owned_planet = {
limit = {
exists = sector.leader
sector.leader = { has_leader_flag = gray_governor }
}
save_event_target_as = gray_constship_location
}
}
else = {
capital_scope = { save_event_target_as = gray_constship_location }
}
}
else = {
capital_scope = { save_event_target_as = gray_constship_location }
}
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
}
}
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 }
}
if = {
limit = {
exists = event_target:gray_leader_scientist
}
event_target:gray_leader_scientist = {
set_owner = event_target:gray_owner
remove_leader_flag = rg_gray_leader_temp
}
}
else = {
create_leader = {
class = scientist
species = event_target:gray_species
name = "NAME_Gray"
immortal = yes
event_leader = yes
gender = female
skill = 10
set_age = 18
traits = {
trait = RG_leader_trait_scientist_gray
trait = leader_trait_carefree
}
effect = {
save_global_event_target_as = gray_leader_scientist
set_leader_flag = rg_gray_leader
set_leader_flag = gray_scientist
change_leader_portrait = Gray
}
}
}
set_country_flag = gray_constship_active
create_fleet = {
name = "NAME_Gray"
settings = {
can_upgrade = no
can_disband = no
can_change_composition = no
can_change_leader = yes
uses_naval_capacity = no
spawn_debris = no
}
effect = {
set_owner = prev
create_ship = {
name = "NAME_Gray"
design = "NAME_RG_GRAY_scienceship"
prefix = no
upgradable = yes
}
set_fleet_stance = evasive
set_location = {
target = event_target:gray_constship_location
distance = 0
angle = random
}
set_fleet_flag = gray_constship
save_global_event_target_as = global_gray_constship
set_cloaking_active = yes
assign_leader = event_target:gray_leader_scientist
}
}
every_owned_fleet = {
limit = { has_fleet_flag = gray_fleet }
delete_fleet = {
target = this
kill_leader = no
destroy_template = yes
}
}
every_owned_army = {
limit = { army_type = gray_army }
if = {
limit = { exists = leader }
unassign_leader = leader
}
remove_army = yes
}
remove_country_flag = gray_army_active
remove_country_flag = gray_warship_active
remove_country_flag = gray_governor_active
random_owned_leader = {
limit = { has_leader_flag = gray_scientist }
set_skill = owner.rg_gray_level
}
}
rg_create_gray_army = {
optimize_memory
if = {
limit = { has_country_flag = gray_constship_active }
if = {
limit = { exists = event_target:global_gray_constship }
event_target:global_gray_constship = {
save_event_target_as = gray_transport_location
}
} else = {
random_owned_fleet = {
limit = { has_fleet_flag = gray_constship }
save_event_target_as = gray_transport_location
}
}
}
else_if = {
limit = { has_country_flag = gray_warship_active }
if = {
limit = { exists = event_target:gray_warship }
event_target:gray_warship = {
save_event_target_as = gray_transport_location
}
} else = {
random_owned_fleet = {
limit = { has_fleet_flag = gray_fleet }
save_event_target_as = gray_transport_location
}
}
}
else_if = {
limit = { has_country_flag = gray_juggernaut_active }
if = {
limit = { exists = event_target:gray_juggernaut }
event_target:gray_juggernaut = {
save_event_target_as = gray_transport_location
}
} else = {
random_controlled_fleet = {
limit = { has_fleet_flag = gray_juggernaut_fleet }
save_event_target_as = gray_transport_location
}
}
}
else_if = {
limit = { has_country_flag = gray_governor_active }
if = {
limit = { any_owned_planet = {
exists = sector.leader
sector.leader = { has_leader_flag = gray_governor }
}
}
random_owned_planet = {
limit = {
exists = sector.leader
sector.leader = { has_leader_flag = gray_governor }
}
save_event_target_as = gray_transport_location
}
}
else = {
capital_scope = { save_event_target_as = gray_warship_location }
}
}
else = {
capital_scope = { save_event_target_as = gray_transport_location }
}
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
}
}
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 }
}
if = {
limit = {
exists = event_target:gray_leader_general
}
event_target:gray_leader_general = {
set_owner = event_target:gray_owner
remove_leader_flag = rg_gray_leader_temp
}
}
else = {
create_leader = {
class = general
species = event_target:gray_species
name = "NAME_Gray"
immortal = yes
event_leader = yes
gender = female
skill = 10
set_age = 18
traits = {
trait = RG_leader_trait_general_gray
trait = leader_trait_army_logistician
}
effect = {
save_global_event_target_as = gray_leader_general
set_leader_flag = rg_gray_leader
set_leader_flag = gray_general
change_leader_portrait = Gray
}
}
}
create_ship_design = {
design = "NAME_RG_armed_transport_ship"
}
add_ship_design = last_created_design
set_country_flag = gray_army_active
create_fleet = {
name = "NAME_Gray"
effect = {
set_owner = prev
create_army_transport = {
ship_name = "NAME_Gray"
army_name = "NAME_Gray"
army_type = "gray_army"
}
set_location = {
target = event_target:gray_transport_location
distance = 0
angle = random
}
# set_cloaking_active = yes
set_fleet_stance = aggressive
}
}
last_created_army = {
assign_leader = event_target:gray_leader_general
}
every_owned_fleet = {
limit = { has_fleet_flag = gray_fleet }
delete_fleet = {
target = this
kill_leader = no
destroy_template = yes
}
}
every_owned_fleet = {
limit = { has_fleet_flag = gray_constship }
delete_fleet = {
target = this
kill_leader = no
destroy_template = yes
}
}
remove_country_flag = gray_warship_active
remove_country_flag = gray_governor_active
remove_country_flag = gray_constship_active
remove_ship_design = last_created_design
random_owned_leader = {
limit = { has_leader_flag = gray_general }
set_skill = owner.rg_gray_level
}
}
rg_create_gray_governor = {
optimize_memory
every_owned_leader = {
limit = { has_leader_flag = rg_gray_leader }
kill_leader = { show_notification = no }
}
every_owned_fleet = {
limit = { has_fleet_flag = gray_fleet }
delete_fleet = {
target = this
kill_leader = no
destroy_template = yes
}
}
every_owned_fleet = {
limit = { has_fleet_flag = gray_constship }
delete_fleet = {
target = this
kill_leader = no
destroy_template = yes
}
}
every_owned_army = {
limit = { army_type = gray_army }
if = {
limit = { exists = leader }
unassign_leader = leader
}
remove_army = yes
}
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
}
}
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 }
}
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 = {
create_leader = {
class = governor
species = event_target:gray_species
name = "NAME_Gray"
gender = female
immortal = yes
event_leader = yes
skill = 10
set_age = 18
traits = {
trait = RG_leader_trait_governor_gray
trait = leader_trait_retired_fleet_officer
}
effect = {
save_global_event_target_as = gray_governor
set_leader_flag = rg_gray_leader
set_leader_flag = gray_governor
}
}
}
set_country_flag = gray_governor_active
remove_country_flag = gray_warship_active
remove_country_flag = gray_constship_active
remove_country_flag = gray_army_active
random_owned_leader = {
limit = { has_leader_flag = gray_governor }
set_skill = owner.rg_gray_level
}
}
rg_create_gray_warship = {
optimize_memory
if = {
limit = { has_country_flag = gray_constship_active }
if = {
limit = { exists = event_target:global_gray_constship }
event_target:global_gray_constship = {
save_event_target_as = gray_warship_location
}
} else = {
random_controlled_fleet = {
limit = { has_fleet_flag = gray_constship }
save_event_target_as = gray_warship_location
}
}
}
else_if = {
limit = { has_country_flag = gray_juggernaut_active }
if = {
limit = { exists = event_target:gray_juggernaut }
event_target:gray_juggernaut = {
save_event_target_as = gray_warship_location
}
} else = {
random_controlled_fleet = {
limit = { has_fleet_flag = gray_juggernaut_fleet }
save_event_target_as = gray_warship_location
}
}
}
else_if = {
limit = { has_country_flag = gray_army_active }
if = {
limit = {
any_owned_army = {
army_type = gray_army
exists = planet
}
}
random_owned_army = {
limit = { army_type = gray_army }
planet = { save_event_target_as = gray_warship_location }
}
}
else = {
random_owned_army = {
limit = { army_type = gray_army }
fleet = { save_event_target_as = gray_warship_location }
}
}
}
else_if = {
limit = { has_country_flag = gray_governor_active }
if = {
limit = { any_owned_planet = {
exists = sector.leader
sector.leader = { has_leader_flag = gray_governor }
}
}
random_owned_planet = {
limit = {
exists = sector.leader
sector.leader = { has_leader_flag = gray_governor }
}
save_event_target_as = gray_warship_location
}
}
else = {
capital_scope = { save_event_target_as = gray_warship_location }
}
}
else = {
capital_scope = { save_event_target_as = gray_warship_location }
}
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
}
}
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 }
}
if = {
limit = {
exists = event_target:gray_leader_admiral
}
event_target:gray_leader_admiral = {
set_owner = event_target:gray_owner
remove_leader_flag = rg_gray_leader_temp
}
}
else = {
create_leader = {
class = admiral
species = event_target:gray_species
name = "NAME_Gray"
immortal = yes
event_leader = yes
gender = female
skill = 10
set_age = 18
traits = {
trait = RG_leader_trait_admiral_gray
trait = leader_trait_gale_speed
}
effect = {
save_global_event_target_as = gray_leader_admiral
set_leader_flag = rg_gray_leader
set_leader_flag = gray_admiral
}
}
}
set_country_flag = gray_warship_active
if = {
limit = {
has_country_flag = rg_gray_level_2
}
create_fleet = {
name = "NAME_Gray"
settings = {
can_upgrade = no
can_disband = no
can_change_composition = no
can_change_leader = yes
uses_naval_capacity = no
spawn_debris = no
}
effect = {
set_owner = prev
create_ship = {
name = "NAME_Gray"
design = "NAME_Gray_Warship"
prefix = no
upgradable = yes
}
set_fleet_stance = aggressive
set_location = {
target = event_target:gray_warship_location
distance = 0
angle = random
}
set_fleet_flag = gray_fleet
save_global_event_target_as = gray_warship
assign_leader = event_target:gray_leader_admiral
}
}
}
else_if = {
limit = {
has_country_flag = rg_gray_level_3
NOT = {
has_country_flag = gray_warship_is_juggernaut
}
}
create_fleet = {
name = "NAME_Gray"
settings = {
can_upgrade = no
can_disband = no
can_change_composition = no
can_change_leader = yes
uses_naval_capacity = no
spawn_debris = no
}
effect = {
set_owner = prev
create_ship = {
name = "NAME_Gray"
design = "NAME_gray_capitalship"
prefix = no
upgradable = yes
}
set_fleet_stance = aggressive
set_location = {
target = event_target:gray_warship_location
distance = 0
angle = random
}
set_fleet_flag = gray_fleet
save_global_event_target_as = gray_warship
assign_leader = event_target:gray_leader_admiral
}
}
}
else_if = {
limit = {
has_country_flag = gray_warship_is_juggernaut
}
create_fleet = {
name = "NAME_Gray"
settings = {
can_upgrade = no
can_disband = no
can_change_composition = no
can_change_leader = yes
uses_naval_capacity = no
spawn_debris = no
}
effect = {
set_owner = prev
create_ship = {
name = "NAME_Gray"
design = "NAME_gray_juggernautship"
prefix = no
upgradable = yes
}
set_fleet_stance = aggressive
set_location = {
target = root.capital_scope
distance = 0
angle = random
}
set_fleet_flag = gray_fleet
save_global_event_target_as = gray_warship
}
}
}
else = {
create_fleet = {
name = "NAME_Gray"
settings = {
can_upgrade = no
can_disband = no
can_change_composition = no
can_change_leader = yes
uses_naval_capacity = no
spawn_debris = no
}
effect = {
set_owner = prev
create_ship = {
name = "NAME_Gray"
design = "NAME_Gray_Warship_base"
prefix = no
upgradable = yes
}
set_fleet_stance = aggressive
set_location = {
target = event_target:gray_warship_location
distance = 0
angle = random
}
set_fleet_flag = gray_fleet
save_global_event_target_as = gray_warship
assign_leader = event_target:gray_leader_admiral
}
}
}
every_owned_army = {
limit = { army_type = gray_army }
if = {
limit = { exists = leader }
unassign_leader = leader
}
remove_army = yes
}
every_owned_fleet = {
limit = { has_fleet_flag = gray_constship }
delete_fleet = {
target = this
kill_leader = no
destroy_template = yes
}
}
remove_country_flag = gray_constship_active
remove_country_flag = gray_governor_active
remove_country_flag = gray_army_active
random_owned_leader = {
limit = { has_leader_flag = gray_admiral }
set_skill = owner.rg_gray_level
}
}

View File

@ -1971,3 +1971,70 @@ rg_create_graygoo_fleet_random = {
}
}
}
rg_gray_country_after_init = {
# 送灰风母舰初始科技
give_technology = {
tech = tech_object_gray_5
message = no
}
save_global_event_target_as = gray_owner
set_country_flag = gray_owner
#初始化好感度和衣柜
set_variable = { which = gray_affection value = 1 }
set_variable = { which = gray_affection_level value = 1 }
set_variable = { which = wg_gray_cloth value = 6 }
# 否则事件会自动移除好感度特质(回娘家时保留特质)
set_country_flag = can_have_wg_affection_country_flag
# 默认关闭自动建造中继器
# set_country_flag = rg_can_const_hyper_relay
# 初始化小灰领袖等级
if = {
limit = {
OR = {
has_country_flag = origin_rg_gray #遥远约定
has_country_flag = origin_gray_country #远星之歌
}
}
set_variable = { which = rg_gray_level value = 1 }
} else = {
set_variable = { which = rg_gray_level value = 10 }
}
rg_storyline_trigger = yes
event_target:rg_gray_country = {
establish_communications_no_message = root
}
}
rg_gray_country_init = {
create_country = {
name = "NAME_Gray"
type = gray
flag = {
icon= {
category = "special"
file = "gray_goo.dds"
}
background= {
category = "backgrounds"
file = "sinus.dds"
}
colors={
"grey"
"dark_grey"
"null"
"null"
}
}
effect = {
rg_create_gray_species = yes
# 灰风国家用于领袖切换时暂存领袖
set_country_flag = can_have_wg_affection_country_flag
}
}
last_created_country = {
# establish_communications_no_message = root
save_global_event_target_as = rg_gray_country
}
}

View File

@ -208,10 +208,17 @@ country_event = {
is_triggered_only = yes
immediate = {
rg_gray_country_init = yes #创建国家
rg_gray_govener_init = yes
event_target:gray_governor = {
set_owner = event_target:rg_gray_country
}
}
option = {
name = graygoo.405.a
hidden_effect = {
rg_gray_govener_init = yes
owner = {
country_event = { id = graygoo.406 }
}
@ -271,6 +278,17 @@ country_event = {
default_hide_option = yes
tag = hire_leader
hidden_effect = {
create_message = {
type = MESSAGE_RECRUITED_LEADER
localization = MESSAGE_RECRUITED_LEADER_DESC
days = @toast_message_days
target = event_target:gray_governor
variable = {
type = name
localization = LEADER
scope = event_target:gray_governor
}
}
country_event = { id = graygoo.499 }
}
}
@ -289,64 +307,13 @@ country_event = {
}
immediate = {
create_country = {
name = "NAME_Gray"
type = gray
flag = {
icon= {
category = "special"
file = "gray_goo.dds"
}
background= {
category = "backgrounds"
file = "sinus.dds"
}
colors={
"grey"
"dark_grey"
"null"
"null"
}
}
effect = {
rg_create_gray_species = yes
# 灰风国家用于领袖切换时暂存领袖
set_country_flag = can_have_wg_affection_country_flag
}
}
last_created_country = {
rg_gray_country_after_init = yes
event_target:rg_gray_country = {
establish_communications_no_message = root
save_global_event_target_as = rg_gray_country
}
# 送灰风母舰初始科技
give_technology = {
tech = tech_object_gray_5
message = no
event_target:gray_governor = {
set_owner = root
}
save_global_event_target_as = gray_owner
set_country_flag = gray_owner
#初始化好感度和衣柜
set_variable = { which = gray_affection value = 1 }
set_variable = { which = gray_affection_level value = 1 }
set_variable = { which = wg_gray_cloth value = 6 }
# 否则事件会自动移除好感度特质(回娘家时保留特质)
set_country_flag = can_have_wg_affection_country_flag
# 默认关闭自动建造中继器
# set_country_flag = rg_can_const_hyper_relay
# 初始化小灰领袖等级
if = {
limit = {
OR = {
has_country_flag = origin_rg_gray #遥远约定
has_country_flag = origin_gray_country #远星之歌
}
}
set_variable = { which = rg_gray_level value = 1 }
} else = {
set_variable = { which = rg_gray_level value = 10 }
}
rg_storyline_trigger = yes
}
}
@ -377,22 +344,6 @@ country_event = {
}
immediate = {
if = { # 检查是否存在任何形式的小灰
limit = {
any_owned_leader = {
NOR = {
has_leader_flag = rg_gray_leader
OR = {
has_leader_flag = gray_governor
has_leader_flag = gray_admiral
has_leader_flag = gray_general
has_leader_flag = gray_scientist
}
}
}
}
rg_gray_govener_init = yes #创建一个衣架子
}
country_event = { id = rg_grayleader.500 } #放行。
}
}
@ -422,22 +373,6 @@ country_event = {
}
immediate = {
if = { # 检查是否存在任何形式的小灰
limit = {
any_owned_leader = {
NOR = {
has_leader_flag = rg_gray_leader
OR = {
has_leader_flag = gray_governor
has_leader_flag = gray_admiral
has_leader_flag = gray_general
has_leader_flag = gray_scientist
}
}
}
}
rg_gray_govener_init = yes #创建一个衣架子
}
country_event = { id = rg_grayleader.501 } #放行。
}
}
@ -469,22 +404,6 @@ country_event = {
}
immediate = {
if = { # 检查是否存在任何形式的小灰
limit = {
any_owned_leader = {
NOR = {
has_leader_flag = rg_gray_leader
OR = {
has_leader_flag = gray_governor
has_leader_flag = gray_admiral
has_leader_flag = gray_general
has_leader_flag = gray_scientist
}
}
}
}
rg_gray_admiral_init = yes #创建一个衣架子
}
country_event = { id = rg_grayleader.502 } #放行。
}
}
@ -524,22 +443,6 @@ country_event = {
}
immediate = {
if = { # 检查是否存在任何形式的小灰
limit = {
any_owned_leader = {
NOR = {
has_leader_flag = rg_gray_leader
OR = {
has_leader_flag = gray_governor
has_leader_flag = gray_admiral
has_leader_flag = gray_general
has_leader_flag = gray_scientist
}
}
}
}
rg_gray_general_init = yes #创建一个衣架子
}
country_event = { id = rg_grayleader.503 } #放行。
}
}
@ -615,22 +518,6 @@ country_event = {
}
immediate = {
if = { # 检查是否存在任何形式的小灰
limit = {
any_owned_leader = {
NOR = {
has_leader_flag = rg_gray_leader
OR = {
has_leader_flag = gray_governor
has_leader_flag = gray_admiral
has_leader_flag = gray_general
has_leader_flag = gray_scientist
}
}
}
}
rg_gray_scientist_init = yes #创建一个衣架子
}
country_event = { id = rg_grayleader.505 } #放行。
}
}

View File

@ -46,7 +46,7 @@ country_event = {
type = MESSAGE_RECRUITED_LEADER
localization = "rg.2.desc"
days = @toast_message_days
target = root
target = event_target:gray_governor
variable = {
type = name
localization = LEADER