mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Disband squadrons sinking with ship + Sink/Resurrect cheat
This commit is contained in:
parent
22f7767b99
commit
6dc5296130
@ -18,12 +18,14 @@
|
||||
* **[Campaign Design]** Support for Kola map by Orbx
|
||||
* **[UI]** Zoom level retained when switching campaigns
|
||||
* **[UX]** Allow changing squadrons in flight's edit dialog
|
||||
* **[Cheats]** Sink/Resurrect carriers instead of showing an error during cheat-capture (use AWCD-cheat to add squadrons upon resurrection)
|
||||
|
||||
## Fixes
|
||||
* **[UI/UX]** A-10A flights can be edited again
|
||||
* **[Mission Generation]** IADS bug sometimes triggering "no skynet usable units" error during mission generation
|
||||
* **[New Game Wizard]** Campaign errors show a dialog again and avoid CTDs
|
||||
* **[UI]** Landmap wasn't updating when switching to a different theater
|
||||
* **[Mission Results Processor]** Squadrons of a sunken carrier are now disbanded
|
||||
|
||||
# Retribution v1.3.1
|
||||
#### Note: Re-save your missions in DCS' Mission Editor to avoid possible crashes due to datalink (usually the case when F-16C blk50s are used) when hosting missions on a dedicated server.
|
||||
|
||||
@ -283,6 +283,10 @@ class TheaterGroundObject(MissionTarget, SidcDescribable, ABC):
|
||||
def coalition(self) -> Coalition:
|
||||
return self.control_point.coalition
|
||||
|
||||
@property
|
||||
def is_naval_control_point(self) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
class BuildingGroundObject(TheaterGroundObject):
|
||||
def __init__(
|
||||
@ -384,6 +388,10 @@ class GenericCarrierGroundObject(NavalGroundObject, ABC):
|
||||
def is_control_point(self) -> bool:
|
||||
return True
|
||||
|
||||
@property
|
||||
def is_naval_control_point(self) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
# TODO: Why is this both a CP and a TGO?
|
||||
class CarrierGroundObject(GenericCarrierGroundObject):
|
||||
|
||||
@ -66,6 +66,18 @@ class TheaterUnit:
|
||||
if self.ground_object.is_iads:
|
||||
iads = self.ground_object.control_point.coalition.game.theater.iads_network
|
||||
iads.update_tgo(self.ground_object, events)
|
||||
if self.ground_object.is_naval_control_point:
|
||||
cp = self.ground_object.control_point
|
||||
for squadron in cp.squadrons:
|
||||
cp.coalition.air_wing.squadrons[squadron.aircraft].remove(squadron)
|
||||
|
||||
def revive(self, events: GameUpdateEvents) -> None:
|
||||
self.alive = True
|
||||
self.ground_object.threat_poly()
|
||||
events.update_tgo(self.ground_object)
|
||||
if self.ground_object.is_iads:
|
||||
iads = self.ground_object.control_point.coalition.game.theater.iads_network
|
||||
iads.update_tgo(self.ground_object, events)
|
||||
|
||||
@property
|
||||
def unit_name(self) -> str:
|
||||
|
||||
@ -159,7 +159,8 @@ class QBaseMenu2(QDialog):
|
||||
transfer_button.clicked.connect(self.open_transfer_dialog)
|
||||
|
||||
if self.cheat_capturable:
|
||||
capture_button = QPushButton("CHEAT: Capture")
|
||||
label = "Sink/Resurrect" if self.cp.is_fleet else "Capture"
|
||||
capture_button = QPushButton(f"CHEAT: {label}")
|
||||
capture_button.setProperty("style", "btn-danger")
|
||||
bottom_row.addWidget(capture_button)
|
||||
capture_button.clicked.connect(self.cheat_capture)
|
||||
@ -181,11 +182,23 @@ class QBaseMenu2(QDialog):
|
||||
|
||||
def cheat_capture(self) -> None:
|
||||
events = GameUpdateEvents()
|
||||
self.cp.capture(self.game_model.game, events, for_player=not self.cp.captured)
|
||||
if self.cp.is_fleet:
|
||||
for go in self.cp.ground_objects:
|
||||
if go.is_naval_control_point:
|
||||
if go.alive_unit_count > 0:
|
||||
for u in go.units:
|
||||
u.kill(events)
|
||||
else:
|
||||
for u in go.units:
|
||||
u.revive(events)
|
||||
else:
|
||||
self.cp.capture(
|
||||
self.game_model.game, events, for_player=not self.cp.captured
|
||||
)
|
||||
mrp = MissionResultsProcessor(self.game_model.game)
|
||||
mrp.redeploy_units(self.cp)
|
||||
# Reinitialized ground planners and the like. The ATO needs to be reset because
|
||||
# missions planned against the flipped base are no longer valid.
|
||||
# missions planned against the flipped base (or killed carrier) are no longer valid.
|
||||
self.game_model.game.initialize_turn(events)
|
||||
EventStream.put_nowait(events)
|
||||
GameUpdateSignal.get_instance().updateGame(self.game_model.game)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user