mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
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.
This commit is contained in:
parent
d61382f4e2
commit
d440dc00f1
@ -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:
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user