mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
spamram for fa18; non-randomized groups vertical separation on spawn; argument to affect DCS folder selection
This commit is contained in:
parent
74c1861240
commit
f9c1dd980b
@ -2,6 +2,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import dcs
|
import dcs
|
||||||
|
import logging
|
||||||
|
|
||||||
import theater.caucasus
|
import theater.caucasus
|
||||||
import theater.persiangulf
|
import theater.persiangulf
|
||||||
@ -14,11 +15,13 @@ import ui.corruptedsavemenu
|
|||||||
|
|
||||||
from game.game import Game
|
from game.game import Game
|
||||||
from theater import start_generator
|
from theater import start_generator
|
||||||
from userdata import persistency, logging
|
from userdata import persistency, logging as logging_module
|
||||||
|
|
||||||
persistency.setup(sys.argv[1])
|
persistency.setup(sys.argv[1])
|
||||||
logging.setup_version_string(sys.argv[2])
|
dcs.planes.FlyingType.payload_dirs = [os.path.join(os.path.dirname(os.path.realpath(__file__)), "resources\\payloads")]
|
||||||
dcs.planes.FlyingType.payload_dirs.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "resources\\payloads"))
|
|
||||||
|
logging_module.setup_version_string(sys.argv[2])
|
||||||
|
logging.info("Using {} as userdata folder".format(persistency.base_path()))
|
||||||
|
|
||||||
|
|
||||||
def proceed_to_main_menu(game: Game):
|
def proceed_to_main_menu(game: Game):
|
||||||
|
|||||||
@ -343,7 +343,7 @@ Payload will be used for operation of following type, "*" category will be used
|
|||||||
"""
|
"""
|
||||||
PLANE_PAYLOAD_OVERRIDES = {
|
PLANE_PAYLOAD_OVERRIDES = {
|
||||||
FA_18C_hornet: {
|
FA_18C_hornet: {
|
||||||
"*": "AIM-9M*6, AIM-7M*2, FUEL*3",
|
"*": "AIM-120*4,AIM-9*2,AIM-7*2,Fuel",
|
||||||
},
|
},
|
||||||
|
|
||||||
Su_33: {
|
Su_33: {
|
||||||
|
|||||||
@ -37,14 +37,18 @@ TRANSPORT_LANDING_ALT = 1000
|
|||||||
DEFENCE_ENGAGEMENT_MAX_DISTANCE = 60000
|
DEFENCE_ENGAGEMENT_MAX_DISTANCE = 60000
|
||||||
INTERCEPT_MAX_DISTANCE = 200000
|
INTERCEPT_MAX_DISTANCE = 200000
|
||||||
|
|
||||||
|
GROUP_VERTICAL_OFFSET = 300
|
||||||
|
|
||||||
|
|
||||||
class AircraftConflictGenerator:
|
class AircraftConflictGenerator:
|
||||||
escort_targets = [] # type: typing.List[typing.Tuple[PlaneGroup, int]]
|
escort_targets = [] # type: typing.List[typing.Tuple[PlaneGroup, int]]
|
||||||
|
vertical_offset = None # type: int
|
||||||
|
|
||||||
def __init__(self, mission: Mission, conflict: Conflict, settings: Settings):
|
def __init__(self, mission: Mission, conflict: Conflict, settings: Settings):
|
||||||
self.m = mission
|
self.m = mission
|
||||||
self.settings = settings
|
self.settings = settings
|
||||||
self.conflict = conflict
|
self.conflict = conflict
|
||||||
|
self.vertical_offset = 0
|
||||||
self.escort_targets = []
|
self.escort_targets = []
|
||||||
|
|
||||||
def _start_type(self) -> StartType:
|
def _start_type(self) -> StartType:
|
||||||
@ -123,11 +127,12 @@ class AircraftConflictGenerator:
|
|||||||
assert count > 0
|
assert count > 0
|
||||||
assert unit is not None
|
assert unit is not None
|
||||||
|
|
||||||
|
self.vertical_offset += GROUP_VERTICAL_OFFSET
|
||||||
if unit_type in helicopters.helicopter_map.values():
|
if unit_type in helicopters.helicopter_map.values():
|
||||||
alt = WARM_START_HELI_ALT + random.randint(50, 200)
|
alt = WARM_START_HELI_ALT + self.vertical_offset
|
||||||
speed = WARM_START_HELI_AIRSPEED
|
speed = WARM_START_HELI_AIRSPEED
|
||||||
else:
|
else:
|
||||||
alt = WARM_START_ALTITUDE + random.randint(50, 800)
|
alt = WARM_START_ALTITUDE + self.vertical_offset
|
||||||
speed = WARM_START_AIRSPEED
|
speed = WARM_START_AIRSPEED
|
||||||
|
|
||||||
pos = Point(at.x + random.randint(100, 1000), at.y + random.randint(100, 1000))
|
pos = Point(at.x + random.randint(100, 1000), at.y + random.randint(100, 1000))
|
||||||
|
|||||||
@ -10,18 +10,17 @@ IGNORED_PATHS = [
|
|||||||
".git",
|
".git",
|
||||||
".idea",
|
".idea",
|
||||||
".DS_Store",
|
".DS_Store",
|
||||||
|
"submodules",
|
||||||
|
|
||||||
"build",
|
"build",
|
||||||
|
"venv",
|
||||||
]
|
]
|
||||||
|
|
||||||
VERSION = "1.3.2"
|
VERSION = "1.3.3"
|
||||||
|
|
||||||
|
|
||||||
def _mk_archieve():
|
def _zip_dir(archieve, path):
|
||||||
archieve = ZipFile("build/dcs_liberation_{}.zip".format(VERSION), "w")
|
for path, directories, files in os.walk(path):
|
||||||
archieve.writestr("start.bat", "py.exe __init__.py \"%UserProfile%\" \"{}\"".format(VERSION))
|
|
||||||
|
|
||||||
for path, directories, files in os.walk("."):
|
|
||||||
is_ignored = False
|
is_ignored = False
|
||||||
for ignored_path in IGNORED_PATHS:
|
for ignored_path in IGNORED_PATHS:
|
||||||
if ignored_path in path:
|
if ignored_path in path:
|
||||||
@ -32,7 +31,22 @@ def _mk_archieve():
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
for file in files:
|
for file in files:
|
||||||
|
if file in IGNORED_PATHS:
|
||||||
|
continue
|
||||||
archieve.write(os.path.join(path, file))
|
archieve.write(os.path.join(path, file))
|
||||||
|
|
||||||
|
|
||||||
|
def _mk_archieve():
|
||||||
|
path = os.path.join("build", "dcs_liberation_{}.zip".format(VERSION))
|
||||||
|
if os.path.exists(path):
|
||||||
|
print("version already exists")
|
||||||
|
return
|
||||||
|
|
||||||
|
archieve = ZipFile(path, "w")
|
||||||
|
archieve.writestr("start.bat", "py.exe __init__.py \"%UserProfile%\" \"{}\"".format(VERSION))
|
||||||
|
_zip_dir(archieve, ".")
|
||||||
|
os.chdir("submodules\\dcs")
|
||||||
|
_zip_dir(archieve, "dcs")
|
||||||
|
|
||||||
|
|
||||||
_mk_archieve()
|
_mk_archieve()
|
||||||
@ -1 +1 @@
|
|||||||
Subproject commit c913af9c76897138373ca08b62c615d6a4edc708
|
Subproject commit fae126689132d643d317252adfb03184042a0ded
|
||||||
@ -30,7 +30,7 @@ def setup_version_string(str):
|
|||||||
_version_string = str
|
_version_string = str
|
||||||
|
|
||||||
|
|
||||||
if "-stdout" in sys.argv:
|
if "--stdout" in sys.argv:
|
||||||
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
||||||
else:
|
else:
|
||||||
log_stream = StringIO()
|
log_stream = StringIO()
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import logging
|
|||||||
import typing
|
import typing
|
||||||
import pickle
|
import pickle
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
_user_folder = None # type: str
|
_user_folder = None # type: str
|
||||||
@ -17,7 +18,7 @@ def base_path() -> str:
|
|||||||
assert _user_folder
|
assert _user_folder
|
||||||
|
|
||||||
openbeta_path = os.path.join(_user_folder, "Saved Games", "DCS.openbeta")
|
openbeta_path = os.path.join(_user_folder, "Saved Games", "DCS.openbeta")
|
||||||
if os.path.exists(openbeta_path):
|
if "--force-stable-DCS" not in sys.argv and os.path.exists(openbeta_path):
|
||||||
return openbeta_path
|
return openbeta_path
|
||||||
else:
|
else:
|
||||||
return os.path.join(_user_folder, "Saved Games", "DCS")
|
return os.path.join(_user_folder, "Saved Games", "DCS")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user