diff --git a/game/event/event.py b/game/event/event.py index 5aff24fb..69768d27 100644 --- a/game/event/event.py +++ b/game/event/event.py @@ -274,6 +274,8 @@ class Event: ratio = (1.0 + enemy_casualties) / (1.0 + ally_casualties) + player_aggresive = cp.stances[enemy_cp.id] in [CombatStance.AGGRESIVE, CombatStance.ELIMINATION, CombatStance.BREAKTHROUGH] + if ally_units_alive == 0: player_won = False delta = STRONG_DEFEAT_INFLUENCE @@ -296,11 +298,21 @@ class Event: else: delta = DEFEAT_INFLUENCE elif ally_casualties > enemy_casualties: - player_won = False - if cp.stances[enemy_cp.id] == CombatStance.BREAKTHROUGH: + + if ally_units_alive > 2*enemy_units_alive and player_aggresive: + # Even with casualties if the enemy is overwhelmed, they are going to lose ground + player_won = True + delta = MINOR_DEFEAT_INFLUENCE + elif ally_units_alive > 3*enemy_units_alive and player_aggresive: + player_won = True delta = STRONG_DEFEAT_INFLUENCE else: - delta = STRONG_DEFEAT_INFLUENCE + # But is the enemy is not outnumbered, we lose + player_won = False + if cp.stances[enemy_cp.id] == CombatStance.BREAKTHROUGH: + delta = STRONG_DEFEAT_INFLUENCE + else: + delta = STRONG_DEFEAT_INFLUENCE # No progress with defensive strategies if player_won and cp.stances[enemy_cp.id] in [CombatStance.DEFENSIVE, CombatStance.AMBUSH]: diff --git a/game/settings.py b/game/settings.py index e29d7374..3c497e1a 100644 --- a/game/settings.py +++ b/game/settings.py @@ -27,6 +27,6 @@ class Settings: # Performance culling perf_culling = False - perf_culling_distance = 0 + perf_culling_distance = 100 diff --git a/gen/aircraft.py b/gen/aircraft.py index 2f2142e1..fe00fb14 100644 --- a/gen/aircraft.py +++ b/gen/aircraft.py @@ -363,9 +363,9 @@ class AircraftConflictGenerator: group.task = SEAD.name self._setup_group(group, SEAD, flight.client_count) group.points[0].tasks.clear() - group.points[0].tasks.append(SEADTaskAction()) + #group.points[0].tasks.append(SEADTaskAction()) group.points[0].tasks.append(OptReactOnThreat(OptReactOnThreat.Values.EvadeFire)) - group.points[0].tasks.append(OptROE(OptROE.Values.OpenFireWeaponFree)) + group.points[0].tasks.append(OptROE(OptROE.Values.OpenFire)) group.points[0].tasks.append(OptRestrictJettison(True)) elif flight_type in [FlightType.STRIKE]: group.task = PinpointStrike.name @@ -407,8 +407,6 @@ class AircraftConflictGenerator: bombing = Bombing(bcenter) bombing.params["expend"] = "All" bombing.params["attackQtyLimit"] = False - bombing.params["attackQty"] = 1 - bombing.params["expend"] = "All" bombing.params["directionEnabled"] = False bombing.params["altitudeEnabled"] = False bombing.params["weaponType"] = 2032 @@ -423,6 +421,18 @@ class AircraftConflictGenerator: if group.units[0].unit_type == F_14B and j == 0: group.add_nav_target_point(t.position, "ST") elif point.waypoint_type == FlightWaypointType.INGRESS_SEAD: + + tgroup = self.m.find_group(point.targetGroup.group_identifier) + if group is not None: + task = AttackGroup(tgroup.id) + task.params["expend"] = "All" + task.params["attackQtyLimit"] = False + task.params["directionEnabled"] = False + task.params["altitudeEnabled"] = False + task.params["weaponType"] = 268402702 # Guided Weapons + task.params["groupAttack"] = True + pt.tasks.append(task) + for j, t in enumerate(point.targets): if group.units[0].unit_type == JF_17 and j < 4: group.add_nav_target_point(t.position, "PP" + str(j + 1)) diff --git a/gen/flights/ai_flight_planner.py b/gen/flights/ai_flight_planner.py index 06384462..8ca7dc68 100644 --- a/gen/flights/ai_flight_planner.py +++ b/gen/flights/ai_flight_planner.py @@ -567,8 +567,9 @@ class FlightPlanner: point.description = "DEAD on " + location.obj_name point.pretty_name = "DEAD on " + location.obj_name point.only_for_player = True - ingress_point.targets.append(location) - flight.points.append(point) + ingress_point.targets.append(location) + ingress_point.targetGroup = location + flight.points.append(point) else: point = FlightWaypoint(location.position.x, location.position.y, 0) point.alt_type = "RADIO" @@ -581,6 +582,7 @@ class FlightPlanner: point.pretty_name = "DEAD on " + location.obj_name point.only_for_player = True ingress_point.targets.append(location) + ingress_point.targetGroup = location flight.points.append(point) egress_pos = location.position.point_from_heading(egress_heading, self.doctrine["INGRESS_EGRESS_DISTANCE"]) diff --git a/gen/flights/flight.py b/gen/flights/flight.py index a36605a0..16b4e4f9 100644 --- a/gen/flights/flight.py +++ b/gen/flights/flight.py @@ -70,6 +70,7 @@ class FlightWaypoint: self.name = "" self.description = "" self.targets = [] + self.targetGroup = None self.obj_name = "" self.pretty_name = "" self.waypoint_type = FlightWaypointType.TAKEOFF # type: FlightWaypointType diff --git a/qt_ui/widgets/QTopPanel.py b/qt_ui/widgets/QTopPanel.py index 0fe623bd..901bef6d 100644 --- a/qt_ui/widgets/QTopPanel.py +++ b/qt_ui/widgets/QTopPanel.py @@ -32,7 +32,7 @@ class QTopPanel(QFrame): self.passTurnButton.setProperty("style", "btn-primary") self.passTurnButton.clicked.connect(self.passTurn) - self.proceedButton = QPushButton("Proceed") + self.proceedButton = QPushButton("Mission Planning") self.proceedButton.setIcon(CONST.ICONS["Proceed"]) self.proceedButton.setProperty("style", "btn-primary") self.proceedButton.clicked.connect(self.proceed) diff --git a/qt_ui/windows/basemenu/base_defenses/QBaseDefenseGroupInfo.py b/qt_ui/windows/basemenu/base_defenses/QBaseDefenseGroupInfo.py index a18eb5cd..c3f3d454 100644 --- a/qt_ui/windows/basemenu/base_defenses/QBaseDefenseGroupInfo.py +++ b/qt_ui/windows/basemenu/base_defenses/QBaseDefenseGroupInfo.py @@ -22,14 +22,14 @@ class QBaseDefenseGroupInfo(QGroupBox): unit_dict[u.type] = 1 i = 0 for k, v in unit_dict.items(): - icon = QLabel() - if k in VEHICLES_ICONS.keys(): - icon.setPixmap(VEHICLES_ICONS[k]) - else: - icon.setText("" + k[:6] + "") - icon.setProperty("style", "icon-plane") - layout.addWidget(icon, i, 0) - layout.addWidget(QLabel(str(v) + " x " + k), i, 1) + #icon = QLabel() + #if k in VEHICLES_ICONS.keys(): + # icon.setPixmap(VEHICLES_ICONS[k]) + #else: + # icon.setText("" + k[:6] + "") + #icon.setProperty("style", "icon-plane") + #layout.addWidget(icon, i, 0) + layout.addWidget(QLabel(str(v) + " x " + "" + k + ""), i, 1) i = i + 1 self.setLayout(layout) diff --git a/qt_ui/windows/basemenu/base_defenses/QBaseInformation.py b/qt_ui/windows/basemenu/base_defenses/QBaseInformation.py index 432d2d2d..7ae07483 100644 --- a/qt_ui/windows/basemenu/base_defenses/QBaseInformation.py +++ b/qt_ui/windows/basemenu/base_defenses/QBaseInformation.py @@ -1,4 +1,4 @@ -from PySide2.QtWidgets import QGridLayout, QLabel, QGroupBox, QVBoxLayout +from PySide2.QtWidgets import QGridLayout, QLabel, QGroupBox, QVBoxLayout, QFrame from game import db from qt_ui.uiconstants import AIRCRAFT_ICONS, VEHICLES_ICONS @@ -6,10 +6,10 @@ from qt_ui.windows.basemenu.base_defenses.QBaseDefenseGroupInfo import QBaseDefe from theater import ControlPoint, Airport -class QBaseInformation(QGroupBox): +class QBaseInformation(QFrame): def __init__(self, cp:ControlPoint, airport:Airport): - super(QBaseInformation, self).__init__("Base defenses") + super(QBaseInformation, self).__init__() self.cp = cp self.airport = airport self.setMinimumWidth(500)