strike operations fixes

This commit is contained in:
Vasyl Horbachenko 2018-09-09 23:56:30 +03:00
parent 61a237d1ae
commit 40bfb6fa88
5 changed files with 16 additions and 12 deletions

View File

@ -354,6 +354,7 @@ PLANE_PAYLOAD_OVERRIDES = {
A_10C: {
CAS: "AGM-65D*2,AGM-65H*2,GBU-12*2,GBU-38*2,AIM-9*2,TGP,ECM,MK151*7",
GroundAttack: "AGM-65K*2,GBU-12*8,AIM-9M*2.ECM,TGP",
},
Ka_50: {

View File

@ -84,11 +84,15 @@ class AircraftConflictGenerator:
override_loadout = db.PLANE_PAYLOAD_OVERRIDES[unit_type]
if type(override_loadout) == dict:
if for_task in db.PLANE_PAYLOAD_OVERRIDES[unit_type]:
group.load_loadout(db.PLANE_PAYLOAD_OVERRIDES[unit_type][for_task])
payload_name = db.PLANE_PAYLOAD_OVERRIDES[unit_type][for_task]
group.load_loadout(payload_name)
did_load_loadout = True
logging.info("Loaded overridden payload for {} - {} for task {}".format(unit_type, payload_name, for_task))
elif "*" in db.PLANE_PAYLOAD_OVERRIDES[unit_type]:
group.load_loadout(db.PLANE_PAYLOAD_OVERRIDES[unit_type]["*"])
payload_name = db.PLANE_PAYLOAD_OVERRIDES[unit_type]["*"]
group.load_loadout(payload_name)
did_load_loadout = True
logging.info("Loaded overridden payload for {} - {} for task {}".format(unit_type, payload_name, for_task))
elif issubclass(override_loadout, MainTask):
group.load_task_default_loadout(override_loadout)
did_load_loadout = True
@ -275,12 +279,12 @@ class AircraftConflictGenerator:
escort_until_waypoint = None
for name, pos in targets:
waypoint = group.add_waypoint(pos, WARM_START_ALTITUDE, WARM_START_AIRSPEED, self.m.translation.create_string(name))
waypoint = group.add_waypoint(pos, 0, WARM_START_AIRSPEED, self.m.translation.create_string(name))
if escort_until_waypoint is None:
escort_until_waypoint = waypoint
group.task = CAS.name
self._setup_group(group, CAS, client_count)
group.task = GroundAttack.name
self._setup_group(group, GroundAttack, client_count)
self.escort_targets.append((group, group.points.index(escort_until_waypoint)))
self._rtb_for(group, self.conflict.from_cp, at)

@ -1 +1 @@
Subproject commit fae126689132d643d317252adfb03184042a0ded
Subproject commit fce769c41d1db9a48d5c264101750510a9db1fcc

View File

@ -39,9 +39,9 @@ class EventResultsMenu(Menu):
if not self.finished:
header("You are clear for takeoff !")
header("You are clear for takeoff!")
label("In DCS, open and play the mission :")
label("In DCS, open and play the mission:")
label("liberation_nextturn", "italic")
label("or")
label("liberation_nextturn_quick", "italic")
@ -78,7 +78,6 @@ class EventResultsMenu(Menu):
header("Operation failed", "title-red")
header("Player losses")
for unit_type, count in self.player_losses.items():
Label(self.frame, text=db.unit_type_name(unit_type), **STYLES["widget"]).grid(row=row)
Label(self.frame, text="{}".format(count), **STYLES["widget"]).grid(column=1, row=row)
@ -89,6 +88,7 @@ class EventResultsMenu(Menu):
if self.debriefing.destroyed_objects:
Label(self.frame, text="Ground assets", **STYLES["widget"]).grid(row=row)
Label(self.frame, text="{}".format(len(self.debriefing.destroyed_objects)), **STYLES["widget"]).grid(column=1, row=row)
row += 1
for unit_type, count in self.enemy_losses.items():
if count == 0:

View File

@ -171,11 +171,10 @@ class Debriefing:
for mission_id in self._dead_objects:
for group in mission.country(enemy.name).static_group + mission.country(enemy.name).vehicle_group:
if group.id == mission_id:
if mission_id in [x.id for x in group.units]:
logging.info("debriefing: connected id {} to group {}".format(mission_id, str(group.name)))
self.destroyed_objects.append(str(group.name))
self.destroyed_objects += self._dead_defense
def debriefing_directory_location() -> str:
return os.path.join(base_path(), "liberation_debriefings")