Change SEAD task to Search and Engage for ARM weapon

SEAD flights will have the Search and Engage Group Task instead of the current AttackGroup task when the flight has ARM weapons in the Loadout. This resolves an issue with AI not able to attack a SAM when skynet is used. This is due to the RADAR not emitting and the AI therefore just diving into the SAM.
Non-ARM Loadouts will still use the AttackGroup task. This ensures that for example the ADM-141 TALD used by the F-14s will work correctly
This commit is contained in:
RndName 2022-03-29 14:58:20 +02:00
parent 23ba3215d4
commit 1bb7e1bf47
2 changed files with 23 additions and 8 deletions

View File

@ -94,6 +94,7 @@ class Weapon:
@unique @unique
class WeaponType(Enum): class WeaponType(Enum):
ARM = "ARM"
LGB = "LGB" LGB = "LGB"
TGP = "TGP" TGP = "TGP"
UNKNOWN = "unknown" UNKNOWN = "unknown"

View File

@ -1,7 +1,8 @@
import logging import logging
from dcs.point import MovingPoint from dcs.point import MovingPoint
from dcs.task import AttackGroup, OptECMUsing, WeaponType from dcs.task import AttackGroup, EngageGroup, OptECMUsing, WeaponType as DcsWeaponType
from game.data.weapons import WeaponType
from game.theater import TheaterGroundObject from game.theater import TheaterGroundObject
from .pydcswaypointbuilder import PydcsWaypointBuilder from .pydcswaypointbuilder import PydcsWaypointBuilder
@ -27,13 +28,26 @@ class SeadIngressBuilder(PydcsWaypointBuilder):
) )
continue continue
task = AttackGroup(miz_group.id, weapon_type=WeaponType.Guided) if self.flight.loadout.has_weapon_of_type(WeaponType.ARM):
task.params["expend"] = "All" # Special handling for ARM Weapon types:
task.params["attackQtyLimit"] = False # The SEAD flight will Search for the targeted group and then engage it
task.params["directionEnabled"] = False # if it is found only. This will prevent AI from having huge problems
task.params["altitudeEnabled"] = False # when skynet is enabled and the Radar is not emitting. They dive
task.params["groupAttack"] = True # into the SAM instead of waiting for it to come alive
waypoint.tasks.append(task) engage_task = EngageGroup(miz_group.id)
engage_task.params["weaponType"] = DcsWeaponType.Guided.value
waypoint.tasks.append(engage_task)
else:
# All non ARM types like Decoys will use the normal AttackGroup Task
attack_task = AttackGroup(
miz_group.id, weapon_type=DcsWeaponType.Guided
)
attack_task.params["expend"] = "All"
attack_task.params["attackQtyLimit"] = False
attack_task.params["directionEnabled"] = False
attack_task.params["altitudeEnabled"] = False
attack_task.params["groupAttack"] = True
waypoint.tasks.append(attack_task)
# Preemptively use ECM to better avoid getting swatted. # Preemptively use ECM to better avoid getting swatted.
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfDetectedLockByRadar) ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfDetectedLockByRadar)