Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Loyalty Handling for Reeducation Camps #4232

Merged
merged 3 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
* @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 @@
setLoyalty(-1);
} else if (roll == 17) {
setLoyalty(-2);
} else if (roll == 18){
} else if (roll >= 18){
Dismissed Show dismissed Hide dismissed
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 @@ -816,10 +816,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
Loading