From 6c31b3ab5e6faa067b52ff613eae2fb3e3ec3fb1 Mon Sep 17 00:00:00 2001 From: "actions[bot]" Date: Sun, 17 Nov 2024 20:00:50 +0000 Subject: [PATCH] 2024-11-17 20:00:50 --- src/common/ai_strategy/BFL.txt | 597 ++++++++++- src/common/ai_strategy/BYG.txt | 678 ++++++++++++ src/common/ai_strategy/HUJ.txt | 1430 +++++++++++++++++++++++++- src/common/ai_strategy/SAD.txt | 140 ++- src/common/ai_strategy/TIX.txt | 1162 ++++++++++++++++++++- src/common/ai_strategy/YUW.txt | 184 ++++ src/common/ideas/_economic.txt | 36 +- src/common/ideas/chy_new1.txt | 22 +- src/common/national_focus/tiexue.txt | 11 +- src/events/ai_bianzhi.txt | 50 + src/events/az_pt_event.txt | 2 +- 11 files changed, 4205 insertions(+), 107 deletions(-) diff --git a/src/common/ai_strategy/BFL.txt b/src/common/ai_strategy/BFL.txt index 0896cd9..ecc00d9 100755 --- a/src/common/ai_strategy/BFL.txt +++ b/src/common/ai_strategy/BFL.txt @@ -231,12 +231,6 @@ BFL_bangzhuxifang = { } } - - ai_strategy = { - type = send_volunteers_desire - id = "YUG" - value = 50 - } ai_strategy = { type = send_volunteers_desire id = "ROM" @@ -272,6 +266,11 @@ claims_on_poland = { id = "POL" value = 100 } + ai_strategy = { + type = send_volunteers_desire + id = "POL" + value = -100 + } } BFL_wushichongying = { @@ -1194,4 +1193,590 @@ BFL_protect_sandacheng_ore = { area = europe } +} + +BFL_home_land_is_safe = { + allowed = { + original_tag = BFL + } + enable = { + always = yes + } + abort_when_not_enabled = yes + + ai_strategy = { + type = garrison + value = -25 + } +} + +BFL_scorched_earth_german_front_baltics = { + + allowed = { original_tag = BFL } + enable = { + is_historical_focus_on = yes + has_war_with = TIX + NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower + has_manpower < 1000000 + has_political_power < 200 + OR = { + has_idea = volunteer_only + has_idea = limited_conscription + } + } + count_triggers = { + amount = 4 #if 4 baltic states are owned by an enemy, burn the rest of the Baltics + 814 = { CONTROLLER = { has_war_with = BFL } } + 11 = { CONTROLLER = { has_war_with = BFL } } + 189 = { CONTROLLER = { has_war_with = BFL } } + 815 = { CONTROLLER = { has_war_with = BFL } } + 190 = { CONTROLLER = { has_war_with = BFL } } + 809 = { CONTROLLER = { has_war_with = BFL } } + 810 = { CONTROLLER = { has_war_with = BFL } } + 808 = { CONTROLLER = { has_war_with = BFL } } + 811 = { CONTROLLER = { has_war_with = BFL } } + 13 = { CONTROLLER = { has_war_with = BFL } } + 812 = { CONTROLLER = { has_war_with = BFL } } + 813 = { CONTROLLER = { has_war_with = BFL } } + 191 = { CONTROLLER = { has_war_with = BFL } } + } + } + + abort = { + OR = { + NOT = { has_war_with = TIX } + strength_ratio = { tag = TIX ratio > 1.5 } + date > 1944.1.1 + } + } + + ai_strategy = { + type = scorched_earth_prio + id = BFL + states = { + 814 + 11 + 189 + 815 + 190 + 809 + 810 + 808 + 811 + 13 + 812 + 813 + 191 + } + } +} + +BFL_scorched_earth_german_front_Poland = { + + allowed = { original_tag = BFL } + enable = { + has_war_with = TIX + is_historical_focus_on = yes + NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower + has_manpower < 1000000 + has_political_power < 200 + OR = { + has_idea = volunteer_only + has_idea = limited_conscription + } + } + count_triggers = { + amount = 2 #if 2 states are owned by an enemy, burn the rest of the area + 784 = { CONTROLLER = { has_war_with = BFL } } + 96 = { CONTROLLER = { has_war_with = BFL } } + 95 = { CONTROLLER = { has_war_with = BFL } } + 94 = { CONTROLLER = { has_war_with = BFL } } + 93 = { CONTROLLER = { has_war_with = BFL } } + 91 = { CONTROLLER = { has_war_with = BFL } } + 89 = { CONTROLLER = { has_war_with = BFL } } + + } + } + + abort = { + OR = { + NOT = { has_war_with = TIX } + strength_ratio = { tag = TIX ratio > 1.5 } + date > 1944.1.1 + } + } + + ai_strategy = { + type = scorched_earth_prio + id = BFL + states = { + 784 + 96 + 95 + 94 + 93 + 91 + 89 + } + } +} + +BFL_scorched_earth_german_front_north = { + + allowed = { original_tag = BFL } + enable = { + has_war_with = TIX + is_historical_focus_on = yes + NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower + has_manpower < 1000000 + has_political_power < 200 + OR = { + has_idea = volunteer_only + has_idea = limited_conscription + } + } + count_triggers = { + amount = 2 #if 2 states are owned by an enemy, burn the rest of the area + 208 = { CONTROLLER = { has_war_with = BFL } } + 209 = { CONTROLLER = { has_war_with = BFL } } + 210 = { CONTROLLER = { has_war_with = BFL } } + 195 = { CONTROLLER = { has_war_with = BFL } } + 263 = { CONTROLLER = { has_war_with = BFL } } + 246 = { CONTROLLER = { has_war_with = BFL } } + + + } + } + + abort = { + OR = { + NOT = { has_war_with = TIX } + strength_ratio = { tag = TIX ratio > 1.5 } + date > 1944.1.1 + } + } + + ai_strategy = { + type = scorched_earth_prio + id = BFL + states = { + 208 + 209 + 210 + 195 + 263 + 246 + } + } +} + +BFL_scorched_earth_german_front_center = { + + allowed = { original_tag = BFL } + enable = { + has_war_with = TIX + is_historical_focus_on = yes + NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower + has_manpower < 1000000 + has_political_power < 200 + OR = { + has_idea = volunteer_only + has_idea = limited_conscription + } + } + count_triggers = { + amount = 4 #if 4 states are owned by an enemy, burn the rest of the area + 207 = { CONTROLLER = { has_war_with = BFL } } + 206 = { CONTROLLER = { has_war_with = BFL } } + 204 = { CONTROLLER = { has_war_with = BFL } } + 194 = { CONTROLLER = { has_war_with = BFL } } + 201 = { CONTROLLER = { has_war_with = BFL } } + 199 = { CONTROLLER = { has_war_with = BFL } } + 202 = { CONTROLLER = { has_war_with = BFL } } + 193 = { CONTROLLER = { has_war_with = BFL } } + 241 = { CONTROLLER = { has_war_with = BFL } } + 242 = { CONTROLLER = { has_war_with = BFL } } + 243 = { CONTROLLER = { has_war_with = BFL } } + 224 = { CONTROLLER = { has_war_with = BFL } } + } + } + + abort = { + OR = { + NOT = { has_war_with = TIX } + strength_ratio = { tag = TIX ratio > 1.5 } + date > 1944.1.1 + } + } + + ai_strategy = { + type = scorched_earth_prio + id = BFL + states = { + 207 + 206 + 204 + 194 + 201 + 199 + 202 + 193 + 241 + 242 + 243 + 224 + } + } +} + +BFL_scorched_earth_german_front_moscow = { + + allowed = { original_tag = BFL } + enable = { + has_war_with = TIX + is_historical_focus_on = yes + NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower + has_manpower < 1000000 + has_political_power < 200 + OR = { + has_idea = volunteer_only + has_idea = limited_conscription + } + } + count_triggers = { + amount = 1 #if 1 states are owned by an enemy, burn the rest of the area + 219 = { CONTROLLER = { has_war_with = BFL } } + 246 = { CONTROLLER = { has_war_with = BFL } } + 242 = { CONTROLLER = { has_war_with = BFL } } + 205 = { CONTROLLER = { has_war_with = BFL } } + 223 = { CONTROLLER = { has_war_with = BFL } } + + } + } + + abort = { + OR = { + NOT = { has_war_with = TIX } + strength_ratio = { tag = TIX ratio > 1.5 } + date > 1944.1.1 + } + controls_state = 220 + controls_state = 224 + controls_state = 243 + controls_state = 207 + controls_state = 210 + } + + ai_strategy = { + type = scorched_earth_prio + id = BFL + states = { + 219 + 246 + 242 + 205 + 223 + } + } +} + +BFL_scorched_earth_german_front_stalingrad = { + + allowed = { original_tag = BFL } + enable = { + has_war_with = TIX + is_historical_focus_on = yes + NOT = { # please don't spend PP on blowing up your own stuff when you need it for manpower + has_manpower < 1000000 + has_political_power < 200 + OR = { + has_idea = volunteer_only + has_idea = limited_conscription + } + } + count_triggers = { + amount = 1 #if 1 states are owned by an enemy, burn the rest of the area + 217 = { CONTROLLER = { has_war_with = BFL } } + 265 = { CONTROLLER = { has_war_with = BFL } } + 245 = { CONTROLLER = { has_war_with = BFL } } + 238 = { CONTROLLER = { has_war_with = BFL } } + 829 = { CONTROLLER = { has_war_with = BFL } } + + } + } + + abort = { + OR = { + NOT = { has_war_with = TIX } + strength_ratio = { tag = TIX ratio > 1.5 } + date > 1944.1.1 + } + controls_state = 218 + controls_state = 228 + controls_state = 260 + controls_state = 239 + } + + ai_strategy = { + type = scorched_earth_prio + id = BFL + states = { + 217 + 265 + 245 + 238 + 829 + } + } +} + +BFL_dont_do_so_many_naval_invasions_please = { + allowed = { original_tag = BFL } + + enable = { + always = yes + } + abort_when_not_enabled = yes + + ai_strategy = { + type = invasion_unit_request + tag = TIX + value = -50 + } + ai_strategy = { + type = invasion_unit_request + tag = FIN + value = -50 + } +} + +BFL_defend_blitzkrieg = {#Only perform careful attacks, we want to defend while germany has buffs. + allowed = { + original_tag = BFL + } + + enable = { + date < 1942.8.1 #To space! + has_war_with = TIX + TIX = { has_idea = TIX_sljh } + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = front_control + + tag = TIX + + ratio = 0.4 + + priority = 100 + ordertype = front + execution_type = careful + execute_order = no + } + +} + +BFL_defend_blitzkrieg_2 = {#Only perform careful attacks, we want to defend for a bit + allowed = { + original_tag = BFL + } + + enable = { + date < 1942.8.1 #To space! + has_war_with = TIX + NOT = { TIX = { has_idea = TIX_sljh } } + is_historical_focus_on = yes + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = front_control + + tag = TIX + + ratio = 0.4 + + priority = 100 + ordertype = front + execution_type = careful + } + +} + +########################### +### avoid attacking the baltics until we have sent ultimatums +########################### +BFL_ultimatum_LIT = { + allowed = { + original_tag = BFL + } + enable = { + is_historical_focus_on = yes + } + abort = { + date > 1941.12.31 #If it's late then it's fine + } + + ai_strategy = { + type = antagonize + id = LIT + value = -50 + } + ai_strategy = { + type = conquer + id = LIT + value = -200 + } +} + +BFL_ultimatum_LAT = { + allowed = { + original_tag = BFL + } + enable = { + is_historical_focus_on = yes + } + abort = { + date > 1941.12.31 #If it's late then it's fine + } + + ai_strategy = { + type = antagonize + id = LAT + value = -50 + } + ai_strategy = { + type = conquer + id = LAT + value = -200 + } +} + +BFL_ultimatum_EST = { + allowed = { + original_tag = BFL + } + enable = { + is_historical_focus_on = yes + } + abort = { + date > 1941.12.31 #If it's late then it's fine + } + + ai_strategy = { + type = antagonize + id = EST + value = -50 + } + ai_strategy = { + type = conquer + id = EST + value = -200 + } +} + +########################### +### avoid attacking Finland until we have sent ultimatum +########################### + +BFL_ultimatum_FIN = { + allowed = { + original_tag = BFL + } + enable = { + is_historical_focus_on = yes + OR = { + NOT = { owns_state = 146 } #Karjala + 146 = { + owner = { NOT = { is_in_faction_with = ROOT } } + } + } + } + abort = { + OR = { + date > 1941.12.31 #If it's late then it's fine + OR = { + owns_state = 146 #Karjala + 146 = { + owner = { is_in_faction_with = ROOT } + } + } + } + } + + ai_strategy = { + type = antagonize + id = FIN + value = -30 + } + ai_strategy = { + type = conquer + id = FIN + value = -200 + } +} + +###### Don't start ww3 until Japan is defeated + +AZ_ALLIES_avoid_enemies_for_a_while_ww3 = { + allowed = { + OR = { + original_tag = HUJ + is_in_faction_with = HUJ + } + } + enable = { + is_historical_focus_on = yes + date > 1943.1.1 + OR = { + has_war_with = TIX + has_war_with = CHY + } + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = conquer + id = PER + value = -200 + } + ai_strategy = { + type = conquer + id = BFL + value = -200 + } +} + +#### FORCE CONCENTRATION + +# Spread out before barbarossa +BFL_aifc_linear_defence = { + allowed = { original_tag = BFL } + enable = { + # We have split Poland up + OR = { + owns_state = 96 + owns_state = 95 + owns_state = 94 + owns_state = 93 + owns_state = 92 + } + } + abort = { + OR ={ + # Winter Offensive, Right + date > 1941.12.1 + # Desperate Defence + surrender_progress > 0.4 + } + } + + ai_strategy = { + type = force_concentration_factor + value = -100 # Just don't + } } \ No newline at end of file diff --git a/src/common/ai_strategy/BYG.txt b/src/common/ai_strategy/BYG.txt index 72307a5..62c3389 100755 --- a/src/common/ai_strategy/BYG.txt +++ b/src/common/ai_strategy/BYG.txt @@ -764,6 +764,34 @@ BYG_unit_buffer_for_europe = { subtract_invasions_from_need = no } + + ai_strategy = { + type = put_unit_buffers + + order_id = 1 + + # north africa + states = { + 290 + 461 + 459 + 460 + 458 + 665 + 448 + 449 + 450 + 451 + 452 + 447 + } + + ratio = 0.15 + + area = europe + + subtract_invasions_from_need = yes + } } BYG_naval_invasions_please = { @@ -1143,4 +1171,654 @@ BYG_wushibfl = { id = "BFL" value = 500 } +} + +BYG_ask_HUJ_YUW_for_access_before_war = { + allowed = { + tag = BYG + } + enable = { + date > 1940.9.9 + NOT = { + OR = { + is_in_faction_with = HUJ + has_military_access_to = HUJ + } + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = diplo_action_desire + id = HUJ + target = military_access + value = 1000 + } + ai_strategy = { + type = diplo_action_desire + id = YUW + target = military_access + value = 1000 + } +} + +BYG_focus_on_africa = { + allowed = { original_tag = BYG } + + enable = { + is_historical_focus_on = yes + has_war_with = TIX + country_exists = WEX + OR = { # Check whole north-african coast + 448 = { CONTROLLER = { has_war_with = ROOT } } # tripoli + 450 = { CONTROLLER = { has_war_with = ROOT } } # benghazi + 458 = { CONTROLLER = { has_war_with = ROOT } } # tunisia + 461 = { CONTROLLER = { has_war_with = ROOT } } # casablanca + 462 = { CONTROLLER = { has_war_with = ROOT } } # marrakech + 459 = { CONTROLLER = { has_war_with = ROOT } } # algiers + 460 = { CONTROLLER = { has_war_with = ROOT } } # constantine + 665 = { CONTROLLER = { has_war_with = ROOT } } # gabès + 449 = { CONTROLLER = { has_war_with = ROOT } } # el agheila + 451 = { CONTROLLER = { has_war_with = ROOT } } # derna + 452 = { CONTROLLER = { has_war_with = ROOT } } # matrouh + 447 = { CONTROLLER = { has_war_with = ROOT } } # alexandria + 446 = { CONTROLLER = { has_war_with = ROOT } } # cairo + 290 = { CONTROLLER = { has_war_with = ROOT } } # spanish africa + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = front_unit_request + area = africa + value = 60 + } + + ai_strategy = { + type = area_priority + id = africa + value = 60 + } +} + +BYG_HUJ_sync_invasions_on_europe = { + allowed = { + #always = no + OR = { + tag = BYG + tag = HUJ + } + } + + # only allow invasion on europe on every third month + + enable = { + set_temp_variable = { days = global.num_days } + modulo_temp_variable = { days = 90 } + check_variable = { days < 60 } + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = front_control + + area = mainland_europe + + ordertype = invasion + execute_order = no + } +} + +BYG_take_out_italy_boost = { + allowed = { + original_tag = BYG + is_historical_focus_on = yes + } + enable = { + date > 1942.6.1 + SAD = { + surrender_progress < 0.2 + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = invade + id = SAD + value = 150 + } + + ai_strategy = { + type = area_priority + id = italy + value = 600 + } + + ai_strategy = { + type = invasion_unit_request + area = italy + value = 3 + } + + ai_strategy = { + type = area_priority + id = north_africa + value = 400 + } + + ai_strategy = { + type = area_priority + id = normandy_landing_zone + value = -100 + } +} + +BYG_d_day_boost = { + allowed = { + original_tag = BYG + } + enable = { + has_war_with = TIX + date > 1942.9.1 + SAD = { + surrender_progress > 0.2 + } + } + abort = { + OR = { + date > 1944.9.1 # if we haven't succeeded by now, kill Japan instead + AND = { + 16 = { is_controlled_by_ROOT_or_ally = yes } # Paris has been liberated + is_historical_focus_on = yes + } + } + } + + ai_strategy = { + type = invade + id = TIX + value = 200 + } + + ai_strategy = { + type = area_priority + id = normandy_landing_zone + value = 400 + } + + ai_strategy = { + type = invasion_unit_request + area = normandy_landing_zone + value = 5 + } +} + +BYG_torch_boost = { + allowed = { + original_tag = BYG + } + enable = { + country_exists = WEX + has_war_with = TIX + date > 1942.5.1 + } + abort = { + OR = { + date > 1943.9.1 # if we haven't succeeded by now, maybe try somewhere else + 461 = { is_controlled_by_ROOT_or_ally = yes } + 459 = { is_controlled_by_ROOT_or_ally = yes } + } + } + + ai_strategy = { + type = area_priority + id = torch_landing_zone + value = 800 + } + + ai_strategy = { + type = area_priority + id = vichy_mainland + value = -200 + } + + ai_strategy = { + type = invasion_unit_request + area = torch_landing_zone + value = 2 + } + ai_strategy = { + type = front_unit_request + area = torch_landing_zone + value = 1 + } + ai_strategy = { + type = prepare_for_war + id = WEX + value = 200 + } + ai_strategy = { + type = invade + id = WEX + value = 200 + } +} + +BYG_save_india = { # in the case where japan has beaten china and is moving on india we should step up + allowed = { original_tag = BYG } + enable = { + has_government = democratic + is_in_faction = no + has_war = no + + CHY = { + or = { + has_war_with = RAJ + has_war_with = HUJ + } + NOT = { has_war_with = DOH } + } + or = { + RAJ = { + is_in_faction_with = HUJ + surrender_progress > 0.15 + } + not = { country_exists = RAJ } + } + } + abort = { + OR = { + has_war_with = RAJ + is_in_faction_with = CHY + CHY = { + NOT = { has_war_with = RAJ } + } + } + } + + ai_strategy = { + type = contain + id = "CHY" + value = 200 + } + + ai_strategy = { + type = protect + id = "RAJ" + value = 200 + } +} + +BYG_lose_fateful_lightning_from_terribly_swift_sword = { + + allowed = { + OR = { + tag = BYG + tag = HUJ # second breakfast protocol - activated + } + } + enable = { + country_exists = WEX + YUW = { + OR = { + has_capitulated = yes + controls_state = 16 + } + has_war_with = TIX + is_in_faction_with = BYG + } + OR = { + AND = { + WEX = { + is_ai = no + has_war = no + } + is_historical_focus_on = yes + date > 1942.9.1 + } + AND = { + OR = { + is_historical_focus_on = no + WEX = { has_war = yes } + } + date > 1942.6.1 + } + AND = { + WEX = { is_ai = yes } + date > 1942.6.1 + } + } + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = antagonize + id = WEX + value = 2500 # we hateses them filthy Vichy Frenches + } + ai_strategy = { + type = declare_war + id = WEX + value = 500 # we hateses them filthy Vichy Frenches. strategy >= 500 forces declaration + } +} + +TIX_is_bad = { + allowed = { + tag = BYG + } + + enable = { + TIX = { + exists = yes + } + NOT = { is_ally_with = TIX } + HUJ = { + has_war_with = TIX + } + has_government = democratic + HUJ = { + has_government = democratic + } + date > 1939.1.1 + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = prepare_for_war + id = TIX + value = 100 + } +} + +BYG_produce_floating_harbors = { + allowed = { original_tag = BYG } + enable = { + is_historical_focus_on = yes + date > 1941.1.1 + has_war = yes + num_of_naval_factories > 25 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = unit_ratio + id = floating_harbor # for floating harbors, 'unit_ratio' is actually not a ratio but an absolute desired number + value = 10 + } +} + +BYG_stay_away_from_my_pacific = { + allowed = { + original_tag = BYG + } + enable = { + has_war_with = CHY + } + abort_when_not_enabled = yes + + ai_strategy = { + type = area_priority + id = pacific + value = 100 + } +} + +BYG_start_buffering_in_pacific = { + allowed = { + tag = BYG + } + enable = { + date > 1941.10.2 + OR = { + has_war_with = CHY + has_war_with = DOH + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = put_unit_buffers + + # pacific islands + states = { + 633 #Marshall + 632 #Wake + 684 #Caroline + 645 #Iwo Jima + 638 #Guam + 646 #Saipan + } + + ratio = 0.12 + + area = pacific + + subtract_invasions_from_need = no + subtract_fronts_from_need = no + } + + ai_strategy = { + type = put_unit_buffers + + # pacific islands + states = { + 633 #Marshall + 632 #Wake + 684 #Caroline + 645 #Iwo Jima + 638 #Guam + 646 #Saipan + } + + ratio = 0.12 + + area = pacific + + subtract_invasions_from_need = yes + subtract_fronts_from_need = no + } + + ai_strategy = { + type = put_unit_buffers + + # pacific islands + states = { + 633 #Marshall + 632 #Wake + 684 #Caroline + 645 #Iwo Jima + 638 #Guam + 646 #Saipan + } + + ratio = 0.12 + area = home_islands + + subtract_invasions_from_need = yes + subtract_fronts_from_need = no + } + + ai_strategy = { + type = front_unit_request + area = pacific + value = 30 + } + + ai_strategy = { + type = invasion_unit_request + area = pacific + value = 2 + } + + ai_strategy = { + type = naval_invasion_supremacy_weight + value = 50 + } +} + +BYG_sugar_daddy_for_HUJ = { + allowed = { original_tag = BYG } + enable = { + NOT = { has_war_with = HUJ } + has_government = democratic + HUJ = { + has_government = democratic + has_war = yes + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = send_lend_lease_desire + id = HUJ + value = 500 + } +} + +BYG_sugar_daddy_for_BFL = { + allowed = { original_tag = BYG } + enable = { + NOT = { has_war_with = BFL } + has_government = democratic + TIX = { has_government = fascism } + BFL = { + has_war_with = TIX + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = send_lend_lease_desire + id = BFL + value = 500 + } +} + +BYG_dont_guarantee_SA_unless_everyhting_is_shit = { + allowed = { + original_tag = BYG + has_dlc = "Trial of Allegiance" + } + enable = { + threat < 0.9 + + } + abort_when_not_enabled = yes + + ai_strategy = { + type = protect + id = CAN + value = -200 + } + ai_strategy = { + type = protect + id = MEX + value = -200 + } + ai_strategy = { + type = protect + id = GUA + value = -200 + } + + ai_strategy = { + type = protect + id = HON + value = -200 + } + ai_strategy = { + type = protect + id = ELS + value = -200 + } + + ai_strategy = { + type = protect + id = NIC + value = -200 + } + ai_strategy = { + type = protect + id = CUB + value = -200 + } + + ai_strategy = { + type = protect + id = HAI + value = -200 + } + ai_strategy = { + type = protect + id = DOM + value = -200 + } + ai_strategy = { + type = protect + id = COS + value = -200 + } + ai_strategy = { + type = protect + id = PAN + value = -200 + } + ai_strategy = { + type = protect + id = COL + value = -200 + } + ai_strategy = { + type = protect + id = VEN + value = -200 + } + + ai_strategy = { + type = protect + id = ECU + value = -200 + } + ai_strategy = { + type = protect + id = PRU + value = -200 + } + + ai_strategy = { + type = protect + id = BOL + value = -200 + } + ai_strategy = { + type = protect + id = CHL + value = -200 + } + + ai_strategy = { + type = protect + id = ARG + value = -200 + } + ai_strategy = { + type = protect + id = PAR + value = -200 + } + + ai_strategy = { + type = protect + id = URG + value = -200 + } + ai_strategy = { + type = protect + id = BRA + value = -200 + } } \ No newline at end of file diff --git a/src/common/ai_strategy/HUJ.txt b/src/common/ai_strategy/HUJ.txt index 26453d4..fa4b5d3 100755 --- a/src/common/ai_strategy/HUJ.txt +++ b/src/common/ai_strategy/HUJ.txt @@ -434,33 +434,6 @@ HUJ_naval_role_ratios_historical = { } } -HUJ_lifeline_of_the_empire = { - allowed = { - original_tag = HUJ - } - - enable = { - OR = { - has_war_with = TIX - has_war_with = BYG - has_war_with = BFL - has_war_with = CHY - has_war_with = SAD - has_war_with = DOH - has_war_with = YUW - } - } - - abort_when_not_enabled = yes - - ai_strategy = { - type = area_priority - id = suez - value = 30 # this is extra on top of 50 base - } -} - - HUJ_BYG_focus_on_europe = { allowed = { OR = { @@ -489,6 +462,7 @@ HUJ_time_to_ditch_FRA = { } enable = { + is_historical_focus_on = yes YUW = { has_capitulated = no } @@ -1242,13 +1216,17 @@ HUJ_protect_africa_ore = { states = { 452 447 - 907 446 } # ai areas that the orders will use these buffers in - area = africa + area = suez + + subtract_invasions_from_need = yes + subtract_fronts_from_need = yes + } + } @@ -1405,4 +1383,1398 @@ HUJ_dengguanbi_rom = { value = -200 } +} + +HUJ_protect_poland_against_germany = { + allowed = { original_tag = HUJ } + + enable = { + TIX = { has_completed_focus = TIX_jiekesiluofakedemingyun } + TIX = { NOT = { has_war_with = POL } } + country_exists = POL + } + abort = { + OR = { + NOT = { country_exists = POL } + has_war_with = POL + } + } + + ai_strategy = { + type = protect + id = "POL" + value = 200 + } + ai_strategy = { + type = alliance + id = "POL" + value = 200 + } + ai_strategy = { + type = diplo_action_desire + id = POL + target = guarantee + value = 20 + } +} + +# lets make sure the allies dont overcommit to invasions early on +HUJ_ALLIES_careful_with_early_invasions = { + enable = { + date < 1941.6.1 + NOT = { original_tag = BYG } + + OR = { + is_in_faction_with = HUJ # anyone in allies + } + + NOT = { + BFL = { + has_war_with = TIX + surrender_progress > 0.1 + } + } + } + abort = { + OR = { + BFL = { + has_war_with = TIX + surrender_progress > 0.2 + } + date > 1941.6.1 + } + } + + ai_strategy = { + type = invade + id = SAD + value = -500 + } + + ai_strategy = { + type = invade + id = TIX + value = -500 + } + + ai_strategy = { + type = invade + id = WEX + value = -500 + } + + ai_strategy = { + type = invade + id = CHY + value = -500 + } + + ai_strategy = { + type = area_priority + id = scandinavia + value = -300 + } +} + +HUJ_BYG_careful_with_early_invasions = { #Same as above, alter in tandem + + allowed = { original_tag = BYG } # TODO this strategy seems bugged + + enable = { + date < 1941.6.1 + + OR = { + is_in_faction_with = HUJ # anyone in allies + } + + NOT = { + BFL = { + has_war_with = TIX + surrender_progress > 0.1 + } + } + } + abort = { + OR = { + BFL = { + has_war_with = TIX + surrender_progress > 0.2 + } + date > 1941.6.1 + } + } + + ai_strategy = { + type = invade + id = SAD + value = -500 + } + + ai_strategy = { + type = invade + id = TIX + value = -500 + } + + ai_strategy = { + type = invade + id = WEX + value = -500 + } + + ai_strategy = { + type = area_priority + id = scandinavia + value = -300 + } +} + +HUJ_ALLIES_east_prussia_invasion_is_death_trap = { + enable = { + + OR = { + is_in_faction_with = HUJ # anyone in allies + tag = YUW + } + + TIX = { has_war_with = POL } + POL = { + OR = { + exists = yes + has_capitulated = no + } + } + + date < 1940.1.1 + } + + abort = { + OR = { + NOT = { TIX = { has_war_with = POL } } + POL = { + OR = { + exists = no + has_capitulated = yes + } + } + date > 1940.1.1 + } + } + + ai_strategy = { + type = invade + id = TIX + value = -2000 + } + ai_strategy = { + type = dont_defend_ally_borders + id = POL + value = 100 + } +} + +# AI gets trapped here and dies to germany, although this takes a big toll +# on germany as well leading to bad attack on soviet as well as no UK troops +# to invade them later when they are busy. +HUJ_trying_to_save_benelux_is_deathtrap = { + allowed = { original_tag = HUJ } + enable = { + has_war_with = TIX + date < 1940.3.1 + OR = { + HOL = { has_capitulated = no } + BEL = { has_capitulated = no } + } + } + + abort = { + OR = { + date > 1940.3.1 + AND = { + HOL = { has_capitulated = yes } + BEL = { has_capitulated = yes } + } + } + } + + ai_strategy = { + type = dont_defend_ally_borders + id = HOL + value = 70 + } + ai_strategy = { + type = dont_defend_ally_borders + id = BEL + value = 50 + } + ai_strategy = { + type = dont_defend_ally_borders + id = LUX + value = 50 + } + ai_strategy = { + type = put_unit_buffers + # french states bordering benelux + states = { + 29 + 785 + 18 + } + ratio = 0.1 + area = europe + subtract_invasions_from_need = no + subtract_fronts_from_need = yes + } +} + +HUJ_the_adriatic_is_dangerous = { + allowed = { original_tag = HUJ } + enable = { + has_war_with = SAD + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_avoid_region + id = 168 #adriatic + value = 75 + } +} + +HUJ_home_guard = { + allowed = { original_tag = HUJ } + enable = { + any_enemy_country = { + OR = { + controls_state = 539 + controls_state = 14 + controls_state = 785 + controls_state = 29 + controls_state = 6 + controls_state = 35 + controls_state = 7 + controls_state = 36 + controls_state = 56 + controls_state = 59 + controls_state = 58 + controls_state = 909 + controls_state = 912 + controls_state = 99 + controls_state = 142 + controls_state = 337 + controls_state = 100 + controls_state = 922 + controls_state = 30 + controls_state = 23 + controls_state = 19 + controls_state = 806 + } + } + surrender_progress < 0.01 + } + + ai_strategy = { + type = garrison + value = 200 + } + + + + ai_strategy = { #closest sea zones + type = put_unit_buffers + ratio = 0.35 + states = { + 127 + 338 + 126 + 123 + 122 + 130 + 131 + 125 + } + subtract_fronts_from_need = no + } + + abort_when_not_enabled = yes + +} + +HUJ_home_guard_2 = { #we are being invaded help help + allowed = { original_tag = HUJ } + enable = { + surrender_progress > 0 + } + + ai_strategy = { + type = front_control + state_trigger = { + is_core_of = HUJ + } + area = UK_excluding_ni + priority = 250 + ratio = 0 + ordertype = front + execution_type = rush + execute_order = yes + manual_attack = yes + } + + ai_strategy = { #closest sea zones + type = put_unit_buffers + ratio = 0 + states = { + 127 + 338 + 126 + 123 + 122 + 130 + 131 + 125 + } + subtract_fronts_from_need = yes + } + + ai_strategy = { + type = area_priority + id = UK_excluding_ni + value = 60 + } + + ai_strategy = { + type = front_unit_request + area = UK_excluding_ni + value = 18 + } + + ai_strategy = { + type = front_unit_request + state_trigger = { + is_core_of = HUJ + } + area = UK_excluding_ni + value = 250 + } + + + + ai_strategy = { + type = theatre_distribution_demand_increase + id = 126 + value = 4 + } + + abort_when_not_enabled = yes + +} + +HUJ_protect_the_channel_from_invasion = { + allowed = { original_tag = HUJ } + enable = { + has_war = yes + + any_enemy_country = { + OR = { + ships_in_area = { + type = screen_ship + area = 18 + size > 14 + } + + ships_in_area = { + type = capital_ship + area = 18 + size > 1 + } + + ships_in_area = { + type = submarine + area = 18 + size > 23 + } + + ships_in_area = { + type = carrier + area = 18 + size > 1 + } + } + } + + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_mission_threshold + id = MISSION_PATROL + value = -100 + } + + ai_strategy = { + type = strike_force_home_base + id = 18 + value = 250 + } +} + +HUJ_the_channel_is_dangerous = { + allowed = { original_tag = HUJ } + enable = { + has_war = yes + 127 = { is_fully_controlled_by = HUJ } + 123 = { is_fully_controlled_by = HUJ } + 126 = { is_fully_controlled_by = HUJ } + 125 = { is_fully_controlled_by = HUJ } + + any_enemy_country = { + OR = { + ships_in_area = { + type = screen_ship + area = 18 + size < 15 + } + + ships_in_area = { + type = capital_ship + area = 18 + size < 2 + } + + ships_in_area = { + type = submarine + area = 18 + size < 24 + } + + ships_in_area = { + type = carrier + area = 18 + size < 2 + } + } + } + + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_avoid_region + id = 18 #english channel + value = 75 + } +} + +HUJ_raid_the_channel = { + allowed = { original_tag = HUJ } + enable = { + has_war = yes + OR = { + 127 = { NOT = { is_fully_controlled_by = HUJ } } + 123 = { NOT = { is_fully_controlled_by = HUJ } } + 126 = { NOT = { is_fully_controlled_by = HUJ } } + 125 = { NOT = { is_fully_controlled_by = HUJ } } + } + + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_convoy_raid_region + id = 18 #english channel + value = 250 + } + + ai_strategy = { + type = strike_force_home_base + id = 18 + value = 120 + } +} + +HUJ_raid_the_north_sea = { + allowed = { original_tag = HUJ } + enable = { + has_war = yes + OR = { + 130 = { NOT = { is_fully_controlled_by = HUJ } } + 131 = { NOT = { is_fully_controlled_by = HUJ } } + 121 = { NOT = { is_fully_controlled_by = HUJ } } + 136 = { NOT = { is_fully_controlled_by = HUJ } } + 120 = { NOT = { is_fully_controlled_by = HUJ } } + } + + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_convoy_raid_region + id = 16 #english channel + value = 250 + } + + ai_strategy = { + type = strike_force_home_base + id = 16 + value = 120 + } +} + +HUJ_raid_the_western_appproaches = { + allowed = { original_tag = HUJ } + enable = { + has_war = yes + + OR = { + 120 = { NOT = { is_fully_controlled_by = HUJ } } + 133 = { NOT = { is_fully_controlled_by = HUJ } } + 131 = { NOT = { is_fully_controlled_by = HUJ } } + 132 = { NOT = { is_fully_controlled_by = HUJ } } + 122 = { NOT = { is_fully_controlled_by = HUJ } } + 338 = { NOT = { is_fully_controlled_by = HUJ } } + 131 = { NOT = { is_fully_controlled_by = HUJ } } + } + + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_convoy_raid_region + id = 16 #english channel + value = 250 + } + + ai_strategy = { + type = strike_force_home_base + id = 16 + value = 120 + } +} + +HUJ_baltic_is_a_trap = { + allowed = { original_tag = HUJ } + enable = { + has_war_with = TIX + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_avoid_region + id = 9 #northern baltic + value = 600 + } + ai_strategy = { + type = naval_avoid_region + id = 206 #central baltic + value = 600 + } + ai_strategy = { + type = naval_avoid_region + id = 207 #danish belts + value = 600 + } + #ai_strategy = { + # type = naval_avoid_region + # id = 279 #Bothnia + # value = 600 + #} + ai_strategy = { + type = naval_avoid_region + id = 9 #gulf of finland + value = 600 + } +} + +HUJ_lifeline_of_the_empire = { + allowed = { original_tag = HUJ } + enable = { + always = yes + } + abort = { + always = no + } + + ai_strategy = { + type = area_priority + id = suez + value = 80 # this is extra on top of 50 base (now equal to other territory) + } +} + +HUJ_evacuate_troops_after_fall_of_france = { + allowed = { + OR = { + tag = HUJ + tag = BYG + } + } + + abort_when_not_enabled = yes + + enable = { + is_historical_focus_on = yes + OR = { + date < 1941.3.1 + BFL = { + surrender_progress < 0.3 + date < 1941.3.1 + } + } + } + + ai_strategy = { + type = front_unit_request + area = mainland_europe + value = -100 + } +} + +HUJ_COMMONWEALTH_dont_get_sucked_into_YUW_and_die = { + + enable = { + OR = { + tag = HUJ + is_subject_of = HUJ + } + has_war_with = TIX + has_war_together_with = YUW + + date < 1941.1.1 + + not = { country_exists = WEX } + + } + abort_when_not_enabled = yes + + ai_strategy = { + type = front_unit_request + area = europe + value = -60 + } + + ai_strategy = { + type = garrison + value = 70 + } +} + +HUJ_please_stop_stomping_italy_so_hard_in_africa_ty = { + + enable = { + OR = { + tag = HUJ + is_subject_of = HUJ + } + + date < 1941.3.1 + + } + abort_when_not_enabled = yes + + ai_strategy = { + type = put_unit_buffers + area = UK + ratio = 0.5 + subtract_invasions_from_need = no + subtract_fronts_from_need = yes + } +} + +HUJ_allies_dont_ask_for_diplo_access_to_BFL = { + enable = { + HUJ = { + has_government = democratic + } + BFL = { + has_government = communism + } + is_in_faction_with = HUJ + } + abort_when_not_enabled = yes + + ai_strategy = { + type = diplo_action_desire + id = BFL + target = military_access + value = -5000 + } + ai_strategy = { + type = diplo_action_desire + id = TAN + target = military_access + value = -5000 + } + ai_strategy = { + type = diplo_action_desire + id = MON + target = military_access + value = -5000 + } + ai_strategy = { + type = diplo_action_desire + id = BFL + target = docking_rights + value = -5000 + } + ai_strategy = { + type = diplo_action_desire + id = TAN + target = docking_rights + value = -5000 + } + ai_strategy = { + type = diplo_action_desire + id = MON + target = docking_rights + value = -5000 + } +} + +HUJ_defend_mediterranean = { + allowed = { + tag = HUJ + } + + enable = { + always = yes + } + abort_when_not_enabled = yes + + # Alexandria + ai_strategy = { + type = theatre_distribution_demand_increase + id = 447 + value = 10 + } + + # Gibraltar + ai_strategy = { + type = theatre_distribution_demand_increase + id = 118 + value = 4 + } + + # Malta + ai_strategy = { + type = theatre_distribution_demand_increase + id = 116 + value = 4 + } +} + +HUJ_convoy_raids_german_italian_convoys = { + allowed = { + tag = HUJ + } + + enable = { + OR = { + has_war_with = TIX + has_war_with = SAD + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_convoy_raid_region + id = 61 # cape verde plain + value = 100 + } + + ai_strategy = { + type = naval_convoy_raid_region + id = 45 # norwegian sea + value = 100 + } +} + +HUJ_produce_floating_harbors = { + allowed = { original_tag = HUJ } + enable = { + is_historical_focus_on = yes + date > 1941.1.1 + has_war = yes + num_of_naval_factories > 25 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = unit_ratio + id = floating_harbor # for floating harbors, 'unit_ratio' is actually not a ratio but an absolute desired number + value = 10 + } +} + +HUJ_ALLIES_norway_is_not_THAT_important = { + allowed = { + always = yes + } + enable = { + date < 1945.1.1 + is_in_faction_with = HUJ + NOT = { original_tag = NOR } # Let (exiled) Norway do what they want if they are in the Allies + any_allied_country = { + NORDIC_is_nordic = yes + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = area_priority + id = scandinavia + value = -150 + } + + ai_strategy = { + type = front_unit_request + area = scandinavia + value = -40 + } + + #ai_strategy = { + # type = naval_invasion_focus + # value = -100 + #} + + ai_strategy = { + type = naval_avoid_region + id = 173 #eastern north sea + value = 600 + } +} + +HUJ_BYG_take_italys_spaghetti = { + allowed = { + OR = { + original_tag = BYG + original_tag = HUJ + } + is_historical_focus_on = yes + } + enable = { + date > 1941.6.1 + SAD = { + surrender_progress < 0.2 + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = area_priority + id = italy + value = 60 + } + + ai_strategy = { + type = area_priority + id = north_africa + value = 100 + } + + ai_strategy = { + type = area_priority + id = normandy_landing_zone + value = -100 + } +} + +HUJ_BYG_onto_the_beaches = { + allowed = { + OR = { + original_tag = BYG + original_tag = HUJ + } + is_historical_focus_on = yes + } + enable = { + date > 1942.6.1 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_invasion_focus + value = 10 + } + + ai_strategy = { + type = invasion_unit_request + area = normandy_landing_zone + value = 10 + } +} + +HUJ_BYG_onto_the_beaches_2 = { + allowed = { + OR = { + original_tag = BYG + original_tag = HUJ + } + is_historical_focus_on = yes + } + enable = { + date > 1943.1.1 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_invasion_focus + value = 20 + } + + ai_strategy = { + type = invasion_unit_request + area = normandy_landing_zone + value = 6 + } + + ai_strategy = { + type = area_priority + id = normandy_landing_zone + value = 80 + } +} + +HUJ_BYG_onto_the_beaches_3 = { + allowed = { + OR = { + original_tag = BYG + original_tag = HUJ + } + is_historical_focus_on = yes + } + enable = { + date > 1943.6.1 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_invasion_focus + value = 30 + } +} + +HUJ_BYG_onto_the_beaches_4 = { + allowed = { + OR = { + original_tag = BYG + original_tag = HUJ + } + is_historical_focus_on = yes + } + enable = { + date > 1944.1.1 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_invasion_focus + value = 20 + } +} + +# Note BYG has an additional boost in the BYG_d_day_boost strategy +HUJ_BYG_d_day = { + allowed = { + OR = { + original_tag = BYG + original_tag = HUJ + } + is_historical_focus_on = yes + } + enable = { + date > 1942.6.1 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = area_priority + id = normandy_landing_zone + value = 60 + } + + ai_strategy = { + type = invasion_unit_request + area = normandy_landing_zone + value = 5 + } +} + +HUJ_RAJ_the_hot_gates = { + allowed = { + OR = { + original_tag = HUJ + original_tag = RAJ + } + } + enable = { + OR = { + 671 = { is_controlled_by = CHY } + 670 = { is_controlled_by = CHY } + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = area_priority + id = burma + value = 60 + } + + ai_strategy = { + type = front_unit_request + area = burma + value = 8 + } + + ai_strategy = { + type = put_unit_buffers + # burmese states + states = { + 288 + 640 + 430 + } + ratio = 0.05 + area = burma + subtract_invasions_from_need = no + subtract_fronts_from_need = yes + } +} + +HUJ_ALLIES_we_hate_fighting_in_the_balkans = { + + enable = { + date < 1943.1.1 + is_in_faction_with = HUJ + NOT = { tag = YUG } + NOT = { tag = GRE } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = dont_defend_ally_borders + id = YUG + value = 30 + } + + ai_strategy = { + type = front_unit_request + area = greater_balkans + value = -100 + } + + ai_strategy = { + type = area_priority + id = greater_balkans + value = -100 + } +} + +HUJ_sardinia_is_a_stupid_island = { + + allowed = { + original_tag = HUJ + } + enable = { + date < 1943.1.1 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = front_unit_request + area = sardinia + value = -50 + } + + ai_strategy = { + type = area_priority + id = sardinia + value = -50 + } + + ai_strategy = { + type = invasion_unit_request + area = sardinia + value = -100 + } +} + +HUJ_COMMONWEALTH_disregard_france_a_bit = { + allowed = { + is_in_faction_with = HUJ + is_subject_of = HUJ + } + enable = { + is_historical_focus_on = yes + } + abort = { + YUW = { + OR = { + has_capitulated = yes + is_government_in_exile = yes + } + } + } + ai_strategy = { + type = strategic_air_importance + id = 19 #Strategic Region ID - Northern France + value = -30000 #value of stocked main front in active combat is usually around 35,000 + } + ai_strategy = { + type = strategic_air_importance + id = 5 #Strategic Region ID - benelux + value = -30000 #value of stocked main front in active combat is usually around 35,000 + } +} + +HUJ_disregard_france_a_bit = { + allowed = { + original_tag = HUJ + } + enable = { + is_historical_focus_on = yes + } + abort = { + YUW = { + OR = { + has_capitulated = yes + is_government_in_exile = yes + } + } + } + ai_strategy = { + type = strategic_air_importance + id = 19 #Strategic Region ID - Northern France + value = -20000 #value of stocked main front in active combat is usually around 35,000 + } + ai_strategy = { + type = strategic_air_importance + id = 5 #Strategic Region ID - benelux + value = -20000 #value of stocked main front in active combat is usually around 35,000 + } +} + +HUJ_the_baltic_is_a_terrible_holiday_destination = { + + allowed = { + original_tag = HUJ + } + + enable = { + OR = { + has_war_with = TIX + has_war_with = DEN + TIX = { + OR = { + has_war_with = POL + has_war_with = HOL + has_war_with = DEN + } + } + } + } + + abort = { + TIX = { has_war = no } + } + + ai_strategy = { + type = naval_avoid_region + id = 9 #northern baltic + value = 200 + } + ai_strategy = { + type = naval_avoid_region + id = 206 #central baltic + value = 200 + } + ai_strategy = { + type = naval_avoid_region + id = 207 #danish belts + value = 200 + } + #ai_strategy = { + # type = naval_avoid_region + # id = 279 #Bothnia + # value = 200 + #} + ai_strategy = { + type = naval_avoid_region + id = 9 #gulf of finland + value = 200 + } +} + +HUJ_chill_on_the_pacific = { + allowed = { + original_tag = HUJ + } + enable = { + is_historical_focus_on = yes + has_war_with = CHY + has_war_with = TIX + TIX = { has_capitulated = no } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = area_priority + id = pacific + value = -50 + } + + ai_strategy = { #Invade japan after germany has capitulated + type = invade + id = CHY + value = -500 + } +} + +HUJ_no_naval_landings_in_libya_yet = { + allowed = { original_tag = HUJ } + enable = { + is_historical_focus_on = yes # Don't like locking it behind a checkbox... + date < 1943.5.1 # Historically, the North African campaign concluded May 1943. If Allies have not won there yet at this point, let them invade. + OR = { + date < 1941.8.1 # If Tobruk hasn't fallen by this time, maybe it's time to start thinking about going around + 451 = { is_controlled_by_ROOT_or_ally = yes } # Tobruk is in our hands, we can continue on land + } + OR = { + date > 1939.9.1 + has_war = yes + } + has_war_with = SAD + SAD = { + has_navy_size = { size > 39 } # Maybe want to look at fleet composition, not just total size + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = invasion_unit_request + area = north_africa + value = -100 + } +} + +HUJ_to_tobruk = { + allowed = { original_tag = HUJ } + enable = { + # NOTE: make sure these conditions are largely the same as for ENG_supply_for_tobruk_push below + is_historical_focus_on = yes + date > 1940.12.1 # Operation Compass + date < 1943.6.1 + 451 = { is_controlled_by = SAD } + SAD = { is_ai = yes } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = front_control + + state = 451 #derna + + ratio = 0.1 + + priority = 100 + ordertype = front + execution_type = rush + execute_order = yes + } + + ai_strategy = { + type = area_priority + id = north_africa + value = 50 + } + + ai_strategy = { + type = invade + id = SAD + value = 550 # Counter-balances the ENG_ALLIES_careful_with_early_invasions strategy, so we get positive again + } +} + +HUJ_avoid_balkans_until_africa_is_secure = { + allowed = { original_tag = HUJ } + enable = { + is_historical_focus_on = yes + date > 1939.6.6 + date < 1943.6.6 + + # The check below should really be a scripted trigger or something + OR = { # Check whole north-african coast + 448 = { CONTROLLER = { has_war_with = ROOT } } # tripoli + 450 = { CONTROLLER = { has_war_with = ROOT } } # benghazi + 458 = { CONTROLLER = { has_war_with = ROOT } } # tunisia + 461 = { CONTROLLER = { has_war_with = ROOT } } # casablanca + 462 = { CONTROLLER = { has_war_with = ROOT } } # marrakech + 459 = { CONTROLLER = { has_war_with = ROOT } } # algiers + 460 = { CONTROLLER = { has_war_with = ROOT } } # constantine + 665 = { CONTROLLER = { has_war_with = ROOT } } # gabès + 449 = { CONTROLLER = { has_war_with = ROOT } } # el agheila + 451 = { CONTROLLER = { has_war_with = ROOT } } # derna + 452 = { CONTROLLER = { has_war_with = ROOT } } # matrouh + 447 = { CONTROLLER = { has_war_with = ROOT } } # alexandria + 446 = { CONTROLLER = { has_war_with = ROOT } } # cairo + 290 = { CONTROLLER = { has_war_with = ROOT } } # spanish africa + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = invasion_unit_request + area = greater_balkans + value = -100 + } + + ai_strategy = { + type = area_priority + id = greater_balkans + value = -50 + } +} + +HUJ_ALLIES_dont_invade_norway = { + allowed = { + always = yes + } + enable = { + is_historical_focus_on = yes + date < 1943.2.1 + is_in_faction_with = HUJ + has_war_with = NOR + } + abort_when_not_enabled = yes + + ai_strategy = { + type = invade + id = NOR + value = -500 + } + + ai_strategy = { + type = area_priority + id = scandinavia + value = -100 + } + + ai_strategy = { + type = front_unit_request + area = scandinavia + value = -100 + } +} + +HUJ_raids = { + allowed = { + original_tag = HUJ + } + enable = { always = yes } + abort_when_not_enabled = yes + ai_strategy = { + type = raid_target_country + id = TIX + value = 200 # +200% more likely to target TIX + } } \ No newline at end of file diff --git a/src/common/ai_strategy/SAD.txt b/src/common/ai_strategy/SAD.txt index 6fce851..a295bf6 100755 --- a/src/common/ai_strategy/SAD.txt +++ b/src/common/ai_strategy/SAD.txt @@ -305,32 +305,32 @@ SAD_hold_africa = { original_tag = SAD } enable = { - is_in_faction_with = TIX + date < 1941.1.1 } abort = { - NOT = { country_exists = TIX } + any_owned_state = { is_core_of = SAD NOT = { is_controlled_by = SAD } } + date > 1941.1.1 } + # Tripoli ai_strategy = { - type = area_priority - id = africa - value = 1 + type = theatre_distribution_demand_increase + id = 448 + value = 2 } - ai_strategy = { - type = area_priority - id = suez - value = 200 - } - ai_strategy = { - type = area_priority - id = europe - value = 50 - } + # Benghasi ai_strategy = { - type = front_unit_request - area = suez - value = 60 + type = theatre_distribution_demand_increase + id = 450 + value = 2 + } + + # Alexandria + ai_strategy = { + type = theatre_distribution_demand_increase + id = 447 + value = 2 } } @@ -661,12 +661,24 @@ SAD_war_with_ETH = { ai_strategy = { type = front_unit_request tag = ETH - value = 200 + value = 400 } ai_strategy = { type = invade id = "ETH" - value = 200 + value = 400 + } + ai_strategy = { + type = front_control + + tag = ETH + + ratio = 0.8 + + priority = 100 + ordertype = front + execution_type = rush + execute_order = yes } } @@ -879,4 +891,92 @@ SAD_helpnor = { } +} + +SAD_trade_with_sweden = { + allowed = { + original_tag = SAD + } + enable = { + # if we're not communist and they're not communist + NOT = { has_government = communism } + NOT = { SWE = { has_government = communism } } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = equipment_market_trade_desire + id = SWE + value = 60 + } +} + +SAD_trade_with_germany = { + allowed = { + original_tag = SAD + } + enable = { + has_government = fascism + TIX = { has_government = fascism } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = equipment_market_trade_desire + id = TIX + value = 40 + } +} + +# lets not invade until we have europe +SAD_dont_invade_NOR_until_YUW_falls = { + allowed = { + original_tag = SAD + is_historical_focus_on = yes + } + + enable = { + has_war_together_with = TIX + date < 1942.1.1 # Italy should probably stay out of Norway for a while even if France has capitulated + #YUW = { + # has_capitulated = no + #} + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = invasion_unit_request + tag = NOR + value = -100 + } +} + +SAD_invasion_buffer = { + allowed = { + original_tag = SAD + } + enable = { + is_historical_focus_on = yes + date > 1942.1.1 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = put_unit_buffers + states = { + 156 + 117 + 849 + 157 + 2 + 162 + 161 + ### Oh no we forgot sicily! What could possibly go wrong. + } + ratio = 0.20 + area = italy + subtract_invasions_from_need = no + subtract_fronts_from_need = yes + } } \ No newline at end of file diff --git a/src/common/ai_strategy/TIX.txt b/src/common/ai_strategy/TIX.txt index fbbb920..948006d 100755 --- a/src/common/ai_strategy/TIX.txt +++ b/src/common/ai_strategy/TIX.txt @@ -623,6 +623,19 @@ TIX_strike_BFL = { execution_type = rush execute_order = yes } + + ai_strategy = { + type = strategic_air_importance + id = 39 #Strategic Region ID - Eastern Poland + value = 20000 #value of stocked main front in active combat is usually around 35,000 + } + + ai_strategy = { + type = strategic_air_importance + id = 130 #Strategic Region ID - Ukraine + value = 20000 #value of stocked main front in active combat is usually around 35,000 + } + } TIX_strike_BFL_aivsai = { @@ -650,6 +663,18 @@ TIX_strike_BFL_aivsai = { execution_type = rush execute_order = yes } + + ai_strategy = { + type = strategic_air_importance + id = 39 #Strategic Region ID - Eastern Poland + value = 20000 #value of stocked main front in active combat is usually around 35,000 + } + + ai_strategy = { + type = strategic_air_importance + id = 130 #Strategic Region ID - Ukraine + value = 20000 #value of stocked main front in active combat is usually around 35,000 + } } TIX_strike_BFL_crazyaivsai = { @@ -802,38 +827,85 @@ TIX_area_priority = { } } -make_sure_poland_is_ganked_before_we_move = { +# Make sure we deploy our breakthrough units against Poland +TIX_blitzkrieg_poland = { + allowed = { + original_tag = TIX + } + enable = { + #is_historical_focus_on = yes + OR = { + focus_progress = { + focus = TIX_danzehuozhanzheng + progress > 0.01 + } + has_war_with = POL + } + } + abort = { + OR = { + POL = { + has_capitulated = yes + } + has_war_with = HOL + } + } + ai_strategy = { + type = front_armor_score + id = POL + value = 100 + } + + ai_strategy = { + type = force_concentration_target_weight + state = 87 # Lodz + state = 10 # Warsaw + + value = 25 # +25% + } + + ai_strategy = { + # Still need to defend at the maginot... + type = front_unit_request + state = 28 # Alsace-Lorraine + value = 30 # +30 % + } +} + +TIX_make_sure_poland_is_ganked_before_we_move = { allowed = { original_tag = TIX } enable = { has_completed_focus = TIX_sudetiaoyue - OR = { - POL = { has_capitulated = no } - country_exists = POL - } + has_war_with = POL + POL = { has_capitulated = no } + date < 1940.2.1 } abort = { - date > 1940.1.1 + OR = { + POL = { + has_capitulated = yes + days_since_capitulated > 8 + } + date > 1940.2.1 + } } ai_strategy = { - type = prepare_for_war - id = "POL" - value = 200 + type = declare_war + id = HOL + value = -2000 } - ai_strategy = { - type = front_control - - tag = POL - - ratio = 0.1 - - priority = 100 - ordertype = front - execution_type = rush - execute_order = yes + type = declare_war + id = BEL + value = -2000 + } + ai_strategy = { + type = declare_war + id = LUX + value = -2000 } ai_strategy = { @@ -1615,27 +1687,28 @@ spain_help_TIX = { } } -#TIX_naval_invasions_NOR = { -# allowed = { original_tag = TIX } -# -# enable = { -# has_war_with = NOR -# NOR = { has_civil_war = no } -# } -# -# abort_when_not_enabled = yes -# -# ai_strategy = { -# type = invasion_unit_request -# tag = NOR -# value = 20 -# } -# ai_strategy = { -# type = invasion_unit_request -# tag = DEN -# value = 10 -# } -#} +# AI are not willing to invade if it is at war at its home against another country's home location (france...), unless it has a positive "invade" value +TIX_enable_invasion_of_NOR = { + allowed = { + OR = { + original_tag = TIX + } + } + enable = { + # try to invade NOR if things are looking not so bad + OR = { + date < 1940.1.4 + YUW = { has_capitulated = yes } # uh oh, maybe we need more units against YUW + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = invade + id = NOR + value = 10 + } +} TIX_naval_invasions_DEN = { allowed = { original_tag = TIX } @@ -1971,4 +2044,1011 @@ TIX_SIR_guanxi = { id = SIR value = 40 } +} + +TIX_dont_join_gie_wars_early = { + allowed = { + original_tag = TIX + } + enable = { + is_in_faction_with = SAD + SAD = { + all_enemy_country = { + is_government_in_exile = yes + } + } + } + abort = { + OR = { + TIX = { + any_enemy_country = { + is_government_in_exile = no + } + } + SAD = { + any_enemy_country = { + is_government_in_exile = no + } + } + } + } + + ai_strategy = { + type = diplo_action_desire + id = TIX + value = -9999 + target = join_allies + } + + ai_strategy = { + type = diplo_action_acceptance + id = SAD + value = -9999 + target = call_allies + } +} + +TIX_anschluss_rejected = { + allowed = { + original_tag = TIX + } + enable = { + country_exists = AUS + } + abort = { + NOT = { + country_exists = AUS + } + } + + ai_strategy = { + type = antagonize + id = AUS + value = 300 + } +} + +AUS_yanwu_TIX = { + allowed = { + original_tag = AUS + } + enable = { + country_exists = TIX + } + abort = { + NOT = { + country_exists = TIX + } + } + + ai_strategy = { + type = antagonize + id = TIX + value = 300 + } +} + +TIX_force_concentration_through_maginot_hurts_too_much = { + allowed = { + original_tag = TIX + } + enable = { + date < 1941.1.1 # Deactivate after some time + 28 = { # Alsace-Lorraine + NOT = { is_controlled_by = TIX } + + any_province_building_level = { # Only if Maginot is actually fortified + province = { + all_provinces = yes + limit_to_border = yes + } + building = bunker + level > 5 + } + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = force_concentration_front_factor + state = 28 # Alsace-Lorraine + ratio = 0.50 # Only if > 50 % of the front consists of Alsace-Lorraine. This should make it deactivate if the frontline extends around the maginot + value = -100 + } + ai_strategy = { + type = force_concentration_target_weight + state = 28 # Alsace-Lorraine + value = -100 # -100 % / Don't even consider targets here. Infantry and Artillery are better at dealing with the Maginot than tank formations are + } +} + +TIX_invading_france_is_pointless_because_we_go_through_benelux_soon = { + allowed = { + original_tag = TIX + } + enable = { + if = { + limit = { NOT = { has_dlc = "Man the Guns" } } + NOT = { has_tech = landing_craft } + } + else = { + NOT = { has_tech = mtg_landing_craft } + } + date < 1940.1.1 + } + abort = { + OR = { + has_tech = landing_craft + has_tech = mtg_landing_craft + date > 1940.1.1 + } + } + + ai_strategy = { + type = invade + id = YUW + value = -2000 # that low means not going for islands either + } + + # danzig corridor is too small to be worth opening extra invasion front + ai_strategy = { + type = invade + id = POL + value = -500 + } +} + +AZ_AXIS_stay_away_from_the_royal_navy = { + enable = { + has_war_with = HUJ + date < 1942.1.1 + + OR = { + TIX = { + naval_strength_ratio = { + tag = HUJ + ratio < 0.5 + } + } + + # if we manage to get a foothold in UK we must do what we can to exploit it! (checks coastal states) + divisions_in_state = { state = 127 size < 1 } + divisions_in_state = { state = 126 size < 1 } + divisions_in_state = { state = 125 size < 1 } + divisions_in_state = { state = 129 size < 1 } + divisions_in_state = { state = 130 size < 1 } + divisions_in_state = { state = 131 size < 1 } + divisions_in_state = { state = 123 size < 1 } + divisions_in_state = { state = 122 size < 1 } + divisions_in_state = { state = 132 size < 1 } + divisions_in_state = { state = 121 size < 1 } + divisions_in_state = { state = 136 size < 1 } + divisions_in_state = { state = 120 size < 1 } + divisions_in_state = { state = 133 size < 1 } + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = naval_avoid_region + id = 18 #english channel + value = 600 # avoid doing missions as well + } + ai_strategy = { + type = naval_avoid_region + id = 16 #around UK + value = 100 + } + ai_strategy = { + type = naval_avoid_region + id = 43 #around UK + value = 100 + } +} + +AZ_AXIS_care_less_about_making_friends = { + + enable = { + has_government = fascism + is_in_faction = yes + manpower_per_military_factory < 3000 + has_war = yes + } + abort = { + OR = { + NOT = { has_government = fascism } + is_in_faction = no + manpower_per_military_factory > 3000 + has_war = no + } + } + + ai_strategy = { + type = pp_spend_priority + id = relation + value = -9999 + } +} + +TIX_trade_with_italy = { + allowed = { + original_tag = TIX + } + enable = { + has_government = fascism + SAD = { has_government = fascism } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = equipment_market_trade_desire + id = SAD + value = 40 + } +} + +TIX_market_management_after_anschluss = { + allowed = { + original_tag = TIX + } + enable = { + not = { has_government = democratic } + } + abort_when_not_enabled = yes + + # Time to start buffer for war + ai_strategy = { + type = equipment_market_for_sale_threshold + id = infantry + value = 200000 + } + ai_strategy = { + type = equipment_market_for_sale_threshold + id = support + value = 15000 + } + ai_strategy = { + type = equipment_market_for_sale_threshold + id = artillery + value = 15000 + } + ai_strategy = { + type = equipment_market_for_sale_threshold + id = anti_air + value = 15000 + } + ai_strategy = { + type = equipment_market_for_sale_threshold + id = anti_tank + value = 15000 + } + ai_strategy = { + type = equipment_market_for_sale_threshold + id = armor + value = 10000 + } + ai_strategy = { + type = equipment_market_for_sale_threshold + id = motorized + value = 20000 + } + ai_strategy = { + type = equipment_market_for_sale_threshold + id = train + value = 2000 + } +} + +TIX_prepare_for_weserubung = { + allowed = { + original_tag = TIX + } + enable = { + focus_progress = { + focus = TIX_weisebaoxingdong + progress > 0 + } + } + abort = { + has_completed_focus = TIX_weisebaoxingdong + # Norway and Denmark are either defeated or have joined us (or at least not our enemies anymore) + NOR = { + OR = { + has_capitulated = yes + NOT = { has_war_with = ROOT } + } + } + DEN = { + OR = { + has_capitulated = yes + NOT = { has_war_with = ROOT } + } + } + } + + ai_strategy = { + type = invade + id = NOR + value = 100 + } + ai_strategy = { + type = invasion_unit_request + tag = NOR + value = 100 + } + ai_strategy = { + type = area_priority + id = just_norway + value = 50 + } +} + +TIX_no_no_definitely_not_planning_to_invade_norway = { + # This strategy is only to make the AI understand that it needs to prepare naval invasion of Norway before starting the Weserubung focus, because invasion takes longer time to prepare than the focus takes to complete. + allowed = { + original_tag = TIX + } + enable = { + has_completed_focus = TIX_danzehuozhanzheng + POL = { has_capitulated = yes } + } + abort = { + OR = { + has_completed_focus = TIX_weisebaoxingdong # already at war so no need to prepare anymore + date > 1940.9.1 # just for safety, if things really go south + } + } + ai_strategy = { + type = prepare_for_war + id = NOR + value = 100 + } +} + +# focus armor units on HOL and LUX +TIX_around_the_maginot = { + allowed = { + original_tag = TIX + is_historical_focus_on = yes + } + + enable = { + date < 1941.4.1 + YUW = { + is_ai = yes + } + + #uh oh, they are pushing + 42 = { + is_controlled_by = TIX + } + 978 = { + is_controlled_by = TIX + } + + # both low countries fell + OR = { + HOL = { + has_capitulated = no + } + LUX = { + has_capitulated = no + } + } + + # we are ready to declare war on low countries + OR = { + focus_progress = { + focus = TIX_didigongshi + progress > 0 + } + AND = { + is_in_array = { potential_and_current_enemies = HOL } + is_in_array = { potential_and_current_enemies = LUX } + } + } + is_in_array = { potential_and_current_enemies = YUW } + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = front_armor_score + id = YUW + value = -100 + } + + ai_strategy = { + type = front_armor_score + id = HOL + value = 100 + } + ai_strategy = { + type = prepare_for_war + id = HOL + value = 1000 + } + ai_strategy = { + type = force_concentration_front_factor + tag = HOL + value = 200 + } + + ai_strategy = { + type = front_armor_score + id = LUX + value = 100 + } + ai_strategy = { + type = prepare_for_war + id = LUX + value = 1000 + } + ai_strategy = { + type = force_concentration_front_factor + tag = LUX + value = 200 + } +} + +#Pounce on BEL once the rest of the Low Countries are secured +TIX_tanks_against_belgium = { + allowed = { + original_tag = TIX + } + + enable = { + is_historical_focus_on = yes + HOL = { has_capitulated = yes } + #LUX = { has_capitulated = yes } + } + + abort = { + surrender_progress > 0.15 #Bring our metal bawkses home + } + + ai_strategy = { + type = front_armor_score + id = BEL + value = 100 + } + ai_strategy = { + type = prepare_for_war + id = BEL + value = 1000 + } + ai_strategy = { + type = force_concentration_front_factor + tag = BEL + value = 200 + } +} + +# lets not invade until we have europe +TIX_dont_invade_until_YUW_falls = { + allowed = { + original_tag = TIX + is_historical_focus_on = yes + } + + enable = { + date < 1941.3.1 + YUW = { + has_capitulated = no + } + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = invasion_unit_request + country_trigger = { + NOT = { original_tag = NOR } # We do want to allow invasion against norway + } + + value = -100 + } +} + +TIX_blitzkrieg_benelux = { + allowed = { + original_tag = TIX + } + + enable = { + date < 1940.9.15 #Don't keep pushing wildly if we haven't capitulated benelux in 4 months - we lost anyway + OR = { + AND = { + focus_progress = { + focus = TIX_didigongshi + progress > 0.01 + } + NOT = { has_war_with = HOL } + } + AND = { + focus_progress = { + focus = TIX_didigongshi + progress > 0.01 + } + NOT = { has_war_with = BEL } + } + AND = { + focus_progress = { + focus = TIX_didigongshi + progress > 0.01 + } + NOT = { has_war_with = LUX } + } + AND = { + has_war_with = HOL + HOL = { has_capitulated = no } + } + AND = { + has_war_with = BEL + BEL = { has_capitulated = no } + } + AND = { + has_war_with = LUX + LUX = { has_capitulated = no } + } + } + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = front_control + + tag = HOL + + ratio = 0.25 + + priority = 100 + ordertype = front + execution_type = rush + execute_order = yes + } + + ai_strategy = { + type = front_control + + tag = BEL + + ratio = 0.25 + + priority = 100 + ordertype = front + execution_type = rush + execute_order = yes + } + + ai_strategy = { + type = front_control + + tag = LUX + + ratio = 0.25 + + priority = 100 + ordertype = front + execution_type = rush + execute_order = yes + } + + ai_strategy = { + type = front_unit_request + + tag = BEL + + value = 50 # lets put more units, should be safe + } + + ai_strategy = { + type = front_unit_request + + tag = HOL + + value = 60 # lets put more units, should be safe + } + + ai_strategy = { + type = front_unit_request + + tag = LUX + + value = 50 # lets put more units, should be safe + } +} + +TIX_blitz_france = { + + allowed = { + original_tag = TIX + } + + enable = { + date < 1940.9.1 + HOL = { has_capitulated = yes } + is_historical_focus_on = yes + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = consider_weak + id = YUW + value = 25 + } + + ai_strategy = { + type = front_control + + tag = YUW + + ratio = 0.5 + + priority = 100 + ordertype = front + execution_type = rush_weak + execute_order = yes + } + + ai_strategy = { + type = force_concentration_target_weight + state = 29 # Nord-Pas_de_Calais + state = 785 # Picardy + state = 16 # Ile de France + state = 15 # Normandy + # include Belgium as well even though we hopefully have already taken it + state = 6 # Vlaanderen + state = 34 # Wallonie + state = 977 # Antwerpen + + value = 80 # +80% + } + + ai_strategy = { + # Avoid the areas behind the Maginot line + type = force_concentration_target_weight + state = 18 # Champagne + state = 17 # Franche-Comte + state = 28 # Alsace-Lorraine + state = 27 # Bourgogne + + value = -60 # -60% + } +} + +TIX_tanks_in_the_snow = { + allowed = { + original_tag = TIX + } + + enable = { + OR = { + focus_progress = { + focus = TIX_zhifujuxiong + progress > 0.01 + } + has_completed_focus = TIX_zhifujuxiong + } + } + + abort = { + surrender_progress > 0.1 #Bring our metal bawkses home + } + + ai_strategy = { + type = front_armor_score + id = BFL + value = 300 + } + + ai_strategy = { + type = front_unit_request + + tag = BFL + + value = 300 + } + + ai_strategy = { #TIX might be fighting GRE when Barbarossa needs to take place; prioritize BFL + type = prepare_for_war + id = BFL + value = 200 + } +} + +TIX_tanks_against_france = { + allowed = { + original_tag = TIX + } + + enable = { + is_historical_focus_on = yes + HOL = { has_capitulated = yes } + BEL = { has_capitulated = yes } + LUX = { has_capitulated = yes } + } + + abort = { + surrender_progress > 0.15 #Bring our metal bawkses home + } + + ai_strategy = { + type = front_armor_score + id = YUW + value = 100 + } + + ai_strategy = { + type = front_unit_request + tag = YUW + value = 10 + } +} + +TIX_abandon_ship = { + allowed = { + original_tag = TIX + } + + enable = { + surrender_progress > 0.25 #Bring our metal bawkses home + } + + abort = { + surrender_progress < 0.25 #Bring our metal bawkses home + } + + ai_strategy = { + type = front_unit_request + + tag = BFL + + value = -40 + } +} + +TIX_normandy_buffer = { + allowed = { + original_tag = TIX + } + enable = { + is_historical_focus_on = yes + YUW = { + has_capitulated = yes + } + date < 1943.1.1 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = put_unit_buffers + states = { + 14 + 15 + 29 + 735 + 22 + } + ratio = 0.11 + area = normandy_landing_zone + subtract_invasions_from_need = no + subtract_fronts_from_need = yes + } + + ai_strategy = { + type = role_ratio + id = garrison + value = 10 + } +} + +TIX_invasion_buffer = { + allowed = { + original_tag = TIX + } + enable = { + is_historical_focus_on = yes + YUW = { + has_capitulated = yes + } + date > 1943.1.1 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = put_unit_buffers + states = { + 15 + 14 + 23 + 29 + 6 + } + ratio = 0.20 + area = normandy_landing_zone + subtract_invasions_from_need = no + subtract_fronts_from_need = yes + } + ai_strategy = { + type = role_ratio + id = garrison + value = 10 + } +} + +TIX_pause_in_BFL = { #We got this far but our home is under siege + allowed = { + original_tag = TIX + } + + enable = { + is_historical_focus_on = yes + has_war_with = BFL + BFL = { has_capitulated = no } + OR = { + surrender_progress > 0.15 + 16 = { + controller = { + has_war_with = TIX + } + } + } + date > 1942.1.1 + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = front_control + + tag = BFL + + ratio = 0.60 + + priority = 100 + ordertype = front + execution_type = careful + execute_order = no + } + + ai_strategy = { + type = front_unit_request + + tag = YUW + + value = 20 # omg no, the french + } + + ai_strategy = { + type = front_unit_request + + tag = BFL + + value = -20 # FLEE + } +} + +TIX_dont_act_on_danzig_if_things_went_south = { + allowed = { + original_tag = TIX + } + enable = { + has_war_with = CZE + date < 1940.6.1 + } + abort_when_not_enabled = yes + + ai_strategy = { + type = declare_war + id = POL + value = -2000 + } +} + +TIX_dont_send_half_the_army_to_finland_if_not_in_our_faction = { + allowed = { + original_tag = TIX + } + enable = { + FIN = { has_war_with = BFL } + has_war_with = BFL + NOT = { is_in_faction_with = FIN } + has_military_access_to = FIN + 925 = { is_controlled_by = ROOT } # Germany still controls Finnmark in Northern Norway + + # Safety measures, if Soviets have lost Leningrad or Novgorod the Finnish and German frontlines are probably close to becoming one, and then we need to disable the strategy + 195 = { is_controlled_by = BFL } # Leningrad + 263 = { is_controlled_by = BFL } # Novgorod + } + abort_when_not_enabled = yes + + ai_strategy = { + type = put_unit_buffers + + # ratio of total armies in country to be buffered + ratio = 0.05 + + # states to put garrison orders (if no state is friendly, strat is invalid) + states = { + 925 # Finnmark + } + + # ai areas that the orders will use these buffers in + area = scandinavia + } + + ai_strategy = { + type = front_unit_request + + # As long as the front touches any of these regions. I hope this doesn't mess up the bigger Eastern Front if the Finnish and German frontlines merge... + strategic_region = 13 # Eastern Finland + strategic_region = 277 # Northern Finland + strategic_region = 265 # East Karelia + strategic_region = 12 # Kola + + value = -90 + } + + ai_strategy = { + type = send_lend_lease_desire + id = FIN + value = 200 + } +} + +TIX_protect_swedish_ore = { + allowed = { + original_tag = TIX + } + enable = { + NOT = { has_war_with = SWE } + SWE = { has_capitulated = no } + + 142 = { is_fully_controlled_by = ROOT } + 110 = { is_fully_controlled_by = ROOT } + 143 = { is_fully_controlled_by = ROOT } + 144 = { is_fully_controlled_by = ROOT } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = put_unit_buffers + + # ratio of total armies in country to be buffered + ratio = 0.05 + + # you can specify an order id. ratio of same orders ids will be share same ratio + order_id = 1 + + # states to put garrison orders (if no state is friendly, strat is invalid) + states = { + 142 + 110 + 143 + 144 + } + + # ai areas that the orders will use these buffers in + area = europe + } +} + +TIX_TEMP_avoid_sweden = { + allowed = { + original_tag = TIX + } + enable = { + country_exists = SWE + is_historical_focus_on = yes + } + abort_when_not_enabled = yes + + ai_strategy = { + type = conquer + id = SWE + value = -999 + } } \ No newline at end of file diff --git a/src/common/ai_strategy/YUW.txt b/src/common/ai_strategy/YUW.txt index def2853..54d2919 100755 --- a/src/common/ai_strategy/YUW.txt +++ b/src/common/ai_strategy/YUW.txt @@ -521,4 +521,188 @@ YUW_protect_maqinuo_ore = { area = europe } +} + +YUW_accept_BYG_access = { + allowed = { + tag = YUW # not original_tag to avoid Vichy weirdness + } + enable = { + date > 1940.9.9 + BYG = { + is_ai = yes + NOT = { + OR = { + is_in_faction_with = YUW + has_military_access_to = YUW + } + } + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = diplo_action_acceptance + id = BYG + target = military_access + value = 1000 + } +} + +TUW_TIX_will_probably_join_SAD = { + # if SAD is going to war with us, consider TIX as a threat as well + + allowed = { + original_tag = YUW + } + + enable = { + TIX = { + has_government = fascism + NOT = { + has_war_with = YUW + } + } + SAD = { + has_government = fascism + OR = { + is_in_faction = no + is_in_faction_with = TIX + } + OR = { + # check if we are declaring on YUW + OR = { + has_war_with = YUW + is_justifying_wargoal_against = YUW + has_wargoal_against = YUW + } + + # check if we are declaring on any guarantee of YUW + YUW = { + any_guaranteed_country = { + SAD = { + OR = { + has_war_with = PREV + is_justifying_wargoal_against = PREV + has_wargoal_against = PREV + } + } + } + } + } + } + } + + abort_when_not_enabled = yes + + ai_strategy = { + type = prepare_for_war + id = TIX + value = 100 + } +} + +YUW_why_push_into_germany_their_food_is_horrible = { + allowed = { + original_tag = YUW + } + enable = { + date < 1941.1.1 # Deactivate after some time + surrender_progress < 0.01 # We haven't lost territories + + # Once Germany launches some kind of attack on the low countries, or if they go somewhere dangerous, we can try if we want to + GER = { NOT = { has_war_with = BEL } } + GER = { NOT = { has_war_with = HOL } } + GER = { NOT = { has_war_with = CZE } } + GER = { NOT = { has_war_with = AUS } } + GER = { NOT = { has_war_with = BFL } } + GER = { NOT = { has_war_with = SAD } } + + + 28 = { # Alsace-Lorraine + is_fully_controlled_by = ROOT + } + + 42 = { # Moselland + is_controlled_by = GER + } + 978 = { # Baden + is_controlled_by = GER + } + } + abort_when_not_enabled = yes + + ai_strategy = { + type = force_concentration_front_factor + state = 42 # Moselland + state = 978 # Baden + ratio = 0.95 # Only if > 95 % of the front consists of these states. This should make it deactivate if the frontline extends around the maginot + value = -100 + } + + ai_strategy = { + type = front_control + + state = 42 # Moselland + state = 978 # Baden + + ratio = 0.8 + + priority = 100 + ordertype = front + execution_type = careful + execute_order = no # This should block France from attacking, It's a bit digital, but as the strategy should cancel if they do something weird, it should be fine + manual_attack = no + } +} + +YUW_benelux_will_surely_not_fall = { + allowed = { original_tag = YUW } + enable = { + has_war_with = TIX + date < 1940.8.1 + OR = { + HOL = { has_capitulated = no } + BEL = { has_capitulated = no } + } + } + + abort = { + OR = { + date > 1940.8.1 + AND = { + HOL = { surrender_progress > 0.30 } + BEL = { surrender_progress > 0.30 } + } + } + } + + ai_strategy = { + type = dont_defend_ally_borders + id = "HOL" + value = 50 + } + ai_strategy = { + type = dont_defend_ally_borders + id = "BEL" + value = 50 + } + ai_strategy = { + type = dont_defend_ally_borders + id = "LUX" + value = 50 + } + ai_strategy = { + type = put_unit_buffers + # french states bordering benelux + states = { + 29 + 785 + 18 + } + ratio = 0.1 + area = europe + subtract_invasions_from_need = no + subtract_fronts_from_need = yes + } } \ No newline at end of file diff --git a/src/common/ideas/_economic.txt b/src/common/ideas/_economic.txt index 6abd0f9..2dfbc72 100755 --- a/src/common/ideas/_economic.txt +++ b/src/common/ideas/_economic.txt @@ -430,6 +430,41 @@ ideas = { cancel_if_invalid = no } + totaler_krieg_economy = { + + visible = { + original_tag = GER + has_completed_focus = GER_totaler_krieg + } + + available = { + has_completed_focus = GER_totaler_krieg + has_war_with_major = yes + has_war_support > 0.8 + any_enemy_country = { + ic_ratio = { + tag = ROOT + ratio > 0.5 + } + } + } + + cost = 150 + removal_cost = -1 + + modifier = { + consumer_goods_expected_value = 0.15 + conscription = -0.02 + production_speed_arms_factory_factor = 0.2 + production_speed_dockyard_factor = 0.2 + conversion_cost_civ_to_mil_factor= -0.3 + conversion_cost_mil_to_civ_factor = -0.3 + industrial_capacity_factory = 0.05 + industrial_capacity_dockyard = 0.05 + } + cancel_if_invalid = no + } + new_economic_policy = { picture = new_economic_policy @@ -915,7 +950,6 @@ ideas = { cost = 150 removal_cost = -1 - modifier = { min_export = 0 #civilian_intel_to_others = 0.0 diff --git a/src/common/ideas/chy_new1.txt b/src/common/ideas/chy_new1.txt index ceb0dc5..8545bf4 100755 --- a/src/common/ideas/chy_new1.txt +++ b/src/common/ideas/chy_new1.txt @@ -56,7 +56,7 @@ ideas = { always = yes } modifier = { - production_speed_buildings_factor = 0.1 + production_speed_buildings_factor = 0.15 global_building_slots = 1 production_speed_air_base_factor = 0.2 production_speed_naval_base_factor = 0.2 @@ -74,7 +74,7 @@ ideas = { always = yes } modifier = { - industrial_capacity_factory = 0.15 + industrial_capacity_factory = 0.2 production_factory_max_efficiency_factor = -0.05 } } @@ -84,9 +84,10 @@ ideas = { always = yes } modifier = { - industrial_capacity_factory = 0.05 + industrial_capacity_factory = 0.15 industrial_capacity_dockyard = 0.1 production_factory_efficiency_gain_factor = 0.1 + production_factory_max_efficiency_factor = 0.2 } } CHY_chongyingzaochuan = { @@ -125,7 +126,7 @@ ideas = { always = yes } modifier = { - local_resources_factor = 0.15 + local_resources_factor = 0.5 } } CHY_navyupupup = { @@ -134,7 +135,7 @@ ideas = { always = yes } modifier = { - consumer_goods_factor = 0.1 + consumer_goods_factor = 0.05 production_speed_dockyard_factor = 0.1 production_speed_naval_base_factor = 0.2 production_speed_coastal_bunker_factor = 0.2 @@ -147,7 +148,7 @@ ideas = { always = yes } modifier = { - research_speed_factor = 0.1 + research_speed_factor = 0.15 } } chy_hangmu_buff_1 = { @@ -910,6 +911,15 @@ ideas = { } } } + AL_guojizongdui_back = { + picture = generic_production_bonus + allowed_civil_war = { + always = yes + } + modifier = { + production_speed_buildings_factor = 0.01 + } + } } } diff --git a/src/common/national_focus/tiexue.txt b/src/common/national_focus/tiexue.txt index a7723aa..458ef9f 100755 --- a/src/common/national_focus/tiexue.txt +++ b/src/common/national_focus/tiexue.txt @@ -1056,9 +1056,12 @@ focus_tree = { } } if = { - limit = { has_idea = TIX_organization_todt_improved + limit = { OR = { + has_idea = TIX_organization_todt_improved has_idea = TIX_philipp_holzmann_improved - has_dlc = "Arms Against Tyranny" } + } + has_dlc = "Arms Against Tyranny" + } swap_ideas = { add_idea = TIX_hanz_building remove_idea = TIX_organization_todt_improved @@ -1066,8 +1069,10 @@ focus_tree = { } } if = { - limit = { has_idea = TIX_organization_todt_improved + limit = { OR = { + has_idea = TIX_organization_todt_improved has_idea = TIX_philipp_holzmann_improved + } NOT = { has_dlc = "Arms Against Tyranny" } } swap_ideas = { add_idea = TIX_hanz_building_no_aat diff --git a/src/events/ai_bianzhi.txt b/src/events/ai_bianzhi.txt index bbe98df..33fa43f 100755 --- a/src/events/ai_bianzhi.txt +++ b/src/events/ai_bianzhi.txt @@ -16,6 +16,11 @@ country_event = { set_technology = { tech_military_police = 1 } set_technology = { tech_maintenance_company = 1 } set_technology = { tech_maintenance_company2 = 1 } + set_technology = { sp_armored_engineer_tech = 1 } + set_technology = { sp_armored_maintenance_tech = 1 } + set_technology = { sp_helicopter_med_evac_tech = 1 } + set_technology = { sp_helicopter_transport_pods_tech = 1 } + set_technology = { sp_armored_signal_tech = 1 } complete_special_project = { project = sp:sp_land_flamethrower_tank } complete_special_project = { project = sp:sp_land_military_engineering_vehicles } complete_special_project = { project = sp:sp_air_helicopter } @@ -227,6 +232,11 @@ country_event = { set_technology = { tech_military_police = 1 } set_technology = { tech_maintenance_company = 1 } set_technology = { tech_maintenance_company2 = 1 } + set_technology = { sp_armored_engineer_tech = 1 } + set_technology = { sp_armored_maintenance_tech = 1 } + set_technology = { sp_helicopter_med_evac_tech = 1 } + set_technology = { sp_helicopter_transport_pods_tech = 1 } + set_technology = { sp_armored_signal_tech = 1 } complete_special_project = { project = sp:sp_land_flamethrower_tank } complete_special_project = { project = sp:sp_land_military_engineering_vehicles } complete_special_project = { project = sp:sp_air_helicopter } @@ -465,6 +475,11 @@ country_event = { set_technology = { tech_military_police = 1 } set_technology = { tech_maintenance_company = 1 } set_technology = { tech_maintenance_company2 = 1 } + set_technology = { sp_armored_engineer_tech = 1 } + set_technology = { sp_armored_maintenance_tech = 1 } + set_technology = { sp_helicopter_med_evac_tech = 1 } + set_technology = { sp_helicopter_transport_pods_tech = 1 } + set_technology = { sp_armored_signal_tech = 1 } complete_special_project = { project = sp:sp_land_flamethrower_tank } complete_special_project = { project = sp:sp_land_military_engineering_vehicles } complete_special_project = { project = sp:sp_air_helicopter } @@ -733,6 +748,11 @@ country_event = { set_technology = { tech_military_police = 1 } set_technology = { tech_maintenance_company = 1 } set_technology = { tech_maintenance_company2 = 1 } + set_technology = { sp_armored_engineer_tech = 1 } + set_technology = { sp_armored_maintenance_tech = 1 } + set_technology = { sp_helicopter_med_evac_tech = 1 } + set_technology = { sp_helicopter_transport_pods_tech = 1 } + set_technology = { sp_armored_signal_tech = 1 } complete_special_project = { project = sp:sp_land_flamethrower_tank } complete_special_project = { project = sp:sp_land_military_engineering_vehicles } complete_special_project = { project = sp:sp_air_helicopter } @@ -989,6 +1009,11 @@ country_event = { set_technology = { motorized_rocket_unit = 1 } set_technology = { tech_maintenance_company = 1 } set_technology = { tech_maintenance_company2 = 1 } + set_technology = { sp_armored_engineer_tech = 1 } + set_technology = { sp_armored_maintenance_tech = 1 } + set_technology = { sp_helicopter_med_evac_tech = 1 } + set_technology = { sp_helicopter_transport_pods_tech = 1 } + set_technology = { sp_armored_signal_tech = 1 } complete_special_project = { project = sp:sp_land_flamethrower_tank } complete_special_project = { project = sp:sp_land_military_engineering_vehicles } complete_special_project = { project = sp:sp_air_helicopter } @@ -1234,6 +1259,11 @@ country_event = { set_technology = { tech_military_police = 1 } set_technology = { tech_maintenance_company = 1 } set_technology = { tech_maintenance_company2 = 1 } + set_technology = { sp_armored_engineer_tech = 1 } + set_technology = { sp_armored_maintenance_tech = 1 } + set_technology = { sp_helicopter_med_evac_tech = 1 } + set_technology = { sp_helicopter_transport_pods_tech = 1 } + set_technology = { sp_armored_signal_tech = 1 } complete_special_project = { project = sp:sp_land_flamethrower_tank } complete_special_project = { project = sp:sp_land_military_engineering_vehicles } complete_special_project = { project = sp:sp_air_helicopter } @@ -1465,6 +1495,11 @@ country_event = { set_technology = { interwar_antitank = 1 } set_technology = { tech_maintenance_company = 1 } set_technology = { tech_maintenance_company2 = 1 } + set_technology = { sp_armored_engineer_tech = 1 } + set_technology = { sp_armored_maintenance_tech = 1 } + set_technology = { sp_helicopter_med_evac_tech = 1 } + set_technology = { sp_helicopter_transport_pods_tech = 1 } + set_technology = { sp_armored_signal_tech = 1 } complete_special_project = { project = sp:sp_land_flamethrower_tank } complete_special_project = { project = sp:sp_land_military_engineering_vehicles } complete_special_project = { project = sp:sp_air_helicopter } @@ -1730,6 +1765,11 @@ country_event = { set_technology = { tech_logistics_company = 1 } set_technology = { tech_maintenance_company = 1 } set_technology = { tech_maintenance_company2 = 1 } + set_technology = { sp_armored_engineer_tech = 1 } + set_technology = { sp_armored_maintenance_tech = 1 } + set_technology = { sp_helicopter_med_evac_tech = 1 } + set_technology = { sp_helicopter_transport_pods_tech = 1 } + set_technology = { sp_armored_signal_tech = 1 } complete_special_project = { project = sp:sp_land_flamethrower_tank } complete_special_project = { project = sp:sp_land_military_engineering_vehicles } complete_special_project = { project = sp:sp_air_helicopter } @@ -2113,6 +2153,11 @@ country_event = { set_technology = { tech_logistics_company = 1 } set_technology = { tech_maintenance_company = 1 } set_technology = { tech_maintenance_company2 = 1 } + set_technology = { sp_armored_engineer_tech = 1 } + set_technology = { sp_armored_maintenance_tech = 1 } + set_technology = { sp_helicopter_med_evac_tech = 1 } + set_technology = { sp_helicopter_transport_pods_tech = 1 } + set_technology = { sp_armored_signal_tech = 1 } complete_special_project = { project = sp:sp_land_flamethrower_tank } complete_special_project = { project = sp:sp_land_military_engineering_vehicles } complete_special_project = { project = sp:sp_air_helicopter } @@ -2331,6 +2376,11 @@ country_event = { set_technology = { tech_logistics_company = 1 } set_technology = { tech_maintenance_company = 1 } set_technology = { tech_maintenance_company2 = 1 } + set_technology = { sp_armored_engineer_tech = 1 } + set_technology = { sp_armored_maintenance_tech = 1 } + set_technology = { sp_helicopter_med_evac_tech = 1 } + set_technology = { sp_helicopter_transport_pods_tech = 1 } + set_technology = { sp_armored_signal_tech = 1 } complete_special_project = { project = sp:sp_land_flamethrower_tank } complete_special_project = { project = sp:sp_land_military_engineering_vehicles } complete_special_project = { project = sp:sp_air_helicopter } diff --git a/src/events/az_pt_event.txt b/src/events/az_pt_event.txt index 6290f52..02c8593 100755 --- a/src/events/az_pt_event.txt +++ b/src/events/az_pt_event.txt @@ -2651,7 +2651,7 @@ country_event = { desc = az_PT_9_014_tooltip_1 picture = GFX_report_event_generic_read_write trigger = { - has_tech = advanced_centimetric_radar + has_tech = monopulse_radar NOT = { has_country_flag = az_PT_9_014 } } option = {