mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa55ae1fcc | ||
|
|
90fbe77682 | ||
|
|
26a7609875 | ||
|
|
77a07f6628 | ||
|
|
42c8b2f989 | ||
|
|
3861926ff7 | ||
|
|
3fd3e591e7 |
@@ -1,4 +1,6 @@
|
||||
WIP [DCS World](https://www.digitalcombatsimulator.com/en/products/world/) single-player liberation dynamic campaign.
|
||||
[DCS World](https://www.digitalcombatsimulator.com/en/products/world/) single-player liberation dynamic campaign.
|
||||
|
||||
[Installation instructions/Manual](https://github.com/shdwp/dcs_liberation/wiki)
|
||||
|
||||
Inspired by *ARMA Liberation* mission.
|
||||
|
||||
|
||||
10
game/db.py
10
game/db.py
@@ -43,7 +43,7 @@ PRICES = {
|
||||
MiG_29A: 22,
|
||||
MiG_29S: 26,
|
||||
|
||||
F_5E: 6,
|
||||
F_5E_3: 6,
|
||||
MiG_15bis: 5,
|
||||
MiG_21Bis: 6,
|
||||
AJS37: 8,
|
||||
@@ -134,7 +134,7 @@ UNIT_BY_TASK = {
|
||||
CAP: [
|
||||
C_101CC,
|
||||
AJS37,
|
||||
F_5E,
|
||||
F_5E_3,
|
||||
Su_27,
|
||||
Su_33,
|
||||
MiG_21Bis,
|
||||
@@ -234,7 +234,7 @@ UNIT_BY_COUNTRY = {
|
||||
"Russia": [
|
||||
C_101CC,
|
||||
AJS37,
|
||||
F_5E,
|
||||
F_5E_3,
|
||||
Su_27,
|
||||
Su_33,
|
||||
MiG_15bis,
|
||||
@@ -279,7 +279,7 @@ UNIT_BY_COUNTRY = {
|
||||
F_15C,
|
||||
FA_18C_hornet,
|
||||
AJS37,
|
||||
F_5E,
|
||||
F_5E_3,
|
||||
M_2000C,
|
||||
MiG_21Bis,
|
||||
MiG_15bis,
|
||||
@@ -416,7 +416,7 @@ def choose_units(for_task: Task, factor: float, count: int, country: str) -> typ
|
||||
|
||||
index_start = min(idx, len(suitable_unittypes) - variety)
|
||||
index_end = min(idx + variety, len(suitable_unittypes))
|
||||
return set(suitable_unittypes[index_start:index_end])
|
||||
return list(set(suitable_unittypes[index_start:index_end]))
|
||||
|
||||
|
||||
def _validate_db():
|
||||
|
||||
@@ -138,6 +138,10 @@ class TriggersGenerator:
|
||||
player_coalition = self.game.player == "USA" and "blue" or "red"
|
||||
enemy_coalition = player_coalition == "blue" and "red" or "blue"
|
||||
|
||||
# dcs require at least some slots on both sides for the mission to start
|
||||
self.mission.groundControl.red_observer = 1
|
||||
self.mission.groundControl.blue_observer = 1
|
||||
|
||||
self.mission.coalition[player_coalition].bullseye = {"x": self.conflict.position.x,
|
||||
"y": self.conflict.position.y}
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ def generate_initial(theater: ConflictTheater, enemy: str, sams: bool, multiplie
|
||||
variety = int(UNIT_VARIETY)
|
||||
unittypes = db.choose_units(task, importance_factor, variety, enemy)
|
||||
|
||||
if not sams:
|
||||
unittypes = [x for x in unittypes if x not in db.SAM_BAN]
|
||||
if not sams and task == AirDefence:
|
||||
unittypes = [x for x in db.find_unittype(AirDefence, enemy) if x not in db.SAM_BAN]
|
||||
|
||||
count_log = math.log(cp.importance + 0.01, UNIT_COUNT_IMPORTANCE_LOG)
|
||||
count = max(COUNT_BY_TASK[task] * multiplier * (1+count_log), 1)
|
||||
|
||||
@@ -14,6 +14,8 @@ from dcs.unit import UnitType
|
||||
|
||||
from game import db
|
||||
|
||||
from .persistency import _base_path
|
||||
|
||||
DEBRIEFING_LOG_EXTENSION = "log"
|
||||
|
||||
|
||||
@@ -92,7 +94,7 @@ class Debriefing:
|
||||
|
||||
|
||||
def debriefing_directory_location() -> str:
|
||||
return os.path.expanduser("~\Saved Games\DCS\liberation_debriefings")
|
||||
return os.path.join(_base_path(), "liberation_debriefings")
|
||||
|
||||
|
||||
def _logfiles_snapshot() -> typing.Dict[str, float]:
|
||||
|
||||
@@ -4,12 +4,20 @@ import os
|
||||
import shutil
|
||||
|
||||
|
||||
def _base_path() -> str:
|
||||
openbeta_path = os.path.expanduser("~\Saved Games\DCS.openbeta")
|
||||
if os.path.exists(openbeta_path):
|
||||
return openbeta_path
|
||||
else:
|
||||
return os.path.expanduser("~\Saved Games\DCS")
|
||||
|
||||
|
||||
def _save_file() -> str:
|
||||
return os.path.expanduser("~\Saved Games\DCS\liberation_save")
|
||||
return os.path.join(_base_path(), "liberation_save")
|
||||
|
||||
|
||||
def _temporary_save_file() -> str:
|
||||
return os.path.expanduser("~\Saved Games\DCS\liberation_save_tmp")
|
||||
return os.path.join(_base_path(), "liberation_save_tmp")
|
||||
|
||||
|
||||
def _save_file_exists() -> bool:
|
||||
@@ -17,7 +25,7 @@ def _save_file_exists() -> bool:
|
||||
|
||||
|
||||
def mission_path_for(name: str) -> str:
|
||||
return os.path.expanduser("~\Saved Games\DCS\Missions\{}".format(name))
|
||||
return os.path.join(_base_path(), "Missions\{}".format(name))
|
||||
|
||||
|
||||
def restore_game():
|
||||
|
||||
Reference in New Issue
Block a user