From 856759ab93c4b550c766a997f42ca92dc0f14ee3 Mon Sep 17 00:00:00 2001 From: ademblon Date: Wed, 2 Aug 2023 23:35:56 +0200 Subject: [PATCH 1/2] fixed div/0 error fixed aroai considering distilleries with total prohibition and tobacco allowed starting buildings of ussr : more combustion plants less paper mills --- common/history/buildings/02_east_europe.txt | 27 ++++---------- common/history/buildings/09_central_asia.txt | 35 +++---------------- .../aroai_downsizing_effects.txt | 8 ++--- .../aroai_evaluation_triggers.txt | 4 +++ .../aroai_framework_triggers.txt | 1 + 5 files changed, 19 insertions(+), 56 deletions(-) diff --git a/common/history/buildings/02_east_europe.txt b/common/history/buildings/02_east_europe.txt index b29894594..568908f1b 100644 --- a/common/history/buildings/02_east_europe.txt +++ b/common/history/buildings/02_east_europe.txt @@ -665,7 +665,7 @@ } create_building = { building = "building_combustion_plant" - level = 10 + level = 20 subsidized = yes reserves = 1 activate_production_methods = { @@ -1013,19 +1013,6 @@ "pm_government_run_mine" } } - create_building = { - building = "building_paper_manufactories" - level = 30 - subsidized = yes - reserves = 1 - activate_production_methods = { - "pm_base_paper" - "pm_no_automation" - "pm_professional_service_industry_no" - "pm_no_environmental_tech" - "pm_government_run_general_industry" - } - } create_building = { building = "building_government_administration" level = 8 @@ -1213,7 +1200,7 @@ } create_building = { building = "building_combustion_plant" - level = 10 + level = 20 subsidized = yes reserves = 1 activate_production_methods = { @@ -1706,7 +1693,7 @@ } create_building = { building = "building_combustion_plant" - level = 5 + level = 10 subsidized = yes reserves = 1 activate_production_methods = { @@ -1860,7 +1847,7 @@ } create_building = { building = "building_combustion_plant" - level = 3 + level = 10 subsidized = yes reserves = 1 activate_production_methods = { @@ -1971,7 +1958,7 @@ } create_building = { building = "building_combustion_plant" - level = 6 + level = 10 subsidized = yes reserves = 1 activate_production_methods = { @@ -2217,7 +2204,7 @@ } create_building = { building = "building_combustion_plant" - level = 3 + level = 10 subsidized = yes reserves = 1 activate_production_methods = { @@ -3294,7 +3281,7 @@ } create_building = { building = "building_combustion_plant" - level = 5 + level = 10 subsidized = yes reserves = 1 activate_production_methods = { diff --git a/common/history/buildings/09_central_asia.txt b/common/history/buildings/09_central_asia.txt index 81aeaa629..e9f1339e3 100644 --- a/common/history/buildings/09_central_asia.txt +++ b/common/history/buildings/09_central_asia.txt @@ -183,7 +183,7 @@ } create_building = { building = "building_combustion_plant" - level = 1 + level = 5 subsidized = yes reserves = 1 activate_production_methods = { @@ -510,7 +510,7 @@ } create_building = { building = "building_combustion_plant" - level = 3 + level = 10 subsidized = yes reserves = 1 activate_production_methods = { @@ -555,19 +555,6 @@ "pm_government_run_building_railway" } } - create_building = { - building = "building_paper_manufactories" - level = 30 - subsidized = yes - reserves = 1 - activate_production_methods = { - "pm_base_paper" - "pm_no_automation" - "pm_professional_service_industry_no" - "pm_no_environmental_tech" - "pm_government_run_general_industry" - } - } create_building = { building = "building_motor_industry" level = 10 @@ -595,21 +582,9 @@ } } } + # saratov s:STATE_TARTARIA = { - region_state:RUS = { - create_building = { - building = "building_paper_manufactories" - level = 20 - subsidized = yes - reserves = 1 - activate_production_methods = { - "pm_base_paper" - "pm_no_automation" - "pm_professional_service_industry_no" - "pm_no_environmental_tech" - "pm_government_run_general_industry" - } - } + region_state:RUS = { } create_building = { building = "building_airport" level = 1 @@ -656,7 +631,7 @@ } create_building = { building = "building_combustion_plant" - level = 3 + level = 10 subsidized = yes reserves = 1 activate_production_methods = { diff --git a/common/scripted_effects/aroai_downsizing_effects.txt b/common/scripted_effects/aroai_downsizing_effects.txt index ff3f884a0..36d1fb272 100644 --- a/common/scripted_effects/aroai_downsizing_effects.txt +++ b/common/scripted_effects/aroai_downsizing_effects.txt @@ -104,9 +104,7 @@ aroai_downsize_excessive_buildings = { # Barracks if = { limit = { - aroai_tax_level_equal_or_higher = { - value = 3 - } + aroai_tax_level_equal_or_higher = { value = 3 } aroai_is_using_military_forces = no aroai_building_barracks_spending_value >= aroai_building_barracks_spending_excess } @@ -130,9 +128,7 @@ aroai_downsize_excessive_buildings = { # Naval base if = { limit = { - aroai_tax_level_equal_or_higher = { - value = 3 - } + aroai_tax_level_equal_or_higher = { value = 3 } aroai_is_using_military_forces = no aroai_building_naval_base_spending_value >= aroai_building_naval_base_spending_excess } diff --git a/common/scripted_triggers/aroai_evaluation_triggers.txt b/common/scripted_triggers/aroai_evaluation_triggers.txt index 8efb49452..c695e7e04 100644 --- a/common/scripted_triggers/aroai_evaluation_triggers.txt +++ b/common/scripted_triggers/aroai_evaluation_triggers.txt @@ -7,6 +7,10 @@ aroai_building_is_allowed = { $id$ < 15 NOT = { has_law = law_type:law_anti_industrialization } } + OR = { + NOT = {$id$ = 81} + NOR = { has_law = law_type:law_total_prohibition has_law = law_type:law_tobacco_allowed } + } OR = { aroai_is_regular_construction_allowed = yes AND = { diff --git a/common/scripted_triggers/aroai_framework_triggers.txt b/common/scripted_triggers/aroai_framework_triggers.txt index 197318009..809230d8c 100644 --- a/common/scripted_triggers/aroai_framework_triggers.txt +++ b/common/scripted_triggers/aroai_framework_triggers.txt @@ -7,6 +7,7 @@ aroai_is_country_allowed = { NOT = { is_country_type = decentralized } + income > 0 } # From 86955192d312a324fd52f0b582d735d22659accb Mon Sep 17 00:00:00 2001 From: ademblon Date: Wed, 2 Aug 2023 23:59:52 +0200 Subject: [PATCH 2/2] aroai stop considering a few more buildings depending on prohibition laws removed a bracket in building histories --- common/history/buildings/09_central_asia.txt | 2 +- .../aroai_evaluation_triggers.txt | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/common/history/buildings/09_central_asia.txt b/common/history/buildings/09_central_asia.txt index e9f1339e3..bccc7b274 100644 --- a/common/history/buildings/09_central_asia.txt +++ b/common/history/buildings/09_central_asia.txt @@ -584,7 +584,7 @@ } # saratov s:STATE_TARTARIA = { - region_state:RUS = { } + region_state:RUS = { create_building = { building = "building_airport" level = 1 diff --git a/common/scripted_triggers/aroai_evaluation_triggers.txt b/common/scripted_triggers/aroai_evaluation_triggers.txt index c695e7e04..616d9848d 100644 --- a/common/scripted_triggers/aroai_evaluation_triggers.txt +++ b/common/scripted_triggers/aroai_evaluation_triggers.txt @@ -3,10 +3,29 @@ # called by : Every consider function # aroai_building_is_allowed = { + OR = { $id$ < 15 NOT = { has_law = law_type:law_anti_industrialization } } + OR = { + #opium, tobacco, distilleries not allowed + NOR = { $id$ = 81 $id$ = 41 $id$ = 42 } + NOT = { has_law = law_type:law_total_prohibition } + } + OR = { + # opium, distilleries not allowed + NOR = { $id$ = 81 $id$ = 42 } + NOT = { has_law = law_type:law_tobacco_allowed } + } + OR = { + # opium not allowed + NOR = { $id$ = 42 } + NOT = { has_law = law_type:law_alcohol_allowed} + } + + + OR = { NOT = {$id$ = 81} NOR = { has_law = law_type:law_total_prohibition has_law = law_type:law_tobacco_allowed }