Skip to content

Commit fbe0a71

Browse files
authored
Merge pull request #6161 from psikomonkie/adjust-pa-to-use-delivery-scale
Adjusted Planetary Acquisitions to use the campaign option for Delivery Scale to make deliveries optionally slower
2 parents 5b065f4 + 12aad13 commit fbe0a71

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

MekHQ/src/mekhq/campaign/Campaign.java

+13-4
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@
163163
import static mekhq.campaign.personnel.education.EducationController.getAcademy;
164164
import static mekhq.campaign.personnel.education.TrainingCombatTeams.processTrainingCombatTeams;
165165
import static mekhq.campaign.personnel.turnoverAndRetention.RetirementDefectionTracker.Payout.isBreakingContract;
166-
import static mekhq.campaign.randomEvents.GrayMonday.EVENT_DATE_CLARION_NOTE;
167-
import static mekhq.campaign.randomEvents.GrayMonday.EVENT_DATE_GRAY_MONDAY;
168-
import static mekhq.campaign.randomEvents.GrayMonday.isGrayMonday;
166+
import static mekhq.campaign.randomEvents.GrayMonday.*;
169167
import static mekhq.campaign.randomEvents.prisoners.PrisonerEventManager.DEFAULT_TEMPORARY_CAPACITY;
170168
import static mekhq.campaign.randomEvents.prisoners.enums.PrisonerStatus.BONDSMAN;
171169
import static mekhq.campaign.stratcon.SupportPointNegotiation.negotiateAdditionalSupportPoints;
@@ -8027,7 +8025,15 @@ public int calculatePartTransitTime(PlanetarySystem system) {
80278025
// if you are delivering from the same planet then no transit times
80288026
int currentTransitTime = (distance > 0) ? (int) Math.ceil(getCurrentSystem().getTimeToJumpPoint(1.0)) : 0;
80298027
int originTransitTime = (distance > 0) ? (int) Math.ceil(system.getTimeToJumpPoint(1.0)) : 0;
8030-
int amazonFreeShipping = d6(1 + jumps);
8028+
8029+
// CO 51 (latest) has much longer average part times. Let's adjust amazonFreeShipping
8030+
// based on what getUnitTransitTime is set in the options in an attempt to get some
8031+
// delivery times more in line with RAW's one-month minimum. Default is TRANSIT_UNIT_MONTH
8032+
int amazonFreeShipping = switch (campaignOptions.getUnitTransitTime()) {
8033+
case TRANSIT_UNIT_MONTH -> 7 + (d6(7 * (1 + jumps)));
8034+
case TRANSIT_UNIT_WEEK -> 2 + (d6(2 * (1 + jumps)));
8035+
default -> d6(1 + jumps);
8036+
};
80318037
return (recharges * 7) + currentTransitTime + originTransitTime + amazonFreeShipping;
80328038
}
80338039

@@ -8050,6 +8056,9 @@ public int calculatePartTransitTime(PlanetarySystem system) {
80508056
* calculated transit time.
80518057
*/
80528058
public int calculatePartTransitTime(int availability) {
8059+
// This is accurate as of the latest rules. It was
8060+
// (BASE_MODIFIER - (roll + availability) / 4 months
8061+
// in the older version.
80538062
final int BASE_MODIFIER = 7; // CamOps p51
80548063
final int roll = d6(1);
80558064
final int total = max(1, (BASE_MODIFIER + roll + availability) / 4); // CamOps p51

0 commit comments

Comments
 (0)