mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Update pydcs.
This commit is contained in:
parent
267da47f6e
commit
60f772081c
@ -13,14 +13,13 @@ from dcs.planes import F_15C
|
||||
from dcs.ships import HandyWind, LHA_Tarawa, Stennis, USS_Arleigh_Burke_IIa
|
||||
from dcs.statics import Fortification, Warehouse
|
||||
from dcs.terrain import Airport
|
||||
from dcs.triggers import TriggerZoneCircular
|
||||
from dcs.unitgroup import PlaneGroup, ShipGroup, StaticGroup, VehicleGroup
|
||||
from dcs.vehicles import AirDefence, Armor, MissilesSS, Unarmed
|
||||
|
||||
from game.positioned import Positioned
|
||||
from game.profiling import logged_duration
|
||||
from game.scenery_group import SceneryGroup
|
||||
from game.theater.presetlocation import PresetLocation
|
||||
from game.utils import Distance, meters
|
||||
from game.theater.controlpoint import (
|
||||
Airfield,
|
||||
Carrier,
|
||||
@ -29,7 +28,8 @@ from game.theater.controlpoint import (
|
||||
Lha,
|
||||
OffMapSpawn,
|
||||
)
|
||||
from game.utils import Distance, Heading, meters
|
||||
from game.theater.presetlocation import PresetLocation
|
||||
from game.utils import Distance, meters
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from game.theater.conflicttheater import ConflictTheater
|
||||
@ -69,13 +69,13 @@ class MizCampaignLoader:
|
||||
MEDIUM_RANGE_SAM_UNIT_TYPES = {
|
||||
AirDefence.Hawk_ln.id,
|
||||
AirDefence.S_75M_Volhov.id,
|
||||
AirDefence._5p73_s_125_ln.id,
|
||||
AirDefence.X_5p73_s_125_ln.id,
|
||||
}
|
||||
|
||||
SHORT_RANGE_SAM_UNIT_TYPES = {
|
||||
AirDefence.M1097_Avenger.id,
|
||||
AirDefence.Rapier_fsa_launcher.id,
|
||||
AirDefence._2S6_Tunguska.id,
|
||||
AirDefence.X_2S6_Tunguska.id,
|
||||
AirDefence.Strela_1_9P31.id,
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class MizCampaignLoader:
|
||||
AirDefence.ZSU_23_4_Shilka.id,
|
||||
}
|
||||
|
||||
EWR_UNIT_TYPE = AirDefence._1L13_EWR.id
|
||||
EWR_UNIT_TYPE = AirDefence.X_1L13_EWR.id
|
||||
|
||||
ARMOR_GROUP_UNIT_TYPE = Armor.M_1_Abrams.id
|
||||
|
||||
@ -240,7 +240,11 @@ class MizCampaignLoader:
|
||||
|
||||
@property
|
||||
def scenery(self) -> List[SceneryGroup]:
|
||||
return SceneryGroup.from_trigger_zones(self.mission.triggers._zones)
|
||||
return SceneryGroup.from_trigger_zones(
|
||||
z
|
||||
for z in self.mission.triggers._zones
|
||||
if isinstance(z, TriggerZoneCircular)
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def control_points(self) -> dict[UUID, ControlPoint]:
|
||||
|
||||
@ -5,8 +5,8 @@ from game.theater.theatergroup import TheaterUnit
|
||||
|
||||
class AlicCodes:
|
||||
CODES = {
|
||||
AirDefence._1L13_EWR.id: 101,
|
||||
AirDefence._55G6_EWR.id: 102,
|
||||
AirDefence.X_1L13_EWR.id: 101,
|
||||
AirDefence.X_55G6_EWR.id: 102,
|
||||
AirDefence.S_300PS_40B6MD_sr.id: 103,
|
||||
AirDefence.S_300PS_64H6E_sr.id: 104,
|
||||
AirDefence.SA_11_Buk_SR_9S18M1.id: 107,
|
||||
@ -17,7 +17,7 @@ class AlicCodes:
|
||||
AirDefence.Osa_9A33_ln.id: 117,
|
||||
AirDefence.Strela_10M3.id: 118,
|
||||
AirDefence.Tor_9A331.id: 119,
|
||||
AirDefence._2S6_Tunguska.id: 120,
|
||||
AirDefence.X_2S6_Tunguska.id: 120,
|
||||
AirDefence.ZSU_23_4_Shilka.id: 121,
|
||||
AirDefence.P_19_s_125_sr.id: 122,
|
||||
AirDefence.Snr_s_125_tr.id: 123,
|
||||
|
||||
@ -1,31 +1,32 @@
|
||||
from dcs.ships import (
|
||||
Forrestal,
|
||||
PIOTR,
|
||||
MOSCOW,
|
||||
VINSON,
|
||||
ALBATROS,
|
||||
CVN_71,
|
||||
CVN_72,
|
||||
CVN_73,
|
||||
Stennis,
|
||||
KUZNECOW,
|
||||
CV_1143_5,
|
||||
NEUSTRASH,
|
||||
ALBATROS,
|
||||
REZKY,
|
||||
MOLNIYA,
|
||||
Forrestal,
|
||||
KUZNECOW,
|
||||
LHA_Tarawa,
|
||||
MOLNIYA,
|
||||
MOSCOW,
|
||||
NEUSTRASH,
|
||||
PERRY,
|
||||
PIOTR,
|
||||
REZKY,
|
||||
Stennis,
|
||||
TICONDEROG,
|
||||
Type_052B,
|
||||
Type_052C,
|
||||
Type_054A,
|
||||
USS_Arleigh_Burke_IIa,
|
||||
VINSON,
|
||||
)
|
||||
from dcs.vehicles import AirDefence
|
||||
|
||||
from pydcs_extensions import highdigitsams as hds
|
||||
|
||||
TELARS = {
|
||||
AirDefence._2S6_Tunguska,
|
||||
AirDefence.X_2S6_Tunguska,
|
||||
AirDefence.SA_11_Buk_LN_9A310M1,
|
||||
AirDefence.Osa_9A33_ln,
|
||||
AirDefence.Tor_9A331,
|
||||
@ -53,7 +54,7 @@ TRACK_RADARS = {
|
||||
|
||||
LAUNCHER_TRACKER_PAIRS = {
|
||||
AirDefence.Kub_2P25_ln: AirDefence.Kub_1S91_str,
|
||||
AirDefence._5p73_s_125_ln: AirDefence.Snr_s_125_tr,
|
||||
AirDefence.X_5p73_s_125_ln: AirDefence.Snr_s_125_tr,
|
||||
AirDefence.S_300PS_5P85C_ln: AirDefence.S_300PS_40B6M_tr,
|
||||
AirDefence.S_300PS_5P85D_ln: AirDefence.S_300PS_40B6M_tr,
|
||||
AirDefence.Hawk_ln: AirDefence.Hawk_tr,
|
||||
@ -80,7 +81,7 @@ LAUNCHER_TRACKER_PAIRS = {
|
||||
|
||||
UNITS_WITH_RADAR = {
|
||||
# Radars
|
||||
AirDefence._2S6_Tunguska,
|
||||
AirDefence.X_2S6_Tunguska,
|
||||
AirDefence.SA_11_Buk_LN_9A310M1,
|
||||
AirDefence.Osa_9A33_ln,
|
||||
AirDefence.Tor_9A331,
|
||||
@ -88,11 +89,11 @@ UNITS_WITH_RADAR = {
|
||||
AirDefence.Vulcan,
|
||||
AirDefence.Roland_ADS,
|
||||
AirDefence.ZSU_23_4_Shilka,
|
||||
AirDefence._1L13_EWR,
|
||||
AirDefence.X_1L13_EWR,
|
||||
AirDefence.Kub_1S91_str,
|
||||
AirDefence.S_300PS_40B6M_tr,
|
||||
AirDefence.S_300PS_40B6MD_sr,
|
||||
AirDefence._55G6_EWR,
|
||||
AirDefence.X_55G6_EWR,
|
||||
AirDefence.S_300PS_64H6E_sr,
|
||||
AirDefence.SA_11_Buk_SR_9S18M1,
|
||||
AirDefence.Dog_Ear_radar,
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
from __future__ import annotations
|
||||
from game.theater.theatergroundobject import NAME_BY_CATEGORY
|
||||
from dcs.triggers import TriggerZone
|
||||
|
||||
from typing import Iterable, List
|
||||
|
||||
from dcs.triggers import TriggerZoneCircular
|
||||
|
||||
from game.theater.theatergroundobject import NAME_BY_CATEGORY
|
||||
|
||||
|
||||
class SceneryGroupError(RuntimeError):
|
||||
"""Error for when there are insufficient conditions to create a SceneryGroup."""
|
||||
@ -15,7 +17,10 @@ class SceneryGroup:
|
||||
"""Store information about a scenery objective."""
|
||||
|
||||
def __init__(
|
||||
self, zone_def: TriggerZone, zones: Iterable[TriggerZone], category: str
|
||||
self,
|
||||
zone_def: TriggerZoneCircular,
|
||||
zones: Iterable[TriggerZoneCircular],
|
||||
category: str,
|
||||
) -> None:
|
||||
|
||||
self.zone_def = zone_def
|
||||
@ -24,7 +29,9 @@ class SceneryGroup:
|
||||
self.category = category
|
||||
|
||||
@staticmethod
|
||||
def from_trigger_zones(trigger_zones: Iterable[TriggerZone]) -> List[SceneryGroup]:
|
||||
def from_trigger_zones(
|
||||
trigger_zones: Iterable[TriggerZoneCircular],
|
||||
) -> List[SceneryGroup]:
|
||||
"""Define scenery objectives based on their encompassing blue/red circle."""
|
||||
zone_definitions = []
|
||||
white_zones = []
|
||||
@ -79,11 +86,11 @@ class SceneryGroup:
|
||||
return scenery_groups
|
||||
|
||||
@staticmethod
|
||||
def is_blue(zone: TriggerZone) -> bool:
|
||||
def is_blue(zone: TriggerZoneCircular) -> bool:
|
||||
# Blue in RGB is [0 Red], [0 Green], [1 Blue]. Ignore the fourth position: Transparency.
|
||||
return zone.color[1] == 0 and zone.color[2] == 0 and zone.color[3] == 1
|
||||
|
||||
@staticmethod
|
||||
def is_white(zone: TriggerZone) -> bool:
|
||||
def is_white(zone: TriggerZoneCircular) -> bool:
|
||||
# White in RGB is [1 Red], [1 Green], [1 Blue]. Ignore the fourth position: Transparency.
|
||||
return zone.color[1] == 1 and zone.color[2] == 1 and zone.color[3] == 1
|
||||
|
||||
@ -32,7 +32,7 @@ pluggy==1.0.0
|
||||
pre-commit==2.19.0
|
||||
py==1.11.0
|
||||
pydantic==1.9.1
|
||||
-e git+https://github.com/pydcs/dcs@ca682e883449164d39401750cdc1c974bc902064#egg=pydcs
|
||||
-e git+https://github.com/pydcs/dcs@99724085475bc5773ba8132d569c9daa332fc25c#egg=pydcs
|
||||
pyinstaller==5.2
|
||||
pyinstaller-hooks-contrib==2022.8
|
||||
pyparsing==3.0.9
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user