mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
proper settings for barcap
This commit is contained in:
parent
cf7276b528
commit
61a237d1ae
@ -33,7 +33,7 @@ class StrikeOperation(Operation):
|
|||||||
if self.game.player == self.defender_name:
|
if self.game.player == self.defender_name:
|
||||||
self.attackers_starting_position = None
|
self.attackers_starting_position = None
|
||||||
|
|
||||||
conflict = Conflict.capture_conflict(
|
conflict = Conflict.strike_conflict(
|
||||||
attacker=self.mission.country(self.attacker_name),
|
attacker=self.mission.country(self.attacker_name),
|
||||||
defender=self.mission.country(self.defender_name),
|
defender=self.mission.country(self.defender_name),
|
||||||
from_cp=self.from_cp,
|
from_cp=self.from_cp,
|
||||||
|
|||||||
@ -24,6 +24,7 @@ WARM_START_AIRSPEED = 550
|
|||||||
|
|
||||||
INTERCEPTION_ALT = 3000
|
INTERCEPTION_ALT = 3000
|
||||||
INTERCEPTION_AIRSPEED = 1000
|
INTERCEPTION_AIRSPEED = 1000
|
||||||
|
BARCAP_RACETRACK_DISTANCE = 20000
|
||||||
|
|
||||||
ATTACK_CIRCLE_ALT = 5000
|
ATTACK_CIRCLE_ALT = 5000
|
||||||
ATTACK_CIRCLE_DURATION = 15
|
ATTACK_CIRCLE_DURATION = 15
|
||||||
@ -218,12 +219,6 @@ class AircraftConflictGenerator:
|
|||||||
at=at)
|
at=at)
|
||||||
|
|
||||||
group.task = Escort.name
|
group.task = Escort.name
|
||||||
|
|
||||||
"""
|
|
||||||
heading = group.position.heading_between_point(self.conflict.position)
|
|
||||||
position = group.position # type: Point
|
|
||||||
wayp = group.add_waypoint(position.point_from_heading(heading, WORKAROUND_WAYP_DIST), CAS_ALTITUDE, WARM_START_AIRSPEED)
|
|
||||||
"""
|
|
||||||
self._setup_group(group, CAP, client_count)
|
self._setup_group(group, CAP, client_count)
|
||||||
|
|
||||||
for escorted_group, waypoint_index in self.escort_targets:
|
for escorted_group, waypoint_index in self.escort_targets:
|
||||||
@ -404,6 +399,10 @@ class AircraftConflictGenerator:
|
|||||||
if self.conflict.is_vector:
|
if self.conflict.is_vector:
|
||||||
group.add_waypoint(self.conflict.tail, WARM_START_ALTITUDE, WARM_START_AIRSPEED)
|
group.add_waypoint(self.conflict.tail, WARM_START_ALTITUDE, WARM_START_AIRSPEED)
|
||||||
else:
|
else:
|
||||||
|
heading = group.position.heading_between_point(self.conflict.position)
|
||||||
|
waypoint = group.add_waypoint(self.conflict.position.point_from_heading(heading, BARCAP_RACETRACK_DISTANCE),
|
||||||
|
WARM_START_ALTITUDE,
|
||||||
|
WARM_START_AIRSPEED)
|
||||||
waypoint.tasks.append(OrbitAction(WARM_START_ALTITUDE, WARM_START_AIRSPEED))
|
waypoint.tasks.append(OrbitAction(WARM_START_ALTITUDE, WARM_START_AIRSPEED))
|
||||||
|
|
||||||
group.task = CAP.name
|
group.task = CAP.name
|
||||||
|
|||||||
@ -21,6 +21,9 @@ AIR_DISTANCE = 40000
|
|||||||
|
|
||||||
CAPTURE_AIR_ATTACKERS_DISTANCE = 25000
|
CAPTURE_AIR_ATTACKERS_DISTANCE = 25000
|
||||||
CAPTURE_AIR_DEFENDERS_DISTANCE = 60000
|
CAPTURE_AIR_DEFENDERS_DISTANCE = 60000
|
||||||
|
STRIKE_AIR_ATTACKERS_DISTANCE = 45000
|
||||||
|
STRIKE_AIR_DEFENDERS_DISTANCE = 25000
|
||||||
|
|
||||||
CAP_CAS_DISTANCE = 10000, 120000
|
CAP_CAS_DISTANCE = 10000, 120000
|
||||||
|
|
||||||
GROUND_INTERCEPT_SPREAD = 5000
|
GROUND_INTERCEPT_SPREAD = 5000
|
||||||
@ -225,6 +228,33 @@ class Conflict:
|
|||||||
air_defenders_location=position.point_from_heading(_opposite_heading(attack_raw_heading), CAPTURE_AIR_DEFENDERS_DISTANCE)
|
air_defenders_location=position.point_from_heading(_opposite_heading(attack_raw_heading), CAPTURE_AIR_DEFENDERS_DISTANCE)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def strike_conflict(cls, attacker: Country, defender: Country, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater):
|
||||||
|
position = to_cp.position
|
||||||
|
attack_raw_heading = to_cp.position.heading_between_point(from_cp.position)
|
||||||
|
attack_heading = to_cp.find_radial(attack_raw_heading)
|
||||||
|
defense_heading = to_cp.find_radial(from_cp.position.heading_between_point(to_cp.position), ignored_radial=attack_heading)
|
||||||
|
|
||||||
|
distance = to_cp.size * GROUND_DISTANCE_FACTOR
|
||||||
|
attackers_location = position.point_from_heading(attack_heading, distance)
|
||||||
|
attackers_location = Conflict._find_ground_position(attackers_location, distance * 2, _heading_sum(attack_heading, 180), theater)
|
||||||
|
|
||||||
|
defenders_location = position.point_from_heading(defense_heading, distance)
|
||||||
|
defenders_location = Conflict._find_ground_position(defenders_location, distance * 2, _heading_sum(defense_heading, 180), theater)
|
||||||
|
|
||||||
|
return cls(
|
||||||
|
position=position,
|
||||||
|
theater=theater,
|
||||||
|
from_cp=from_cp,
|
||||||
|
to_cp=to_cp,
|
||||||
|
attackers_side=attacker,
|
||||||
|
defenders_side=defender,
|
||||||
|
ground_attackers_location=attackers_location,
|
||||||
|
ground_defenders_location=defenders_location,
|
||||||
|
air_attackers_location=position.point_from_heading(attack_raw_heading, STRIKE_AIR_ATTACKERS_DISTANCE),
|
||||||
|
air_defenders_location=position.point_from_heading(_opposite_heading(attack_raw_heading), STRIKE_AIR_DEFENDERS_DISTANCE)
|
||||||
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def intercept_conflict(cls, attacker: Country, defender: Country, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater):
|
def intercept_conflict(cls, attacker: Country, defender: Country, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater):
|
||||||
raw_distance = from_cp.position.distance_to_point(to_cp.position) * 1.5
|
raw_distance = from_cp.position.distance_to_point(to_cp.position) * 1.5
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user