|
39 | 39 | import static megamek.common.MiscType.F_SPONSON_TURRET; |
40 | 40 | import static megamek.common.enums.SkillLevel.NONE; |
41 | 41 | import static mekhq.MHQConstants.BATTLE_OF_TUKAYYID; |
42 | | -import static mekhq.campaign.force.CombatTeam.getStandardForceSize; |
43 | 42 | import static mekhq.campaign.force.ForceType.CONVOY; |
44 | 43 | import static mekhq.campaign.force.ForceType.STANDARD; |
45 | 44 | import static mekhq.campaign.market.procurement.Procurement.getTechFaction; |
|
78 | 77 | import mekhq.campaign.personnel.skills.SkillType; |
79 | 78 | import mekhq.campaign.unit.Unit; |
80 | 79 | import mekhq.campaign.universe.Faction; |
| 80 | +import mekhq.campaign.universe.factionStanding.FactionStandingUtilities; |
| 81 | +import mekhq.campaign.universe.factionStanding.FactionStandings; |
81 | 82 |
|
82 | 83 | /** |
83 | 84 | * The {@code Resupply} class manages the resupply process during a campaign. It calculates the required resupply |
@@ -450,7 +451,14 @@ static int calculateTargetCargoTonnage(Campaign campaign, AtBContract contract) |
450 | 451 | final double baseTonnage = min(unitTonnage, tonnageCap); |
451 | 452 |
|
452 | 453 | final int TONNAGE_DIVIDER = 125; |
453 | | - final double dropSize = baseTonnage / TONNAGE_DIVIDER; |
| 454 | + double dropSize = baseTonnage / TONNAGE_DIVIDER; |
| 455 | + |
| 456 | + if (campaign.getCampaignOptions().isUseFactionStandingResupplySafe()) { |
| 457 | + FactionStandings standings = campaign.getFactionStandings(); |
| 458 | + double regard = standings.getRegardForFaction(contract.getEmployerCode(), true); |
| 459 | + double resupplyMultiplier = FactionStandingUtilities.getResupplyWeightModifier(regard); |
| 460 | + dropSize *= resupplyMultiplier; |
| 461 | + } |
454 | 462 |
|
455 | 463 | return (int) max(CARGO_MINIMUM_WEIGHT, round(dropSize)); |
456 | 464 | } |
|
0 commit comments