mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
This class does far too many things and the file is huge. Split it up into a few more classes.
37 lines
1.2 KiB
Python
37 lines
1.2 KiB
Python
import logging
|
|
|
|
from dcs.point import MovingPoint
|
|
from dcs.task import AttackGroup, WeaponType
|
|
|
|
from game.theater import TheaterGroundObject
|
|
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
|
|
|
|
|
class DeadIngressBuilder(PydcsWaypointBuilder):
|
|
def build(self) -> MovingPoint:
|
|
waypoint = super().build()
|
|
self.register_special_waypoints(self.waypoint.targets)
|
|
|
|
target = self.package.target
|
|
if not isinstance(target, TheaterGroundObject):
|
|
logging.error(
|
|
"Unexpected target type for DEAD mission: %s",
|
|
target.__class__.__name__,
|
|
)
|
|
return waypoint
|
|
|
|
for group in target.groups:
|
|
miz_group = self.mission.find_group(group.name)
|
|
if miz_group is None:
|
|
logging.error(f"Could not find group for DEAD mission {group.name}")
|
|
continue
|
|
|
|
task = AttackGroup(miz_group.id, weapon_type=WeaponType.Auto)
|
|
task.params["expend"] = "All"
|
|
task.params["attackQtyLimit"] = False
|
|
task.params["directionEnabled"] = False
|
|
task.params["altitudeEnabled"] = False
|
|
task.params["groupAttack"] = True
|
|
waypoint.tasks.append(task)
|
|
return waypoint
|