mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
parent
22835e7535
commit
3fc82af3ac
@ -73,13 +73,15 @@ class ProcurementAi:
|
||||
cp_aircraft = cp.allocated_aircraft()
|
||||
aircraft_investment += cp_aircraft.total_value
|
||||
|
||||
total_investment = aircraft_investment + armor_investment
|
||||
if total_investment == 0:
|
||||
air = self.game.settings.auto_procurement_balance / 100.0
|
||||
ground = 1 - air
|
||||
weighted_investment = aircraft_investment * air + armor_investment * ground
|
||||
if weighted_investment == 0:
|
||||
# Turn 0 or all units were destroyed. Either way, split 30/70.
|
||||
return 0.3
|
||||
return min(0.3, ground)
|
||||
|
||||
# the more planes we have, the more ground units we want and vice versa
|
||||
ground_unit_share = aircraft_investment / total_investment
|
||||
ground_unit_share = aircraft_investment * air / weighted_investment
|
||||
if ground_unit_share > 1.0:
|
||||
raise ValueError
|
||||
|
||||
|
||||
@ -273,6 +273,19 @@ class Settings:
|
||||
HQ_AUTOMATION_SECTION,
|
||||
default=True,
|
||||
)
|
||||
auto_procurement_balance: int = bounded_int_option(
|
||||
"AI ground unit procurement budget ratio (%)",
|
||||
CAMPAIGN_MANAGEMENT_PAGE,
|
||||
HQ_AUTOMATION_SECTION,
|
||||
min=0,
|
||||
max=100,
|
||||
default=50,
|
||||
detail=(
|
||||
"Ratio (larger number -> more budget for ground units) "
|
||||
"that indicates how the AI procurement planner should "
|
||||
"spend its budget."
|
||||
),
|
||||
)
|
||||
reserves_procurement_target: int = 10
|
||||
|
||||
# Mission Generator
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user