mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Merge branch 'develop' into faction_refactor
# Conflicts: # game/factions/bluefor_coldwar.py # game/factions/bluefor_coldwar_a4.py # game/factions/bluefor_coldwar_mods.py # game/factions/bluefor_modern.py
This commit is contained in:
107
game/db.py
107
game/db.py
@@ -43,6 +43,7 @@ from dcs.planes import (
|
||||
FA_18C_hornet,
|
||||
FW_190A8,
|
||||
FW_190D9,
|
||||
F_117A,
|
||||
F_14B,
|
||||
F_15C,
|
||||
F_15E,
|
||||
@@ -97,6 +98,9 @@ from dcs.planes import (
|
||||
Su_34,
|
||||
Tornado_GR4,
|
||||
Tornado_IDS,
|
||||
Tu_160,
|
||||
Tu_22M3,
|
||||
Tu_95MS,
|
||||
WingLoong_I,
|
||||
Yak_40,
|
||||
plane_map,
|
||||
@@ -304,6 +308,10 @@ PRICES = {
|
||||
# Bombers
|
||||
B_52H: 35,
|
||||
B_1B: 50,
|
||||
F_117A: 100,
|
||||
Tu_160: 50,
|
||||
Tu_22M3: 40,
|
||||
Tu_95MS: 35,
|
||||
|
||||
# special
|
||||
IL_76MD: 30,
|
||||
@@ -584,49 +592,53 @@ UNIT_BY_TASK = {
|
||||
SA342Mistral
|
||||
],
|
||||
CAS: [
|
||||
F_15E,
|
||||
F_86F_Sabre,
|
||||
MiG_15bis,
|
||||
L_39ZA,
|
||||
AV8BNA,
|
||||
AH_1W,
|
||||
AH_64A,
|
||||
AH_64D,
|
||||
AJS37,
|
||||
AV8BNA,
|
||||
A_10A,
|
||||
A_10C,
|
||||
A_10C_2,
|
||||
Su_17M4,
|
||||
Su_25,
|
||||
Su_25T,
|
||||
Su_34,
|
||||
Ka_50,
|
||||
SA342M,
|
||||
SA342L,
|
||||
SA342Minigun,
|
||||
Su_24M,
|
||||
Su_24MR,
|
||||
AH_64A,
|
||||
AH_64D,
|
||||
OH_58D,
|
||||
B_52H,
|
||||
B_1B,
|
||||
Tornado_IDS,
|
||||
Tornado_GR4,
|
||||
UH_1H,
|
||||
Mi_8MT,
|
||||
Mi_28N,
|
||||
Mi_24V,
|
||||
MiG_27K,
|
||||
A_20G,
|
||||
B_17G,
|
||||
B_1B,
|
||||
B_52H,
|
||||
F_117A,
|
||||
F_15E,
|
||||
F_86F_Sabre,
|
||||
Ju_88A4,
|
||||
Ka_50,
|
||||
L_39ZA,
|
||||
MB_339PAN,
|
||||
MQ_9_Reaper,
|
||||
MiG_15bis,
|
||||
MiG_27K,
|
||||
Mi_24V,
|
||||
Mi_28N,
|
||||
Mi_8MT,
|
||||
OH_58D,
|
||||
P_47D_30,
|
||||
P_47D_30bl1,
|
||||
P_47D_40,
|
||||
Ju_88A4,
|
||||
B_17G,
|
||||
MB_339PAN,
|
||||
Rafale_A_S,
|
||||
WingLoong_I,
|
||||
MQ_9_Reaper,
|
||||
RQ_1A_Predator,
|
||||
AH_1W
|
||||
Rafale_A_S,
|
||||
SA342L,
|
||||
SA342M,
|
||||
SA342Minigun,
|
||||
Su_17M4,
|
||||
Su_24M,
|
||||
Su_24MR,
|
||||
Su_25,
|
||||
Su_25T,
|
||||
Su_34,
|
||||
Tornado_GR4,
|
||||
Tornado_IDS,
|
||||
Tu_160,
|
||||
Tu_22M3,
|
||||
Tu_95MS,
|
||||
UH_1H,
|
||||
WingLoong_I,
|
||||
],
|
||||
Transport: [
|
||||
IL_76MD,
|
||||
@@ -942,6 +954,23 @@ COMMON_OVERRIDE = {
|
||||
|
||||
PLANE_PAYLOAD_OVERRIDES: Dict[Type[PlaneType], Dict[Type[Task], str]] = {
|
||||
|
||||
B_1B: {
|
||||
CAS: "GBU-38*16, CBU-97*20",
|
||||
PinpointStrike: "GBU-31*8, GBU-38*32",
|
||||
GroundAttack: "GBU-31*8, GBU-38*32",
|
||||
},
|
||||
B_52H: {
|
||||
PinpointStrike: "AGM-86C*20",
|
||||
GroundAttack: "Mk 82*51",
|
||||
},
|
||||
F_117A: {
|
||||
PinpointStrike: "GBU-10*2",
|
||||
},
|
||||
F_15E: {
|
||||
CAS: "AIM-120B*2,AIM-9M*2,FUEL,GBU-12*4,GBU-38*4,AGM-65D*2",
|
||||
GroundAttack: "AIM-120B*2,AIM-9M*2,FUEL*3,CBU-97*12",
|
||||
PinpointStrike: "AIM-120B*2,AIM-9M*2,FUEL,GBU-31*4,AGM-154C*2",
|
||||
},
|
||||
FA_18C_hornet: {
|
||||
CAP: "CAP HEAVY",
|
||||
Intercept: "CAP HEAVY",
|
||||
@@ -962,6 +991,15 @@ PLANE_PAYLOAD_OVERRIDES: Dict[Type[PlaneType], Dict[Type[Task], str]] = {
|
||||
GroundAttack: "STRIKE",
|
||||
Escort: "CAP HEAVY",
|
||||
},
|
||||
Tu_160: {
|
||||
PinpointStrike: "Kh-65*12",
|
||||
},
|
||||
Tu_22M3: {
|
||||
GroundAttack: "FAB-500*33, FAB-250*36",
|
||||
},
|
||||
Tu_95MS: {
|
||||
PinpointStrike: "Kh-65*6",
|
||||
},
|
||||
A_10A: COMMON_OVERRIDE,
|
||||
A_10C: COMMON_OVERRIDE,
|
||||
A_10C_2: COMMON_OVERRIDE,
|
||||
@@ -970,7 +1008,6 @@ PLANE_PAYLOAD_OVERRIDES: Dict[Type[PlaneType], Dict[Type[Task], str]] = {
|
||||
F_5E_3: COMMON_OVERRIDE,
|
||||
F_14B: COMMON_OVERRIDE,
|
||||
F_15C: COMMON_OVERRIDE,
|
||||
F_15E: COMMON_OVERRIDE,
|
||||
F_16C_50: COMMON_OVERRIDE,
|
||||
JF_17: COMMON_OVERRIDE,
|
||||
M_2000C: COMMON_OVERRIDE,
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
from dcs.planes import An_26B, An_30M, IL_76MD, IL_78M, MiG_15bis, Yak_40
|
||||
from dcs.planes import (
|
||||
An_26B,
|
||||
An_30M,
|
||||
IL_76MD,
|
||||
IL_78M,
|
||||
MiG_15bis,
|
||||
Tu_95MS,
|
||||
Yak_40,
|
||||
)
|
||||
from dcs.ships import (
|
||||
Bulk_cargo_ship_Yakushev,
|
||||
CV_1143_5_Admiral_Kuznetsov,
|
||||
@@ -19,6 +27,8 @@ Russia_1955 = {
|
||||
An_30M,
|
||||
Yak_40,
|
||||
|
||||
Tu_95MS,
|
||||
|
||||
AirDefence.AAA_ZU_23_Closed,
|
||||
AirDefence.AAA_ZU_23_on_Ural_375,
|
||||
Armor.ARV_BRDM_2,
|
||||
|
||||
@@ -8,6 +8,7 @@ from dcs.planes import (
|
||||
MiG_15bis,
|
||||
MiG_19P,
|
||||
MiG_21Bis,
|
||||
Tu_95MS,
|
||||
Yak_40,
|
||||
)
|
||||
from dcs.ships import (
|
||||
@@ -32,6 +33,8 @@ Russia_1965 = {
|
||||
An_30M,
|
||||
Yak_40,
|
||||
|
||||
Tu_95MS,
|
||||
|
||||
A_50,
|
||||
|
||||
Mi_8MT,
|
||||
|
||||
@@ -15,6 +15,8 @@ from dcs.planes import (
|
||||
Su_17M4,
|
||||
Su_24M,
|
||||
Su_25,
|
||||
Tu_22M3,
|
||||
Tu_95MS,
|
||||
Yak_40,
|
||||
)
|
||||
from dcs.ships import (
|
||||
@@ -41,6 +43,9 @@ Russia_1975 = {
|
||||
Su_24M,
|
||||
Su_25,
|
||||
|
||||
Tu_22M3,
|
||||
Tu_95MS,
|
||||
|
||||
IL_76MD,
|
||||
IL_78M,
|
||||
An_26B,
|
||||
|
||||
@@ -17,6 +17,9 @@ from dcs.planes import (
|
||||
Su_24M,
|
||||
Su_25,
|
||||
Su_27,
|
||||
Tu_160,
|
||||
Tu_22M3,
|
||||
Tu_95MS,
|
||||
Yak_40,
|
||||
)
|
||||
from dcs.ships import (
|
||||
@@ -51,6 +54,10 @@ Russia_1990 = {
|
||||
Su_25,
|
||||
Ka_50,
|
||||
|
||||
Tu_160,
|
||||
Tu_22M3,
|
||||
Tu_95MS,
|
||||
|
||||
IL_76MD,
|
||||
IL_78M,
|
||||
An_26B,
|
||||
|
||||
@@ -20,6 +20,9 @@ from dcs.planes import (
|
||||
Su_30,
|
||||
Su_33,
|
||||
Su_34,
|
||||
Tu_160,
|
||||
Tu_22M3,
|
||||
Tu_95MS,
|
||||
Yak_40,
|
||||
)
|
||||
from dcs.ships import (
|
||||
@@ -55,6 +58,10 @@ Russia_2010 = {
|
||||
Su_24M,
|
||||
L_39ZA,
|
||||
|
||||
Tu_160,
|
||||
Tu_22M3,
|
||||
Tu_95MS,
|
||||
|
||||
IL_76MD,
|
||||
IL_78M,
|
||||
An_26B,
|
||||
|
||||
@@ -20,6 +20,9 @@ from dcs.planes import (
|
||||
Su_30,
|
||||
Su_33,
|
||||
Su_34,
|
||||
Tu_160,
|
||||
Tu_22M3,
|
||||
Tu_95MS,
|
||||
Yak_40,
|
||||
)
|
||||
from dcs.ships import (
|
||||
@@ -58,6 +61,10 @@ Russia_2020 = {
|
||||
Su_24M,
|
||||
L_39ZA,
|
||||
|
||||
Tu_160,
|
||||
Tu_22M3,
|
||||
Tu_95MS,
|
||||
|
||||
IL_76MD,
|
||||
IL_78M,
|
||||
An_26B,
|
||||
|
||||
@@ -6,10 +6,13 @@ from dcs.helicopters import (
|
||||
UH_1H,
|
||||
)
|
||||
from dcs.planes import (
|
||||
B_1B,
|
||||
B_52H,
|
||||
C_130,
|
||||
E_3A,
|
||||
FA_18C_hornet,
|
||||
F_15C,
|
||||
F_15E,
|
||||
F_16C_50,
|
||||
F_5E_3,
|
||||
KC130,
|
||||
@@ -38,11 +41,15 @@ US_Aggressors = {
|
||||
"units": [
|
||||
|
||||
F_15C,
|
||||
F_15E,
|
||||
F_5E_3,
|
||||
FA_18C_hornet,
|
||||
F_16C_50,
|
||||
Su_27,
|
||||
|
||||
B_1B,
|
||||
B_52H,
|
||||
|
||||
KC_135,
|
||||
KC130,
|
||||
C_130,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from dcs.planes import (
|
||||
B_52H,
|
||||
C_130,
|
||||
E_3A,
|
||||
F_86F_Sabre,
|
||||
@@ -25,6 +26,8 @@ USA_1955 = {
|
||||
F_86F_Sabre,
|
||||
P_51D,
|
||||
|
||||
B_52H,
|
||||
|
||||
KC_135,
|
||||
KC130,
|
||||
C_130,
|
||||
|
||||
@@ -2,6 +2,7 @@ from dcs.helicopters import (
|
||||
UH_1H,
|
||||
)
|
||||
from dcs.planes import (
|
||||
B_52H,
|
||||
C_130,
|
||||
E_3A,
|
||||
F_86F_Sabre,
|
||||
@@ -28,6 +29,8 @@ USA_1960 = {
|
||||
F_86F_Sabre,
|
||||
P_51D,
|
||||
|
||||
B_52H,
|
||||
|
||||
KC_135,
|
||||
KC130,
|
||||
C_130,
|
||||
|
||||
@@ -5,9 +5,12 @@ from dcs.helicopters import (
|
||||
from dcs.planes import (
|
||||
AV8BNA,
|
||||
A_10A,
|
||||
B_1B,
|
||||
B_52H,
|
||||
C_130,
|
||||
E_3A,
|
||||
FA_18C_hornet,
|
||||
F_117A,
|
||||
F_14B,
|
||||
F_15C,
|
||||
F_15E,
|
||||
@@ -43,6 +46,10 @@ USA_1990 = {
|
||||
A_10A,
|
||||
AV8BNA,
|
||||
|
||||
B_1B,
|
||||
B_52H,
|
||||
F_117A,
|
||||
|
||||
KC_135,
|
||||
KC130,
|
||||
C_130,
|
||||
|
||||
@@ -6,9 +6,12 @@ from dcs.planes import (
|
||||
AV8BNA,
|
||||
A_10C,
|
||||
A_10C_2,
|
||||
B_1B,
|
||||
B_52H,
|
||||
C_130,
|
||||
E_3A,
|
||||
FA_18C_hornet,
|
||||
F_117A,
|
||||
F_14B,
|
||||
F_15C,
|
||||
F_15E,
|
||||
@@ -46,6 +49,10 @@ USA_2005 = {
|
||||
AV8BNA,
|
||||
MQ_9_Reaper,
|
||||
|
||||
B_1B,
|
||||
B_52H,
|
||||
F_117A,
|
||||
|
||||
KC_135,
|
||||
KC130,
|
||||
C_130,
|
||||
|
||||
@@ -14,7 +14,7 @@ from dcs.translation import String
|
||||
from dcs.triggers import TriggerStart
|
||||
from dcs.unittype import UnitType
|
||||
|
||||
from gen import Conflict, VisualGenerator, FlightType
|
||||
from gen import Conflict, FlightType, VisualGenerator
|
||||
from gen.aircraft import AIRCRAFT_DATA, AircraftConflictGenerator, FlightData
|
||||
from gen.airfields import AIRFIELD_DATA
|
||||
from gen.airsupportgen import AirSupport, AirSupportConflictGenerator
|
||||
@@ -28,10 +28,11 @@ from gen.kneeboard import KneeboardGenerator
|
||||
from gen.radios import RadioFrequency, RadioRegistry
|
||||
from gen.tacan import TacanRegistry
|
||||
from gen.triggergen import TRIGGER_RADIUS_MEDIUM, TriggersGenerator
|
||||
from plugin import LuaPluginManager
|
||||
from theater import ControlPoint
|
||||
from .. import db
|
||||
from ..debriefing import Debriefing
|
||||
from plugin import LuaPluginManager
|
||||
|
||||
|
||||
class Operation:
|
||||
attackers_starting_position = None # type: db.StartingPosition
|
||||
@@ -74,7 +75,7 @@ class Operation:
|
||||
self.departure_cp = departure_cp
|
||||
self.to_cp = to_cp
|
||||
self.is_quick = False
|
||||
self.listOfPluginsScripts = []
|
||||
self.plugin_scripts: List[str] = []
|
||||
|
||||
def units_of(self, country_name: str) -> List[UnitType]:
|
||||
return []
|
||||
@@ -133,33 +134,37 @@ class Operation:
|
||||
else:
|
||||
self.defenders_starting_position = None
|
||||
|
||||
def injectLuaTrigger(self, luascript, comment = "LUA script"):
|
||||
def inject_lua_trigger(self, contents: str, comment: str) -> None:
|
||||
trigger = TriggerStart(comment=comment)
|
||||
trigger.add_action(DoScript(String(luascript)))
|
||||
trigger.add_action(DoScript(String(contents)))
|
||||
self.current_mission.triggerrules.triggers.append(trigger)
|
||||
|
||||
def bypassPluginScript(self, pluginName, scriptFileMnemonic):
|
||||
self.listOfPluginsScripts.append(scriptFileMnemonic)
|
||||
def bypass_plugin_script(self, mnemonic: str) -> None:
|
||||
self.plugin_scripts.append(mnemonic)
|
||||
|
||||
def injectPluginScript(self, pluginName, scriptFile, scriptFileMnemonic):
|
||||
if not scriptFileMnemonic in self.listOfPluginsScripts:
|
||||
self.listOfPluginsScripts.append(scriptFileMnemonic)
|
||||
def inject_plugin_script(self, plugin_mnemonic: str, script: str,
|
||||
script_mnemonic: str) -> None:
|
||||
if script_mnemonic in self.plugin_scripts:
|
||||
logging.debug(
|
||||
f"Skipping already loaded {script} for {plugin_mnemonic}"
|
||||
)
|
||||
|
||||
plugin_path = Path("./resources/plugins",pluginName)
|
||||
self.plugin_scripts.append(script_mnemonic)
|
||||
|
||||
if scriptFile != None:
|
||||
scriptFile_path = Path(plugin_path, scriptFile)
|
||||
if scriptFile_path.exists():
|
||||
trigger = TriggerStart(comment="Load " + scriptFileMnemonic)
|
||||
filename = scriptFile_path.resolve()
|
||||
fileref = self.current_mission.map_resource.add_resource_file(filename)
|
||||
trigger.add_action(DoScriptFile(fileref))
|
||||
self.current_mission.triggerrules.triggers.append(trigger)
|
||||
else:
|
||||
logging.error(f"Cannot find script file {scriptFile} for plugin {pluginName}")
|
||||
plugin_path = Path("./resources/plugins", plugin_mnemonic)
|
||||
|
||||
else:
|
||||
logging.debug(f"Skipping script file {scriptFile} for plugin {pluginName}")
|
||||
script_path = Path(plugin_path, script)
|
||||
if not script_path.exists():
|
||||
logging.error(
|
||||
f"Cannot find {script_path} for plugin {plugin_mnemonic}"
|
||||
)
|
||||
return
|
||||
|
||||
trigger = TriggerStart(comment=f"Load {script_mnemonic}")
|
||||
filename = script_path.resolve()
|
||||
fileref = self.current_mission.map_resource.add_resource_file(filename)
|
||||
trigger.add_action(DoScriptFile(fileref))
|
||||
self.current_mission.triggerrules.triggers.append(trigger)
|
||||
|
||||
def generate(self):
|
||||
radio_registry = RadioRegistry()
|
||||
@@ -334,7 +339,7 @@ class Operation:
|
||||
kneeboard_generator.add_flight(flight)
|
||||
if flight.friendly and flight.flight_type in [FlightType.ANTISHIP, FlightType.DEAD, FlightType.SEAD, FlightType.STRIKE]:
|
||||
flightType = flight.flight_type.name
|
||||
flightTarget = flight.targetPoint
|
||||
flightTarget = flight.package.target
|
||||
if flightTarget:
|
||||
flightTargetName = None
|
||||
flightTargetType = None
|
||||
@@ -453,8 +458,6 @@ dcsLiberation.TargetPoints = {
|
||||
self.current_mission.triggerrules.triggers.append(trigger)
|
||||
|
||||
# Inject Plugins Lua Scripts and data
|
||||
self.listOfPluginsScripts = []
|
||||
|
||||
for plugin in LuaPluginManager().getPlugins():
|
||||
plugin.injectScripts(self)
|
||||
plugin.injectConfiguration(self)
|
||||
|
||||
Reference in New Issue
Block a user