-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force destruction of out-of-control DropShips and larger #5845
Force destruction of out-of-control DropShips and larger #5845
Conversation
@@ -207,9 +206,9 @@ public MovePath addStep(final MoveStepType type, final boolean noCost) { | |||
} | |||
|
|||
public MovePath addStep(final MoveStepType type, final Map<Integer, Integer> additionalIntData) { | |||
return addStep(new MoveStep(this, type, additionalIntData)); | |||
return addStep(new MoveStep(this, type, additionalIntData)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDEA just reallllly disliked the formatting in this file.
@@ -4898,6 +4898,7 @@ else if (game.getBoard().onGround()) { | |||
private Vector<Report> processCrash(Entity entity, int vel, Coords c) { | |||
Vector<Report> vReport = new Vector<>(); | |||
Report r; | |||
boolean destroyDropShip = false; // save for later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New code part 1.
// If out of control, destruction (of DropShips and larger) is assured. | ||
destroyDropShip = (entity instanceof Dropship || entity instanceof Jumpship) | ||
&& ((IAero) entity).isOutControlTotal(); | ||
|
||
// Technically bring to a halt; actual landing is handled elsewhere. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New code part 2.
if (destroyDropShip) { | ||
// Out-of-control DropShip that crashes is automatically destroyed. | ||
r = new Report(9708, Report.PUBLIC); | ||
r.indent(); | ||
r.addDesc(entity); | ||
vReport.addAll(destroyEntity(entity, "Crashed while out of control!")); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New code part 3; actually finishes the job.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5845 +/- ##
============================================
- Coverage 28.99% 28.99% -0.01%
Complexity 13930 13930
============================================
Files 2512 2512
Lines 267279 267289 +10
Branches 47833 47837 +4
============================================
+ Hits 77509 77510 +1
- Misses 185820 185829 +9
Partials 3950 3950 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it looks fine (other than the minor cleanup), I'm likely to introduce an unofficial option to keep large craft alive upon crashing. Because, dammit, if the thing's hull integrity is intact, we should be able to keep it going.
I can add an option to turn this rule off, but as a reminder, it's only for Large Craft crashing while out of control. If they crash due to loss of thrust or some other reason, they'll be treated as before. |
8af3671
to
a55a508
Compare
This is the final step to completing the Errata from #770: enforce destruction of DropShips (and larger) that crash while out of control.
Note: this may be gilding the lily, as the chances of most DropShips surviving crashes is slim already. But this will ensure that, after all damage is dealt and terrain is re-arranged, the crashing unit will be utterly kaput.
Testing:
Close #770