Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions common/ai_strategies/00_default_strategy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,9 @@ ai_strategy_default = {

add = {
value = investment_pool_income
divide = 1000 # 1 construction output per this much into the investment pool
subtract = 7500 # So small nations don't overshoot early on
divide = 750 # 1 construction output per this much into the investment pool
min = 0
}

add = {
Expand Down Expand Up @@ -1212,7 +1214,6 @@ ai_strategy_default = {
}

min = 10
max = 1000
}

# How many levels of barracks should the AI have
Expand Down Expand Up @@ -1337,17 +1338,6 @@ ai_strategy_default = {
limit = { has_law = law_type:law_national_militia }
multiply = 0.33
}

max = {
value = 500

if = {
limit = {
has_technology_researched = modernized_logistics
}
multiply = 1.25
}
}
min = 1
}

Expand Down Expand Up @@ -1438,8 +1428,7 @@ ai_strategy_default = {
limit = { has_strategy = ai_strategy_maintain_mandate_of_heaven }
multiply = 0.25
}

max = 500

min = 0
}

Expand Down Expand Up @@ -3198,7 +3187,7 @@ ai_strategy_default = {
}
}

add = 10
add = 5
}
}

Expand Down
54 changes: 39 additions & 15 deletions common/decrees/00_decree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ decree_emergency_relief = {
has_harvest_condition = drought
has_harvest_condition = disease_outbreak
has_harvest_condition = extreme_winds
has_harvest_condition = tsunami
}
}
any_scope_pop = {
Expand Down Expand Up @@ -272,52 +273,75 @@ decree_promote_national_values = {
scope:country = {
OR = {
has_strategy = ai_strategy_reactionary_agenda
has_strategy = ai_strategy_conservative_agenda
}
}
}
add = 100
}
if = {
else_if = {
limit = {
scope:country = {
has_strategy = ai_strategy_nationalist_agenda
}
}
add = 200
}

if = {
limit = {
state_population < 100000
scope:country = {
OR = {
has_law = law_type:law_ethnostate
has_law = law_type:law_state_religion
has_law = law_type:law_theocracy
}
}
}
multiply = 0
multiply = 2.0
}
if = {
else_if = {
limit = {
state_population < 300000
scope:country = {
OR = {
has_law = law_type:law_cultural_exclusion
has_law = law_type:law_freedom_of_conscience
}
}
}
multiply = 0.5
}
if = {
else_if = {
limit = {
scope:country = {
OR = {
has_strategy = ai_strategy_reactionary_agenda
has_strategy = ai_strategy_conservative_agenda
has_law = law_type:law_multicultural
has_law = law_type:law_total_separation
}
}
}
multiply = 0.5
multiply = 0.1
}

if = {
limit = {
scope:country = {
OR = {
has_strategy = ai_strategy_progressive_agenda
has_strategy = ai_strategy_egalitarian_agenda
}
primary_cultures_percent_state > 0.9
religion_percent_state = {
target = scope:country.religion
value > 0.9
}
}
multiply = 1.5
multiply = 0
}
else_if = {
limit = {
primary_cultures_percent_state > 0.5
religion_percent_state = {
target = scope:country.religion
value > 0.5
}
}
multiply = 0.5
}
}
}
Expand Down
20 changes: 20 additions & 0 deletions common/history/ai/00_strategy.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
AI = {
# Default AI subject starting strategy depends on LD
every_country = {
limit = { is_subject = yes }
if = {
limit = { liberty_desire >= 80 }
set_strategy = ai_strategy_subject_break_free
}
else_if = {
limit = { liberty_desire >= 60 }
set_strategy = ai_strategy_subject_strengthen_self
}
else_if = {
limit = { liberty_desire <= 20 }
set_strategy = ai_strategy_subject_overlord_compliance
}
else = {
set_strategy = ai_strategy_subject_maintain_autonomy
}
}

c:RUS ?= {
set_strategy = ai_strategy_industrial_expansion
set_strategy = ai_strategy_hardline_communist
Expand Down
4 changes: 2 additions & 2 deletions common/on_actions/00_code_on_actions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1002,10 +1002,10 @@ on_treaty_entered_into_force = {
# Fires in addition to on_treaty_entered_into_force for treaties enforced by plays, etc
on_treaty_enforced = {
effect = {
scope:treaty_options.first_country = {
root.first_country = {
create_diplomatic_catalyst = {
type = catalyst_treaty_enforced
target = scope:treaty_options.second_country
target = root.second_country
}
}
}
Expand Down
73 changes: 71 additions & 2 deletions events/vanilla_events/natural_disasters_events.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ natural_disaster_events.1 = { #Small Earthquake
trigger = {
any_scope_state = {
in_earthquake_zone = yes
state_region = {
NOT = { has_variable = natural_disaster_cooldown }
}
}
}

Expand All @@ -30,6 +33,12 @@ natural_disaster_events.1 = { #Small Earthquake
in_earthquake_zone = yes
}
save_scope_as = earthquake_state
state_region = {
set_variable = {
name = natural_disaster_cooldown
days = normal_modifier_time
}
}
}
}

Expand Down Expand Up @@ -76,6 +85,7 @@ natural_disaster_events.2 = { #Small Flood
any_scope_state = {
state_region = {
has_harvest_condition = flood
NOT = { has_variable = natural_disaster_cooldown }
}
}
}
Expand All @@ -88,6 +98,12 @@ natural_disaster_events.2 = { #Small Flood
}
}
save_scope_as = flood_state
state_region = {
set_variable = {
name = natural_disaster_cooldown
days = normal_modifier_time
}
}
}
}

Expand Down Expand Up @@ -134,6 +150,7 @@ natural_disaster_events.3 = { #Mega Flood
any_scope_state = {
state_region = {
has_harvest_condition = flood
NOT = { has_variable = natural_disaster_cooldown }
}
}

Expand All @@ -154,6 +171,12 @@ natural_disaster_events.3 = { #Mega Flood
}
}
save_scope_as = mega_flood_state
state_region = {
set_variable = {
name = natural_disaster_cooldown
days = normal_modifier_time
}
}
}
set_variable = mega_flood
if = {
Expand Down Expand Up @@ -215,6 +238,9 @@ natural_disaster_events.4 = { #Mega Earthquake
trigger = {
any_scope_state = {
in_earthquake_zone = yes
state_region = {
NOT = { has_variable = natural_disaster_cooldown }
}
}
NOT = {
has_variable = mega_earthquake
Expand All @@ -231,6 +257,12 @@ natural_disaster_events.4 = { #Mega Earthquake
in_earthquake_zone = yes
}
save_scope_as = mega_earthquake_state
state_region = {
set_variable = {
name = natural_disaster_cooldown
days = normal_modifier_time
}
}
}
if = {
limit = {
Expand Down Expand Up @@ -294,10 +326,11 @@ natural_disaster_events.5 = { #Crop Failure
any_scope_building = {
is_farm_building = yes
occupancy >= 0.1
weekly_profit <= 0.5
}
state_region = {
has_harvest_condition = disease_outbreak
NOT = { has_variable = natural_disaster_cooldown }
NOT = { has_variable = krakatoa_crop_failure }
}
}
}
Expand All @@ -308,13 +341,20 @@ natural_disaster_events.5 = { #Crop Failure
any_scope_building = {
is_farm_building = yes
occupancy >= 0.1
weekly_profit <= 0.5
}
state_region = {
has_harvest_condition = disease_outbreak
NOT = { has_variable = natural_disaster_cooldown }
NOT = { has_variable = krakatoa_crop_failure }
}
}
save_scope_as = crop_fail_state
state_region = {
set_variable = {
name = natural_disaster_cooldown
days = normal_modifier_time
}
}
random_scope_building = {
limit = {
is_farm_building = yes
Expand Down Expand Up @@ -373,6 +413,9 @@ natural_disaster_events.6 = { #Tropical Cyclone
any_scope_state = {
in_earthquake_zone = yes
is_coastal = yes
state_region = {
NOT = { has_variable = natural_disaster_cooldown }
}
}
}

Expand All @@ -383,6 +426,12 @@ natural_disaster_events.6 = { #Tropical Cyclone
is_coastal = yes
}
save_scope_as = cyclone_state
state_region = {
set_variable = {
name = natural_disaster_cooldown
days = normal_modifier_time
}
}
}
}

Expand Down Expand Up @@ -428,6 +477,9 @@ natural_disaster_events.7 = { #Small Eruption
trigger = {
any_scope_state = {
in_volcanic_zone = yes
state_region = {
NOT = { has_variable = natural_disaster_cooldown }
}
}
}

Expand All @@ -437,6 +489,12 @@ natural_disaster_events.7 = { #Small Eruption
in_volcanic_zone = yes
}
save_scope_as = volcanic_state
state_region = {
set_variable = {
name = natural_disaster_cooldown
days = normal_modifier_time
}
}
}
}

Expand Down Expand Up @@ -500,6 +558,10 @@ natural_disaster_events.8 = { #Mega Eruption
trigger = {
any_scope_state = {
in_volcanic_zone = yes
state_region = {
NOT = { has_variable = natural_disaster_cooldown }
}
NOT = { state_region = s:STATE_WEST_JAVA }
}
NOT = {
has_variable = mega_eruption
Expand All @@ -514,8 +576,15 @@ natural_disaster_events.8 = { #Mega Eruption
random_scope_state = {
limit = {
in_volcanic_zone = yes
NOT = { state_region = s:STATE_WEST_JAVA }
}
save_scope_as = mega_volcanic_state
state_region = {
set_variable = {
name = natural_disaster_cooldown
days = normal_modifier_time
}
}
}
set_variable = {
name = mega_eruption
Expand Down