From 602f88dab96a1319c8ffc96d2a14acb8ca206d0d Mon Sep 17 00:00:00 2001 From: Raffson Date: Sun, 19 Feb 2023 14:14:33 +0100 Subject: [PATCH] More options for better control over procurement --- game/procurement.py | 5 ++--- game/settings/settings.py | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/game/procurement.py b/game/procurement.py index e8d9c248..b5f88873 100644 --- a/game/procurement.py +++ b/game/procurement.py @@ -16,8 +16,6 @@ if TYPE_CHECKING: from game.factions.faction import Faction from game.squadrons import Squadron -FRONTLINE_RESERVES_FACTOR = 1.3 - @dataclass(frozen=True) class AircraftProcurementRequest: @@ -258,7 +256,8 @@ class ProcurementAi: # No source of ground units, so can't buy anything. continue - purchase_target = cp.frontline_unit_count_limit * FRONTLINE_RESERVES_FACTOR + fr_factor = self.game.settings.frontline_reserves_factor / 100.0 + purchase_target = cp.frontline_unit_count_limit * fr_factor allocated = cp.allocated_ground_units( self.game.coalition_for(self.is_player).transfers ) diff --git a/game/settings/settings.py b/game/settings/settings.py index c01a0b9f..10a37c89 100644 --- a/game/settings/settings.py +++ b/game/settings/settings.py @@ -286,7 +286,29 @@ class Settings: "spend its budget." ), ) - reserves_procurement_target: int = 10 + frontline_reserves_factor: int = bounded_int_option( + "AI ground unit front-line reserves factor (%)", + CAMPAIGN_MANAGEMENT_PAGE, + HQ_AUTOMATION_SECTION, + min=0, + max=1000, + default=130, + detail=( + "Factor to be multiplied with the control point's unit count limit " + "to calculate the procurement target for reserve troops at front-lines." + ), + ) + reserves_procurement_target: int = bounded_int_option( + "AI ground unit reserves procurement target", + CAMPAIGN_MANAGEMENT_PAGE, + HQ_AUTOMATION_SECTION, + min=0, + max=1000, + default=10, + detail=( + "The number of units that will be bought as reserves for applicable control points" + ), + ) # Mission Generator # Gameplay