Skip to content

Commit

Permalink
Merge pull request #1367 from MegaMek/rs_ba_bays
Browse files Browse the repository at this point in the history
Show BA Bay capacity on record sheet by troopers rather than squads.
  • Loading branch information
SJuliez authored Jan 3, 2024
2 parents e00940f + 7eff16d commit 79c8774
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion megameklab/src/megameklab/printing/InventoryWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,18 @@ public double printBayInfo(float fontSize, double lineHeight, double currY) {
for (int i = 0; i < bays.size(); i++) {
Bay b = bays.get(i);
bayTypeString.append(b.getType());
bayCapacityString.append(NumberFormat.getInstance().format(b.getCapacity()));
// BA bays are shown per suit rather than squad
double capacity = b.getCapacity();
if (b instanceof BattleArmorBay) {
if (((BattleArmorBay) b).isClan()) {
capacity *= 5;
} else if (((BattleArmorBay) b).isComStar()) {
capacity *= 6;
} else {
capacity *= 4;
}
}
bayCapacityString.append(NumberFormat.getInstance().format(capacity));
if ((i + 1) < bays.size()) {
bayTypeString.append("/");
bayCapacityString.append("/");
Expand Down

0 comments on commit 79c8774

Please sign in to comment.