mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Added some factions, refactor bluefor/redfor distinction code.
This commit is contained in:
parent
707e1f8b67
commit
ba0b3adf71
38
game/db.py
38
game/db.py
@ -16,8 +16,10 @@ from game.factions.china_2000 import China_2000
|
||||
from game.factions.france_1995 import France_1995
|
||||
from game.factions.germany_1990 import Germany_1990
|
||||
from game.factions.iran_2015 import Iran_2015
|
||||
from game.factions.israel_2000 import Israel_2000
|
||||
from game.factions.italy_1990 import Italy_1990
|
||||
from game.factions.netherlands_1990 import Netherlands_1990
|
||||
from game.factions.north_korea_2000 import NorthKorea_2000
|
||||
from game.factions.russia_1975 import Russia_1975
|
||||
from game.factions.germany_1944 import Germany_1944
|
||||
from game.factions.india_2010 import India_2010
|
||||
@ -26,6 +28,8 @@ from game.factions.russia_1965 import Russia_1965
|
||||
from game.factions.russia_1990 import Russia_1990
|
||||
from game.factions.russia_2010 import Russia_2010
|
||||
from game.factions.spain_1990 import Spain_1990
|
||||
from game.factions.turkey_2005 import Turkey_2005
|
||||
from game.factions.uae_2005 import UAE_2005
|
||||
from game.factions.uk_1990 import UnitedKingdom_1990
|
||||
from game.factions.usa_1944 import USA_1944
|
||||
from game.factions.usa_1955 import USA_1955
|
||||
@ -469,17 +473,14 @@ EXTRA_AA = {
|
||||
"China": AirDefence.SPAAA_ZSU_23_4_Shilka,
|
||||
"UK": AirDefence.AAA_Vulcan_M163,
|
||||
"Iran": AirDefence.SPAAA_ZSU_23_4_Shilka,
|
||||
"Russia 1955": AirDefence.AAA_ZU_23_Closed,
|
||||
"USA 1955": AirDefence.AAA_Vulcan_M163,
|
||||
"Russia 1965": AirDefence.AAA_ZU_23_Closed,
|
||||
"Russia 1975": AirDefence.AAA_ZU_23_Closed,
|
||||
"USA 1965": AirDefence.AAA_Vulcan_M163,
|
||||
"Russia 1988": AirDefence.AAA_ZU_23_Closed,
|
||||
"USA 1990": AirDefence.AAA_Vulcan_M163,
|
||||
"France 1990": AirDefence.AAA_Vulcan_M163,
|
||||
"Germany 1990": AirDefence.AAA_Vulcan_M163,
|
||||
"Iran 2015": AirDefence.SPAAA_ZSU_23_4_Shilka,
|
||||
"China 2015": AirDefence.SPAAA_ZSU_23_4_Shilka
|
||||
"North Korea": AirDefence.AAA_ZU_23_Closed,
|
||||
"Italy": AirDefence.AAA_Vulcan_M163,
|
||||
"Spain": AirDefence.AAA_Vulcan_M163,
|
||||
"The Netherlands": AirDefence.AAA_Vulcan_M163,
|
||||
"Turkey": AirDefence.AAA_Vulcan_M163,
|
||||
"Israel": AirDefence.AAA_Vulcan_M163,
|
||||
"India": AirDefence.SPAAA_ZSU_23_4_Shilka,
|
||||
"United Arab Emirates": AirDefence.Stinger_MANPADS
|
||||
}
|
||||
|
||||
"""
|
||||
@ -494,6 +495,7 @@ FACTIONS = {
|
||||
"Russia 2010": Russia_2010,
|
||||
"Iran 2015": Iran_2015,
|
||||
"China 2000": China_2000,
|
||||
"North Korea 2000": NorthKorea_2000,
|
||||
|
||||
"USA 2005": USA_2005,
|
||||
"USA 1990": USA_1990,
|
||||
@ -508,8 +510,14 @@ FACTIONS = {
|
||||
"Spain 1990": Spain_1990,
|
||||
"Italy 1990": Italy_1990,
|
||||
"India 2010": India_2010,
|
||||
"Israel 2000": Israel_2000,
|
||||
"Turkey 2005": Turkey_2005,
|
||||
"United Arab Emirates 2005": UAE_2005,
|
||||
"Germany 1944 (Require WW2 Pack)": Germany_1944
|
||||
}
|
||||
BLUEFOR_FACTIONS = [FACTIONS[f]["country"] for f in FACTIONS if FACTIONS[f]["side"] == "blue"]
|
||||
print(BLUEFOR_FACTIONS)
|
||||
|
||||
|
||||
CARRIER_TYPE_BY_PLANE = {
|
||||
FA_18C_hornet: CVN_74_John_C__Stennis,
|
||||
@ -840,7 +848,6 @@ def _validate_db():
|
||||
for unit_type in total_set:
|
||||
did_find = False
|
||||
for country_units_list in FACTIONS.values():
|
||||
print(country_units_list)
|
||||
if unit_type in country_units_list["units"]:
|
||||
did_find = True
|
||||
print("WARN : {} not in country list".format(unit_type))
|
||||
@ -849,5 +856,10 @@ def _validate_db():
|
||||
for unit_type in total_set:
|
||||
assert unit_type in PRICES, "{} not in prices".format(unit_type)
|
||||
|
||||
|
||||
_validate_db()
|
||||
|
||||
class DefaultLiveries:
|
||||
class Default(Enum):
|
||||
af_standard = ""
|
||||
|
||||
OH_58D.Liveries = DefaultLiveries
|
||||
34
game/factions/israel_2000.py
Normal file
34
game/factions/israel_2000.py
Normal file
@ -0,0 +1,34 @@
|
||||
from dcs.vehicles import *
|
||||
from dcs.ships import *
|
||||
from dcs.planes import *
|
||||
from dcs.helicopters import *
|
||||
|
||||
Israel_2000 = {
|
||||
"country": "Israel",
|
||||
"side": "blue",
|
||||
"units":[
|
||||
F_16C_50,
|
||||
F_15C,
|
||||
F_4E,
|
||||
|
||||
KC_135,
|
||||
S_3B_Tanker,
|
||||
C_130,
|
||||
E_3A,
|
||||
|
||||
AH_1W,
|
||||
AH_64D,
|
||||
|
||||
Armor.MBT_Merkava_Mk__4,
|
||||
Armor.APC_M113, # Standing as VAB
|
||||
|
||||
Unarmed.Transport_M818,
|
||||
Infantry.Infantry_M4,
|
||||
|
||||
AirDefence.SAM_Patriot_EPP_III,
|
||||
|
||||
CVN_74_John_C__Stennis,
|
||||
LHA_1_Tarawa,
|
||||
Armed_speedboat,
|
||||
]
|
||||
}
|
||||
@ -7,7 +7,7 @@ Netherlands_1990 = {
|
||||
"country": "The Netherlands",
|
||||
"side": "blue",
|
||||
"units": [
|
||||
F_16C_bl_50,
|
||||
F_16C_50,
|
||||
F_5E_3,
|
||||
|
||||
KC_135,
|
||||
|
||||
46
game/factions/north_korea_2000.py
Normal file
46
game/factions/north_korea_2000.py
Normal file
@ -0,0 +1,46 @@
|
||||
from dcs.vehicles import *
|
||||
from dcs.ships import *
|
||||
from dcs.planes import *
|
||||
from dcs.helicopters import *
|
||||
|
||||
NorthKorea_2000 = {
|
||||
"country": "North Korea",
|
||||
"side": "red",
|
||||
"units":[
|
||||
MiG_29A,
|
||||
Su_25,
|
||||
MiG_15bis,
|
||||
MiG_21Bis,
|
||||
MiG_23MLD,
|
||||
MiG_19P,
|
||||
|
||||
IL_76MD,
|
||||
IL_78M,
|
||||
An_26B,
|
||||
An_30M,
|
||||
Yak_40,
|
||||
|
||||
A_50,
|
||||
|
||||
Mi_8MT,
|
||||
Mi_24V,
|
||||
|
||||
Armor.MBT_T_55,
|
||||
Armor.MBT_T_72B,
|
||||
Armor.MBT_T_80U,
|
||||
Armor.IFV_BMP_1,
|
||||
Armor.APC_BTR_80,
|
||||
Armor.ARV_BRDM_2,
|
||||
|
||||
Unarmed.Transport_M818,
|
||||
Infantry.Soldier_AK,
|
||||
|
||||
AirDefence.SAM_SA_2_LN_SM_90,
|
||||
AirDefence.SAM_SA_3_S_125_LN_5P73,
|
||||
|
||||
CV_1143_5_Admiral_Kuznetsov,
|
||||
Bulk_cargo_ship_Yakushev,
|
||||
Dry_cargo_ship_Ivanov,
|
||||
Tanker_Elnya_160
|
||||
]
|
||||
}
|
||||
37
game/factions/turkey_2005.py
Normal file
37
game/factions/turkey_2005.py
Normal file
@ -0,0 +1,37 @@
|
||||
from dcs.vehicles import *
|
||||
from dcs.ships import *
|
||||
from dcs.planes import *
|
||||
from dcs.helicopters import *
|
||||
|
||||
Turkey_2005 = {
|
||||
"country": "Turkey",
|
||||
"side": "blue",
|
||||
"units":[
|
||||
F_16C_50,
|
||||
F_4E,
|
||||
|
||||
KC_135,
|
||||
S_3B_Tanker,
|
||||
C_130,
|
||||
E_3A,
|
||||
|
||||
UH_1H,
|
||||
OH_58D,
|
||||
AH_1W,
|
||||
|
||||
Armor.MBT_Leopard_2,
|
||||
Armor.MBT_Leopard_1A3,
|
||||
Armor.MBT_M60A3_Patton, # Standing as VAB
|
||||
Armor.APC_Cobra,
|
||||
Armor.APC_BTR_80,
|
||||
|
||||
Unarmed.Transport_M818,
|
||||
Infantry.Infantry_M4,
|
||||
|
||||
AirDefence.SAM_Avenger_M1097,
|
||||
|
||||
CVN_74_John_C__Stennis,
|
||||
LHA_1_Tarawa,
|
||||
Armed_speedboat,
|
||||
]
|
||||
}
|
||||
34
game/factions/uae_2005.py
Normal file
34
game/factions/uae_2005.py
Normal file
@ -0,0 +1,34 @@
|
||||
from dcs.vehicles import *
|
||||
from dcs.ships import *
|
||||
from dcs.planes import *
|
||||
from dcs.helicopters import *
|
||||
|
||||
UAE_2005 = {
|
||||
"country": "United Arab Emirates",
|
||||
"side": "blue",
|
||||
"units":[
|
||||
M_2000C,
|
||||
Mirage_2000_5,
|
||||
F_16C_50,
|
||||
|
||||
KC_135,
|
||||
S_3B_Tanker,
|
||||
C_130,
|
||||
E_3A,
|
||||
|
||||
AH_64D,
|
||||
|
||||
Armor.MBT_Leclerc,
|
||||
Armor.IFV_BMP_3,
|
||||
Armor.TPz_Fuchs,
|
||||
|
||||
Unarmed.Transport_M818,
|
||||
Infantry.Infantry_M4,
|
||||
|
||||
AirDefence.Rapier_FSA_Launcher,
|
||||
|
||||
CVN_74_John_C__Stennis,
|
||||
LHA_1_Tarawa,
|
||||
Armed_speedboat,
|
||||
]
|
||||
}
|
||||
@ -187,7 +187,7 @@ class TriggersGenerator:
|
||||
self.mission.triggerrules.triggers.append(trigger_two)
|
||||
|
||||
def generate(self, player_cp: ControlPoint, is_quick: bool, activation_trigger_radius: int, awacs_enabled: bool):
|
||||
player_coalition = self.game.player_country in ["USA", "France", "Germany", "UK", "The Netherlands", "Italy", "Spain", "India"] and "blue" or "red"
|
||||
player_coalition = self.game.player_country in db.BLUEFOR_FACTIONS and "blue" or "red"
|
||||
enemy_coalition = player_coalition == "blue" and "red" or "blue"
|
||||
|
||||
self.mission.coalition[player_coalition].bullseye = {"x": self.conflict.position.x,
|
||||
|
||||
@ -6,7 +6,7 @@ from PySide2.QtWidgets import QGraphicsRectItem, QGraphicsSceneHoverEvent, QGrap
|
||||
import qt_ui.uiconstants as CONST
|
||||
from game import Game
|
||||
from qt_ui.windows.QBaseMenu import QBaseMenu
|
||||
from theater import ControlPoint
|
||||
from theater import ControlPoint, db
|
||||
|
||||
|
||||
class QMapControlPoint(QGraphicsRectItem):
|
||||
@ -81,14 +81,14 @@ class QMapControlPoint(QGraphicsRectItem):
|
||||
|
||||
@property
|
||||
def brush_color(self)->QColor:
|
||||
if self.parent.game.player_country in ["USA", "France", "Germany", "UK", "The Netherlands", "Italy", "Spain", "India"]:
|
||||
if self.parent.game.player_country in db.BLUEFOR_FACTIONS:
|
||||
return self.model.captured and CONST.COLORS["blue"] or CONST.COLORS["red"]
|
||||
else:
|
||||
return self.model.captured and CONST.COLORS["red"] or CONST.COLORS["blue"]
|
||||
|
||||
@property
|
||||
def pen_color(self) -> QColor:
|
||||
if self.parent.game.player_country in ["USA", "France", "Germany", "UK", "The Netherlands", "Italy", "Spain", "India"]:
|
||||
if self.parent.game.player_country in db.BLUEFOR_FACTIONS:
|
||||
return self.model.captured and CONST.COLORS["dark_blue"] or CONST.COLORS["bright_red"]
|
||||
else:
|
||||
return self.model.captured and CONST.COLORS["bright_red"] or CONST.COLORS["dark_blue"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user