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
3 changed files with 23 additions and 2 deletions

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,