Add decoy weapon type and configure AI tasks.

See https://github.com/dcs-liberation/dcs_liberation/pull/2810
for more discussion.

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2780.
This commit is contained in:
zhexu14 2023-04-26 13:02:30 +10:00 committed by GitHub
parent e2c6d6788c
commit 4bf8f25d31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 2 deletions

View File

@ -97,6 +97,7 @@ class WeaponType(Enum):
ARM = "ARM"
LGB = "LGB"
TGP = "TGP"
DECOY = "decoy"
UNKNOWN = "unknown"

View File

@ -9,7 +9,6 @@ from dcs.task import (
WeaponType as DcsWeaponType,
)
from game.data.weapons import WeaponType
from game.theater import TheaterGroundObject
from .pydcswaypointbuilder import PydcsWaypointBuilder
@ -45,8 +44,20 @@ class SeadIngressBuilder(PydcsWaypointBuilder):
engage_task.params["groupAttack"] = True
engage_task.params["expend"] = Expend.All.value
waypoint.tasks.append(engage_task)
elif self.flight.loadout.has_weapon_of_type(WeaponType.DECOY):
# Special handling for DECOY weapon types:
# - Specify that DECOY weapon type is used in AttackGroup task so that
# the flight actually launches the decoy. See link below for details
# https://github.com/dcs-liberation/dcs_liberation/issues/2780
attack_task = AttackGroup(
miz_group.id,
weapon_type=DcsWeaponType.Decoy,
group_attack=True,
expend=Expend.All,
)
waypoint.tasks.append(attack_task)
else:
# All non ARM types like Decoys will use the normal AttackGroup Task
# All non ARM and non DECOY types will use the normal AttackGroup Task
attack_task = AttackGroup(
miz_group.id,
weapon_type=DcsWeaponType.Guided,

View File

@ -0,0 +1,9 @@
name: ADM-141A TALD
# https://www.designation-systems.net/dusrm/m-141.html
year: 1987
type: decoy
clsids:
- "{BRU42_ADM141}"
- "{BRU3242_ADM141}"
- "{ADM_141A}"
- "{ADM_141B}"