mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
fixes for selectable departure; generate statics for used units; raised RTB alt
This commit is contained in:
@@ -30,7 +30,7 @@ ATTACK_CIRCLE_ALT = 5000
|
||||
ATTACK_CIRCLE_DURATION = 15
|
||||
|
||||
CAS_ALTITUDE = 1000
|
||||
RTB_ALTITUDE = 1000
|
||||
RTB_ALTITUDE = 3000
|
||||
HELI_ALT = 900
|
||||
|
||||
TRANSPORT_LANDING_ALT = 1000
|
||||
|
||||
@@ -49,12 +49,14 @@ class AirSupportConflictGenerator:
|
||||
)
|
||||
|
||||
tanker_group.points[0].tasks.append(ActivateBeaconCommand(channel=97 + i, unit_id=tanker_group.id, aa=False))
|
||||
tanker_group.tasks.append(SetInvisibleCommand(True))
|
||||
tanker_group.tasks.append(SetImmortalCommand(True))
|
||||
|
||||
if is_awacs_enabled:
|
||||
awacs_unit = db.find_unittype(AWACS, self.conflict.attackers_side.name)[0]
|
||||
self.mission.awacs_flight(
|
||||
awacs_flight = self.mission.awacs_flight(
|
||||
country=self.mission.country(self.game.player),
|
||||
name=namegen.next_awacs_name(self.mission.country(self.game.player),),
|
||||
name=namegen.next_awacs_name(self.mission.country(self.game.player)),
|
||||
plane_type=awacs_unit,
|
||||
altitude=AWACS_ALT,
|
||||
airport=None,
|
||||
@@ -62,3 +64,6 @@ class AirSupportConflictGenerator:
|
||||
frequency=133,
|
||||
start_type=StartType.Warm,
|
||||
)
|
||||
|
||||
awacs_flight.tasks.append(SetInvisibleCommand(True))
|
||||
awacs_flight.tasks.append(SetImmortalCommand(True))
|
||||
|
||||
@@ -277,7 +277,7 @@ class Conflict:
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def intercept_position(cls, from_cp: ControlPoint, to_cp:ControlPoint) -> Point:
|
||||
def intercept_position(cls, from_cp: ControlPoint, to_cp: ControlPoint) -> Point:
|
||||
raw_distance = from_cp.position.distance_to_point(to_cp.position) * 1.5
|
||||
distance = max(min(raw_distance, INTERCEPT_MAX_DISTANCE), INTERCEPT_MIN_DISTANCE)
|
||||
heading = _heading_sum(from_cp.position.heading_between_point(to_cp.position), random.choice([-1, 1]) * random.randint(60, 100))
|
||||
@@ -285,6 +285,7 @@ class Conflict:
|
||||
|
||||
@classmethod
|
||||
def intercept_conflict(cls, attacker: Country, defender: Country, position: Point, from_cp: ControlPoint, to_cp: ControlPoint, theater: ConflictTheater):
|
||||
heading = from_cp.position.heading_between_point(position)
|
||||
return cls(
|
||||
position=position.point_from_heading(position.heading_between_point(to_cp.position), INTERCEPT_CONFLICT_DISTANCE),
|
||||
theater=theater,
|
||||
|
||||
@@ -54,14 +54,12 @@ class TriggersGenerator:
|
||||
vehicle_group.late_activation = True
|
||||
activate_by_trigger.append(vehicle_group)
|
||||
|
||||
"""
|
||||
conflict_distance = player_cp.position.distance_to_point(self.conflict.position)
|
||||
minimum_radius = max(conflict_distance - TRIGGER_MIN_DISTANCE_FROM_START, TRIGGER_RADIUS_MINIMUM)
|
||||
if minimum_radius < 0:
|
||||
minimum_radius = 0
|
||||
|
||||
result_radius = min(minimum_radius, radius)
|
||||
"""
|
||||
radius = min(minimum_radius, radius)
|
||||
|
||||
activation_trigger_zone = self.mission.triggers.add_triggerzone(self.conflict.position, radius, name="Activation zone")
|
||||
activation_trigger = TriggerOnce(Event.NoEvent, "Activation trigger")
|
||||
|
||||
@@ -124,6 +124,17 @@ class VisualGenerator:
|
||||
position=pos)
|
||||
break
|
||||
|
||||
def _generate_stub_planes(self):
|
||||
mission_units = set()
|
||||
for coalition_name, coalition in self.mission.coalition.items():
|
||||
for country in coalition.countries.values():
|
||||
for group in country.plane_group + country.helicopter_group + country.vehicle_group:
|
||||
for unit in group.units:
|
||||
mission_units.add(db.unit_type_of(unit))
|
||||
|
||||
for unit_type in mission_units:
|
||||
self.mission.static_group(self.mission.country("USA"), "a", unit_type, Point(0, 0))
|
||||
|
||||
def generate_target_smokes(self, target):
|
||||
spread = target.size * DESTINATION_SMOKE_DISTANCE_FACTOR
|
||||
for _ in range(0, int(target.size * DESTINATION_SMOKE_AMOUNT_FACTOR * (1.1 - target.base.strength))):
|
||||
@@ -159,3 +170,4 @@ class VisualGenerator:
|
||||
|
||||
def generate(self):
|
||||
self._generate_frontline_smokes()
|
||||
self._generate_stub_planes()
|
||||
|
||||
Reference in New Issue
Block a user