realgray-stellaris-mod/events/RG_combat_skill_events.txt

786 lines
14 KiB
Plaintext
Raw Normal View History

namespace = rg_skill
2023-06-14 17:15:05 +08:00
# fleet_event = {
# id = rg_skill.1
# hide_window = yes
# is_triggered_only = yes
#
# trigger = {
# NOT = { has_global_flag = rg_grayskill_cooldown }
# any_owned_fleet = {
# exists = leader
# leader = { has_leader_flag = gray_leader_admiral }
# is_in_combat = yes
# }
# }
#
# immediate = {
# if = {
# limit = {
# any_owned_fleet = {
# exists = leader
# leader = { has_leader_flag = gray_leader_admiral }
# is_in_combat = yes
# }
# }
# random_owned_fleet = {
# if = {
# limit = { leader = { has_leader_flag = gray_leader_admiral }}
# save_event_target_as = gray_warship_location
# }
# }
# create_fleet = {
# name = "NAME_RG_carrier"
# settings = {
# can_disband = yes
# can_upgrade = no
# can_change_composition = yes
# can_change_leader = no
# uses_naval_capacity = no
# spawn_debris = no
# }
# effect = {
# set_owner = event_target:gray_owner
# while = {
# count = 4
# create_ship = {
# name = random
# design = "RG_carrier_Interdictor"
# graphical_culture = "pirate_01"
# prefix = no
# upgradable = no
# }
# }
# set_location = {
# target = event_target:gray_warship_location
# distance = 55
# angle = 270
# }
# set_fleet_flag = RG_carrier_fleet
# save_global_event_target_as = RG_carrier_fleet
# }
# }
#
# set_timed_global_flag = {
# flag = rg_grayskill_cooldown days = 120
# }
# }
# }
# }
# fleet_event = {
# id = rg_skill.2
# hide_window = yes
# is_triggered_only = yes
#
# trigger = {
# any_owned_fleet = {
# has_fleet_flag = RG_carrier_fleet
# is_in_combat = no
# }
# }
#
# immediate = {
# if = {
# limit = {
# any_owned_fleet = {
# has_fleet_flag = RG_carrier_fleet
# is_in_combat = no
# }
# }
# event_target:RG_carrier_fleet = { delete_ship = this }
# }
# }
# }
ship_event = {
id = rg_skill.3
hide_window = yes
is_triggered_only = yes
trigger = {
OR = {
AND = {
is_ship_size = RG_armed_science_ship
OR = {
has_component = RG_AUTOCONST_HANGER
2023-06-08 13:11:05 +08:00
}
}
}
solar_system = {
OR = {
2023-06-08 13:11:05 +08:00
NOT = {
exists = space_owner
}
AND = {
2023-06-08 13:11:05 +08:00
space_owner = {
is_same_empire = root.controller
}
any_system_planet = {
RG_planet_can_auto_build = yes
}
}
}
NOT = {
any_neighbor_system = {
has_owner = yes
owner = {
OR = {
is_fallen_empire_xenophobe = yes
has_ai_personality = fallen_empire_xenophobe
has_ai_personality = awakened_fallen_empire_xenophobe
}
}
}
}
}
}
immediate = {
if = {
2023-06-08 13:11:05 +08:00
limit = {
2023-06-07 22:29:39 +08:00
owner = {
NOT = {
is_same_value = origin_rg_gray_country
}
}
solar_system = {
2023-06-08 13:11:05 +08:00
NOT = {
any_fleet_in_system = {
exists = controller
2023-06-08 13:11:05 +08:00
controller = {
is_hostile = root.controller
}
}
}
}
}
2023-06-07 22:29:39 +08:00
RG_const_auto_build_effect_event = yes
}
else_if = {
2023-06-08 13:11:05 +08:00
limit = {
2023-06-07 22:29:39 +08:00
owner = {
is_same_value = origin_rg_gray_country
NOT = {
has_global_flag = l_cluster_opened
}
}
2023-06-07 22:29:39 +08:00
solar_system = {
has_star_flag = lcluster
2023-06-14 17:15:05 +08:00
NOT = {
2023-06-08 13:11:05 +08:00
any_fleet_in_system = {
2023-06-07 22:29:39 +08:00
exists = controller
2023-06-08 13:11:05 +08:00
controller = {
is_hostile = root.controller
}
}
}
}
2023-06-07 22:29:39 +08:00
}
RG_const_auto_build_effect_event = yes
}
else_if = {
2023-06-08 13:11:05 +08:00
limit = {
2023-06-07 22:29:39 +08:00
owner = {
2023-06-08 13:11:05 +08:00
is_same_value = origin_rg_gray_country # 是小灰起源
has_global_flag = l_cluster_opened # L星门已开启
2023-06-07 22:29:39 +08:00
}
solar_system = {
# has_star_flag = lcluster
2023-06-14 17:15:05 +08:00
NOT = {
2023-06-08 13:11:05 +08:00
any_fleet_in_system = {
2023-06-07 22:29:39 +08:00
exists = controller
2023-06-08 13:11:05 +08:00
controller = {
is_hostile = root.controller
}
}
}
}
}
2023-06-07 22:29:39 +08:00
RG_const_auto_build_effect_event = yes
}
ship_event = {
id = rg_skill.3
days = 10
}
}
}
# Gray Breeds(?
fleet_event = {
id = rg_skill.4
hide_window = yes
2023-06-08 13:11:05 +08:00
mean_time_to_happen = {
years = 1
}
trigger = {
any_controlled_ship = {
has_ship_flag = rg_mothership
2023-06-08 13:11:05 +08:00
}
num_ships < 20
is_ship_size = RG_graygoo_mothership
}
immediate = {
random_list = {
14 = {
create_ship = {
name = random
design = "RG_aircruiser_Interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_carrier_Interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_battleship_Interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_titan_interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_torpedo_interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_AA_interdictor"
upgradable = yes
}
}
12 = {
2023-06-08 13:11:05 +08:00
create_ship = {
name = random
design = "RG_Arsenal_Interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_torpedocruiser_interdictor"
upgradable = yes
}
}
}
}
}
#Tempest Breeds(?
fleet_event = {
id = rg_skill.5
hide_window = yes
2023-06-08 13:11:05 +08:00
mean_time_to_happen = {
months = 5
}
trigger = {
any_controlled_ship = {
OR = {
OR = {
is_ship_size = RG_graygoo_mothership
is_ship_size = graygoo_mothership
}
has_ship_flag = rg_nanite_mothership
}
2023-06-08 13:11:05 +08:00
owner = {
is_country_type = gray_goo
}
}
num_ships < 40
}
immediate = {
random_list = {
14 = {
create_ship = {
name = random
design = "RG_aircruiser_Interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_carrier_Interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_battleship_Interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_titan_interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_torpedo_interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_AA_interdictor"
upgradable = yes
}
}
12 = {
2023-06-08 13:11:05 +08:00
create_ship = {
name = random
design = "RG_Arsenal_Interdictor"
upgradable = yes
}
}
12 = {
create_ship = {
name = random
design = "RG_icebreaker_interdictor"
upgradable = yes
}
}
}
}
}
# Tempest incoming traits
# Recursive check every X days
# This = planet
# From = country attacking
planet_event = {
id = rg_skill.6
hide_window = yes
is_triggered_only = yes
immediate = {
save_event_target_as = tempest_incoming_battlefield_planet
2023-06-08 13:11:05 +08:00
if = {
# planet
limit = {
has_ground_combat = no
}
remove_planet_flag = checking_tempest_incoming
}
2023-06-08 13:11:05 +08:00
else = {
#planet
any_ground_combat_attacker = {
#army
exists = leader
2023-06-08 13:11:05 +08:00
leader = {
#leader
has_trait = RG_leader_trait_general_gray_skill
2023-06-08 13:11:05 +08:00
owner = {
#country
save_event_target_as = attacking_general_country
}
}
}
# Do the same check again in X days
2023-06-08 13:11:05 +08:00
country_event = {
id = rg_skill.10
} # NOTE: Update custom loc for effect when changing days
}
}
}
# tempest incoming traits
# Inital event started by on_ground_combat_started
# to kick of the recursive check in X days
# This = planet
# From = country attacking
planet_event = {
id = rg_skill.7
hide_window = yes
is_triggered_only = yes
# Prevent duplicate events
trigger = {
2023-06-08 13:11:05 +08:00
not = {
has_planet_flag = checking_tempest_incoming
}
}
immediate = {
2023-06-08 13:11:05 +08:00
set_planet_flag = checking_tempest_incoming # Prevent duplicate events
planet_event = {
id = rg_skill.6
days = 1
}
}
}
# On army killed in combat.
# This = owner
# From = army
# FromFrom = opponent
# FromFromFrom = planet
country_event = {
id = rg_skill.8
hide_window = yes
is_triggered_only = yes
immediate = {
2023-06-08 13:11:05 +08:00
FROMFROMFROM = {
# Planet where ground combat is taking place.
# Check if dead army is a defensive army.
if = {
limit = {
any_ground_combat_defender = {
is_same_value = ROOT.FROM
}
}
# Check if attacking army has general with Crusader trait.
random_ground_combat_attacker = {
limit = {
exists = leader
leader = {
OR = {
has_trait = RG_leader_trait_general_gray_skill
}
}
}
leader = {
save_event_target_as = attacking_general
owner = {
save_event_target_as = attacking_general_country
}
}
}
}
2023-06-08 13:11:05 +08:00
if = {
# planet where ground combat is taking place.
limit = {
exists = event_target:attacking_general
}
if = {
limit = {
2023-06-08 13:11:05 +08:00
event_target:attacking_general_country = {
# attacking general country
NOT = {
check_variable = {
which = rg_general_skill_combat_killed_variable
value = 100
}
}
}
}
event_target:attacking_general_country = {
change_variable = {
which = rg_general_skill_combat_killed_variable
value = 1
}
change_variable = {
which = rg_general_skill_combat_daypassed_variable
value = 1
}
}
}
# Handle both sides of the ground combat
2023-06-08 13:11:05 +08:00
RG_leader_trait_tempest_incoming_random_kill_effect = {
SIDE_A = attacker
SIDE_B = defender
}
RG_leader_trait_tempest_incoming_random_kill_effect = {
SIDE_A = defender
SIDE_B = attacker
}
}
}
}
}
country_event = {
id = rg_skill.9
hide_window = yes
is_triggered_only = yes
trigger = {
any_owned_army = {
army_type = gray_army
if = {
2023-06-08 13:11:05 +08:00
limit = {
exists = planet
}
planet = {
has_ground_combat = no
}
}
}
}
immediate = {
2023-06-08 13:11:05 +08:00
set_variable = {
# country
which = rg_general_skill_combat_daypassed_variable
value = 1
}
2023-06-08 13:11:05 +08:00
set_variable = {
# country
which = rg_general_skill_combat_killed_variable
value = 0
}
}
}
country_event = {
id = rg_skill.10
hide_window = yes
is_triggered_only = yes
trigger = {
any_owned_army = {
army_type = gray_army
exists = leader
leader = {
OR = {
has_trait = RG_leader_trait_general_gray_skill
}
}
if = {
2023-06-08 13:11:05 +08:00
limit = {
exists = planet
}
planet = {
has_ground_combat = yes
}
}
}
}
immediate = {
event_target:attacking_general_country = {
change_variable = {
which = rg_general_skill_combat_daypassed_variable
value = 1
}
}
2023-06-08 13:11:05 +08:00
country_event = {
id = rg_skill.10
days = 1
}
}
}
# 重组仪
country_event = {
id = rg_skill.11
hide_window = yes
is_triggered_only = yes
trigger = {
FromFromFrom = {
is_in_combat = yes
has_component = RG_revive_component
}
}
immediate = {
FromFromFrom = {
save_event_target_as = event_ship
}
FromFromFrom.fleet = {
create_ship = {
name = event_target:event_ship
design = event_target:event_ship
}
}
}
}
2023-06-20 14:05:14 +08:00
# 纳米重塑
2023-06-21 12:34:44 +08:00
# This = owner of ship 1 (combatant)
# From = owner of ship 2 (destroyed)
# FromFrom = ship 1
# FromFromFrom = ship 2
2023-06-20 14:05:14 +08:00
country_event = {
id = rg_skill.12
hide_window = yes
is_triggered_only = yes
trigger = {
FromFromFrom = {
is_in_combat = yes
NOT = {
2023-06-21 13:08:31 +08:00
is_same_value = event_target:gray_warship_ship
2023-06-20 14:05:14 +08:00
}
2023-06-21 13:08:31 +08:00
exists = fleet.leader
2023-06-20 14:05:14 +08:00
}
2023-06-21 12:34:44 +08:00
FromFromFrom.fleet.leader = {
2023-06-20 14:05:14 +08:00
has_trait = RG_leader_trait_admiral_nanorebuild_gray
}
}
immediate = {
if = {
limit = {
2023-06-21 12:34:44 +08:00
From = {
2023-06-20 14:05:14 +08:00
check_variable = {
which = rg_nanorebuild_counter
value >= 1
}
}
}
FromFromFrom = {
save_event_target_as = event_ship
}
FromFromFrom.fleet = {
create_ship = {
name = event_target:event_ship
design = event_target:event_ship
}
}
2023-06-21 12:34:44 +08:00
From = {
2023-06-20 14:05:14 +08:00
change_variable = {
which = rg_nanorebuild_counter
value = -1
}
}
}
}
}
2023-06-21 12:34:44 +08:00
# country_event = {
# id = rg_skill.13
# hide_window = yes
# is_triggered_only = yes
# trigger = {
# FromFromFrom = {
# is_in_combat = yes
# }
# FromFrom.solar_system = {
# any_fleet_in_system = {
# leader = {
# has_trait = RG_leader_trait_admiral_nanorebuild_gray
# }
# }
# }
# this = {
# NOT = {
# is_same_value = event_target:gray_owner
# is_in_federation_with = event_target:gray_owner
# }
# }
# }
# immediate = {
# event_target:gray_owner = {
# change_variable = {
# which = rg_nanorebuild_counter
# value = 1
# }
# }
# }
# }
# On destroying enemy ship.
2023-06-20 14:05:14 +08:00
country_event = {
id = rg_skill.13
hide_window = yes
is_triggered_only = yes
2023-06-21 12:34:44 +08:00
2023-06-21 13:08:31 +08:00
trigger = {
FromFrom = {
is_in_combat = yes
exists = fleet.leader
}
FromFrom.fleet.leader = {
has_trait = RG_leader_trait_admiral_nanorebuild_gray
}
}
2023-06-20 14:05:14 +08:00
immediate = {
2023-06-21 12:34:44 +08:00
FROMFROM = { # Winning ship.
if = {
limit = { exists = fleet.leader }
fleet.leader = {
if = {
limit = {
OR = {
has_trait = RG_leader_trait_admiral_nanorebuild_gray
}
}
ROOT = {
change_variable = {
which = rg_nanorebuild_counter
value = 1
}
}
}
}
2023-06-20 14:05:14 +08:00
}
}
}
}
2023-06-21 12:58:32 +08:00
# This = owner of fleet 1 (winner)
# From = owner of fleet 2 (loser)
# FromFrom = fleet 1
# FromFromFrom = fleet 2
2023-06-20 14:05:14 +08:00
country_event = {
id = rg_skill.14
hide_window = yes
is_triggered_only = yes
trigger = {
2023-06-21 12:58:32 +08:00
OR = {
fromfrom.leader = {
2023-06-20 14:05:14 +08:00
has_trait = RG_leader_trait_admiral_nanorebuild_gray
}
}
NOT = {
2023-06-21 12:58:32 +08:00
This = {
2023-06-20 14:05:14 +08:00
check_variable = {
which = rg_nanorebuild_counter
value = 0
}
}
}
}
immediate = {
2023-06-21 12:58:32 +08:00
This = {
set_variable = {
which = rg_nanorebuild_counter
value = 0
}
}
}
}
# This = owner of fleet 1 (loser)
# From = owner of fleet 2 (winner)
# FromFrom = fleet 1
# FromFromFrom = fleet 2
country_event = {
id = rg_skill.15
hide_window = yes
is_triggered_only = yes
trigger = {
OR = {
fromfrom.leader = {
has_trait = RG_leader_trait_admiral_nanorebuild_gray
}
}
NOT = {
This = {
check_variable = {
which = rg_nanorebuild_counter
value = 0
}
}
}
}
immediate = {
This = {
set_variable = {
2023-06-20 14:05:14 +08:00
which = rg_nanorebuild_counter
value = 0
}
}
}
}