位置判断重置

This commit is contained in:
FA507RM-KALOSPA\Kalo 2023-06-03 17:46:32 +08:00
parent 0fd08e942e
commit 9203ccb874
7 changed files with 189 additions and 236 deletions

View File

@ -1,5 +1,92 @@
#灰风
#灰风舰船刷新位置检测
rg_global_gray_location_check = {
if = {
limit = { has_country_flag = gray_constship_active }
if = {
limit = { exists = event_target:global_gray_constship }
event_target:global_gray_constship = {
save_global_event_target_as = global_gray_location
}
} else = {
random_owned_fleet = {
limit = { has_fleet_flag = gray_constship }
save_global_event_target_as = global_gray_location
}
}
}
else_if = {
limit = { has_country_flag = gray_warship_active }
if = {
limit = { exists = event_target:gray_warship }
event_target:gray_warship = {
save_global_event_target_as = global_gray_location
}
} else = {
random_owned_fleet = {
limit = { has_fleet_flag = gray_fleet }
save_global_event_target_as = global_gray_location
}
}
}
else_if = {
limit = { has_country_flag = gray_juggernaut_active }
if = {
limit = { exists = event_target:gray_juggernaut }
event_target:gray_juggernaut = {
save_global_event_target_as = global_gray_location
}
} else = {
random_controlled_fleet = {
limit = { has_fleet_flag = gray_juggernaut_fleet }
save_global_event_target_as = global_gray_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_global_event_target_as = global_gray_location
}
}
else = {
capital_scope = { save_global_event_target_as = global_gray_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_global_event_target_as = global_gray_location }
}
}
else = {
random_owned_army = {
limit = { army_type = gray_army }
fleet = { save_global_event_target_as = global_gray_location }
}
}
}
else = {
capital_scope = { save_global_event_target_as = global_gray_location }
}
}
#创造灰风总督
rg_create_gray_governor = {
#延迟执行
@ -95,78 +182,7 @@ rg_create_gray_governor = {
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 }
}
rg_global_gray_location_check = yes
# 存储当前领袖等级
every_owned_leader = {
if = {
@ -236,7 +252,7 @@ rg_create_gray_warship = {
}
set_fleet_stance = aggressive
set_location = {
target = event_target:gray_warship_location
target = event_target:global_gray_location
distance = 0
angle = random
}
@ -279,7 +295,7 @@ rg_create_gray_warship = {
}
set_fleet_stance = aggressive
set_location = {
target = event_target:gray_warship_location
target = event_target:global_gray_location
distance = 0
angle = random
}
@ -319,7 +335,7 @@ rg_create_gray_warship = {
}
set_fleet_stance = aggressive
set_location = {
target = root.capital_scope
target = event_target:global_gray_location
distance = 0
angle = random
}
@ -354,7 +370,7 @@ rg_create_gray_warship = {
}
set_fleet_stance = aggressive
set_location = {
target = event_target:gray_warship_location
target = event_target:global_gray_location
distance = 0
angle = random
}
@ -413,71 +429,8 @@ rg_create_gray_warship = {
#创造灰风地面单位
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 }
}
#舰船刷新位置检测
rg_global_gray_location_check = yes
every_owned_leader = {
if = {
@ -536,7 +489,7 @@ rg_create_gray_army = {
army_type = "gray_army"
}
set_location = {
target = event_target:gray_transport_location
target = event_target:global_gray_location
distance = 0
angle = random
}
@ -581,78 +534,8 @@ rg_create_gray_army = {
#创造灰风科学舰
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 }
}
#舰船刷新位置检测
rg_global_gray_location_check = yes
every_owned_leader = {
if = {
@ -718,7 +601,7 @@ rg_create_gray_const = {
}
set_fleet_stance = evasive
set_location = {
target = event_target:gray_constship_location
target = event_target:global_gray_location
distance = 0
angle = random
}

View File

@ -62,7 +62,7 @@ rg_create_gray_warship_1 = {
effect = { set_ship_flag = rg_mothership }
}
set_location = {
target = root.capital_scope
target = event_target:global_gray_location
distance = 0
angle = random
}
@ -89,7 +89,7 @@ rg_create_gray_juggernautship_1 = {
upgradable = yes
}
set_location = {
target = root.capital_scope
target = event_target:global_gray_location
distance = 0
angle = random
}
@ -117,7 +117,7 @@ rg_create_gray_constship_1 = {
upgradable = yes
}
set_location = {
target = root.capital_scope
target = event_target:global_gray_location
distance = 0
angle = random
}

View File

@ -178,10 +178,43 @@ rg_create_gray_constship_1 = {
upgradable = yes
}
set_location = {
target = root.capital_scope
target = event_target:global_gray_location
distance = 0
angle = random
}
}
}
}
rg_create_gray_colony_1 = {
create_ship_design = {
design = "NAME_RG_armed_colony_ship"
}
add_ship_design = last_created_design
create_fleet = {
name = "NAME_Gray"
settings = {
can_disband = yes
can_upgrade = yes
can_change_composition = yes
can_change_leader = yes
uses_naval_capacity = yes
spawn_debris = yes
}
effect = {
set_owner = root
create_ship = {
name = "NAME_Gray"
design = "NAME_RG_armed_colony_ship"
prefix = no
upgradable = yes
}
set_location = {
target = event_target:global_gray_location
distance = 0
angle = random
}
}
}
remove_ship_design = last_created_design
}

View File

@ -23,18 +23,8 @@ country_event = {
country_event = {
id = rg.2
title = "graygoo.500.title"
desc = {
text = "rg.2.desc"
}
hide_window = yes
picture_event_data = {
portrait = root.species
room = "ethic_spaceship_room"
}
is_triggered_only = yes
immediate = {
@ -109,7 +99,7 @@ country_event = {
diplomatic = yes
picture_event_data = {
portrait = root.species
portrait = event_target:rg_gray_country_leader
room = "ethic_spaceship_room"
}

View File

@ -1395,6 +1395,29 @@ country_event = {
}
option = { # 购买殖民船
name = rg.4.g
trigger = {
NOT = { has_country_flag = gray_reforming }
}
allow = {
resource_stockpile_compare = { resource = food value >= 2000 }
resource_stockpile_compare = { resource = energy value >= 2000 }
}
add_resource = {
food = -2000
energy = -2000
}
hidden_effect = {
rg_create_gray_colony_1 = yes
}
}
option = { # 没钱了,救救
name = rg.4.c
trigger = {

View File

@ -1287,7 +1287,7 @@ country_event = {
}
option = { # 购买灰风母舰
name = rg_graygoo.4.a
name = rg.4.a
trigger = {
NOT = { has_country_flag = gray_reforming }
}
@ -1319,7 +1319,7 @@ country_event = {
}
option = { # 购买工程船
name = rg_graygoo.4.b
name = rg.4.b
trigger = {
NOT = { has_country_flag = gray_reforming }
}
@ -1340,8 +1340,31 @@ country_event = {
}
option = { # 购买殖民船
name = rg.4.g
trigger = {
NOT = { has_country_flag = gray_reforming }
}
allow = {
resource_stockpile_compare = { resource = food value >= 2000 }
resource_stockpile_compare = { resource = energy value >= 2000 }
}
add_resource = {
food = -2000
energy = -2000
}
hidden_effect = {
rg_create_gray_colony_1 = yes
}
}
option = { # 没钱了,救救
name = rg_graygoo.4.c
name = rg.4.c
trigger = {
NOT = { has_country_flag = gray_reforming }
}

View File

@ -107,7 +107,8 @@
rg.4.a:0 "§H建造灰风母舰§!"
rg.4.b:0 "§H建造武装工程舰§!"
rg.4.d:0 "§R建造纳米主宰舰§!"
rg.4.d:0 "§R建造纳米主宰舰§!"
rg.4.g:0 "§H建造模拟殖民舰§!"
rg.4.e:0 "§B开启隐形力场§!"
rg.4.f:0 "§B关闭隐形力场§!"
rg.4.c:0 "又没钱了,老婆救救"