Skip to content

Commit b0effc6

Browse files
committed
Merge branch 'master' into mapTabDisplayDelay
# Conflicts: # MekHQ/src/mekhq/gui/InterstellarMapPanel.java
2 parents 34c82ae + f15a8d0 commit b0effc6

File tree

5 files changed

+58
-22
lines changed

5 files changed

+58
-22
lines changed

MekHQ/docs/history.txt

+2
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ MEKHQ VERSION HISTORY:
185185
+ PR #6286: Increased Minimum Skill Requirement For Replacement Limb Procedures to Match RAW
186186
+ PR #6291: Added Handling for When Unit Quality is Manually Set to Empty or null Quality
187187
+ PR #6292: Added Specific Handling for Legacy Prisoner Capture Styles
188+
+ Fix #5977: Updated Label Texts for Clarity in Campaign Options IIC
189+
+ PR #6298: Added Employer Modifiers to Contract Negotiations
188190

189191
0.50.03 (2025-02-02 2030 UTC)
190192
+ PR #5568: Spare parts rules reference adjustment

MekHQ/resources/mekhq/resources/CampaignOptionsDialog.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,10 @@ lblUseTimeInRank.tooltip=Track the amount of time an active person has had their
488488
lblTimeInRankDisplayFormat.text=Display Time in Rank
489489
lblTimeInRankDisplayFormat.tooltip=This is the format used to display the length the person has\
490490
\ spent in their current rank.
491-
lblTrackTotalEarnings.text=Track Total Earnings
491+
lblTrackTotalEarnings.text=Track Total C-Bill Earnings
492492
lblTrackTotalEarnings.tooltip=This tracks the total amount earned by personnel. The tracking is\
493493
\ only done when this option is enabled, and it is not backfilled.
494-
lblTrackTotalXPEarnings.text=Display Total Earnings
494+
lblTrackTotalXPEarnings.text=Track Total XP Earnings
495495
lblTrackTotalXPEarnings.tooltip=This tracks the total amount of experience earned by personnel. The\
496496
\ tracking is only done when this option is enabled, and it is not backfilled.
497497
lblShowOriginFaction.text=Display Origin Faction

MekHQ/src/mekhq/campaign/market/contractMarket/AtbMonthlyContractMarket.java

+51-17
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
import megamek.common.Compute;
3232
import megamek.common.annotations.Nullable;
33-
import megamek.common.enums.SkillLevel;
3433
import megamek.logging.MMLogger;
3534
import mekhq.MekHQ;
3635
import mekhq.campaign.Campaign;
@@ -53,6 +52,10 @@
5352
import static java.lang.Math.floor;
5453
import static megamek.codeUtilities.MathUtility.clamp;
5554
import static megamek.common.Compute.d6;
55+
import static megamek.common.enums.SkillLevel.ELITE;
56+
import static megamek.common.enums.SkillLevel.GREEN;
57+
import static megamek.common.enums.SkillLevel.REGULAR;
58+
import static megamek.common.enums.SkillLevel.VETERAN;
5659
import static mekhq.campaign.mission.AtBContract.getEffectiveNumUnits;
5760
import static mekhq.campaign.randomEvents.GrayMonday.isGrayMonday;
5861

