mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
* Improve Ingress WP attack tasking and update pydcs - Updated the Attack Tasking of SEAD, DEAD, Strike and BAI to match the pydcs changes - Changed DEAD, BAI and SEAD AttackGroup task to expend=auto. This solves an issue where the AI uses all Ammo on one single target as we defined the expend param to All instead of Auto which is used by default. * Set Expend=All for SEAD Ingress This ensures that the AI will only do one Attack Pass and also really suppress the Target what they are expected to do.
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
import logging
|
|
|
|
from dcs.point import MovingPoint
|
|
from dcs.task import AttackGroup, OptECMUsing, WeaponType
|
|
|
|
from game.theater import TheaterGroundObject
|
|
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
|
|
|
|
|
class DeadIngressBuilder(PydcsWaypointBuilder):
|
|
def add_tasks(self, waypoint: MovingPoint) -> None:
|
|
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
|
|
|
|
for group in target.groups:
|
|
miz_group = self.mission.find_group(group.group_name)
|
|
if miz_group is None:
|
|
logging.error(
|
|
f"Could not find group for DEAD mission {group.group_name}"
|
|
)
|
|
continue
|
|
|
|
task = AttackGroup(
|
|
miz_group.id, weapon_type=WeaponType.Auto, group_attack=True
|
|
)
|
|
waypoint.tasks.append(task)
|
|
|
|
# Preemptively use ECM to better avoid getting swatted.
|
|
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfDetectedLockByRadar)
|
|
waypoint.tasks.append(ecm_option)
|