AI Strike flight will bomb all their targets correctly

This commit is contained in:
Khopa
2020-05-31 15:43:56 +02:00
parent ab3ea84d70
commit 0b9d827ad6
6 changed files with 26 additions and 12 deletions

View File

@@ -46,8 +46,9 @@ INTERCEPT_MAX_DISTANCE = 200000
class AircraftConflictGenerator:
escort_targets = [] # type: typing.List[typing.Tuple[FlyingGroup, int]]
def __init__(self, mission: Mission, conflict: Conflict, settings: Settings):
def __init__(self, mission: Mission, conflict: Conflict, settings: Settings, game):
self.m = mission
self.game = game
self.settings = settings
self.conflict = conflict
self.escort_targets = []
@@ -457,7 +458,12 @@ class AircraftConflictGenerator:
for point in flight.points:
group.add_waypoint(Point(point.x,point.y), point.alt)
for t in point.targets:
group.points[i].tasks.append(Bombing(t.position))
if hasattr(t, "obj_name"):
buildings = self.game.theater.find_ground_objects_by_obj_name(t.obj_name)
for building in buildings:
group.points[i].tasks.append(Bombing(building.position))
else:
group.points[i].tasks.append(Bombing(t.position))
i = i + 1

View File

@@ -57,11 +57,7 @@ class BriefingGenerator:
self.description += "-"*50 + "\n"
for planner in self.game.planners.values():
for flight in planner.cap_flights:
self.add_flight_description(flight)
for flight in planner.cas_flights:
self.add_flight_description(flight)
for flight in planner.sead_flights:
for flight in planner.flights:
self.add_flight_description(flight)
if self.freqs:
@@ -82,7 +78,6 @@ class BriefingGenerator:
self.description += "X"
self.description += " " + str(cp.tacanI) + "\n"
self.m.set_description_text(self.description)