@@ -331,7 +334,7 @@ private void checkForSubcontracts(Campaign campaign, AtBContract contract, int u
331334
setEnemyRating(contract, campaign.getGameYear());
332335

333336
if (contract.getContractType().isCadreDuty()) {
334-
contract.setAllySkill(SkillLevel.GREEN);
337+
contract.setAllySkill(GREEN);
335338
contract.setAllyQuality(IUnitRating.DRAGOON_F);
336339
}
337340

@@ -415,7 +418,7 @@ protected AtBContract generateAtBSubcontract(Campaign campaign,
415418
setEnemyRating(contract, campaign.getGameYear());
416419

417420
if (contract.getContractType().isCadreDuty()) {
418-
contract.setAllySkill(SkillLevel.GREEN);
421+
contract.setAllySkill(GREEN);
419422
contract.setAllyQuality(IUnitRating.DRAGOON_F);
420423
}
421424
contract.calculateLength(campaign.getCampaignOptions().isVariableContractLength());
@@ -700,26 +703,29 @@ private void setContractClauses(AtBContract contract, int unitRatingMod, Campaig
700703
mods.mods[i] += missionMods[contract.getContractType().ordinal()][i];
701704
}
702705

703-
if (Factions.getInstance().getFaction(contract.getEmployerCode()).isISMajorOrSuperPower()) {
704-
mods.mods[CLAUSE_SALVAGE] += -1;
706+
Faction employerFaction = contract.getEmployerFaction();
707+
708+
if (employerFaction.isISMajorOrSuperPower()) {
709+
mods.mods[CLAUSE_SALVAGE] -= 1;
705710
mods.mods[CLAUSE_TRANSPORT] += 1;
706-
}
707-
if (AtBContract.isMinorPower(contract.getEmployerCode())) {
708-
mods.mods[CLAUSE_SALVAGE] += -2;
709-
}
710-
if (contract.getEmployerFaction().isMercenary()) {
711-
mods.mods[CLAUSE_COMMAND] += -1;
711+
} else if (employerFaction.isMinorPower()) {
712+
mods.mods[CLAUSE_SALVAGE] -= 2;
713+
} else if (employerFaction.isMercenary()) {
714+
mods.mods[CLAUSE_COMMAND] -= 1;
712715
mods.mods[CLAUSE_SALVAGE] += 2;
713716
mods.mods[CLAUSE_SUPPORT] += 1;
714717
mods.mods[CLAUSE_TRANSPORT] += 1;
715-
}
716-
if (contract.getEmployerCode().equals("IND")) {
717-
mods.mods[CLAUSE_COMMAND] += 0;
718-
mods.mods[CLAUSE_SALVAGE] += -1;
719-
mods.mods[CLAUSE_SUPPORT] += -1;
720-
mods.mods[CLAUSE_TRANSPORT] += 0;
718+
} else if (employerFaction.getShortName().equals("IND")) {
719+
mods.mods[CLAUSE_SALVAGE] -= 1;
720+
mods.mods[CLAUSE_SUPPORT] -= 1;
721721
}
722722

723+
int modifier = getEmployerNegotiatorModifier(employerFaction);
724+
mods.mods[CLAUSE_COMMAND] -= modifier;
725+
mods.mods[CLAUSE_SALVAGE] -= modifier;
726+
mods.mods[CLAUSE_SUPPORT] -= modifier;
727+
mods.mods[CLAUSE_TRANSPORT] -= modifier;
728+
723729
if (campaign.getFaction().isMercenary()) {
724730
rollCommandClause(contract, mods.mods[CLAUSE_COMMAND]);
725731
} else {
@@ -730,4 +736,32 @@ private void setContractClauses(AtBContract contract, int unitRatingMod, Campaig
730736
rollSupportClause(contract, mods.mods[CLAUSE_SUPPORT]);
731737
rollTransportClause(contract, mods.mods[CLAUSE_TRANSPORT]);
732738
}
739+
740+
/**
741+
* Calculates the negotiation modifier for a contract based on the employer's faction type.
742+
* The modifier reflects the negotiation capabilities of the employer, making it harder to
743+
* achieve favorable results with more influential or powerful employers.
744+
*
745+
* <p>The negotiation modifier is determined as follows:
746+
* <ul>
747+
* <li>Default: A "Green" modifier is used for most employers.</li>
748+
* <li>Major or superpower faction: A "Regular" modifier is applied.</li>
749+
* <li>Clan faction: A "Veteran" modifier is applied.</li>
750+
* <li>ComStar or Word of Blake (WoB): An "Elite" modifier is applied.</li>
751+
* </ul>
752+
*
753+
* @param employerFaction The {@link Faction} that is performing the negotiation.
754+
* @return An integer representing the negotiation modifier corresponding to the employer's capabilities.
755+
*/
756+
private static int getEmployerNegotiatorModifier(Faction employerFaction) {
757+
if (employerFaction.isMajorOrSuperPower()) {
758+
return REGULAR.getExperienceLevel();
759+
} else if (employerFaction.isClan()) {
760+
return VETERAN.getExperienceLevel();
761+
} else if (employerFaction.isComStarOrWoB()) {
762+
return ELITE.getExperienceLevel();
763+
}
764+
765+
return GREEN.getExperienceLevel();
766+
}
733767
}

MekHQ/src/mekhq/gui/InterstellarMapPanel.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public InterstellarMapPanel(Campaign c, CampaignGUI view) {
122122
systems = campaign.getSystems();
123123
hqview = view;
124124
jumpPath = new JumpPath();
125-
optionPanelHidden = true;
125+
optionPanelHidden = false;
126126
optionPanelTimer = new Timer(0, new ActionListener() {
127127
Point viewPoint = new Point();
128128

MekHQ/src/mekhq/gui/stratcon/CampaignManagementDialog.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public void display(Campaign campaign, StratconCampaignState campaignState,
7171
StratconTrackState currentTrack, boolean gmMode) {
7272
currentCampaignState = campaignState;
7373

74-
btnRemoveCVP.setEnabled(currentCampaignState.getVictoryPoints() > 0);
75-
btnGMRemoveSP.setEnabled(currentCampaignState.getSupportPoints() > 0);
74+
btnRemoveCVP.setEnabled(gmMode);
75+
btnGMRemoveSP.setEnabled(gmMode);
7676
btnGMAddVP.setEnabled(gmMode);
7777
btnGMAddSP.setEnabled(gmMode);
7878

0 commit comments

Comments
 (0)