Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion megamek/i18n/megamek/common/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -451,4 +451,6 @@ MovementType.StationKeeping=Station Keeping
MiscType.drones=drones
MiscType.drone=drone
MiscType.theaters=theaters
MiscType.theater=theater
MiscType.theater=theater
MiscType.tons=tons
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we really not have a token for "ton" and "tons?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might. I didn'tcheck because I thought the advantages of keeping this in one place were worth the possibility of duplication.

MiscType.ton=ton
2 changes: 1 addition & 1 deletion megamek/src/megamek/client/ui/swing/UnitEditorDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ private void initEquipPanel() {
|| !m.getType().isHittable() || m.isWeaponGroup()) {
continue;
}
int nCrits = m.getType().getCriticals(entity);
int nCrits = m.getCriticals();
int eqNum = entity.getEquipmentNum(m);
int hits = entity.getDamagedCriticals(CriticalSlot.TYPE_EQUIPMENT,
eqNum, m.getLocation());
Expand Down
4 changes: 4 additions & 0 deletions megamek/src/megamek/common/EquipmentType.java
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ void setTonnage(double tonnage) {
}

public int getCriticals(Entity entity) {
return getCriticals(entity, 1.0);
}

public int getCriticals(Entity entity, double size) {
return criticals;
}

Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/LandAirMech.java
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,7 @@ protected void addBomb(Mounted mounted, int loc) throws LocationFullException {
if (type >= 0) {
slots = BombType.getBombCost(type);
} else {
slots = mounted.getType().getCriticals(this);
slots = mounted.getCriticals();
}
}
for (int i = 0; i < crits[loc].length; i++) {
Expand Down
12 changes: 6 additions & 6 deletions megamek/src/megamek/common/Mech.java
Original file line number Diff line number Diff line change
Expand Up @@ -3013,7 +3013,7 @@ public void addEquipment(Mounted mounted, int loc, boolean rearMounted,

// spreadable or split equipment only gets added to 1 crit at a time,
// since we don't know how many are in this location
int reqSlots = mounted.getType().getCriticals(this);
int reqSlots = mounted.getCriticals();
if (mounted.getType().isSpreadable() || mounted.isSplitable()) {
reqSlots = 1;
}
Expand Down Expand Up @@ -3792,7 +3792,7 @@ && locationHasCase(loc)) {
}

// we subtract per critical slot
toSubtract *= etype.getCriticals(this);
toSubtract *= mounted.getCriticals();
ammoPenalty += toSubtract;
}
if (getJumpType() == JUMP_PROTOTYPE_IMPROVED) {
Expand Down Expand Up @@ -6722,7 +6722,7 @@ public String getMtf() {
sb.append(newLine);
}
for (Mounted mounted : getMisc()) {
if ((mounted.getType().getCriticals(this) == 0)
if ((mounted.getCriticals() == 0)
&& !mounted.getType().hasFlag(MiscType.F_CASE)
&& !EquipmentType.isArmorType(mounted.getType())
&& !EquipmentType.isStructureType(mounted.getType())) {
Expand Down Expand Up @@ -8050,11 +8050,11 @@ public double getArmoredComponentBV() {
&& (mount.getLinkedBy() != null)) {
mountBv += ((MiscType) mount.getLinkedBy().getType()).getBV(
this, mount);
bv += mountBv * 0.05 * (mount.getType().getCriticals(this) + 1);
bv += mountBv * 0.05 * (mount.getCriticals() + 1);
} else if (mountBv > 0) {
bv += mountBv * 0.05 * mount.getType().getCriticals(this);
bv += mountBv * 0.05 * mount.getCriticals();
} else {
bv += 5 * mount.getType().getCriticals(this);
bv += 5 * mount.getCriticals();
}
}

Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/MechView.java
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ private List<ViewElement> getMisc() {
String name = mounted.getName();
if ((((mounted.getLocation() == Entity.LOC_NONE)
// Mechs can have zero-slot equipment in LOC_NONE that needs to be shown.
&& (!isMech || mounted.getType().getCriticals(entity) > 0)))
&& (!isMech || mounted.getCriticals() > 0)))
|| name.contains("Jump Jet")
|| (name.contains("CASE")
&& !name.contains("II")
Expand Down
Loading