mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fixed errors after merge on helipad feature.
This commit is contained in:
parent
1e96aad484
commit
483640b0c6
@ -30,7 +30,6 @@ from .event.frontlineattack import FrontlineAttackEvent
|
||||
from .factions.faction import Faction
|
||||
from .infos.information import Information
|
||||
from .navmesh import NavMesh
|
||||
from .procurement import AircraftProcurementRequest
|
||||
from .profiling import logged_duration
|
||||
from .settings import Settings
|
||||
from .squadrons import AirWing
|
||||
@ -192,7 +191,7 @@ class Game:
|
||||
@property
|
||||
def neutral_country(self):
|
||||
"""Return the best fitting country that can be used as neutral faction in the generated mission"""
|
||||
countries_in_use = [self.player_country, self.enemy_country]
|
||||
countries_in_use = [self.red.country_name, self.blue.country_name]
|
||||
if UnitedNationsPeacekeepers not in countries_in_use:
|
||||
return UnitedNationsPeacekeepers
|
||||
elif Switzerland.name not in countries_in_use:
|
||||
|
||||
@ -1,13 +1,23 @@
|
||||
from typing import Optional
|
||||
|
||||
from dcs import Point
|
||||
from dcs.unitgroup import StaticGroup
|
||||
|
||||
from game.point_with_heading import PointWithHeading
|
||||
from game.utils import Heading
|
||||
|
||||
|
||||
class Helipad(PointWithHeading):
|
||||
def __init__(self):
|
||||
super(Helipad, self).__init__()
|
||||
self.heading = 0
|
||||
self.heading = Heading.from_degrees(0)
|
||||
self.occupied = False
|
||||
self.static_unit: Optional[StaticGroup] = None
|
||||
|
||||
@staticmethod
|
||||
def from_point(point: Point, heading: Heading) -> "Helipad":
|
||||
h = Helipad()
|
||||
h.x = point.x
|
||||
h.y = point.y
|
||||
h.heading = heading
|
||||
return h
|
||||
|
||||
@ -51,11 +51,11 @@ from .controlpoint import (
|
||||
MissionTarget,
|
||||
OffMapSpawn,
|
||||
)
|
||||
from .seasonalconditions import SeasonalConditions
|
||||
from .frontline import FrontLine
|
||||
from .landmap import Landmap, load_landmap, poly_contains
|
||||
from .latlon import LatLon
|
||||
from .projections import TransverseMercator
|
||||
from .seasonalconditions import SeasonalConditions
|
||||
from ..helipad import Helipad
|
||||
from ..point_with_heading import PointWithHeading
|
||||
from ..positioned import Positioned
|
||||
@ -89,7 +89,7 @@ class MizCampaignLoader:
|
||||
SHIPPING_LANE_UNIT_TYPE = HandyWind.id
|
||||
|
||||
FOB_UNIT_TYPE = Unarmed.SKP_11.id
|
||||
FARP_HELIPAD = "SINGLE_HELIPAD"
|
||||
FARP_HELIPAD = "Invisible FARP"
|
||||
|
||||
OFFSHORE_STRIKE_TARGET_UNIT_TYPE = Fortification.Oil_platform.id
|
||||
SHIP_UNIT_TYPE = USS_Arleigh_Burke_IIa.id
|
||||
@ -271,6 +271,7 @@ class MizCampaignLoader:
|
||||
def helipads(self) -> Iterator[StaticGroup]:
|
||||
for group in self.blue.static_group:
|
||||
if group.units[0].type == self.FARP_HELIPAD:
|
||||
print("helooooo")
|
||||
yield group
|
||||
|
||||
@property
|
||||
@ -482,7 +483,7 @@ class MizCampaignLoader:
|
||||
for static in self.helipads:
|
||||
closest, distance = self.objective_info(static)
|
||||
closest.helipads.append(
|
||||
PointWithHeading.from_point(
|
||||
Helipad.from_point(
|
||||
static.position, Heading.from_degrees(static.units[0].heading)
|
||||
)
|
||||
)
|
||||
|
||||
@ -614,7 +614,7 @@ class HelipadGenerator:
|
||||
country=country,
|
||||
name=(name + "_fuel"),
|
||||
_type=Fortification.FARP_Fuel_Depot,
|
||||
position=pad.position.point_from_heading(helipad.heading, 35),
|
||||
position=pad.position.point_from_heading(helipad.heading.degrees, 35),
|
||||
heading=pad.heading,
|
||||
)
|
||||
self.m.static_group(
|
||||
@ -622,8 +622,8 @@ class HelipadGenerator:
|
||||
name=(name + "_ammo"),
|
||||
_type=Fortification.FARP_Ammo_Dump_Coating,
|
||||
position=pad.position.point_from_heading(
|
||||
helipad.heading, 35
|
||||
).point_from_heading(helipad.heading + 90, 10),
|
||||
helipad.heading.degrees, 35
|
||||
).point_from_heading(helipad.heading.degrees + 90, 10),
|
||||
heading=pad.heading,
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user