Skip to content

Commit

Permalink
Added Force BV Multiplier Logging & Adjusted Calculation in `AtBDynam…
Browse files Browse the repository at this point in the history
…icScenarioFactory`

Added logging to display the force BV multiplier from the scenario template and the computed BV budget after applying the multiplier and any scenario modifiers. This helps in debugging by providing detailed information about how the BV budget is calculated.
  • Loading branch information
IllianiCBT committed Nov 3, 2024
1 parent a077804 commit 9461b1a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions MekHQ/src/mekhq/campaign/mission/AtBDynamicScenarioFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,19 @@ public static int generateForce(AtBDynamicScenario scenario, AtBContract contrac
int forceBV = 0;
double forceMultiplier = forceTemplate.getForceMultiplier();

if (forceTemplate.getForceMultiplier() != 1) {
logger.info(String.format("Force BV Multiplier: %s (from scenario template)", forceMultiplier));
}

int forceBVBudget = (int) (effectiveBV * forceMultiplier);

if (isScenarioModifier) {
forceBVBudget = (int) (forceBVBudget * ((double) campaign.getCampaignOptions().getScenarioModBV() / 100)
* forceMultiplier);
forceBVBudget = (int) (forceBVBudget * ((double) campaign.getCampaignOptions().getScenarioModBV() / 100));
}

if (forceTemplate.getForceMultiplier() != 1) {
logger.info(String.format("Force BV Multiplier: %s (from scenario template)", forceMultiplier));
logger.info(String.format("BV Budget was %s, now %s (includes Modifier settings and Multiplier)",
effectiveBV, forceBVBudget));
}

int forceUnitBudget = 0;
Expand Down

0 comments on commit 9461b1a

Please sign in to comment.