diff --git a/common/ai_strategies/00_default_strategy.txt b/common/ai_strategies/00_default_strategy.txt index 576a30c1d..925526dcd 100644 --- a/common/ai_strategies/00_default_strategy.txt +++ b/common/ai_strategies/00_default_strategy.txt @@ -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 = { @@ -1212,7 +1214,6 @@ ai_strategy_default = { } min = 10 - max = 1000 } # How many levels of barracks should the AI have @@ -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 } @@ -1438,8 +1428,7 @@ ai_strategy_default = { limit = { has_strategy = ai_strategy_maintain_mandate_of_heaven } multiply = 0.25 } - - max = 500 + min = 0 } @@ -3198,7 +3187,7 @@ ai_strategy_default = { } } - add = 10 + add = 5 } } diff --git a/common/decrees/00_decree.txt b/common/decrees/00_decree.txt index 9f82594b2..7a6b24c05 100755 --- a/common/decrees/00_decree.txt +++ b/common/decrees/00_decree.txt @@ -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 = { @@ -272,12 +273,13 @@ 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 @@ -285,39 +287,61 @@ decree_promote_national_values = { } 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 } } } diff --git a/common/history/ai/00_strategy.txt b/common/history/ai/00_strategy.txt index f5e59b271..a24dabcc1 100644 --- a/common/history/ai/00_strategy.txt +++ b/common/history/ai/00_strategy.txt @@ -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 diff --git a/common/on_actions/00_code_on_actions.txt b/common/on_actions/00_code_on_actions.txt index 618b37be3..a678896cf 100755 --- a/common/on_actions/00_code_on_actions.txt +++ b/common/on_actions/00_code_on_actions.txt @@ -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 } } } diff --git a/events/vanilla_events/natural_disasters_events.txt b/events/vanilla_events/natural_disasters_events.txt index 29c0af122..cc6897c09 100755 --- a/events/vanilla_events/natural_disasters_events.txt +++ b/events/vanilla_events/natural_disasters_events.txt @@ -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 } + } } } @@ -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 + } + } } } @@ -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 } } } } @@ -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 + } + } } } @@ -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 } } } @@ -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 = { @@ -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 @@ -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 = { @@ -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 } } } } @@ -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 @@ -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 } + } } } @@ -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 + } + } } } @@ -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 } + } } } @@ -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 + } + } } } @@ -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 @@ -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