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

Indicate commercial armor on mech record sheet #673

Merged
merged 1 commit into from
Jul 9, 2020
Merged
Changes from all commits
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
12 changes: 8 additions & 4 deletions src/megameklab/com/printing/PrintEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public abstract class PrintEntity extends PrintRecordSheet {
| (1 << EquipmentType.T_ARMOR_ANTI_PENETRATIVE_ABLATION)
| (1 << EquipmentType.T_ARMOR_HEAT_DISSIPATING)
| (1 << EquipmentType.T_ARMOR_IMPACT_RESISTANT)
| (1 << EquipmentType.T_ARMOR_BALLISTIC_REINFORCED);
| (1 << EquipmentType.T_ARMOR_BALLISTIC_REINFORCED)
| (1 << EquipmentType.T_ARMOR_COMMERCIAL);

/**
* Creates an SVG object for the record sheet
Expand Down Expand Up @@ -298,14 +299,17 @@ protected void hideUnusedCrewElements() {

protected void drawArmor() {
if (getEntity().isSupportVehicle()
&& (getEntity().hasBARArmor(getEntity().firstArmorIndex()))) {
&& (getEntity().hasBARArmor(firstArmorLocation()))) {
setTextField(ARMOR_TYPE, "BAR: " + getEntity().getBARRating(firstArmorLocation()));
} else if (!getEntity().hasPatchworkArmor()) {
if ((AT_SPECIAL & (1 << getEntity().getArmorType(1))) != 0) {
String[] atName = EquipmentType.getArmorTypeName(getEntity().getArmorType(1)).split("-");
final int at = getEntity().getArmorType(firstArmorLocation());
if ((AT_SPECIAL & (1 << at)) != 0) {
String[] atName = EquipmentType.getArmorTypeName(at).split("-");
setTextField(ARMOR_TYPE, atName[0]);
if (atName.length > 1) {
setTextField(ARMOR_TYPE_2, atName[1]);
} else if (getEntity().hasBARArmor(firstArmorLocation())) {
setTextField(ARMOR_TYPE_2, "BAR: " + getEntity().getBARRating(firstArmorLocation()));
}
} else {
hideElement(ARMOR_TYPE, true);
Expand Down