From d440dc00f1eb97519c0a39e1dd0a72e44666a672 Mon Sep 17 00:00:00 2001 From: SnappyComebacks <74509817+SnappyComebacks@users.noreply.github.com> Date: Sat, 29 May 2021 23:47:10 -0600 Subject: [PATCH] Purchase reserves at front lines. This changes the ground unit purchase behavior such that the supply limit is exceeded by 30%, with the extra units kept in reserve. The old hard cap of 50 units is no longer needed, since the ammo supply now does the same task, so that's been removed. --- game/procurement.py | 8 ++++---- game/settings.py | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/game/procurement.py b/game/procurement.py index b89d05dd..846b517f 100644 --- a/game/procurement.py +++ b/game/procurement.py @@ -20,6 +20,8 @@ from game.data.groundunitclass import GroundUnitClass if TYPE_CHECKING: from game import Game +FRONTLINE_RESERVES_FACTOR = 1.3 + @dataclass(frozen=True) class AircraftProcurementRequest: @@ -282,11 +284,9 @@ class ProcurementAi: # No source of ground units, so can't buy anything. continue + purchase_target = cp.frontline_unit_count_limit * FRONTLINE_RESERVES_FACTOR allocated = cp.allocated_ground_units(self.game.transfers) - if ( - allocated.total >= self.game.settings.front_line_procurement_target - or allocated.total >= cp.frontline_unit_count_limit - ): + if allocated.total >= purchase_target: # Control point is already sufficiently defended. continue if allocated.total < worst_supply: diff --git a/game/settings.py b/game/settings.py index 07f21c7d..d16a1bc7 100644 --- a/game/settings.py +++ b/game/settings.py @@ -57,7 +57,6 @@ class Settings: perf_moving_units: bool = True perf_infantry: bool = True perf_destroyed_units: bool = True - front_line_procurement_target: int = 50 reserves_procurement_target: int = 10 # Performance culling