Skip to content

Commit

Permalink
added initBonus to XML read and write
Browse files Browse the repository at this point in the history
  • Loading branch information
DM0000 committed Nov 28, 2024
1 parent 7127244 commit 84e5f32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions MekHQ/src/mekhq/campaign/Campaign.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public Campaign() {
crimeRating = 0;
crimePirateModifier = 0;
dateOfLastCrime = null;
initiativeBonus = 10;
initiativeBonus = 0;
setRankSystemDirect(Ranks.getRankSystemFromCode(Ranks.DEFAULT_SYSTEM_CODE));
forces = new Force(name);
forceIds.put(0, forces);
Expand Down Expand Up @@ -4468,7 +4468,6 @@ private void processReputationChanges() {
}

public int getInitiativeBonus(){
System.out.println("reached here"+ initiativeBonus);
return initiativeBonus;
}
public void setInitiativeBonus(int bonus){
Expand Down Expand Up @@ -5507,7 +5506,7 @@ public void writeToXML(final PrintWriter pw) {
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "lastMissionId", lastMissionId);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "lastScenarioId", lastScenarioId);
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "calendar", getLocalDate());

MHQXMLUtility.writeSimpleXMLTag(pw, indent, "InitiativeBonus", initiativeBonus);
MHQXMLUtility.writeSimpleXMLOpenTag(pw, indent++, "nameGen");
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "faction", RandomNameGenerator.getInstance().getChosenFaction());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "percentFemale", RandomGenderGenerator.getPercentFemale());
Expand Down
2 changes: 2 additions & 0 deletions MekHQ/src/mekhq/campaign/io/CampaignXmlParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,8 @@ private static void processInfoNode(Campaign retVal, Node wni, Version version)
retVal.setRetainerStartDate(LocalDate.parse(wn.getTextContent()));
} else if (xn.equalsIgnoreCase("crimeRating")) {
retVal.setCrimeRating(Integer.parseInt(wn.getTextContent()));
} else if (xn.equalsIgnoreCase("initiativeBonus")) {
retVal.setInitiativeBonus(Integer.parseInt(wn.getTextContent()));
} else if (xn.equalsIgnoreCase("crimePirateModifier")) {
retVal.setCrimePirateModifier(Integer.parseInt(wn.getTextContent()));
} else if (xn.equalsIgnoreCase("dateOfLastCrime")) {
Expand Down

0 comments on commit 84e5f32

Please sign in to comment.