mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Move base EWRs into their own category.
Without this we're sometimes spawning base EWRs at points far outside the base perimeter.
This commit is contained in:
parent
2a06a1ffdf
commit
840107c69e
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,6 +11,7 @@ a.py
|
|||||||
resources/tools/a.miz
|
resources/tools/a.miz
|
||||||
# User-specific stuff
|
# User-specific stuff
|
||||||
.idea/
|
.idea/
|
||||||
|
.env
|
||||||
|
|
||||||
/kneeboards
|
/kneeboards
|
||||||
/liberation_preferences.json
|
/liberation_preferences.json
|
||||||
|
|||||||
@ -399,7 +399,7 @@ class MizCampaignLoader:
|
|||||||
for group in self.ewrs:
|
for group in self.ewrs:
|
||||||
closest, distance = self.objective_info(group)
|
closest, distance = self.objective_info(group)
|
||||||
if distance < self.BASE_DEFENSE_RADIUS:
|
if distance < self.BASE_DEFENSE_RADIUS:
|
||||||
closest.preset_locations.ewrs.append(
|
closest.preset_locations.base_ewrs.append(
|
||||||
PointWithHeading.from_point(group.position, group.units[0].heading)
|
PointWithHeading.from_point(group.position, group.units[0].heading)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -64,6 +64,7 @@ class LocationType(Enum):
|
|||||||
BaseAirDefense = "base air defense"
|
BaseAirDefense = "base air defense"
|
||||||
Coastal = "coastal defense"
|
Coastal = "coastal defense"
|
||||||
Ewr = "EWR"
|
Ewr = "EWR"
|
||||||
|
BaseEwr = "Base EWR"
|
||||||
Garrison = "garrison"
|
Garrison = "garrison"
|
||||||
MissileSite = "missile site"
|
MissileSite = "missile site"
|
||||||
OffshoreStrikeTarget = "offshore strike target"
|
OffshoreStrikeTarget = "offshore strike target"
|
||||||
@ -87,6 +88,9 @@ class PresetLocations:
|
|||||||
#: Locations used by EWRs.
|
#: Locations used by EWRs.
|
||||||
ewrs: List[PointWithHeading] = field(default_factory=list)
|
ewrs: List[PointWithHeading] = field(default_factory=list)
|
||||||
|
|
||||||
|
#: Locations used by Base EWRs.
|
||||||
|
base_ewrs: List[PointWithHeading] = field(default_factory=list)
|
||||||
|
|
||||||
#: Locations used by non-carrier ships. Carriers and LHAs are not random.
|
#: Locations used by non-carrier ships. Carriers and LHAs are not random.
|
||||||
ships: List[PointWithHeading] = field(default_factory=list)
|
ships: List[PointWithHeading] = field(default_factory=list)
|
||||||
|
|
||||||
@ -135,6 +139,8 @@ class PresetLocations:
|
|||||||
return self._random_from(self.coastal_defenses)
|
return self._random_from(self.coastal_defenses)
|
||||||
if location_type == LocationType.Ewr:
|
if location_type == LocationType.Ewr:
|
||||||
return self._random_from(self.ewrs)
|
return self._random_from(self.ewrs)
|
||||||
|
if location_type == LocationType.BaseEwr:
|
||||||
|
return self._random_from(self.base_ewrs)
|
||||||
if location_type == LocationType.Garrison:
|
if location_type == LocationType.Garrison:
|
||||||
return self._random_from(self.base_garrisons)
|
return self._random_from(self.base_garrisons)
|
||||||
if location_type == LocationType.MissileSite:
|
if location_type == LocationType.MissileSite:
|
||||||
@ -474,7 +480,7 @@ class ControlPoint(MissionTarget, ABC):
|
|||||||
for base_defense in self.base_defenses:
|
for base_defense in self.base_defenses:
|
||||||
p = PointWithHeading.from_point(base_defense.position, base_defense.heading)
|
p = PointWithHeading.from_point(base_defense.position, base_defense.heading)
|
||||||
if isinstance(base_defense, EwrGroundObject):
|
if isinstance(base_defense, EwrGroundObject):
|
||||||
self.preset_locations.ewrs.append(p)
|
self.preset_locations.base_ewrs.append(p)
|
||||||
elif isinstance(base_defense, SamGroundObject):
|
elif isinstance(base_defense, SamGroundObject):
|
||||||
self.preset_locations.base_air_defense.append(p)
|
self.preset_locations.base_air_defense.append(p)
|
||||||
elif isinstance(base_defense, VehicleGroupGroundObject):
|
elif isinstance(base_defense, VehicleGroupGroundObject):
|
||||||
|
|||||||
@ -303,7 +303,7 @@ class BaseDefenseGenerator:
|
|||||||
self.generate_base_defenses()
|
self.generate_base_defenses()
|
||||||
|
|
||||||
def generate_ewr(self) -> None:
|
def generate_ewr(self) -> None:
|
||||||
position = self.location_finder.location_for(LocationType.Ewr)
|
position = self.location_finder.location_for(LocationType.BaseEwr)
|
||||||
if position is None:
|
if position is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user