base capture operation implementation

This commit is contained in:
Vasiliy Horbachenko
2018-05-29 03:11:42 +03:00
parent f4a3aef2d5
commit 3809ce67fe
20 changed files with 902 additions and 64 deletions

View File

@@ -72,7 +72,7 @@ class AircraftConflictGenerator:
airport=airport)
self.escort_targets.append(group)
group.add_waypoint(self.conflict.point, CAS_ALTITUDE)
group.add_waypoint(self.conflict.position, CAS_ALTITUDE)
group.task = CAS.name
def generate_escort(self, attackers: typing.Dict[PlaneType, int], airport: Airport = None):
@@ -88,7 +88,7 @@ class AircraftConflictGenerator:
group.task = Escort.name
group.load_task_default_loadout(dcs.task.Escort.name)
heading = group.position.heading_between_point(self.conflict.point)
heading = group.position.heading_between_point(self.conflict.position)
position = group.position # type: Point
wayp = group.add_waypoint(position.point_from_heading(heading, 3000), CAS_ALTITUDE)
@@ -107,6 +107,6 @@ class AircraftConflictGenerator:
group.task = FighterSweep.name
group.load_task_default_loadout(dcs.task.FighterSweep())
wayp = group.add_waypoint(self.conflict.point, CAS_ALTITUDE)
wayp = group.add_waypoint(self.conflict.position, CAS_ALTITUDE)
wayp.tasks.append(dcs.task.EngageTargets(max_distance=self.conflict.size * INTERCEPT_MAX_DISTANCE_FACTOR))
wayp.tasks.append(dcs.task.OrbitAction())

View File

@@ -43,7 +43,7 @@ class ArmorConflictGenerator:
position=self._group_point(at),
group_size=1,
move_formation=PointAction.OffRoad)
wayp = group.add_waypoint(self.conflict.point)
wayp = group.add_waypoint(self.conflict.position)
wayp.tasks = []
def generate(self, attackers: typing.Dict[UnitType, int], defenders: typing.Dict[UnitType, int]):

View File

@@ -20,18 +20,15 @@ GROUND_DISTANCE_FACTOR = 2
AIR_DISTANCE_FACTOR = 5
class Conflict:
trigger_zone = None # type: TriggerZone
activation_trigger = None # type: Trigger
def __init__(self, attacker: Country, attack_heading: int, defender: Country, defense_heading: int, point: Point, size: int):
def __init__(self, attacker: Country, attack_heading: int, defender: Country, defense_heading: int, position: Point, size: int):
self.attackers_side = attacker
self.defenders_side = defender
self.point = point
self.position = position
self.size = size
self.ground_attackers_location = self.point.point_from_heading(attack_heading, self.size * GROUND_DISTANCE_FACTOR)
self.ground_defenders_location = self.point.point_from_heading(defense_heading, self.size * GROUND_DISTANCE_FACTOR)
self.ground_attackers_location = self.position.point_from_heading(attack_heading, self.size * GROUND_DISTANCE_FACTOR)
self.ground_defenders_location = self.position.point_from_heading(defense_heading, self.size * GROUND_DISTANCE_FACTOR)
self.air_attackers_location = self.point.point_from_heading(attack_heading, self.size * AIR_DISTANCE_FACTOR)
self.air_defenders_location = self.point.point_from_heading(defense_heading, self.size * AIR_DISTANCE_FACTOR)
self.air_attackers_location = self.position.point_from_heading(attack_heading, self.size * AIR_DISTANCE_FACTOR)
self.air_defenders_location = self.position.point_from_heading(defense_heading, self.size * AIR_DISTANCE_FACTOR)