mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Introduce weighted distribution for random 2/3/4-ships
This commit is contained in:
@@ -183,3 +183,12 @@ class PackagePlanningTask(TheaterCommanderTask, Generic[MissionTargetT]):
|
||||
if iads_threat not in state.threatening_air_defenses:
|
||||
state.threatening_air_defenses.append(iads_threat)
|
||||
return not threatened
|
||||
|
||||
def get_flight_size(self) -> int:
|
||||
settings = self.target.coalition.game.settings
|
||||
weights = [
|
||||
settings.fpa_2ship_weight,
|
||||
settings.fpa_3ship_weight,
|
||||
settings.fpa_4ship_weight,
|
||||
]
|
||||
return random.choices([2, 3, 4], weights, k=1)[0]
|
||||
|
||||
Reference in New Issue
Block a user