mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8226782c1 | ||
|
|
a592cf3a05 | ||
|
|
0b1cb0d770 | ||
|
|
a4aa1cff3a | ||
|
|
6a02d2ffb6 |
@@ -37,10 +37,10 @@ and prioritization for the enemy (i.e. less important bases will receive units w
|
|||||||
PRICES = {
|
PRICES = {
|
||||||
# fighter
|
# fighter
|
||||||
C_101CC: 8,
|
C_101CC: 8,
|
||||||
MiG_23MLD: 20,
|
MiG_23MLD: 18,
|
||||||
Su_27: 24,
|
Su_27: 24,
|
||||||
Su_33: 25,
|
Su_33: 25,
|
||||||
MiG_29A: 22,
|
MiG_29A: 24,
|
||||||
MiG_29S: 26,
|
MiG_29S: 26,
|
||||||
|
|
||||||
F_5E_3: 6,
|
F_5E_3: 6,
|
||||||
@@ -137,6 +137,7 @@ UNIT_BY_TASK = {
|
|||||||
CAP: [
|
CAP: [
|
||||||
C_101CC,
|
C_101CC,
|
||||||
F_5E_3,
|
F_5E_3,
|
||||||
|
MiG_23MLD,
|
||||||
Su_27,
|
Su_27,
|
||||||
Su_33,
|
Su_33,
|
||||||
MiG_21Bis,
|
MiG_21Bis,
|
||||||
@@ -243,6 +244,7 @@ UNIT_BY_COUNTRY = {
|
|||||||
"Russia": [
|
"Russia": [
|
||||||
C_101CC,
|
C_101CC,
|
||||||
AJS37,
|
AJS37,
|
||||||
|
MiG_23MLD,
|
||||||
F_5E_3,
|
F_5E_3,
|
||||||
Su_25,
|
Su_25,
|
||||||
Su_27,
|
Su_27,
|
||||||
@@ -287,6 +289,7 @@ UNIT_BY_COUNTRY = {
|
|||||||
],
|
],
|
||||||
|
|
||||||
"USA": [
|
"USA": [
|
||||||
|
F_5E_3,
|
||||||
F_15C,
|
F_15C,
|
||||||
FA_18C_hornet,
|
FA_18C_hornet,
|
||||||
AJS37,
|
AJS37,
|
||||||
|
|||||||
@@ -127,10 +127,10 @@ class AircraftConflictGenerator:
|
|||||||
alt = WARM_START_HELI_ALT + random.randint(50, 200)
|
alt = WARM_START_HELI_ALT + random.randint(50, 200)
|
||||||
speed = WARM_START_HELI_AIRSPEED
|
speed = WARM_START_HELI_AIRSPEED
|
||||||
else:
|
else:
|
||||||
alt = WARM_START_ALTITUDE + random.randint(50, 200)
|
alt = WARM_START_ALTITUDE + random.randint(50, 800)
|
||||||
speed = WARM_START_AIRSPEED
|
speed = WARM_START_AIRSPEED
|
||||||
|
|
||||||
pos = Point(at.x + random.randint(100, 200), at.y + random.randint(100, 200))
|
pos = Point(at.x + random.randint(100, 1000), at.y + random.randint(100, 1000))
|
||||||
|
|
||||||
logging.info("airgen: {} for {} at {} at {}".format(unit_type, side.id, alt, speed))
|
logging.info("airgen: {} for {} at {} at {}".format(unit_type, side.id, alt, speed))
|
||||||
return self.m.flight_group(
|
return self.m.flight_group(
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class AirSupportConflictGenerator:
|
|||||||
plane_type=tanker_unit,
|
plane_type=tanker_unit,
|
||||||
position=tanker_position,
|
position=tanker_position,
|
||||||
altitude=TANKER_ALT,
|
altitude=TANKER_ALT,
|
||||||
frequency=140,
|
frequency=240,
|
||||||
start_type=StartType.Warm,
|
start_type=StartType.Warm,
|
||||||
tacanchannel="99X",
|
tacanchannel="99X",
|
||||||
)
|
)
|
||||||
@@ -49,6 +49,6 @@ class AirSupportConflictGenerator:
|
|||||||
altitude=AWACS_ALT,
|
altitude=AWACS_ALT,
|
||||||
airport=None,
|
airport=None,
|
||||||
position=self.conflict.position.random_point_within(AWACS_DISTANCE, AWACS_DISTANCE),
|
position=self.conflict.position.random_point_within(AWACS_DISTANCE, AWACS_DISTANCE),
|
||||||
frequency=180,
|
frequency=244,
|
||||||
start_type=StartType.Warm,
|
start_type=StartType.Warm,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -149,10 +149,10 @@ class TriggersGenerator:
|
|||||||
description = ""
|
description = ""
|
||||||
description += "FREQUENCIES:"
|
description += "FREQUENCIES:"
|
||||||
description += "\nFlight: 251 MHz AM"
|
description += "\nFlight: 251 MHz AM"
|
||||||
description += "\nTanker: 10X/140 MHz"
|
description += "\nTanker: 10X/240 MHz"
|
||||||
|
|
||||||
if awacs_enabled:
|
if awacs_enabled:
|
||||||
description += "\nAWACS: 180 MHz"
|
description += "\nAWACS: 244 MHz"
|
||||||
|
|
||||||
if self.conflict.from_cp.is_global or self.conflict.to_cp.is_global:
|
if self.conflict.from_cp.is_global or self.conflict.to_cp.is_global:
|
||||||
description += "\nCarrier: 20X/ICLS CHAN1"
|
description += "\nCarrier: 20X/ICLS CHAN1"
|
||||||
|
|||||||
Binary file not shown.
@@ -4,11 +4,11 @@ from dcs.mission import Mission
|
|||||||
from dcs.terrain import PersianGulf
|
from dcs.terrain import PersianGulf
|
||||||
|
|
||||||
m = Mission()
|
m = Mission()
|
||||||
m.load_file("tools/cau_terrain.miz")
|
m.load_file("./gulf_terrain.miz")
|
||||||
|
|
||||||
landmap = []
|
landmap = []
|
||||||
for plane_group in m.country("USA").plane_group:
|
for plane_group in m.country("USA").plane_group:
|
||||||
landmap.append([(x.position.x, x.position.y) for x in plane_group.points])
|
landmap.append([(x.position.x, x.position.y) for x in plane_group.points])
|
||||||
|
|
||||||
with open("./caulandmap.p", "wb") as f:
|
with open("../gulflandmap.p", "wb") as f:
|
||||||
pickle.dump(landmap, f)
|
pickle.dump(landmap, f)
|
||||||
|
|||||||
Binary file not shown.
@@ -35,11 +35,11 @@ class PersianGulfTheater(ConflictTheater):
|
|||||||
tunb_kochak = ControlPoint.from_airport(persiangulf.Tunb_Kochak, [135, 180], SIZE_SMALL, 1.2, has_frontline=False)
|
tunb_kochak = ControlPoint.from_airport(persiangulf.Tunb_Kochak, [135, 180], SIZE_SMALL, 1.2, has_frontline=False)
|
||||||
|
|
||||||
bandar_lengeh = ControlPoint.from_airport(persiangulf.Bandar_Lengeh, [270, 315, 0, 45], SIZE_SMALL, 1.1)
|
bandar_lengeh = ControlPoint.from_airport(persiangulf.Bandar_Lengeh, [270, 315, 0, 45], SIZE_SMALL, 1.1)
|
||||||
qeshm = ControlPoint.from_airport(persiangulf.Qeshm_Island, [270, 315, 0, 45, 90, 135, 180], SIZE_SMALL, 1.3, has_frontline=False)
|
qeshm = ControlPoint.from_airport(persiangulf.Qeshm_Island, [270, 315, 0, 45, 90, 135, 180], SIZE_SMALL, 1.2, has_frontline=False)
|
||||||
|
|
||||||
havadarya = ControlPoint.from_airport(persiangulf.Havadarya, COAST_DL_W, SIZE_REGULAR, 1.2)
|
havadarya = ControlPoint.from_airport(persiangulf.Havadarya, COAST_DL_W, SIZE_REGULAR, 1.1)
|
||||||
bandar_abbas = ControlPoint.from_airport(persiangulf.Bandar_Abbas_Intl, LAND, SIZE_BIG, 1.3)
|
bandar_abbas = ControlPoint.from_airport(persiangulf.Bandar_Abbas_Intl, LAND, SIZE_BIG, 1.2)
|
||||||
lar = ControlPoint.from_airport(persiangulf.Lar_Airbase, LAND, SIZE_REGULAR, 1.1)
|
lar = ControlPoint.from_airport(persiangulf.Lar_Airbase, LAND, SIZE_REGULAR, IMPORTANCE_LOW)
|
||||||
shiraz = ControlPoint.from_airport(persiangulf.Shiraz_International_Airport, LAND, SIZE_BIG, IMPORTANCE_LOW)
|
shiraz = ControlPoint.from_airport(persiangulf.Shiraz_International_Airport, LAND, SIZE_BIG, IMPORTANCE_LOW)
|
||||||
kerman = ControlPoint.from_airport(persiangulf.Kerman_Airport, LAND, SIZE_BIG, IMPORTANCE_LOW)
|
kerman = ControlPoint.from_airport(persiangulf.Kerman_Airport, LAND, SIZE_BIG, IMPORTANCE_LOW)
|
||||||
|
|
||||||
@@ -48,6 +48,10 @@ class PersianGulfTheater(ConflictTheater):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(PersianGulfTheater, self).__init__()
|
super(PersianGulfTheater, self).__init__()
|
||||||
|
|
||||||
|
self.add_controlpoint(self.shiraz, connected_to=[self.lar, self.kerman])
|
||||||
|
self.add_controlpoint(self.kerman, connected_to=[self.lar, self.shiraz])
|
||||||
|
self.add_controlpoint(self.lar, connected_to=[self.bandar_lengeh, self.qeshm, self.havadarya, self.shiraz, self.kerman])
|
||||||
|
|
||||||
self.add_controlpoint(self.al_dhafra, connected_to=[self.sir_abu_nuayr, self.al_maktoum])
|
self.add_controlpoint(self.al_dhafra, connected_to=[self.sir_abu_nuayr, self.al_maktoum])
|
||||||
self.add_controlpoint(self.al_maktoum, connected_to=[self.al_dhafra, self.al_minhad, self.sir_abu_nuayr])
|
self.add_controlpoint(self.al_maktoum, connected_to=[self.al_dhafra, self.al_minhad, self.sir_abu_nuayr])
|
||||||
self.add_controlpoint(self.al_minhad, connected_to=[self.al_maktoum, self.dubai])
|
self.add_controlpoint(self.al_minhad, connected_to=[self.al_maktoum, self.dubai])
|
||||||
@@ -66,9 +70,6 @@ class PersianGulfTheater(ConflictTheater):
|
|||||||
self.add_controlpoint(self.qeshm, connected_to=[self.bandar_lengeh, self.havadarya, self.tunb_island, self.lar])
|
self.add_controlpoint(self.qeshm, connected_to=[self.bandar_lengeh, self.havadarya, self.tunb_island, self.lar])
|
||||||
self.add_controlpoint(self.havadarya, connected_to=[self.lar, self.qeshm, self.bandar_abbas])
|
self.add_controlpoint(self.havadarya, connected_to=[self.lar, self.qeshm, self.bandar_abbas])
|
||||||
self.add_controlpoint(self.bandar_abbas, connected_to=[self.havadarya])
|
self.add_controlpoint(self.bandar_abbas, connected_to=[self.havadarya])
|
||||||
self.add_controlpoint(self.lar, connected_to=[self.bandar_lengeh, self.qeshm, self.havadarya, self.shiraz, self.kerman])
|
|
||||||
self.add_controlpoint(self.shiraz, connected_to=[self.lar, self.kerman])
|
|
||||||
self.add_controlpoint(self.kerman, connected_to=[self.lar, self.shiraz])
|
|
||||||
|
|
||||||
self.add_controlpoint(self.west_carrier)
|
self.add_controlpoint(self.west_carrier)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class OverviewCanvas:
|
|||||||
self.canvas = Canvas(frame, width=self.image.width(), height=self.image.height())
|
self.canvas = Canvas(frame, width=self.image.width(), height=self.image.height())
|
||||||
self.canvas.grid(column=0, row=0, sticky=NSEW)
|
self.canvas.grid(column=0, row=0, sticky=NSEW)
|
||||||
|
|
||||||
def transform_point(self, p: Point) -> (int, int):
|
def transform_point(self, p: Point, treshold=30) -> (int, int):
|
||||||
point_a = list(self.game.theater.reference_points.keys())[0]
|
point_a = list(self.game.theater.reference_points.keys())[0]
|
||||||
point_a_img = self.game.theater.reference_points[point_a]
|
point_a_img = self.game.theater.reference_points[point_a]
|
||||||
|
|
||||||
@@ -44,7 +44,6 @@ class OverviewCanvas:
|
|||||||
X = point_b_img[1] + X_offset * X_scale
|
X = point_b_img[1] + X_offset * X_scale
|
||||||
Y = point_a_img[0] - Y_offset * Y_scale
|
Y = point_a_img[0] - Y_offset * Y_scale
|
||||||
|
|
||||||
treshold = 30
|
|
||||||
return X > treshold and X or treshold, Y > treshold and Y or treshold
|
return X > treshold and X or treshold, Y > treshold and Y or treshold
|
||||||
|
|
||||||
def create_cp_title(self, coords, cp: ControlPoint):
|
def create_cp_title(self, coords, cp: ControlPoint):
|
||||||
@@ -81,7 +80,9 @@ class OverviewCanvas:
|
|||||||
|
|
||||||
if cp.captured and not connected_cp.captured and Conflict.has_frontline_between(cp, connected_cp):
|
if cp.captured and not connected_cp.captured and Conflict.has_frontline_between(cp, connected_cp):
|
||||||
frontline_pos, heading, distance = Conflict.frontline_vector(cp, connected_cp, self.game.theater)
|
frontline_pos, heading, distance = Conflict.frontline_vector(cp, connected_cp, self.game.theater)
|
||||||
start_coords, end_coords = self.transform_point(frontline_pos), self.transform_point(frontline_pos.point_from_heading(heading, distance))
|
start_coords = self.transform_point(frontline_pos, treshold=10)
|
||||||
|
end_coords = self.transform_point(frontline_pos.point_from_heading(heading, distance), treshold=60)
|
||||||
|
|
||||||
self.canvas.create_line((*start_coords, *end_coords), width=2, fill=color)
|
self.canvas.create_line((*start_coords, *end_coords), width=2, fill=color)
|
||||||
|
|
||||||
for cp in self.game.theater.controlpoints:
|
for cp in self.game.theater.controlpoints:
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
import logging
|
import logging
|
||||||
import traceback
|
import traceback
|
||||||
|
import sys
|
||||||
|
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from tkinter import *
|
from tkinter import *
|
||||||
from tkinter.scrolledtext import *
|
from tkinter.scrolledtext import *
|
||||||
|
|
||||||
log_stream = StringIO()
|
if "-stdout" in sys.argv:
|
||||||
logging.basicConfig(stream=log_stream, level=logging.INFO)
|
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
||||||
|
else:
|
||||||
|
log_stream = StringIO()
|
||||||
|
logging.basicConfig(stream=log_stream, level=logging.INFO)
|
||||||
|
|
||||||
|
|
||||||
def _error_prompt():
|
def _error_prompt():
|
||||||
|
|||||||
Reference in New Issue
Block a user