From d18a9f376f8996f42aaafbefdec35a94faa1e098 Mon Sep 17 00:00:00 2001 From: Khopa Date: Thu, 20 Aug 2020 22:15:54 +0200 Subject: [PATCH] Added Syria map with GolanHeights setup. Added a setting to forbid navy units on some control points. --- qt_ui/windows/newgame/QCampaignList.py | 4 +- theater/controlpoint.py | 1 + theater/start_generator.py | 2 +- theater/syria.py | 54 ++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 theater/syria.py diff --git a/qt_ui/windows/newgame/QCampaignList.py b/qt_ui/windows/newgame/QCampaignList.py index 9a3298bc..907898fa 100644 --- a/qt_ui/windows/newgame/QCampaignList.py +++ b/qt_ui/windows/newgame/QCampaignList.py @@ -3,7 +3,7 @@ from PySide2.QtCore import QSize, QItemSelectionModel from PySide2.QtGui import QStandardItemModel, QStandardItem from PySide2.QtWidgets import QListView, QAbstractItemView -from theater import caucasus, nevada, persiangulf, normandy, thechannel +from theater import caucasus, nevada, persiangulf, normandy, thechannel, syria import qt_ui.uiconstants as CONST CAMPAIGNS = [ @@ -18,7 +18,7 @@ CAMPAIGNS = [ ("Persian Gulf - Desert War", persiangulf.DesertWar, "Terrain_Persian_Gulf"), ("Persian Gulf - Full Map", persiangulf.PersianGulfTheater, "Terrain_Persian_Gulf"), - ("Syria - Golan heights battle", persiangulf.PersianGulfTheater, "Terrain_Syria"), + ("Syria - Golan heights battle", syria.GolanHeights, "Terrain_Syria"), ("Syria - Invasion from Turkey", persiangulf.PersianGulfTheater, "Terrain_Syria"), ("Syria - Syrian Civil War", persiangulf.PersianGulfTheater, "Terrain_Syria"), ("Syria - War on Insurgents", persiangulf.PersianGulfTheater, "Terrain_Syria"), diff --git a/theater/controlpoint.py b/theater/controlpoint.py index 49da85b4..96b6605c 100644 --- a/theater/controlpoint.py +++ b/theater/controlpoint.py @@ -28,6 +28,7 @@ class ControlPoint: base = None # type: theater.base.Base at = None # type: db.StartPosition icls = 1 + allow_sea_units = True connected_points = None # type: typing.List[ControlPoint] ground_objects = None # type: typing.List[TheaterGroundObject] diff --git a/theater/start_generator.py b/theater/start_generator.py index 26820755..b029ae92 100644 --- a/theater/start_generator.py +++ b/theater/start_generator.py @@ -155,7 +155,7 @@ def generate_groundobjects(theater: ConflictTheater, game): logging.info(ground_object.groups) # Generate navy groups - if "boat" in db.FACTIONS[faction_name].keys(): + if "boat" in db.FACTIONS[faction_name].keys() and cp.allow_sea_units: if cp.captured and game.settings.do_not_generate_player_navy: continue diff --git a/theater/syria.py b/theater/syria.py new file mode 100644 index 00000000..349d73d0 --- /dev/null +++ b/theater/syria.py @@ -0,0 +1,54 @@ +from dcs.terrain import normandy, syria + +from .conflicttheater import * +from .landmap import * + + +class GolanHeights(ConflictTheater): + terrain = dcs.terrain.Syria() + overview_image = "syria.gif" + reference_points = {(syria.Eyn_Shemer.position.x, syria.Eyn_Shemer.position.y): (1300, 1380), + (syria.Tabqa.position.x, syria.Tabqa.position.y): (2060, 570)} + landmap = load_landmap("resources\\syrialandmap.p") + daytime_map = { + "dawn": (6, 8), + "day": (8, 16), + "dusk": (16, 18), + "night": (0, 5), + } + + def __init__(self): + super(GolanHeights, self).__init__() + + self.ramatDavid = ControlPoint.from_airport(syria.Ramat_David, LAND, SIZE_REGULAR, IMPORTANCE_HIGH) + self.kinghussein = ControlPoint.from_airport(syria.King_Hussein_Air_College, LAND, SIZE_REGULAR, IMPORTANCE_HIGH) + self.khalkhala = ControlPoint.from_airport(syria.Khalkhalah, LAND, SIZE_REGULAR, IMPORTANCE_MEDIUM) + + self.khalkhala.allow_sea_units = False + self.ramatDavid.allow_sea_units = False + self.kinghussein.allow_sea_units = False + + self.marjruhayyil = ControlPoint.from_airport(syria.Marj_Ruhayyil, LAND, SIZE_REGULAR, IMPORTANCE_LOW) + self.mezzeh = ControlPoint.from_airport(syria.Mezzeh, LAND, SIZE_REGULAR, IMPORTANCE_MEDIUM) + self.aldumayr = ControlPoint.from_airport(syria.Al_Dumayr, LAND, SIZE_REGULAR, IMPORTANCE_MEDIUM) + + self.carrier = ControlPoint.carrier("Carrier", Point(-280000, -238000), 1001) + self.lha = ControlPoint.lha("LHA Carrier", Point(-237000, -89800), 1002) + + self.add_controlpoint(self.ramatDavid, connected_to=[self.khalkhala, self.kinghussein]) + self.add_controlpoint(self.khalkhala, connected_to=[self.ramatDavid, self.kinghussein, self.marjruhayyil]) + self.add_controlpoint(self.kinghussein, connected_to=[self.khalkhala, self.ramatDavid]) + self.add_controlpoint(self.marjruhayyil, connected_to=[self.khalkhala, self.mezzeh, self.aldumayr]) + self.add_controlpoint(self.mezzeh, connected_to=[self.marjruhayyil]) + self.add_controlpoint(self.aldumayr, connected_to=[self.marjruhayyil]) + + self.add_controlpoint(self.carrier) + self.add_controlpoint(self.lha) + + self.ramatDavid.captured = True + self.carrier.captured = True + self.lha.captured = True + + self.aldumayr.captured_invert = True + self.carrier.captured_invert = True + self.lha.captured_invert = True