mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Remove the enemy forces multiplier option.
This didn't do what it claimed to (it actually just determines the threshold for whether a control point shoudl be a *preferred* canidate for purchasing ground units), and the income multipliers offer the intended behavior.
This commit is contained in:
parent
aa9ffa0855
commit
ce977ac937
@ -73,12 +73,11 @@ class ProcurementAi:
|
||||
if not self.faction.frontline_units:
|
||||
return budget
|
||||
|
||||
armor_limit = int(30 * self.game.settings.multiplier)
|
||||
candidates = self.front_line_candidates(armor_limit)
|
||||
if not candidates:
|
||||
return budget
|
||||
|
||||
while budget > 0:
|
||||
candidates = self.front_line_candidates()
|
||||
if not candidates:
|
||||
break
|
||||
|
||||
cp = random.choice(candidates)
|
||||
unit = self.random_affordable_ground_unit(budget)
|
||||
if unit is None:
|
||||
@ -89,11 +88,6 @@ class ProcurementAi:
|
||||
assert cp.pending_unit_deliveries is not None
|
||||
cp.pending_unit_deliveries.deliver({unit: 1})
|
||||
|
||||
if cp.base.total_armor >= armor_limit:
|
||||
candidates.remove(cp)
|
||||
if not candidates:
|
||||
break
|
||||
|
||||
return budget
|
||||
|
||||
def random_affordable_aircraft_group(
|
||||
@ -115,7 +109,11 @@ class ProcurementAi:
|
||||
|
||||
while budget > 0:
|
||||
group_size = 2
|
||||
cp = random.choice(self.airbase_candidates(group_size))
|
||||
candidates = self.airbase_candidates(group_size)
|
||||
if not candidates:
|
||||
break
|
||||
|
||||
cp = random.choice(candidates)
|
||||
unit = self.random_affordable_aircraft_group(budget, group_size)
|
||||
if unit is None:
|
||||
# Can't afford any more aircraft.
|
||||
@ -156,13 +154,14 @@ class ProcurementAi:
|
||||
# Otherwise buy them anywhere valid.
|
||||
return all_usable
|
||||
|
||||
def front_line_candidates(self, unit_limit: int) -> List[ControlPoint]:
|
||||
def front_line_candidates(self) -> List[ControlPoint]:
|
||||
candidates = []
|
||||
|
||||
# Prefer to buy front line units at active front lines that are not
|
||||
# already overloaded.
|
||||
for cp in self.owned_points:
|
||||
if cp.base.total_armor >= unit_limit:
|
||||
if cp.base.total_armor >= 30:
|
||||
# Control point is already sufficiently defended.
|
||||
continue
|
||||
for connected in cp.connected_points:
|
||||
if not connected.is_friendly(to_player=self.is_player):
|
||||
|
||||
@ -17,7 +17,6 @@ class Settings:
|
||||
night_disabled: bool = False
|
||||
external_views_allowed: bool = True
|
||||
supercarrier: bool = False
|
||||
multiplier: float = 1.0
|
||||
generate_marks: bool = True
|
||||
manpads: bool = True
|
||||
cold_start: bool = False # Legacy parameter do not use
|
||||
|
||||
@ -69,7 +69,6 @@ class GeneratorSettings:
|
||||
start_date: datetime
|
||||
player_budget: int
|
||||
enemy_budget: int
|
||||
multiplier: float
|
||||
midgame: bool
|
||||
inverted: bool
|
||||
no_carrier: bool
|
||||
|
||||
@ -146,7 +146,6 @@ def create_game(campaign_path: Path, blue: str, red: str,
|
||||
start_date=datetime.today(),
|
||||
player_budget=DEFAULT_BUDGET,
|
||||
enemy_budget=DEFAULT_BUDGET,
|
||||
multiplier=1.0,
|
||||
midgame=False,
|
||||
inverted=False,
|
||||
no_carrier=False,
|
||||
|
||||
@ -81,7 +81,6 @@ class NewGameWizard(QtWidgets.QWizard):
|
||||
enemy_budget=int(self.field("enemy_starting_money")),
|
||||
# QSlider forces integers, so we use 1 to 50 and divide by 10 to
|
||||
# give 0.1 to 5.0.
|
||||
multiplier=self.field("multiplier") / 10,
|
||||
midgame=self.field("midGame"),
|
||||
inverted=self.field("invertMap"),
|
||||
no_carrier=self.field("no_carrier"),
|
||||
@ -360,10 +359,6 @@ class DifficultyAndAutomationOptions(QtWidgets.QWizardPage):
|
||||
economy_layout = QtWidgets.QVBoxLayout()
|
||||
economy_group.setLayout(economy_layout)
|
||||
|
||||
multiplier = TenthsSpinSlider("Enemy forces multiplier", 1, 50, 10)
|
||||
self.registerField('multiplier', multiplier.spinner)
|
||||
economy_layout.addLayout(multiplier)
|
||||
|
||||
player_income = TenthsSpinSlider("Player income multiplier", 1, 50, 10)
|
||||
self.registerField("player_income_multiplier", player_income.spinner)
|
||||
economy_layout.addLayout(player_income)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user