Class AcquisitionPriceMultipliers

java.lang.Object
mekhq.campaign.finances.AcquisitionPriceMultipliers

public final class AcquisitionPriceMultipliers extends Object
The acquisition price multipliers from Campaign Operations (CO p.14), each set by its own campaign option.

Every surcharge that applies stacks additively: ×5 and ×1.25 together make ×5.25. Discounts (multipliers below ×1) are multiplied in afterwards, so no combination of them can make an item free: ×0.5 and ×0.5 make ×0.25. Outside the listed years, nothing replaces the era multipliers, so tech rating E and F fall back to their usual multipliers and Clan tech has no multiplier at all.

The multiplier for a unit covers its whole price. Parts only pay the multipliers when the unofficial CampaignOption.APPLY_ACQUISITION_MULTIPLIERS_TO_PARTS option is on.

A mixed-tech unit pays none of the Clan tech multipliers, whatever its chassis: its mixed-tech unit price multiplier already covers its Clan equipment.

These multipliers only apply to what the campaign pays when buying and receives when selling (see Unit.getPurchaseCost(), Unit.getSalePrice(), Part.getPurchaseCost() and Part.getSalePrice()), and to the spare parts it buys each month for its units (Unit.getSparePartsCost(), CO p.24), never to the value of what it owns (maintenance, contract pay, battle loss compensation, salvage). They only apply under the UnitCostModel.TOTAL_WARFARE CampaignOption.UNIT_COST_MODEL; every other model leaves them at ×1.

Since:
0.51.01
  • Method Details

    • getUnitMultiplier

      public static double getUnitMultiplier(CampaignOptions campaignOptions, @Nullable Faction faction, int gameYear, megamek.common.units.Entity entity)
      Parameters:
      campaignOptions - the campaign options holding the multipliers
      faction - the buying campaign's faction, or null to treat it as neither Clan nor ComStar
      gameYear - the current year
      entity - the unit's entity
      Returns:
      the acquisition price multiplier for the whole unit. Only a pure Clan unit pays the Clan tech multiplier: a mixed-tech unit, on either chassis, is covered by its mixed-tech unit price multiplier.
      Since:
      0.51.01
    • getUnitMultiplier

      public static double getUnitMultiplier(CampaignOptions campaignOptions, @Nullable Faction faction, int gameYear, boolean isClan, boolean isMixedTech, @Nullable megamek.common.enums.TechRating techRating)
      For callers that cache a unit's traits rather than keep its entity loaded, such as unit market offers.
      Parameters:
      campaignOptions - the campaign options holding the multipliers
      faction - the buying campaign's faction, or null to treat it as neither Clan nor ComStar
      gameYear - the current year
      isClan - whether the unit is Clan tech
      isMixedTech - whether the unit is mixed tech, which never pays the Clan tech multiplier
      techRating - the unit's tech rating, or null if it is unknown
      Returns:
      the acquisition price multiplier for the whole unit, as getUnitMultiplier(CampaignOptions, Faction, int, Entity) works it out
      Since:
      0.51.01
    • getUnitMultiplier

      public static double getUnitMultiplier(CampaignOptions campaignOptions, @Nullable Faction faction, int gameYear, megamek.common.loaders.MekSummary summary)
      Parameters:
      campaignOptions - the campaign options holding the multipliers
      faction - the buying campaign's faction, or null to treat it as neither Clan nor ComStar
      gameYear - the current year
      summary - the unit's summary
      Returns:
      the acquisition price multiplier for the whole unit, as getUnitMultiplier(CampaignOptions, Faction, int, Entity) works it out once the unit is loaded
      Since:
      0.51.01
    • getPartMultiplier

      public static double getPartMultiplier(CampaignOptions campaignOptions, @Nullable Faction faction, int gameYear, Part part)
      Parameters:
      campaignOptions - the campaign options holding the multipliers
      faction - the buying campaign's faction, or null to treat it as neither Clan nor ComStar
      gameYear - the current year
      part - the part
      Returns:
      the acquisition price multiplier for the part; ×1 unless CampaignOption.APPLY_ACQUISITION_MULTIPLIERS_TO_PARTS is on
      Since:
      0.51.01