mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Improve AI SEAD capabilities
This commit is contained in:
@@ -7,6 +7,7 @@ from dcs.task import (
|
||||
Expend,
|
||||
OptECMUsing,
|
||||
WeaponType as DcsWeaponType,
|
||||
OptRestrictAfterburner,
|
||||
)
|
||||
|
||||
from game.data.weapons import WeaponType
|
||||
@@ -29,6 +30,11 @@ class SeadIngressBuilder(PydcsWaypointBuilder):
|
||||
# Preemptively use ECM to better avoid getting swatted.
|
||||
ecm_option = OptECMUsing(value=OptECMUsing.Values.UseIfDetectedLockByRadar)
|
||||
waypoint.tasks.append(ecm_option)
|
||||
|
||||
# Avoid having AI burn all of its fuel while loitering until next weapon release
|
||||
burn_restrict = OptRestrictAfterburner(True)
|
||||
waypoint.tasks.append(burn_restrict)
|
||||
|
||||
for group in target.groups:
|
||||
miz_group = self.mission.find_group(group.group_name)
|
||||
if miz_group is None:
|
||||
@@ -43,7 +49,7 @@ class SeadIngressBuilder(PydcsWaypointBuilder):
|
||||
weapon_type=DcsWeaponType.Decoy,
|
||||
group_attack=True,
|
||||
expend=Expend.All,
|
||||
altitude=waypoint.alt,
|
||||
altitude=round(waypoint.alt * 1.5), # 50% increase to force a climb
|
||||
)
|
||||
waypoint.tasks.append(attack_task)
|
||||
|
||||
@@ -54,8 +60,16 @@ class SeadIngressBuilder(PydcsWaypointBuilder):
|
||||
# when skynet is enabled and the Radar is not emitting. They dive
|
||||
# into the SAM instead of waiting for it to come alive
|
||||
engage_task = EngageGroup(miz_group.id)
|
||||
engage_task.params["weaponType"] = DcsWeaponType.Guided.value
|
||||
engage_task.params["groupAttack"] = True
|
||||
engage_task.params["expend"] = Expend.All.value
|
||||
engage_task.params["weaponType"] = DcsWeaponType.ARM.value
|
||||
waypoint.tasks.append(engage_task)
|
||||
|
||||
# Use other Air-to-Surface Missiles at last
|
||||
attack_task = AttackGroup(
|
||||
miz_group.id,
|
||||
weapon_type=DcsWeaponType.ASM,
|
||||
altitude=waypoint.alt, # flight loses alt with AB restriction
|
||||
)
|
||||
waypoint.tasks.append(attack_task)
|
||||
|
||||
burn_free = OptRestrictAfterburner(False)
|
||||
waypoint.tasks.append(burn_free)
|
||||
|
||||
Reference in New Issue
Block a user