Skip to content

Commit

Permalink
Merge pull request #4232 from IllianiCBT/turnover_prisonerLoyalty
Browse files Browse the repository at this point in the history
Updated Loyalty Handling for Reeducation Camps
  • Loading branch information
IllianiCBT authored Jun 21, 2024
2 parents e641a9e + a10eefa commit 941cff3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Binary file modified MekHQ/docs/Personnel Modules/Turnover & Retention Module.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions MekHQ/src/mekhq/campaign/ResolveScenarioTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,7 @@ public void resolveScenario(ScenarioStatus resolution, String report) {
person.getHyperlinkedName()));
}

// prisoners should generate with lower than average loyalty, so only roll 2d6
person.generateLoyalty(Compute.d6(2));
} else {
continue;
Expand Down
4 changes: 2 additions & 2 deletions MekHQ/src/mekhq/campaign/personnel/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -3800,7 +3800,7 @@ public void fixReferences(final Campaign campaign) {
* @throws IllegalArgumentException if the provided roll is not between 3 and 18
*/
public void generateLoyalty(int roll) {
if (roll == 3) {
if (roll <= 3) {
setLoyalty(3);
} else if (roll == 4) {
setLoyalty(2);
Expand All @@ -3812,7 +3812,7 @@ public void generateLoyalty(int roll) {
setLoyalty(-1);
} else if (roll == 17) {
setLoyalty(-2);
} else if (roll == 18){
} else if (roll >= 18){
setLoyalty(-3);
} else {
throw new IllegalArgumentException("Invalid roll in mekhq/campaign/personnel/Person.java/generateLoyalty: " + roll);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,10 +842,12 @@ private static void processGraduation(Campaign campaign, Person person, Academy
person.setEduHighestEducation(EducationLevel.parseFromInt(educationLevel));
}

if ((academy.isReeducationCamp()) && (campaign.getCampaignOptions().isUseReeducationCamps())) {
if (!Objects.equals(person.getOriginFaction(), campaign.getFaction())) {
if (academy.isReeducationCamp()) {
if (campaign.getCampaignOptions().isUseReeducationCamps()) {
person.setOriginFaction(campaign.getFaction());
}

person.generateLoyalty(Compute.d6(4));
}
}

Expand Down

0 comments on commit 941cff3

Please sign in to comment.