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

2067 lines
42 KiB
Plaintext
Raw Normal View History

2023-06-03 00:23:34 +08:00
@gray_portrait = Gray
rg_set_gray_portrait = {
change_leader_portrait = @gray_portrait
}
rg_create_gray_species = {
if = {
limit = {
NOT = { exists = event_target:gray_species }
}
if = {
limit = {
OR = {
has_global_flag = has_wsg_mod
has_global_flag = kdc_event_mod_active
}
}
create_species = {
name = GRAY_SPECIES
plural = GRAY_SPECIES
class = ART
portrait = GrayTempest06
namelist = ART1
effect = {
save_global_event_target_as = gray_species
}
}
}
else = {
create_species = {
name = GRAY_SPECIES
plural = GRAY_SPECIES
class = ART
portrait = @gray_portrait
namelist = ART1
effect = {
save_global_event_target_as = gray_species
}
}
}
}
}
rg_create_gray_warship_1 = {
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_Gray_Warship"
upgradable = yes
effect = { set_ship_flag = rg_mothership }
}
set_location = {
2023-06-03 17:46:32 +08:00
target = event_target:global_gray_location
distance = 0
angle = random
}
}
}
}
rg_create_gray_juggernautship_1 = {
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_gray_juggernautship"
upgradable = yes
}
set_location = {
2023-06-03 17:46:32 +08:00
target = event_target:global_gray_location
distance = 0
angle = random
}
}
}
}
rg_create_gray_constship_1 = {
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_GRAY_constructor"
prefix = no
upgradable = yes
}
set_location = {
2023-06-03 17:46:32 +08:00
target = event_target:global_gray_location
distance = 0
angle = random
}
}
}
}
rg_create_graygoo_ships_1 = {
create_ship = {
name = random
design = "NAME_Nanite_Mothership"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 8
create_ship = {
name = random
design = "RG_aircruiser_Interdictor"
graphical_culture = "pirate_01"
}
}
}
rg_create_graygoo_ships_2 = {
create_ship = {
name = random
design = "NAME_Nanite_Mothership"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "NAME_Nanite_Mothership"
graphical_culture = "pirate_01"
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 16
create_ship = {
name = random
design = "RG_line_interdictor"
graphical_culture = "pirate_01"
}
}
}
rg_create_graygoo_ships_3 = {
create_ship = {
name = random
design = "NAME_Nanite_Mothership"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 12
create_ship = {
name = random
design = "RG_carrier_Interdictor"
graphical_culture = "pirate_01"
}
}
}
rg_create_graygoo_ships_4 = {
create_ship = {
name = random
design = "NAME_Nanite_Mothership_Carrier"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 16
create_ship = {
name = random
design = "RG_Arsenal_Interdictor"
graphical_culture = "pirate_01"
}
}
}
rg_create_graygoo_roamers_1 = {
create_fleet = {
name = "NAME_Tempest_Fleet"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Nanite_Mothership_Carrier"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 8
create_ship = {
name = random
design = "RG_carrier_Interdictor"
graphical_culture = "pirate_01"
}
}
set_location = event_target:nanite_factory
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "graygoo_roamers_1.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "graygoo_roamers_1.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
}
}
rg_create_graygoo_roamers_2 = {
create_fleet = {
name = "NAME_Tempest_Fleet"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Nanite_Mothership_titan"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 4
create_ship = {
name = random
design = "RG_titan_interdictor"
graphical_culture = "pirate_01"
}
}
set_location = event_target:start_1
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "graygoo_roamers_2.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "graygoo_roamers_2.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
}
}
rg_create_graygoo_roamers_3 = {
create_fleet = {
name = "NAME_Tempest_Fleet"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Nanite_Mothership"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 8
create_ship = {
name = random
design = "RG_aircruiser_Interdictor"
graphical_culture = "pirate_01"
}
}
set_location = event_target:start_2
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "graygoo_roamers_3.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "graygoo_roamers_3.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
}
}
rg_create_graygoo_roamers_4 = {
create_fleet = {
name = "NAME_Tempest_Fleet"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Nanite_Mothership"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 16
create_ship = {
name = random
design = "RG_Arsenal_Interdictor"
graphical_culture = "pirate_01"
}
}
set_location = event_target:start_3
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "graygoo_roamers_4.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "graygoo_roamers_4.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
}
}
rg_create_graygoo_roamers_5 = {
create_fleet = {
name = "NAME_Tempest_Fleet"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Nanite_Mothership"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 8
create_ship = {
name = random
design = "RG_battleship_Interdictor"
graphical_culture = "pirate_01"
}
}
set_location = event_target:start_4
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "graygoo_roamers_5.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "graygoo_roamers_5.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
}
}
rg_create_graygoo_roamers_6 = {
create_fleet = {
name = "NAME_Tempest_Fleet"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Nanite_Mothership_Carrier"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 16
create_ship = {
name = random
design = "RG_carrier_Interdictor"
graphical_culture = "pirate_01"
}
}
set_location = event_target:start_5
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "graygoo_roamers_6.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "graygoo_roamers_6.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
}
}
rg_create_graygoo_roamers_7 = {
create_fleet = {
name = "NAME_Tempest_Fleet"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Nanite_Mothership"
graphical_culture = "pirate_01"
effect = { set_ship_flag = rg_nanite_mothership }
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 12
create_ship = {
name = random
design = "RG_torpedo_interdictor"
graphical_culture = "pirate_01"
}
}
set_location = event_target:start_6
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "graygoo_roamers_7.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "graygoo_roamers_7.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
}
}
### Create Dessanu ships
rg_create_dessanu_roamers_1 = {
event_target:graygoo_country = {
create_leader = {
class = admiral
species = owner_main_species
name = random
skill = 3
leader_age_min = 25
leader_age_max = 45
traits = {
trait = random_trait
}
}
}
create_fleet = {
name = "NAME_Dessanu_Fleet_2"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Dessanu_Mothership"
effect = { set_ship_flag = rg_nanite_mothership }
}
while = {
count = 5
create_ship = {
name = random
design = "NAME_Dessanu_Interdictor"
}
}
set_location = event_target:nanite_factory
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
assign_leader = last_created_leader
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "dessanu_roamers_1.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "dessanu_roamers_1.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
settings = {
uses_naval_capacity = no
}
}
}
rg_create_dessanu_roamers_2 = {
event_target:graygoo_country = {
create_leader = {
class = admiral
species = owner_main_species
name = random
skill = 3
leader_age_min = 25
leader_age_max = 45
traits = {
trait = random_trait
}
}
}
create_fleet = {
name = "NAME_Dessanu_Fleet_2"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Dessanu_Mothership"
effect = { set_ship_flag = rg_nanite_mothership }
}
while = {
count = 5
create_ship = {
name = random
design = "NAME_Dessanu_Interdictor"
}
}
set_location = event_target:start_1
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
assign_leader = last_created_leader
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "dessanu_roamers_2.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "dessanu_roamers_2.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
settings = {
uses_naval_capacity = no
}
}
}
rg_create_dessanu_roamers_3 = {
event_target:graygoo_country = {
create_leader = {
class = admiral
species = owner_main_species
name = random
skill = 3
leader_age_min = 25
leader_age_max = 45
traits = {
trait = random_trait
}
}
}
create_fleet = {
name = "NAME_Dessanu_Fleet_2"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Dessanu_Mothership"
effect = { set_ship_flag = rg_nanite_mothership }
}
while = {
count = 5
create_ship = {
name = random
design = "NAME_Dessanu_Interdictor"
}
}
set_location = event_target:start_2
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
assign_leader = last_created_leader
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "dessanu_roamers_3.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "dessanu_roamers_3.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
settings = {
uses_naval_capacity = no
}
}
}
rg_create_dessanu_roamers_4 = {
event_target:graygoo_country = {
create_leader = {
class = admiral
species = owner_main_species
name = random
skill = 3
leader_age_min = 25
leader_age_max = 45
traits = {
trait = random_trait
}
}
}
create_fleet = {
name = "NAME_Dessanu_Fleet_2"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Dessanu_Mothership"
effect = { set_ship_flag = rg_nanite_mothership }
}
while = {
count = 5
create_ship = {
name = random
design = "NAME_Dessanu_Interdictor"
}
}
set_location = event_target:start_3
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
assign_leader = last_created_leader
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "dessanu_roamers_4.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "dessanu_roamers_4.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
settings = {
uses_naval_capacity = no
}
}
}
rg_create_dessanu_roamers_5 = {
event_target:graygoo_country = {
create_leader = {
class = admiral
species = owner_main_species
name = random
skill = 3
leader_age_min = 25
leader_age_max = 45
traits = {
trait = random_trait
}
}
}
create_fleet = {
name = "NAME_Dessanu_Fleet_2"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Dessanu_Mothership"
effect = { set_ship_flag = rg_nanite_mothership }
}
while = {
count = 5
create_ship = {
name = random
design = "NAME_Dessanu_Interdictor"
}
}
set_location = event_target:start_4
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
assign_leader = last_created_leader
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "dessanu_roamers_5.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "dessanu_roamers_5.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
settings = {
uses_naval_capacity = no
}
}
}
rg_create_dessanu_roamers_6 = {
event_target:graygoo_country = {
create_leader = {
class = admiral
species = owner_main_species
name = random
skill = 3
leader_age_min = 25
leader_age_max = 45
traits = {
trait = random_trait
}
}
}
create_fleet = {
name = "NAME_Dessanu_Fleet_2"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Dessanu_Mothership"
effect = { set_ship_flag = rg_nanite_mothership }
}
while = {
count = 5
create_ship = {
name = random
design = "NAME_Dessanu_Interdictor"
}
}
set_location = event_target:start_5
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
assign_leader = last_created_leader
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "dessanu_roamers_6.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "dessanu_roamers_6.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
settings = {
uses_naval_capacity = no
}
}
}
rg_create_dessanu_roamers_7 = {
event_target:graygoo_country = {
create_leader = {
class = admiral
species = owner_main_species
name = random
skill = 3
leader_age_min = 25
leader_age_max = 45
traits = {
trait = random_trait
}
}
}
create_fleet = {
name = "NAME_Dessanu_Fleet_2"
effect = {
set_owner = event_target:graygoo_country
create_ship = {
name = random
design = "NAME_Dessanu_Mothership"
effect = { set_ship_flag = rg_nanite_mothership }
}
while = {
count = 5
create_ship = {
name = random
design = "NAME_Dessanu_Interdictor"
}
}
set_location = event_target:start_6
set_formation_scale = 2
set_fleet_stance = aggressive
set_aggro_range_measure_from = self
set_aggro_range = 500
assign_leader = last_created_leader
queue_actions = {
repeat = {
find_random_system = {
trigger = {
id = "dessanu_roamers_7.trigger.1"
has_star_flag = lcluster
}
found_system = {
move_to = THIS
}
}
find_closest_planet = {
trigger = {
id = "dessanu_roamers_7.trigger.2"
is_planet_class = "pc_gray_goo"
}
found_planet = {
orbit_planet = THIS
wait = {
duration = 50
random = 25
}
}
}
}
}
}
settings = {
uses_naval_capacity = no
}
}
}
rg_create_dessanu_ships_1 = {
create_ship = {
name = random
design = "NAME_Dessanu_Mothership"
effect = { set_ship_flag = rg_nanite_mothership }
}
while = {
count = 5
create_ship = {
name = random
design = "NAME_Dessanu_Interdictor"
}
}
}
#工蜂机库
#scope (ship)
RG_const_auto_build_effect = {
create_fleet = {
name = RG_armed_constructor_ship
effect = {
set_owner = root.controller
while = {
count = $count$
create_ship = {
name = RG_armed_constructor_ship
prefix = no
design = "NAME_RG_GRAY_constructor"
effect = {
set_cloaking_active = yes
}
}
}
set_location = root
set_owner = event_target:RG_const_country
queue_actions = {
repeat = {
#前往哨站
find_closest_system = {
trigger = {
id = RG_work_bees_trigger.1
is_same_value = prev.solar_system
NOT = { exists = space_owner }
}
found_system = {
move_to = this
}
}
find_closest_planet = {
trigger = {
id = RG_work_bees_trigger.2
is_star = yes
solar_system = {
NOT = { exists = space_owner }
}
}
found_planet = {
move_to = this
orbit_planet = this
wait = {
duration = $starbase_time$
}
effect = {
id = RG_work_bees_effect.1
solar_system = {
create_starbase = {
size = starbase_outpost
owner = prevprevprev.controller
}
}
}
}
}
#建造中继器
find_closest_planet = {
trigger = {
id = RG_work_bees_trigger.3
is_star = yes
solar_system = {
NOT = { has_megastructure = hyper_relay }
}
}
found_planet = {
move_to = this
orbit_planet = this
wait = {
duration = 360
}
effect = {
id = RG_work_bees_effect.2
solar_system = {
spawn_megastructure = {
type = hyper_relay
owner = prevprevprev.controller
orbit_angle = 220
orbit_distance = 220
}
}
}
}
}
#建造空间站
find_closest_planet = {
trigger = {
id = RG_work_bees_trigger.1
RG_planet_can_auto_build = yes
}
found_planet = {
move_to = this
orbit_planet = this
wait = {
duration = $station_time$
}
effect = {
id = RG_work_bees_effect.2
#若星系属于母国,则自动建造
if = {
limit = {
solar_system = {
is_owned_by = prevprevprev.controller
}
}
RG_build_stations = {
owner = prevprev.controller
}
set_timed_planet_flag = {
flag = RG_work_bees_built
days = 30
}
}
#若星系有主但不属于母国,则工蜂自毁
else_if = {
limit = {
solar_system = {
has_owner = yes
NOT = {
is_owned_by = root.controller
}
}
}
delete_fleet = prev
}
}
}
#若找不到可建造星球,则工蜂自毁
failed = {
effect = {
id = RG_work_bees_failed.1
delete_fleet = this
}
}
}
}
}
}
}
}
#自动建造采矿站
#scope (planet)
RG_build_stations = {
switch = {
trigger = has_deposit_for
shipclass_mining_station = {
create_mining_station = {
owner = $owner$
}
}
shipclass_research_station = {
create_research_station = {
owner = $owner$
}
}
}
}
RG_destroy_planet_effect = {
#Dismantle observation post
if = {
limit = {
has_observation_outpost = yes
}
observation_outpost_owner = {
country_event = { id = planet_destruction.1000 days = 1 }
}
}
# Contingency Machine World
if = {
limit = {
is_planet_class = pc_ai
NOT = { has_planet_flag = machine_lair }
}
set_planet_flag = destroyed_by_colossus
set_planet_flag = planet_cracked
planet_event = { id = crisis.2040 }
}
# Contingency Final Machine World
if = {
limit = {
is_planet_class = pc_ai
has_planet_flag = machine_lair
}
set_planet_flag = destroyed_by_colossus
set_planet_flag = planet_cracked
from.owner = { save_event_target_as = final_machine_world_destroyer }
stop_crisis_sound = yes
planet_event = { id = crisis.2046 }
}
# Swarm Situation Log counter
if = {
limit = {
exists = owner
owner = { is_country_type = swarm }
}
every_country = {
limit = { has_event_chain = "prethoryn_scourge_chain" }
add_event_chain_counter = {
event_chain = "prethoryn_scourge_chain"
counter = "infested_worlds"
amount = -1
}
add_event_chain_counter = {
event_chain = "prethoryn_scourge_chain"
counter = "infested_worlds_cleansed"
amount = 1
}
}
}
if = {
limit = {
OR = {
is_active_resolution = "resolution_rulesofwar_reverence_for_life"
is_active_resolution = "resolution_rulesofwar_independent_tribunals"
is_active_resolution = "resolution_rulesofwar_last_resort_doctrine"
is_active_resolution = "resolution_rulesofwar_demobilization_initiative"
}
}
from.owner = {
set_timed_country_flag = { flag = resolution_breached_fired_cracker days = 3600 }
}
}
# Exterminatus Achievement
if = {
limit = { is_capital = yes }
from.owner = { set_country_flag = exterminatus }
}
if = {
limit = {
exists = owner
owner = {
NOT = { is_same_value = from.owner }
OR = {
is_country_type = default
is_country_type = fallen_empire
is_country_type = awakened_fallen_empire
}
}
}
# Generate threat
if = {
limit = {
is_colony = yes
}
add_threat = { who = from.owner amount = 3 }
# modifier for allies + those upset by genocide
every_country = {
limit = {
NOR = {
is_same_value = from.owner
is_same_value = root.owner
AND = {
has_federation = yes
is_in_federation_with = from.owner
}
}
OR = {
has_communications = from.owner
has_communications = root.owner
}
OR = {
AND = {
has_federation = yes
is_in_federation_with = root.owner
}
has_ai_personality = awakened_fallen_empire_xenophile
AND = {
is_country_type = default
OR = {
is_egalitarian = yes
is_xenophile = yes
}
}
}
}
if = {
limit = { root = { is_colony = no } }
add_opinion_modifier = {
modifier = opinion_cracked_an_uninhabited_world
who = from.owner
}
}
else = {
add_opinion_modifier = {
modifier = opinion_cracked_a_world
who = from.owner
}
}
}
}
else = {
add_threat = { who = from.owner amount = 1 }
}
# modifiers for victim
owner = {
if = {
limit = { root = { is_colony = no } }
add_opinion_modifier = {
modifier = opinion_cracked_my_uninhabited_world
who = from.owner
}
}
else = {
add_opinion_modifier = {
modifier = opinion_cracked_my_world
who = from.owner
}
}
if = {
limit = { NOT = { has_ethic = ethic_gestalt_consciousness } }
add_modifier = {
modifier = colossus_victim
days = 10800 # 30 years
}
}
}
if = {
limit = {
exists = owner
owner = { is_country_type = primitive }
}
# modifier for allies + those upset by genocide
every_country = {
limit = {
NOT = { is_same_value = from.owner }
OR = {
has_communications = from.owner
has_communications = root.owner
}
OR = {
has_ai_personality = awakened_fallen_empire_xenophile
AND = {
is_country_type = default
NOR = {
is_xenophobe = yes
is_homicidal = yes
is_xenophile = yes
}
}
}
}
add_opinion_modifier = {
modifier = opinion_cracked_a_primitive_world
who = from.owner
}
}
every_country = {
limit = {
NOT = { is_same_value = from.owner }
OR = {
has_communications = from.owner
has_communications = root.owner
}
OR = {
has_ai_personality = awakened_fallen_empire_xenophile
AND = {
is_country_type = default
is_xenophile = yes
}
}
}
add_opinion_modifier = {
modifier = opinion_cracked_a_primitive_world_phile
who = from.owner
}
}
}
}
# Add war exhaustion to planet owner
if = {
limit = {
exists = owner
}
owner = {
if = {
limit = { #isn't the case when the crisis bombards planets, for instance
is_at_war_with = from.fleet.owner
}
add_static_war_exhaustion = {
attacker = from.fleet.owner
location = root
value_for_planet_destruction = 1.0
}
}
}
}
if = {
limit = { is_planet_class = pc_habitat } # uncolonized
spawn_habitat_cracker_effect = yes
change_pc = pc_gray_goo
}
if = {
limit = { is_colony = yes }
if = {
limit = {
exists = owner
owner = { is_same_value = event_target:gray_owner }
}
# already owned
}
else = {
set_owner = event_target:gray_owner
}
every_owned_pop = {
modify_species = {
species = event_target:gray_owner.owner_species
add_trait = trait_cybernetic
add_traits_at_start_of_list = yes
change_scoped_species = yes
}
}
every_owned_pop = {
limit = {
has_modifier = pop_recently_conquered
}
remove_modifier = pop_recently_conquered
}
every_owned_pop = {
set_citizenship_type = {
type = citizenship_full_machine
cooldown = yes
}
}
# Special graphics for Habitats and Ring Worlds
if = {
limit = {
is_planet_class = pc_habitat
}
spawn_habitat_nanobot_effect = yes
}
else_if = {
limit = {
is_planet_class = pc_ringworld_habitable
}
spawn_ringworld_nanobot_effect = yes
}
if = {
limit = {
OR = {
is_planet_class = pc_habitat
is_planet_class = pc_ringworld_habitable
}
}
# nothing
}
else = {
change_pc = this
}
}
else_if = {
limit = { is_ringworld = yes }
spawn_ringworld_nanobot_effect = yes
}
else_if = {
limit = { is_planet_class = pc_ringworld_tech }
spawn_ringworld_nanobot_effect = yes
}
else_if = {
limit = { is_planet_class = pc_ringworld_seam }
spawn_ringworld_nanobot_effect = yes
}
else = {
change_pc = pc_gray_goo
add_modifier = {
modifier = "terraforming_candidate"
days = -1
}
}
}
RG_destroy_star_system = {
every_system_ambient_object = {
limit = {
# Preserve Unbidden crisis effects
NOR = {
has_ambient_object_flag = extradimensional_system_effect
has_ambient_object_flag = extradimensional_system_effect_2
}
}
destroy_ambient_object = this
}
every_system_planet = {
limit = { is_star = yes }
create_ambient_object = {
type = "star_explosion"
play_animation_once = yes
location = this
}
last_created_ambient_object = {
set_location = {
target = prev
distance = 0
angle = random
}
}
change_pc = pc_black_hole
solar_system = { set_star_class = sc_black_hole }
if = { limit = { planet_size > 29 } set_planet_size = 15 }
else_if = { limit = { planet_size > 19 } set_planet_size = 10 }
else_if = { limit = { always = yes } set_planet_size = 7 }
prevent_anomaly = yes
clear_deposits = yes
}
# Handle Contingency Machine Worlds
every_system_planet = {
limit = {
is_planet_class = pc_ai
NOT = { has_planet_flag = machine_lair }
}
destroy_machine_world = yes
}
random_system_planet = {
limit = {
is_planet_class = pc_ai
has_planet_flag = machine_lair
}
from.owner = { save_event_target_as = final_machine_world_destroyer }
stop_crisis_sound = yes
planet_event = { id = crisis.2046 }
}
every_system_planet = {
limit = {
is_star = no
is_asteroid = no
NOR = {
is_planet_class = pc_ringworld_habitable_damaged
is_planet_class = pc_ringworld_tech_damaged
is_planet_class = pc_ringworld_seam_damaged
}
}
if = {
limit = { is_planet_class = pc_habitat } # uncolonized
spawn_habitat_cracker_effect = yes
change_pc = pc_gray_goo
}
if = {
limit = { is_colony = yes }
if = {
limit = {
exists = owner
owner = { is_same_value = event_target:gray_owner }
}
# already owned
}
else = {
set_owner = event_target:gray_owner
}
every_owned_pop = {
modify_species = {
species = event_target:gray_owner.owner_species
add_trait = trait_cybernetic
add_traits_at_start_of_list = yes
change_scoped_species = yes
}
}
every_owned_pop = {
limit = {
has_modifier = pop_recently_conquered
}
remove_modifier = pop_recently_conquered
}
every_owned_pop = {
set_citizenship_type = {
type = citizenship_full_machine
cooldown = yes
}
}
# Special graphics for Habitats and Ring Worlds
if = {
limit = {
is_planet_class = pc_habitat
}
spawn_habitat_nanobot_effect = yes
}
else_if = {
limit = {
is_planet_class = pc_ringworld_habitable
}
spawn_ringworld_nanobot_effect = yes
}
if = {
limit = {
OR = {
is_planet_class = pc_habitat
is_planet_class = pc_ringworld_habitable
}
}
# nothing
}
else = {
change_pc = this
}
}
else_if = {
limit = { is_ringworld = yes }
spawn_ringworld_nanobot_effect = yes
}
else_if = {
limit = { is_planet_class = pc_ringworld_tech }
spawn_ringworld_nanobot_effect = yes
}
else_if = {
limit = { is_planet_class = pc_ringworld_seam }
spawn_ringworld_nanobot_effect = yes
}
else = {
change_pc = pc_gray_goo
add_modifier = {
modifier = "terraforming_candidate"
days = -1
}
}
}
every_system_planet = {
limit = {
exists = orbital_station
}
orbital_station = { dismantle = yes }
}
every_system_planet = {
limit = { is_asteroid = yes }
clear_deposits = yes
}
every_fleet_in_system = {
limit = {
NOR = {
is_same_value = from
# except Extradimensionals
AND = {
exists = owner
owner = {
OR = {
is_country_type = portal_holder
is_country_type = extradimensional
is_country_type = extradimensional_2
is_country_type = extradimensional_3
}
}
}
}
}
if = {
limit = {
exists = event_target:gray_owner #i.e. not final destruction of all matter
is_mobile = yes
}
set_mia = yes
}
else = {
destroy_fleet = this
}
}
every_system_megastructure = {
set_ruined_megastructure = yes
}
star = {
create_ambient_object = {
type = "destroyed_system"
location = this
}
last_created_ambient_object = {
set_ambient_object_flag = destroyed_system_effect
set_location = {
target = prev
distance = 0
angle = random
}
}
}
}
rg_emergency_fleet_defence = {
while = {
count = 3
create_ship = {
name = random
design = "NAME_Nanite_Mothership_titan"
graphical_culture = "pirate_01"
}
}
while = {
count = 22
create_ship = {
name = random
design = "RG_Arsenal_Interdictor"
graphical_culture = "pirate_01"
}
}
}
rg_create_graygoo_fleet_random = {
random_list = {
1 = {
create_ship = {
name = random
design = "NAME_gray_capitalship"
graphical_culture = "pirate_01"
upgradable = no
}
}
33 = {
create_ship = {
name = random
design = "NAME_Nanite_Mothership"
graphical_culture = "pirate_01"
upgradable = no
}
}
33 = {
create_ship = {
name = random
design = "NAME_Nanite_Mothership_Carrier"
graphical_culture = "pirate_01"
upgradable = no
}
}
33 = {
create_ship = {
name = random
design = "NAME_Nanite_Mothership_titan"
graphical_culture = "pirate_01"
upgradable = no
}
}
}
create_ship = {
name = random
design = "RG_Buff_interdictor"
graphical_culture = "pirate_01"
}
while = {
count = 8
random_list = {
10 = { #1_航战
create_ship = {
name = random
design = "RG_aircruiser_Interdictor"
graphical_culture = "pirate_01"
upgradable = yes
}
}
10 = { #2_航母
create_ship = {
name = random
design = "RG_carrier_Interdictor"
graphical_culture = "pirate_01"
upgradable = yes
}
}
10 = { #3_战列
create_ship = {
name = random
design = "RG_battleship_Interdictor"
graphical_culture = "pirate_01"
upgradable = yes
}
}
10 = { #4_泰坦
create_ship = {
name = random
design = "RG_titan_interdictor"
graphical_culture = "pirate_01"
upgradable = yes
}
}
10 = { #5_雷击
create_ship = {
name = random
design = "RG_torpedo_interdictor"
graphical_culture = "pirate_01"
upgradable = yes
}
}
10 = { #6_近防
create_ship = {
name = random
design = "RG_AA_interdictor"
graphical_culture = "pirate_01"
upgradable = yes
}
}
10 = { #7_武库
create_ship = {
name = random
design = "RG_Arsenal_Interdictor"
graphical_culture = "pirate_01"
upgradable = yes
}
}
10 = { #8_雷巡
create_ship = {
name = random
design = "RG_torpedocruiser_interdictor"
graphical_culture = "pirate_01"
upgradable = yes
}
}
10 = { #9_破冰
create_ship = {
name = random
design = "RG_icebreaker_interdictor"
graphical_culture = "pirate_01"
upgradable = yes
}
}
10 = { #10_线列
create_ship = {
name = random
design = "RG_line_interdictor"
graphical_culture = "pirate_01"
upgradable = yes
}
}
}
}
2023-05-29 21:23:34 +08:00
}
2023-06-03 12:02:56 +08:00
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
# 创建看板娘用于第一次接触
rg_gray_country_leader_init = yes
set_leader = last_created_leader
}
}
2023-05-29 21:23:34 +08:00
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 }
}
2023-06-03 12:02:56 +08:00
# 启动开局故事事件链
2023-05-29 21:23:34 +08:00
rg_storyline_trigger = yes
2023-06-03 12:02:56 +08:00
# 接受小灰建立通信
2023-05-29 21:23:34 +08:00
event_target:rg_gray_country = {
2023-05-29 21:45:53 +08:00
establish_communications_no_message = event_target:gray_owner
2023-05-29 21:23:34 +08:00
}
2023-06-06 11:32:36 +08:00
}
rg_timeline_attract_field_init = {
#世界线遭到劫持,手动收束关闭其他可能
if = {
limit = {
OR = {
has_global_flag = gray_goo_crisis_set
has_global_flag = active_gray_goo
has_global_flag = dragon_season
has_global_flag = gray_goo_empire_set
}
}
#灰蛊
remove_global_flag = gray_goo_crisis_set
remove_global_flag = active_gray_goo
#L星龙
remove_global_flag = dragon_season
#德萨努
remove_global_flag = gray_goo_empire_set
}
}