This commit is contained in:
Khopa
2020-08-03 19:43:12 +02:00
parent ccf2cd3425
commit 6f4b7e0f1a
10 changed files with 122 additions and 33 deletions

View File

@@ -0,0 +1,33 @@
from dcs.planes import *
from pydcs_extensions.a4ec.a4ec import A_4E_C
"""
This list contains the aircraft that do not use the guns as the last resort weapons, but as a main weapon
They'll RTB when they don't have gun ammo left
"""
GUNFIGHTERS = [
# Cold War
MiG_15bis,
MiG_19P,
MiG_21Bis,
F_86F_Sabre,
A_4E_C,
F_5E_3,
# Trainers
C_101CC,
L_39ZA,
# WW2
P_51D_30_NA,
P_51D,
P_47D_30,
SpitfireLFMkIXCW,
SpitfireLFMkIX,
Bf_109K_4,
FW_190D9,
FW_190A8,
I_16,
]

View File

@@ -76,6 +76,22 @@ class Game:
self.__frontlineData = []
self.__destroyed_units = []
self.sanitize_sides()
def sanitize_sides(self):
"""
Make sure the opposing factions are using different countries
:return:
"""
if self.player_country == self.enemy_country:
if self.player_country == "USA":
self.enemy_country = "USAF Aggressors"
elif self.player_country == "Russia":
self.enemy_country = "USSR"
else:
self.enemy_country = "Russia"
@property
def player_faction(self):
return db.FACTIONS[self.player_name]

View File

@@ -91,15 +91,6 @@ class Operation:
p_country = self.game.player_country
e_country = self.game.enemy_country
if self.game.player_country == self.game.enemy_country:
if self.game.player_country != "USAF Aggresors":
e_country = "USAF Aggresors"
else:
if self.game.player_country != "Russia":
e_country = "Russia"
else:
e_country = "USA"
self.current_mission.coalition["blue"].add_country(country_dict[db.country_id_from_name(p_country)]())
self.current_mission.coalition["red"].add_country(country_dict[db.country_id_from_name(e_country)]())