Skip to content

Commit 556b8ce

Browse files
committed
feat: Updated campaign properties and simplified status change logic
- Modified Campaign.properties text from "departed with their parent" to "departed with a parent" - Simplified status change logic in Campaign.java - Replaced d6 roll method with randomInt(20) function - Added DEFECTED status for personnel on active contracts and RESIGNED for others.
1 parent e4380f6 commit 556b8ce

File tree

2 files changed

+9
-22
lines changed

2 files changed

+9
-22
lines changed

MekHQ/resources/mekhq/resources/Campaign.properties

+1-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ LayeredForceIconLayer.LOGO.text=Logos
3939
LayeredForceIconLayer.LOGO.toolTipText=This tab contains canon faction logos that can be added to the center of a force icon.
4040

4141
#### Turnover and Retention
42-
turnoverBurnedOut.text=burnt out.
43-
turnoverPoached.text=was poached by another force.
4442
turnoverJointDeparture.text=departed with their spouse.
45-
turnoverJointDepartureChild.text=departed with their parent.
43+
turnoverJointDepartureChild.text=departed with a parent.
4644

4745
turnoverEmployeeTurnoverDialog.text=Employee Turnover
4846
turnoverPayoutDialog.text=Show Payout Dialog

MekHQ/src/mekhq/campaign/Campaign.java

+8-19
Original file line numberDiff line numberDiff line change
@@ -692,25 +692,14 @@ public boolean applyRetirement(Money totalPayout, Map<UUID, UUID> unitAssignment
692692

693693
if (!person.getStatus().isDead()) {
694694
if (isBreakingContract(person, getLocalDate(), getCampaignOptions().getServiceContractDuration())) {
695-
int roll = Compute.d6(1);
696-
697-
switch (roll) {
698-
case 1:
699-
getPerson(pid).changeStatus(this, getLocalDate(), PersonnelStatus.RESIGNED);
700-
break;
701-
case 2:
702-
case 3:
703-
addReport(getPerson(pid).getHyperlinkedFullTitle() + ' ' + resources.getString("turnoverPoached.text"));
704-
getPerson(pid).changeStatus(this, getLocalDate(), PersonnelStatus.RESIGNED);
705-
break;
706-
case 4:
707-
case 5:
708-
case 6:
709-
addReport(getPerson(pid).getHyperlinkedFullTitle() + ' ' + resources.getString("turnoverBurnedOut.text"));
710-
getPerson(pid).changeStatus(this, getLocalDate(), PersonnelStatus.RESIGNED);
711-
break;
712-
default:
713-
throw new IllegalStateException("Unexpected value in applyRetirement: " + roll);
695+
if (!getActiveContracts().isEmpty()) {
696+
int roll = Compute.randomInt(20);
697+
698+
if (roll == 0) {
699+
getPerson(pid).changeStatus(this, getLocalDate(), PersonnelStatus.DEFECTED);
700+
}
701+
} else {
702+
getPerson(pid).changeStatus(this, getLocalDate(), PersonnelStatus.RESIGNED);
714703
}
715704
} else if (person.getAge(getLocalDate()) >= 50) {
716705
getPerson(pid).changeStatus(this, getLocalDate(), PersonnelStatus.RETIRED);

0 commit comments

Comments
 (0)