mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
SEAD AI will only target the designated target group.
This commit is contained in:
parent
9c89ad7c72
commit
83e46ddc97
@ -274,6 +274,8 @@ class Event:
|
|||||||
|
|
||||||
ratio = (1.0 + enemy_casualties) / (1.0 + ally_casualties)
|
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:
|
if ally_units_alive == 0:
|
||||||
player_won = False
|
player_won = False
|
||||||
delta = STRONG_DEFEAT_INFLUENCE
|
delta = STRONG_DEFEAT_INFLUENCE
|
||||||
@ -296,6 +298,16 @@ class Event:
|
|||||||
else:
|
else:
|
||||||
delta = DEFEAT_INFLUENCE
|
delta = DEFEAT_INFLUENCE
|
||||||
elif ally_casualties > enemy_casualties:
|
elif ally_casualties > enemy_casualties:
|
||||||
|
|
||||||
|
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:
|
||||||
|
# But is the enemy is not outnumbered, we lose
|
||||||
player_won = False
|
player_won = False
|
||||||
if cp.stances[enemy_cp.id] == CombatStance.BREAKTHROUGH:
|
if cp.stances[enemy_cp.id] == CombatStance.BREAKTHROUGH:
|
||||||
delta = STRONG_DEFEAT_INFLUENCE
|
delta = STRONG_DEFEAT_INFLUENCE
|
||||||
|
|||||||
@ -27,6 +27,6 @@ class Settings:
|
|||||||
|
|
||||||
# Performance culling
|
# Performance culling
|
||||||
perf_culling = False
|
perf_culling = False
|
||||||
perf_culling_distance = 0
|
perf_culling_distance = 100
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -363,9 +363,9 @@ class AircraftConflictGenerator:
|
|||||||
group.task = SEAD.name
|
group.task = SEAD.name
|
||||||
self._setup_group(group, SEAD, flight.client_count)
|
self._setup_group(group, SEAD, flight.client_count)
|
||||||
group.points[0].tasks.clear()
|
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(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))
|
group.points[0].tasks.append(OptRestrictJettison(True))
|
||||||
elif flight_type in [FlightType.STRIKE]:
|
elif flight_type in [FlightType.STRIKE]:
|
||||||
group.task = PinpointStrike.name
|
group.task = PinpointStrike.name
|
||||||
@ -407,8 +407,6 @@ class AircraftConflictGenerator:
|
|||||||
bombing = Bombing(bcenter)
|
bombing = Bombing(bcenter)
|
||||||
bombing.params["expend"] = "All"
|
bombing.params["expend"] = "All"
|
||||||
bombing.params["attackQtyLimit"] = False
|
bombing.params["attackQtyLimit"] = False
|
||||||
bombing.params["attackQty"] = 1
|
|
||||||
bombing.params["expend"] = "All"
|
|
||||||
bombing.params["directionEnabled"] = False
|
bombing.params["directionEnabled"] = False
|
||||||
bombing.params["altitudeEnabled"] = False
|
bombing.params["altitudeEnabled"] = False
|
||||||
bombing.params["weaponType"] = 2032
|
bombing.params["weaponType"] = 2032
|
||||||
@ -423,6 +421,18 @@ class AircraftConflictGenerator:
|
|||||||
if group.units[0].unit_type == F_14B and j == 0:
|
if group.units[0].unit_type == F_14B and j == 0:
|
||||||
group.add_nav_target_point(t.position, "ST")
|
group.add_nav_target_point(t.position, "ST")
|
||||||
elif point.waypoint_type == FlightWaypointType.INGRESS_SEAD:
|
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):
|
for j, t in enumerate(point.targets):
|
||||||
if group.units[0].unit_type == JF_17 and j < 4:
|
if group.units[0].unit_type == JF_17 and j < 4:
|
||||||
group.add_nav_target_point(t.position, "PP" + str(j + 1))
|
group.add_nav_target_point(t.position, "PP" + str(j + 1))
|
||||||
|
|||||||
@ -568,6 +568,7 @@ class FlightPlanner:
|
|||||||
point.pretty_name = "DEAD on " + location.obj_name
|
point.pretty_name = "DEAD on " + location.obj_name
|
||||||
point.only_for_player = True
|
point.only_for_player = True
|
||||||
ingress_point.targets.append(location)
|
ingress_point.targets.append(location)
|
||||||
|
ingress_point.targetGroup = location
|
||||||
flight.points.append(point)
|
flight.points.append(point)
|
||||||
else:
|
else:
|
||||||
point = FlightWaypoint(location.position.x, location.position.y, 0)
|
point = FlightWaypoint(location.position.x, location.position.y, 0)
|
||||||
@ -581,6 +582,7 @@ class FlightPlanner:
|
|||||||
point.pretty_name = "DEAD on " + location.obj_name
|
point.pretty_name = "DEAD on " + location.obj_name
|
||||||
point.only_for_player = True
|
point.only_for_player = True
|
||||||
ingress_point.targets.append(location)
|
ingress_point.targets.append(location)
|
||||||
|
ingress_point.targetGroup = location
|
||||||
flight.points.append(point)
|
flight.points.append(point)
|
||||||
|
|
||||||
egress_pos = location.position.point_from_heading(egress_heading, self.doctrine["INGRESS_EGRESS_DISTANCE"])
|
egress_pos = location.position.point_from_heading(egress_heading, self.doctrine["INGRESS_EGRESS_DISTANCE"])
|
||||||
|
|||||||
@ -70,6 +70,7 @@ class FlightWaypoint:
|
|||||||
self.name = ""
|
self.name = ""
|
||||||
self.description = ""
|
self.description = ""
|
||||||
self.targets = []
|
self.targets = []
|
||||||
|
self.targetGroup = None
|
||||||
self.obj_name = ""
|
self.obj_name = ""
|
||||||
self.pretty_name = ""
|
self.pretty_name = ""
|
||||||
self.waypoint_type = FlightWaypointType.TAKEOFF # type: FlightWaypointType
|
self.waypoint_type = FlightWaypointType.TAKEOFF # type: FlightWaypointType
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class QTopPanel(QFrame):
|
|||||||
self.passTurnButton.setProperty("style", "btn-primary")
|
self.passTurnButton.setProperty("style", "btn-primary")
|
||||||
self.passTurnButton.clicked.connect(self.passTurn)
|
self.passTurnButton.clicked.connect(self.passTurn)
|
||||||
|
|
||||||
self.proceedButton = QPushButton("Proceed")
|
self.proceedButton = QPushButton("Mission Planning")
|
||||||
self.proceedButton.setIcon(CONST.ICONS["Proceed"])
|
self.proceedButton.setIcon(CONST.ICONS["Proceed"])
|
||||||
self.proceedButton.setProperty("style", "btn-primary")
|
self.proceedButton.setProperty("style", "btn-primary")
|
||||||
self.proceedButton.clicked.connect(self.proceed)
|
self.proceedButton.clicked.connect(self.proceed)
|
||||||
|
|||||||
@ -22,14 +22,14 @@ class QBaseDefenseGroupInfo(QGroupBox):
|
|||||||
unit_dict[u.type] = 1
|
unit_dict[u.type] = 1
|
||||||
i = 0
|
i = 0
|
||||||
for k, v in unit_dict.items():
|
for k, v in unit_dict.items():
|
||||||
icon = QLabel()
|
#icon = QLabel()
|
||||||
if k in VEHICLES_ICONS.keys():
|
#if k in VEHICLES_ICONS.keys():
|
||||||
icon.setPixmap(VEHICLES_ICONS[k])
|
# icon.setPixmap(VEHICLES_ICONS[k])
|
||||||
else:
|
#else:
|
||||||
icon.setText("<b>" + k[:6] + "</b>")
|
# icon.setText("<b>" + k[:6] + "</b>")
|
||||||
icon.setProperty("style", "icon-plane")
|
#icon.setProperty("style", "icon-plane")
|
||||||
layout.addWidget(icon, i, 0)
|
#layout.addWidget(icon, i, 0)
|
||||||
layout.addWidget(QLabel(str(v) + " x " + k), i, 1)
|
layout.addWidget(QLabel(str(v) + " x " + "<strong>" + k + "</strong>"), i, 1)
|
||||||
i = i + 1
|
i = i + 1
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
|
|
||||||
|
|||||||
@ -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 game import db
|
||||||
from qt_ui.uiconstants import AIRCRAFT_ICONS, VEHICLES_ICONS
|
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
|
from theater import ControlPoint, Airport
|
||||||
|
|
||||||
|
|
||||||
class QBaseInformation(QGroupBox):
|
class QBaseInformation(QFrame):
|
||||||
|
|
||||||
def __init__(self, cp:ControlPoint, airport:Airport):
|
def __init__(self, cp:ControlPoint, airport:Airport):
|
||||||
super(QBaseInformation, self).__init__("Base defenses")
|
super(QBaseInformation, self).__init__()
|
||||||
self.cp = cp
|
self.cp = cp
|
||||||
self.airport = airport
|
self.airport = airport
|
||||||
self.setMinimumWidth(500)
|
self.setMinimumWidth(500)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user