Skip to content
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

Advanced Atmospheric Control Roll Errata #5867

Merged
merged 18 commits into from
Sep 4, 2024

Conversation

Algebro7
Copy link
Collaborator

@Algebro7 Algebro7 commented Aug 6, 2024

This is currently a WIP implementation of the StratOps Advanced Atmospheric Control Roll Errata introduced on August 2, 2024. The plan is to keep the old rule as an (Unofficial) rule. Please do not merge yet.

Things left to do (please add to this list if you notice something I've missed):

  • Calculate Aero units' highest threshold
  • Calculate LAM highest threshold (only for control rolls, not criticals)
  • Modify threshold control roll logic to compare damageThisRound to the highest threshold
  • Add setting for old "Unofficial" advanced rule
  • Update settings entry text to describe new rule
  • Only roll once when taking a critical hit in addition to the threshold conditions in new rule
  • Apply to small crafts like dropships? (should already be covered, since Dropships extend Aero where these changes were implemented)

@Algebro7 Algebro7 changed the title DRAFT: Atmospheric control roll errata DRAFT: Advanced Atmospheric Control Roll Errata Aug 6, 2024
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.91%. Comparing base (0d1c946) to head (07bce77).
Report is 40 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5867   +/-   ##
=========================================
  Coverage     28.91%   28.91%           
- Complexity    13942    13969   +27     
=========================================
  Files          2539     2542    +3     
  Lines        268416   268503   +87     
  Branches      47947    47967   +20     
=========================================
+ Hits          77603    77644   +41     
- Misses       186842   186882   +40     
- Partials       3971     3977    +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -489,6 +489,8 @@ GameOptionsInfo.option.crashed_dropships_survive.displayableName=(Unofficial) Un
GameOptionsInfo.option.crashed_dropships_survive.description=If checked, DropShips (and larger) that crash while out of control are not instantly destroyed.
GameOptionsInfo.option.expanded_kf_drive_damage.displayableName=(Unofficial) Damage individual K-F Drive components on K-F Drive Critical Hit
GameOptionsInfo.option.expanded_kf_drive_damage.description=If a K-F Drive critical hit is taken, a random component is hit (per BattleSpace rules).
GameOptionsInfo.option.unoff_adv_atmospheric_control.displayableName=(Unofficial) Old StratOps Advanced Atmospheric Control Rolls
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open to suggestions on the naming/wording for these

@repligator repligator added Aerospace Errata This covers officially produced CGL errata that the programs need to implement. labels Aug 6, 2024
@Algebro7 Algebro7 force-pushed the atmospheric-control-roll-errata branch from fde87ee to 5cced64 Compare August 8, 2024 16:34
Comment on lines 20318 to 20325
} else {
// Not an atmospheric control roll under the new rules, so treat normally
rolls.addElement(modifier);
if (!reasons.isEmpty()) {
reasons.append("; ");
}
reasons.append(modifier.getPlainDesc());
}
Copy link
Collaborator Author

@Algebro7 Algebro7 Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will there ever be any control rolls that fall into this condition? Or at this phase of the game (end phase) will all control rolls be thresh/highest thresh/avionics/control? I handled it just to be safe but this condition may be unnecessary

@Algebro7 Algebro7 force-pushed the atmospheric-control-roll-errata branch from b8f0158 to 427fbc2 Compare August 13, 2024 13:21
@Algebro7 Algebro7 force-pushed the atmospheric-control-roll-errata branch from 427fbc2 to 2b94652 Compare August 15, 2024 13:55
@Algebro7 Algebro7 force-pushed the atmospheric-control-roll-errata branch from 2b94652 to ee5d6ac Compare August 25, 2024 18:59
@Algebro7 Algebro7 force-pushed the atmospheric-control-roll-errata branch from ee5d6ac to fe0bd22 Compare September 3, 2024 00:34
@Algebro7 Algebro7 marked this pull request as ready for review September 3, 2024 00:34
@Algebro7
Copy link
Collaborator Author

Algebro7 commented Sep 3, 2024

@Sleet01 I think this is ready for review now that 0.50 is out, whenever you get a chance. @Thom293 tested it awhile back and thought it worked correctly, but I'd like to get an experienced set of eyes on this.

Note my open question above about different types of control rolls in the endphase.

Thanks in advance!

@Algebro7 Algebro7 changed the title DRAFT: Advanced Atmospheric Control Roll Errata Advanced Atmospheric Control Roll Errata Sep 3, 2024
@Sleet01
Copy link
Collaborator

Sleet01 commented Sep 3, 2024

@Algebro7 Looks like NeoAncient's PR updating GameManager.java just went in, so you will need to resolve the new merge conflicts.

I've found the following approach to give good results and, more importantly, not cause a lot of headaches:

  1. Update your fork (via GitHub web UI or CLI) to match the current main repo state.
  2. Switch to master branch on your PC
  3. Pull from the fork
  4. Switch to the feature branch
  5. Run git rebase master via CLI, or use the IDE to rebase the feature branch on the latest master branch state
  6. Resolve any merge conflicts
  7. Push to your fork (will probably require a force, like git push origin atmospheric-control-roll-errata --force-with-lease or the GUI equivalent)

@Algebro7 Algebro7 force-pushed the atmospheric-control-roll-errata branch from fe0bd22 to 4e381b6 Compare September 3, 2024 16:32
@Algebro7
Copy link
Collaborator Author

Algebro7 commented Sep 3, 2024

Thanks, I've rebased and fixed the failing test.

@@ -127,6 +127,7 @@ public String[] getLocationAbbrs() {
private int altLoss = 0;
private int altLossThisRound = 0;


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this added intentionally?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regardless of the answer to this question, it's surely more effort than it's worth it to worry about a single blank line

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nearly no effort to fix, and everyone should get in the habit of spotting unintended changes to their PRs as a matter of course.

Copy link
Collaborator Author

@Algebro7 Algebro7 Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, fixed in 07bce77

Copy link
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just one minor question but very nice!

for (Enumeration<PilotingRollData> j = game.getControlRolls(); j.hasMoreElements(); ) {
final PilotingRollData modifier = j.nextElement();
if (modifier.getEntityId() != e.getId()) {
continue;

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
nukeStats
may be null at this access as suggested by
this
null guard.
@Sleet01 Sleet01 merged commit 876cd55 into MegaMek:master Sep 4, 2024
5 checks passed
@Algebro7 Algebro7 deleted the atmospheric-control-roll-errata branch September 4, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aerospace Errata This covers officially produced CGL errata that the programs need to implement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants