Added option to disable AI pilot levelling

This commit is contained in:
jsjlewis96 2021-06-19 10:55:54 +01:00 committed by Dan Albert
parent 1bcc332885
commit 6cd711a1e2
4 changed files with 23 additions and 1 deletions

View File

@ -5,6 +5,7 @@ Saves from 3.x are not compatible with 4.0.
## Features/Improvements ## Features/Improvements
* **[Campaign]** Squadrons now have a maximum size and killed pilots replenish at a limited rate. * **[Campaign]** Squadrons now have a maximum size and killed pilots replenish at a limited rate.
* **[Campaign]** Added an option to disable levelling up of AI pilots.
* **[Campaign AI]** AI will plan Tanker flights. * **[Campaign AI]** AI will plan Tanker flights.
* **[Economy]** Adjusted prices for aircraft to balance out some price inconsistencies. * **[Economy]** Adjusted prices for aircraft to balance out some price inconsistencies.
* **[Factions]** Added more tankers to factions. * **[Factions]** Added more tankers to factions.

View File

@ -20,6 +20,7 @@ class Settings:
# Difficulty settings # Difficulty settings
player_skill: str = "Good" player_skill: str = "Good"
enemy_skill: str = "Average" enemy_skill: str = "Average"
ai_pilot_levelling: bool = True
enemy_vehicle_skill: str = "Average" enemy_vehicle_skill: str = "Average"
map_coalition_visibility: ForcedOptions.Views = ForcedOptions.Views.All map_coalition_visibility: ForcedOptions.Views = ForcedOptions.Views.All
labels: str = "Full" labels: str = "Full"

View File

@ -305,7 +305,10 @@ class AircraftConflictGenerator:
current_level = levels.index(base_skill) current_level = levels.index(base_skill)
missions_for_skill_increase = 4 missions_for_skill_increase = 4
increase = pilot.record.missions_flown // missions_for_skill_increase increase = pilot.record.missions_flown // missions_for_skill_increase
new_level = min(current_level + increase, len(levels) - 1) capped_increase = min(current_level + increase, len(levels) - 1)
new_level = (capped_increase, current_level)[
self.game.settings.ai_pilot_levelling
]
return levels[new_level] return levels[new_level]
def set_skill(self, unit: FlyingUnit, pilot: Optional[Pilot], blue: bool) -> None: def set_skill(self, unit: FlyingUnit, pilot: Optional[Pilot], blue: bool) -> None:

View File

@ -565,6 +565,23 @@ class QSettingsWindow(QDialog):
general_layout.addWidget(squadron_replenishment_rate_label, 4, 0) general_layout.addWidget(squadron_replenishment_rate_label, 4, 0)
general_layout.addWidget(squadron_replenishment_rate, 4, 1, Qt.AlignRight) general_layout.addWidget(squadron_replenishment_rate, 4, 1, Qt.AlignRight)
ai_pilot_levelling = QCheckBox()
ai_pilot_levelling.setChecked(self.game.settings.ai_pilot_levelling)
ai_pilot_levelling.toggled.connect(self.applySettings)
ai_pilot_levelling_info = (
"Set whether or not AI pilots will level up after completing a number of"
" sorties. Since pilot level affects the AI skill, you may wish to disable"
" this, lest you face an Ace!"
)
ai_pilot_levelling.setToolTip(ai_pilot_levelling_info)
ai_pilot_levelling_label = QLabel("Allow AI pilot levelling")
ai_pilot_levelling_label.setToolTip(ai_pilot_levelling_info)
general_layout.addWidget(ai_pilot_levelling_label, 5, 0)
general_layout.addWidget(ai_pilot_levelling, 5, 1, Qt.AlignRight)
campaign_layout.addWidget(HqAutomationSettingsBox(self.game)) campaign_layout.addWidget(HqAutomationSettingsBox(self.game))
def initGeneratorLayout(self): def initGeneratorLayout(self):