mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Improve bomber tasking
This commit is contained in:
parent
ae561e5564
commit
243ded448d
@ -11,7 +11,10 @@ from .pydcswaypointbuilder import PydcsWaypointBuilder
|
|||||||
|
|
||||||
class StrikeIngressBuilder(PydcsWaypointBuilder):
|
class StrikeIngressBuilder(PydcsWaypointBuilder):
|
||||||
def add_tasks(self, waypoint: MovingPoint) -> None:
|
def add_tasks(self, waypoint: MovingPoint) -> None:
|
||||||
if self.group.units[0].unit_type in [B_17G, B_52H, Tu_22M3]:
|
bomber = self.group.units[0].unit_type in [B_17G, B_52H, Tu_22M3]
|
||||||
|
if bomber:
|
||||||
|
if self.group.units[0].unit_type == B_52H:
|
||||||
|
self.add_strike_tasks(waypoint, WeaponType.Guided)
|
||||||
self.add_bombing_tasks(waypoint)
|
self.add_bombing_tasks(waypoint)
|
||||||
else:
|
else:
|
||||||
self.add_strike_tasks(waypoint)
|
self.add_strike_tasks(waypoint)
|
||||||
@ -27,16 +30,18 @@ class StrikeIngressBuilder(PydcsWaypointBuilder):
|
|||||||
for target in targets[1:]:
|
for target in targets[1:]:
|
||||||
center += target.position
|
center += target.position
|
||||||
center /= len(targets)
|
center /= len(targets)
|
||||||
|
ga = True if self.flight.count > 1 else False
|
||||||
bombing = Bombing(
|
bombing = Bombing(
|
||||||
center, weapon_type=WeaponType.Bombs, expend=Expend.All, group_attack=True
|
center, weapon_type=WeaponType.Bombs, expend=Expend.All, group_attack=ga
|
||||||
)
|
)
|
||||||
waypoint.tasks.append(bombing)
|
waypoint.tasks.append(bombing)
|
||||||
|
|
||||||
def add_strike_tasks(self, waypoint: MovingPoint) -> None:
|
def add_strike_tasks(
|
||||||
|
self, waypoint: MovingPoint, weapon_type: WeaponType = WeaponType.Auto
|
||||||
|
) -> None:
|
||||||
|
ga = True if self.flight.count > 1 else False
|
||||||
for target in self.waypoint.targets:
|
for target in self.waypoint.targets:
|
||||||
bombing = Bombing(
|
bombing = Bombing(target.position, weapon_type=weapon_type, group_attack=ga)
|
||||||
target.position, weapon_type=WeaponType.Auto, group_attack=True
|
|
||||||
)
|
|
||||||
# If there is only one target, drop all ordnance in one pass.
|
# If there is only one target, drop all ordnance in one pass.
|
||||||
if len(self.waypoint.targets) == 1:
|
if len(self.waypoint.targets) == 1:
|
||||||
bombing.params["expend"] = Expend.All.value
|
bombing.params["expend"] = Expend.All.value
|
||||||
|
|||||||
@ -2,6 +2,39 @@ local unitPayloads = {
|
|||||||
["name"] = "B-52H",
|
["name"] = "B-52H",
|
||||||
["payloads"] = {
|
["payloads"] = {
|
||||||
[1] = {
|
[1] = {
|
||||||
|
["name"] = "ANTISHIP",
|
||||||
|
["pylons"] = {
|
||||||
|
[1] = {
|
||||||
|
["CLSID"] = "{46ACDCF8-5451-4E26-BDDB-E78D5830E93C}",
|
||||||
|
["num"] = 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
["tasks"] = {
|
||||||
|
[1] = 30,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[2] = {
|
||||||
|
["name"] = "STRIKE",
|
||||||
|
["pylons"] = {
|
||||||
|
[1] = {
|
||||||
|
["CLSID"] = "{696CFFC4-0BDE-42A8-BE4B-0BE3D9DD723C}",
|
||||||
|
["num"] = 1,
|
||||||
|
},
|
||||||
|
[2] = {
|
||||||
|
["CLSID"] = "{8DCAF3A3-7FCF-41B8-BB88-58DEDA878EDE}",
|
||||||
|
["num"] = 2,
|
||||||
|
},
|
||||||
|
[3] = {
|
||||||
|
["CLSID"] = "{696CFFC4-0BDE-42A8-BE4B-0BE3D9DD723C}",
|
||||||
|
["num"] = 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
["tasks"] = {
|
||||||
|
[1] = 32,
|
||||||
|
[2] = 34,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[3] = {
|
||||||
["name"] = "SEAD",
|
["name"] = "SEAD",
|
||||||
["pylons"] = {
|
["pylons"] = {
|
||||||
[1] = {
|
[1] = {
|
||||||
@ -21,39 +54,6 @@ local unitPayloads = {
|
|||||||
[1] = 33,
|
[1] = 33,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
[2] = {
|
|
||||||
["name"] = "ANTISHIP",
|
|
||||||
["pylons"] = {
|
|
||||||
[1] = {
|
|
||||||
["CLSID"] = "{46ACDCF8-5451-4E26-BDDB-E78D5830E93C}",
|
|
||||||
["num"] = 2,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
["tasks"] = {
|
|
||||||
[1] = 30,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
["name"] = "STRIKE",
|
|
||||||
["pylons"] = {
|
|
||||||
[1] = {
|
|
||||||
["CLSID"] = "{696CFFC4-0BDE-42A8-BE4B-0BE3D9DD723C}",
|
|
||||||
["num"] = 1,
|
|
||||||
},
|
|
||||||
[2] = {
|
|
||||||
["CLSID"] = "{6C47D097-83FF-4FB2-9496-EAB36DDF0B05}",
|
|
||||||
["num"] = 2,
|
|
||||||
},
|
|
||||||
[3] = {
|
|
||||||
["CLSID"] = "{696CFFC4-0BDE-42A8-BE4B-0BE3D9DD723C}",
|
|
||||||
["num"] = 3,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
["tasks"] = {
|
|
||||||
[1] = 32,
|
|
||||||
[2] = 34,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
[4] = {
|
[4] = {
|
||||||
["name"] = "CAP",
|
["name"] = "CAP",
|
||||||
["pylons"] = {
|
["pylons"] = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user