Skip to content

Commit

Permalink
Merge pull request #4365 from IllianiCBT/education_monthlyXpBug
Browse files Browse the repository at this point in the history
Reworked Monthly XP in Education Module
  • Loading branch information
IllianiCBT authored Jul 12, 2024
2 parents db1b2e5 + 12d1683 commit 7b56bb9
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 195 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,9 @@ chkEnableLocalAcademies.toolTip=Allows personnel to enroll in local, planet-side
chkEnablePrestigiousAcademies.text=Enable Prestigious Academies
chkEnablePrestigiousAcademies.toolTip=Allows personnel to enroll in named, canonical, academies.

xpAndSkillBonuses.title=Random XP and Skill Bonuses
chkEnableRandomXp.text=Random Monthly XP
chkEnableRandomXp.toolTip=Enables the per-month chance for students to gain additional xp (based on Faculty Skill).
lblRandomXpRate.text=Random XP Rate
lblRandomXpRate.toolTip=The amount of random xp gained per success.
xpAndSkillBonuses.title=Faculty XP and Skill Bonuses
lblFacultyXPMultiplier.text=Faculty XP Multiplier
lblFacultyXPMultiplier.toolTip=This value multiplies the number of XP gained when completing (or partially completing) a qualification. Setting this to 0 disabled faculty XP.
chkEnableBonuses.text=Graduation Bonuses
chkEnableBonuses.toolTip=Enables the chance of gaining a permanent skill bonus when graduating.

Expand Down
2 changes: 1 addition & 1 deletion MekHQ/resources/mekhq/resources/Education.properties
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ eventTrainingAccidentKilled.text=has suffered a serious training accident. Sadly
dropOut.text=has dropped out of their education or training. Tomorrow they will begin their journey back to the unit.
dropOutRejected.text=wanted to drop out of their education or training, but was convinced to stick it out.
graduatedFailed.text=has failed to graduate. Tomorrow they will begin their journey back to the unit.
graduatedBarely.text=has barely graduated. Tomorrow they will begin their journey back to the unit.
graduatedBarely.text=has barely graduated from %s. Tomorrow they will begin their journey back to the unit.
graduatedClassNeeded.text=still needs to complete one or more classes, and is unable to graduate. %s days have been added to their education.
graduated.text=has attended their graduation ceremony%s. Tomorrow they will begin their journey back to the unit.
graduatedHonors.text=has attended their graduation ceremony%s. They have graduated with honors. Tomorrow they will begin their journey back to the unit.
Expand Down
31 changes: 9 additions & 22 deletions MekHQ/src/mekhq/campaign/CampaignOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@ public static String getTransitUnitName(final int unit) {
private boolean enablePrestigiousAcademies;
private boolean enableOverrideRequirements;
private boolean enableShowIneligibleAcademies;
private boolean enableRandomXp;
private Integer randomXpRate;
private Double facultyXpRate;
private boolean enableBonuses;
private Integer adultDropoutChance;
private Integer childrenDropoutChance;
Expand Down Expand Up @@ -888,8 +887,7 @@ public CampaignOptions() {
setEnablePrestigiousAcademies(true);
setEnableOverrideRequirements(false);
setEnableShowIneligibleAcademies(true);
setEnableRandomXp(true);
setRandomXpRate(1);
setFacultyXpRate(1.00);
setEnableBonuses(true);
setAdultDropoutChance(1000);
setChildrenDropoutChance(10000);
Expand Down Expand Up @@ -2730,20 +2728,12 @@ public void setEnableShowIneligibleAcademies(boolean enableShowIneligibleAcademi
this.enableShowIneligibleAcademies = enableShowIneligibleAcademies;
}

public boolean isEnableRandomXp() {
return enableRandomXp;
public Double getFacultyXpRate() {
return facultyXpRate;
}

public void setEnableRandomXp(boolean enableRandomXp) {
this.enableRandomXp = enableRandomXp;
}

public Integer getRandomXpRate() {
return randomXpRate;
}

public void setRandomXpRate(Integer randomXpRate) {
this.randomXpRate = randomXpRate;
public void setFacultyXpRate(Double facultyXpRate) {
this.facultyXpRate = facultyXpRate;
}

public boolean isEnableBonuses() {
Expand Down Expand Up @@ -4696,8 +4686,7 @@ public void writeToXml(final PrintWriter pw, int indent) {
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "enablePrestigiousAcademies", isEnablePrestigiousAcademies());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "enableOverrideRequirements", isEnableOverrideRequirements());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "enableShowIneligibleAcademies", isEnableShowIneligibleAcademies());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "enableRandomXp", isEnableRandomXp());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "randomXpRate", getRandomXpRate());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "facultyXpRate", getFacultyXpRate());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "enableBonuses", isEnableBonuses());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "adultDropoutChance", getAdultDropoutChance());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "childrenDropoutChance", getChildrenDropoutChance());
Expand Down Expand Up @@ -5449,10 +5438,8 @@ public static CampaignOptions generateCampaignOptionsFromXml(Node wn, Version ve
retVal.setEnableOverrideRequirements(Boolean.parseBoolean(wn2.getTextContent().trim()));
} else if (wn2.getNodeName().equalsIgnoreCase("enableShowIneligibleAcademies")) {
retVal.setEnableShowIneligibleAcademies(Boolean.parseBoolean(wn2.getTextContent().trim()));
} else if (wn2.getNodeName().equalsIgnoreCase("enableRandomXp")) {
retVal.setEnableRandomXp(Boolean.parseBoolean(wn2.getTextContent().trim()));
} else if (wn2.getNodeName().equalsIgnoreCase("randomXpRate")) {
retVal.setRandomXpRate(Integer.parseInt(wn2.getTextContent().trim()));
} else if (wn2.getNodeName().equalsIgnoreCase("facultyXpRate")) {
retVal.setFacultyXpRate(Double.parseDouble(wn2.getTextContent().trim()));
} else if (wn2.getNodeName().equalsIgnoreCase("enableBonuses")) {
retVal.setEnableBonuses(Boolean.parseBoolean(wn2.getTextContent().trim()));
} else if (wn2.getNodeName().equalsIgnoreCase("adultDropoutChance")) {
Expand Down
Loading

0 comments on commit 7b56bb9

Please sign in to comment.