Skip to content

Commit

Permalink
Add strafing task (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
magwo committed Nov 24, 2023
1 parent ca4cb43 commit c65e497
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions dcs/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,27 @@ def __init__(self, airport_id: int = 0, weapon_type: WeaponType = WeaponType.Aut
}


class Strafing(Task):
Id = "Strafing"

def __init__(self, position: Vector2 = Vector2(0, 0), weapon_type: WeaponType = WeaponType.Auto,
expend: Expend = Expend.Auto, attack_qty=1, group_attack=False,
direction: Optional[int] = None, length: Optional[int] = None):
super(Strafing, self).__init__(Strafing.Id)
self.params = {
"directionEnabled": direction is not None,
"direction": direction if direction is not None else 0,
"length": length if length is not None else 0,
"attackQtyLimit": attack_qty > 1,
"attackQty": attack_qty if attack_qty > 1 else 1,
"expend": expend.value,
"x": position.x,
"y": position.y,
"groupAttack": group_attack,
"weaponType": weapon_type.value
}


class EngageTargets(Task):
Id = "EngageTargets"

Expand Down Expand Up @@ -1012,6 +1033,7 @@ def __init__(self, from_index=None, to_index=None):
AttackGroup.Id: AttackGroup,
Bombing.Id: Bombing,
BombingRunway.Id: BombingRunway,
Strafing.Id: Strafing,
EngageTargetsInZone.Id: EngageTargetsInZone,
EngageGroup.Id: EngageGroup,
EngageUnit.Id: EngageUnit,
Expand Down

0 comments on commit c65e497

Please sign in to comment.