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

fixes for multiple stratcon issues; objective display improvement #2756

Merged
merged 4 commits into from
Jul 21, 2021

Conversation

NickAragua
Copy link
Member

  • Pursuit scenario had the opfor set to run for the opposite edge even though it's the player's goal to get to the opposite edge
  • Objective scenarios can sometimes move, but the objective wouldn't go with them
  • Now possible to completely fail a facility capture/control objective if the facility is destroyed
  • Prevent being able to deploy to invisible objective scenarios from the TO&E
  • To help with color-blind users:
    o indicates an in-progress objective (not complete, not failed, colored orange)
    x indicates a failed objective (no way to complete, red colored)
    checkmark indicates a completed objective (green colored)

@codecov
Copy link

codecov bot commented Jul 20, 2021

Codecov Report

Merging #2756 (74f27df) into master (89903d3) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

❗ Current head 74f27df differs from pull request most recent head a7a969b. Consider uploading reports for the commit a7a969b to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2756      +/-   ##
============================================
- Coverage     10.60%   10.59%   -0.02%     
+ Complexity     3853     3845       -8     
============================================
  Files           717      717              
  Lines         99774    99804      +30     
  Branches      16404    16413       +9     
============================================
- Hits          10585    10573      -12     
- Misses        87812    87844      +32     
- Partials       1377     1387      +10     
Impacted Files Coverage Δ
.../mekhq/campaign/stratcon/StratconRulesManager.java 0.00% <0.00%> (ø)
.../campaign/stratcon/StratconStrategicObjective.java 0.00% <0.00%> (ø)
...rc/mekhq/campaign/stratcon/StratconTrackState.java 0.00% <0.00%> (ø)
MekHQ/src/mekhq/gui/StratconTab.java 0.00% <0.00%> (ø)
MekHQ/src/mekhq/gui/adapter/TOEMouseAdapter.java 0.00% <0.00%> (ø)
...ekhq/campaign/universe/RandomFactionGenerator.java 56.40% <0.00%> (-2.00%) ⬇️
...ekHQ/src/mekhq/campaign/market/ContractMarket.java 57.94% <0.00%> (-1.01%) ⬇️
.../mekhq/campaign/mission/enums/AtBContractType.java 12.58% <0.00%> (-0.70%) ⬇️
MekHQ/src/mekhq/campaign/market/UnitMarket.java 2.50% <0.00%> (-0.02%) ⬇️
MekHQ/src/mekhq/Utilities.java 7.68% <0.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89903d3...a7a969b. Read the comment docs.

Copy link
Contributor

@Windchild292 Windchild292 left a comment

Choose a reason for hiding this comment

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

Couple of things first

Comment on lines 75 to 92
case AnyScenarioVictory:
case SpecificScenarioVictory:
// you can fail this if the scenario goes away somehow
return getCurrentObjectiveCount() == OBJECTIVE_FAILED;
case AlliedFacilityControl:
// you can fail this by having the facility destroyed
StratconFacility alliedFacility = trackState.getFacility(getObjectiveCoords());
return alliedFacility == null;
case HostileFacilityControl:
// you can fail this by having the facility destroyed
StratconFacility hostileFacility = trackState.getFacility(getObjectiveCoords());
return hostileFacility == null;
case FacilityDestruction:
// you can't really permanently fail this
return false;
default:
// we shouldn't be here, but just in case
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Indent switch

default:
// we shouldn't be here, but just in case
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Also... this shouldn't line up with the method end

MekHQ/src/mekhq/campaign/stratcon/StratconTrackState.java Outdated Show resolved Hide resolved
@@ -291,6 +295,8 @@ private String buildShortStrategicObjectiveText(StratconCampaignState campaignSt
private String buildStrategicObjectiveText(StratconCampaignState campaignState) {
StringBuilder sb = new StringBuilder();

boolean contractIsActive = campaignState.getContract().isActiveOn(getCampaignGui().getCampaign().getLocalDate());
Copy link
Contributor

Choose a reason for hiding this comment

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

Variable is useless given it is used a grand total of once, and isn't required at all times.

@NickAragua
Copy link
Member Author

Changes made, plus a data fix for an annoying issue where hostile off-board artillery would count towards primary scenario objectives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
StratCon Bugs relating strictly to StratCon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants