Skip to content

Commit 7555b9a

Browse files
authored
Merge pull request #7878 from IllianiBird/cadreRole
Improvement: Added 'Cadre' Combat Role to Distinguish Between Forces Assigned to Train Allied Forces & Those Assigned to Train Player Forces
2 parents 15c0124 + c417521 commit 7555b9a

File tree

22 files changed

+100
-42
lines changed

22 files changed

+100
-42
lines changed

MekHQ/resources/mekhq/resources/CampaignGUI.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,6 @@ dialogCheckDueScenarios.title=Scenarios Must Be Completed
314314
dialogCheckDueScenarios.text=You must complete scenarios with a date of today or earlier before advancing the day.
315315
dialogScenarioAcceptance.outOfCharacter=<b>Reactor online, sensors online, weapons online. All systems nominal.</b>
316316
dialogScenarioAcceptance.button.accept=Commence Drop
317-
dialogScenarioAcceptance.button.cancel=Return to the Launch Bay
317+
dialogScenarioAcceptance.button.accept=Commence Drop
318+
cadreReassignment.text=One or more forces were assigned to Cadre duties. With the contract now concluded, they have \
319+
been reassigned to Frontline.

MekHQ/resources/mekhq/resources/GlossaryEntry.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ COMBAT_ROLES.definition=Combat Roles are used in <a href='GLOSSARY:STRATCON'>Str
198198
\ these rules) Furthermore, when a force deploys to the AO, There''s a chance they will be immediately pulled into \
199199
a hidden scenario. When a Patrol deploys, any hidden scenarios will always be one hex away unless the force is \
200200
deploying ''blind'' (deploying to an unscouted hex).\
201+
<br>- <b>Cadre:</b> Training forces represent your personnel being assigned to train local forces. Outside of Cadre \
202+
Duty contracts this is a roleplay only role. Cadre Duty contracts will require some of your forces to be assigned \
203+
to this role, limiting your combat options.\
201204
<br>- <b>Auxiliary:</b> Forces assigned to this role are those you intend to pull into scenarios piecemeal. While\
202205
\ Auxiliary forces may be used to reinforce, they are best used to house Conventional Infantry for tactics deployment.\
203206
\ Or units specialized in being brought into a scenario as <a href='GLOSSARY:LEADERSHIP_UNITS'>Leadership Units</a>.\

MekHQ/resources/mekhq/resources/Mission.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ CombatRole.TRAINING.toolTipText=The commander of this force is training their su
8282
\ see the supporting documentation.
8383
CombatRole.AUXILIARY.text=Auxiliary
8484
CombatRole.AUXILIARY.toolTipText=This force rolls twice when reinforcing, using the best roll. It\
85-
\ cannot be directly assigned to scenarios, nor will it be automatically assigned to scenarios\
86-
\ during an Integrated contract.
85+
\ cannot be directly assigned to scenarios.
8786
CombatRole.RESERVE.text=Reserve
88-
CombatRole.RESERVE.toolTipText=This force cannot be directly assigned to scenarios, nor will it be\
89-
\ automatically assigned to scenarios during an Integrated contract.
87+
CombatRole.RESERVE.toolTipText=This force cannot be directly assigned to scenarios.
88+
CombatRole.CADRE.text=Cadre
89+
CombatRole.CADRE.toolTipText=This force is being used to train local forces. This has no mechanical effects.
9090
# AtBMoraleLevel Enum
9191
AtBMoraleLevel.ROUTED.text=Routed
9292
AtBMoraleLevel.ROUTED.toolTipText=The enemy is in full retreat, suffering devastating losses and scattered. They pose no\

MekHQ/src/mekhq/campaign/Campaign.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4803,8 +4803,10 @@ public int getDeploymentDeficit(AtBContract contract) {
48034803

48044804
if (!combatRole.isReserve() && !combatRole.isAuxiliary()) {
48054805
if ((combatTeam.getMissionId() == contract.getId())) {
4806-
if (!combatRole.isTraining() || contract.getContractType().isCadreDuty()) {
4807-
total += combatTeam.getSize(this);
4806+
if (!combatRole.isTraining()) {
4807+
if (!combatRole.isCadre() || contract.getContractType().isCadreDuty()) {
4808+
total += combatTeam.getSize(this);
4809+
}
48084810
}
48094811
}
48104812

MekHQ/src/mekhq/campaign/campaignOptions/CampaignOptions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,7 @@ public CampaignOptions() {
13021302
atbBattleChance[CombatRole.FRONTLINE.ordinal()] = 20;
13031303
atbBattleChance[CombatRole.PATROL.ordinal()] = 60;
13041304
atbBattleChance[CombatRole.TRAINING.ordinal()] = 10;
1305+
atbBattleChance[CombatRole.CADRE.ordinal()] = 10;
13051306
generateChases = true;
13061307

13071308
// Scenarios

MekHQ/src/mekhq/campaign/force/CombatTeam.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ public AtBScenario checkForBattle(Campaign campaign) {
647647
getBattleDate(campaign.getLocalDate()));
648648
}
649649
}
650-
case TRAINING: {
650+
case TRAINING, CADRE: {
651651
roll = Compute.randomInt(10) + battleTypeMod;
652652
if (roll < 1) {
653653
return AtBScenarioFactory.createScenario(campaign,

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@ private static void checkForEmployerOverride(LocalDate today, AtBContract contra
477477
contract.calculateLength(campaign.getCampaignOptions().isVariableContractLength());
478478
setContractClauses(contract, unitRatingMod, campaign);
479479

480-
contract.setRequiredCombatTeams(ContractUtilities.calculateBaseNumberOfRequiredLances(campaign));
480+
contract.setRequiredCombatTeams(ContractUtilities.calculateBaseNumberOfRequiredLances(campaign,
481+
contract.getContractType().isCadreDuty()));
481482
contract.setRequiredCombatElements(calculateRequiredCombatElements(campaign, contract, false));
482483
contract.setMultiplier(calculatePaymentMultiplier(campaign, contract));
483484

@@ -576,7 +577,8 @@ protected AtBContract generateAtBSubcontract(Campaign campaign, AtBContract pare
576577
}
577578
contract.setTransportComp(100);
578579

579-
contract.setRequiredCombatTeams(ContractUtilities.calculateBaseNumberOfRequiredLances(campaign));
580+
contract.setRequiredCombatTeams(ContractUtilities.calculateBaseNumberOfRequiredLances(campaign,
581+
contract.getContractType().isCadreDuty()));
580582
contract.setRequiredCombatElements(calculateRequiredCombatElements(campaign, contract, false));
581583
contract.setMultiplier(calculatePaymentMultiplier(campaign, contract));
582584
contract.setPartsAvailabilityLevel(contract.getContractType().calculatePartsAvailabilityLevel());
@@ -649,7 +651,8 @@ private void addFollowup(Campaign campaign, AtBContract contract) {
649651
followup.setAllyQuality(contract.getAllyQuality());
650652
followup.calculateLength(campaign.getCampaignOptions().isVariableContractLength());
651653
setContractClauses(followup, campaign.getAtBUnitRatingMod(), campaign);
652-
followup.setRequiredCombatTeams(ContractUtilities.calculateBaseNumberOfRequiredLances(campaign));
654+
followup.setRequiredCombatTeams(ContractUtilities.calculateBaseNumberOfRequiredLances(campaign,
655+
contract.getContractType().isCadreDuty()));
653656
contract.setRequiredCombatElements(calculateRequiredCombatElements(campaign, contract, false));
654657
followup.setMultiplier(calculatePaymentMultiplier(campaign, followup));
655658
followup.setPartsAvailabilityLevel(followup.getContractType().calculatePartsAvailabilityLevel());

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ private Optional<AtBContract> generateContract(Campaign campaign, ReputationCont
281281
// Step 6: Determine the initial contract clauses
282282
setContractClauses(contract, contractTerms);
283283
// Step 7: Determine the number of required lances (Not CamOps RAW)
284-
contract.setRequiredCombatTeams(ContractUtilities.calculateBaseNumberOfRequiredLances(campaign));
284+
contract.setRequiredCombatTeams(ContractUtilities.calculateBaseNumberOfRequiredLances(campaign,
285+
contract.getContractType().isCadreDuty()));
285286
contract.setRequiredCombatElements(calculateRequiredCombatElements(campaign, contract, false));
286287
// Step 8: Calculate the payment
287288
contract.setMultiplier(calculatePaymentMultiplier(campaign, contract));

MekHQ/src/mekhq/campaign/mission/AtBContract.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,13 @@ public void calculateLength(final boolean variable) {
365365
*
366366
* @return The number of lances required.
367367
*
368-
* @deprecated use {@link ContractUtilities#calculateBaseNumberOfRequiredLances(Campaign)}
368+
* @deprecated use {@link ContractUtilities#calculateBaseNumberOfRequiredLances(Campaign, boolean)}
369369
* <p>
370370
* Calculates the number of lances required for this contract, based on [campaign].
371371
*/
372372
@Deprecated(since = "0.50.07", forRemoval = true)
373373
public static int calculateBaseNumberOfRequiredLances(Campaign campaign) {
374-
return ContractUtilities.calculateBaseNumberOfRequiredLances(campaign);
374+
return ContractUtilities.calculateBaseNumberOfRequiredLances(campaign, false);
375375
}
376376

377377
/**
@@ -1566,7 +1566,8 @@ public AtBContract(Contract contract, Campaign campaign) {
15661566
enemyCode = "REB";
15671567
}
15681568

1569-
setRequiredCombatTeams(ContractUtilities.calculateBaseNumberOfRequiredLances(campaign));
1569+
setRequiredCombatTeams(ContractUtilities.calculateBaseNumberOfRequiredLances(campaign,
1570+
contractType.isCadreDuty()));
15701571
setRequiredCombatElements(ContractUtilities.calculateBaseNumberOfUnitsRequiredInCombatTeams(campaign));
15711572

15721573
setPartsAvailabilityLevel(getContractType().calculatePartsAvailabilityLevel());

MekHQ/src/mekhq/campaign/mission/AtBScenario.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ public void setForces(Campaign campaign) {
734734
private void setStandardScenarioForces(Campaign campaign) {
735735
/* Find the number of attached units required by the command rights clause */
736736
int attachedUnitWeight = EntityWeightClass.WEIGHT_MEDIUM;
737-
if (combatRole.isPatrol() || combatRole.isTraining()) {
737+
if (combatRole.isPatrol() || combatRole.isTraining() || combatRole.isCadre()) {
738738
attachedUnitWeight = EntityWeightClass.WEIGHT_LIGHT;
739739
}
740740
int numAttachedPlayer = 0;

0 commit comments

Comments
 (0)