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

Variable OperationalVP Added to CommonObjectiveFactory.java #3951

Merged
merged 5 commits into from
Apr 3, 2024

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Apr 2, 2024

Current Implementation

MekHQ/src/mekhq/campaign/mission/CommonObjectiveFactory.java details the victory conditions (objectives) for the various built in AtB scenarios. All objectives have a fixed Operational Victory Point value of 1.

Problem

This means that it is not possible to edit the value of objectives when compared to each other. For example, in one scenario you might have three objectives: 1 primary, 2 secondary. All objectives are valued identically, meaning completing both secondary objectives but losing the primary is still considered a victory.

Solution

I added the integer OperationalVP to objective functions, where applicable. I updated all calls from the various objectives to include this variable. All instances default to 1, so nothing has been changed insofar as rewarding Operational VPs. This isn't an update to Operation VP rewards, but preparatory work for a future review.

Examples of Use

The below is an example of use. OperationalVP for the below is actually set to 1 in this PR (as per current implementation), not 99.

image image

A Note on StratCon

With the exception of the base attacks scenario (the one you get when the enemy is Invincible), StratCon doesn't appear to use AtB's scenarios and already has this functionality. The focus of this PR is to bring that functionality to AtB scenarios, as this allows a holistic review of Operational VPs, rather than restricting any review to StratCon only.

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 47 lines in your changes are missing coverage. Please review.

Project coverage is 10.65%. Comparing base (df84da7) to head (356309b).
Report is 26 commits behind head on master.

❗ Current head 356309b differs from pull request most recent head f7e873e. Consider uploading reports for the commit f7e873e to get more accurate results

Files Patch % Lines
...mekhq/campaign/mission/CommonObjectiveFactory.java 0.00% 11 Missing ⚠️
...ission/atb/scenario/ExtractionBuiltInScenario.java 0.00% 4 Missing ⚠️
.../atb/scenario/StarLeagueCache1BuiltInScenario.java 0.00% 3 Missing ⚠️
...n/mission/atb/scenario/AceDuelBuiltInScenario.java 0.00% 2 Missing ⚠️
...on/atb/scenario/AlliedTraitorsBuiltInScenario.java 0.00% 2 Missing ⚠️
...ission/atb/scenario/BaseAttackBuiltInScenario.java 0.00% 2 Missing ⚠️
...sion/atb/scenario/BreakthroughBuiltInScenario.java 0.00% 2 Missing ⚠️
...ign/mission/atb/scenario/ChaseBuiltInScenario.java 0.00% 2 Missing ⚠️
...sion/atb/scenario/CivilianRiotBuiltInScenario.java 0.00% 2 Missing ⚠️
...ssion/atb/scenario/HideAndSeekBuiltInScenario.java 0.00% 2 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #3951   +/-   ##
=========================================
  Coverage     10.65%   10.65%           
  Complexity     5528     5528           
=========================================
  Files           836      836           
  Lines        114275   114275           
  Branches      17185    17185           
=========================================
  Hits          12176    12176           
  Misses       100871   100871           
  Partials       1228     1228           

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

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.

Just needs a few formatting fixes, then good to go.

@Sleet01 Sleet01 merged commit 52874d9 into MegaMek:master Apr 3, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants