MegaMek / mekhq

MekHQ is a java helper program for the MegaMek game that allows users to load a list of entities from an XML file, perform repairs and customizations, and then save the new entities to another XML file that can be loaded into MegaMek.
http://megamek.org
131 stars 168 forks source link

Fix AtBMonthlyContractMarket payment multiplier #4954

Open Algebro7 opened 21 hours ago

Algebro7 commented 21 hours ago

There was an error when calculating the payment multiplier using the CamOps unit rating method for AtBMonthly contracts, which was caused by incorrectly using the reputation score instead of the reputation modifier for determining this multiplier. This PR does a couple of things:

  1. Fixes getReputationFactor() to use the camopsUnitRatingMod instead of the reputation score
  2. Reverts the change in AtBMonthlyContractMarket and uses the AtBUnitRatingMod instead
  3. Adds a getCamOpsUnitRatingMod() method to get the camops unit rating mod and support getReputationFactor()
  4. Adds docstrings for everything

Closes #4952

codecov-commenter commented 21 hours ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 10.45%. Comparing base (980d504) to head (b3341a5). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4954 +/- ## ============================================ + Coverage 10.44% 10.45% +0.01% - Complexity 6005 6016 +11 ============================================ Files 951 951 Lines 132875 132876 +1 Branches 19329 19329 ============================================ + Hits 13876 13894 +18 + Misses 117648 117632 -16 + Partials 1351 1350 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Algebro7 commented 4 hours ago

Thanks for the review, this should be fixed. I'm working on tests but that will likely take some more time/refactoring so I'll push those in a separate PR later.