Skip to content

Commit

Permalink
Merge pull request #1652 from pavelbraginskiy/fix-1651
Browse files Browse the repository at this point in the history
Fix claw modifier in RS
  • Loading branch information
SJuliez authored Nov 5, 2024
2 parents 0fcf925 + 51bc6fe commit 7d4e904
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package megameklab.printing.reference;

import megamek.logging.MMLogger;
import org.apache.batik.util.SVGConstants;

import megamek.common.Entity;
Expand All @@ -31,6 +32,8 @@
*/
public class PhysicalAttacks extends ReferenceTable {

private static final MMLogger logger = MMLogger.create(PhysicalAttacks.class);

public PhysicalAttacks(PrintMek sheet) {
super(sheet, 0.05, 0.5, 0.8);
setHeaders(bundle.getString("attack"), bundle.getString("toHit"), bundle.getString("damage"));
Expand Down Expand Up @@ -120,10 +123,17 @@ private void addPunchAttack(String name, int actuators, int baseDamage, boolean

private void addPhysicalWeapon(Entity entity) {
for (Mounted<?> mounted : entity.getMisc()) {
if (mounted.getType().hasFlag(MiscType.F_CLUB) || mounted.getType().hasFlag(MiscType.F_HAND_WEAPON)) {
if (mounted.getType().hasFlag(MiscType.F_CLUB)) {
addRow(mounted.getName(),
String.format("%+d", ClubAttackAction.getHitModFor((MiscType) mounted.getType())),
StringUtils.getEquipmentInfo(entity, mounted));
} else if (mounted.getType().hasFlag(MiscType.F_HAND_WEAPON)) {
if (mounted.getType().hasSubType(MiscType.S_CLAW)) {
addRow(mounted.getName(), "+1", StringUtils.getEquipmentInfo(entity, mounted));
} else {
logger.error("Unknown hand weapon %s!".formatted(mounted.getName()));
addRow(mounted.getName(), "???", StringUtils.getEquipmentInfo(entity, mounted));
}
}
}
}
Expand Down

0 comments on commit 7d4e904

Please sign in to comment.