mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Improve Ingress Waypoint Attack tasking
* 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.
This commit is contained in:
@@ -36,10 +36,6 @@ class BaiIngressBuilder(PydcsWaypointBuilder):
|
||||
continue
|
||||
|
||||
task = AttackGroup(miz_group.id, weapon_type=WeaponType.Auto)
|
||||
task.params["attackQtyLimit"] = False
|
||||
task.params["directionEnabled"] = False
|
||||
task.params["altitudeEnabled"] = False
|
||||
task.params["groupAttack"] = True
|
||||
waypoint.tasks.append(task)
|
||||
|
||||
waypoint.tasks.append(OptFormation.trail_open())
|
||||
|
||||
@@ -27,12 +27,9 @@ class DeadIngressBuilder(PydcsWaypointBuilder):
|
||||
)
|
||||
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
|
||||
task = AttackGroup(
|
||||
miz_group.id, weapon_type=WeaponType.Auto, group_attack=True
|
||||
)
|
||||
waypoint.tasks.append(task)
|
||||
|
||||
# Preemptively use ECM to better avoid getting swatted.
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
import logging
|
||||
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import AttackGroup, EngageGroup, OptECMUsing, WeaponType as DcsWeaponType
|
||||
from dcs.task import (
|
||||
AttackGroup,
|
||||
EngageGroup,
|
||||
Expend,
|
||||
OptECMUsing,
|
||||
WeaponType as DcsWeaponType,
|
||||
)
|
||||
from game.data.weapons import WeaponType
|
||||
|
||||
from game.theater import TheaterGroundObject
|
||||
@@ -36,17 +42,17 @@ class SeadIngressBuilder(PydcsWaypointBuilder):
|
||||
# into the SAM instead of waiting for it to come alive
|
||||
engage_task = EngageGroup(miz_group.id)
|
||||
engage_task.params["weaponType"] = DcsWeaponType.Guided.value
|
||||
# Ensure that they fire all ammunition in one attack pass
|
||||
engage_task.params["expend"] = Expend.All.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
|
||||
miz_group.id,
|
||||
weapon_type=DcsWeaponType.Guided,
|
||||
group_attack=True,
|
||||
expend=Expend.All,
|
||||
)
|
||||
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.
|
||||
|
||||
@@ -2,7 +2,7 @@ import copy
|
||||
|
||||
from dcs.planes import B_17G, B_52H, Tu_22M3
|
||||
from dcs.point import MovingPoint
|
||||
from dcs.task import Bombing, OptFormation, WeaponType
|
||||
from dcs.task import Bombing, OptFormation, WeaponType, Expend
|
||||
|
||||
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
||||
|
||||
@@ -25,21 +25,19 @@ class StrikeIngressBuilder(PydcsWaypointBuilder):
|
||||
for target in targets[1:]:
|
||||
center += target.position
|
||||
center /= len(targets)
|
||||
bombing = Bombing(center, weapon_type=WeaponType.Bombs)
|
||||
bombing.params["expend"] = "All"
|
||||
bombing.params["attackQtyLimit"] = False
|
||||
bombing.params["directionEnabled"] = False
|
||||
bombing.params["altitudeEnabled"] = False
|
||||
bombing.params["groupAttack"] = True
|
||||
bombing = Bombing(
|
||||
center, weapon_type=WeaponType.Bombs, expend=Expend.All, group_attack=True
|
||||
)
|
||||
waypoint.tasks.append(bombing)
|
||||
|
||||
def add_strike_tasks(self, waypoint: MovingPoint) -> None:
|
||||
for target in self.waypoint.targets:
|
||||
bombing = Bombing(target.position, weapon_type=WeaponType.Auto)
|
||||
bombing = Bombing(
|
||||
target.position, weapon_type=WeaponType.Auto, group_attack=True
|
||||
)
|
||||
# If there is only one target, drop all ordnance in one pass.
|
||||
if len(self.waypoint.targets) == 1:
|
||||
bombing.params["expend"] = "All"
|
||||
bombing.params["groupAttack"] = True
|
||||
bombing.params["expend"] = Expend.All.value
|
||||
waypoint.tasks.append(bombing)
|
||||
|
||||
# Register special waypoints
|
||||
|
||||
Reference in New Issue
Block a user