Vary number of aircraft for main task

The following tasks plan according to the number of targets left:
- BAI
- ANTISHIP
- DEAD
- STRIKE

Other tasks use a random value between 2 and 4.
This commit is contained in:
Raffson
2022-08-15 01:20:14 +02:00
parent a14bf6d1ba
commit 1f4cca329e
9 changed files with 18 additions and 9 deletions

View File

@@ -25,7 +25,8 @@ class PlanDead(PackagePlanningTask[IadsGroundObject]):
state.eliminate_air_defense(self.target)
def propose_flights(self) -> None:
self.propose_flight(FlightType.DEAD, 2)
tgt_count = self.target.alive_unit_count
self.propose_flight(FlightType.DEAD, min(4, (tgt_count // 2) + 1))
# Only include SEAD against SAMs that still have emitters. No need to
# suppress an EWR, and SEAD isn't useful against a SAM that no longer has a