From cdfd28decb3475776a8beb005cb9cd688ce4bbba Mon Sep 17 00:00:00 2001 From: DM0000 <98051919+DM0000@users.noreply.github.com> Date: Sun, 3 Nov 2024 12:48:22 -0700 Subject: [PATCH 1/2] Seperated physical modifiers from base and no show then in toHit --- megamek/src/megamek/common/actions/ClubAttackAction.java | 2 +- megamek/src/megamek/common/actions/KickAttackAction.java | 4 +++- megamek/src/megamek/common/actions/PunchAttackAction.java | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/megamek/src/megamek/common/actions/ClubAttackAction.java b/megamek/src/megamek/common/actions/ClubAttackAction.java index c9558b3925..46fe69db25 100644 --- a/megamek/src/megamek/common/actions/ClubAttackAction.java +++ b/megamek/src/megamek/common/actions/ClubAttackAction.java @@ -479,8 +479,8 @@ public static ToHitData toHit(Game game, int attackerId, // Various versions of physical weapons have different base bonuses and // penalties. - base += getHitModFor(clubType); toHit = new ToHitData(base, "base"); + toHit.addModifier(getHitModFor(clubType), clubType.getName()); PhysicalAttackAction.setCommonModifiers(toHit, game, ae, target); diff --git a/megamek/src/megamek/common/actions/KickAttackAction.java b/megamek/src/megamek/common/actions/KickAttackAction.java index b79e00220d..712fb11d47 100644 --- a/megamek/src/megamek/common/actions/KickAttackAction.java +++ b/megamek/src/megamek/common/actions/KickAttackAction.java @@ -244,11 +244,13 @@ public static ToHitData toHit(Game game, int attackerId, } // Set the base BTH - int base = ae.getCrew().getPiloting() - 2; + int base = ae.getCrew().getPiloting(); // Start the To-Hit toHit = new ToHitData(base, "base"); + toHit.addModifier(-2, "Kick"); + PhysicalAttackAction.setCommonModifiers(toHit, game, ae, target); // +3 modifier for kicking infantry in same hex diff --git a/megamek/src/megamek/common/actions/PunchAttackAction.java b/megamek/src/megamek/common/actions/PunchAttackAction.java index bc3e15b378..055407fd60 100644 --- a/megamek/src/megamek/common/actions/PunchAttackAction.java +++ b/megamek/src/megamek/common/actions/PunchAttackAction.java @@ -215,6 +215,8 @@ public static ToHitData toHit(Game game, int attackerId, toHit = new ToHitData(base, "base"); + toHit.addModifier(0, "Punch"); + PhysicalAttackAction.setCommonModifiers(toHit, game, ae, target); // Prone Meks can only punch vehicles in the same hex. From 3b290ad3a51cb7e3458a44912ffbbf6f8ea6299b Mon Sep 17 00:00:00 2001 From: DM0000 <98051919+DM0000@users.noreply.github.com> Date: Sun, 3 Nov 2024 13:09:40 -0700 Subject: [PATCH 2/2] Added charge,DFA,JumpJet,Push and Trip attacks --- megamek/src/megamek/common/actions/ChargeAttackAction.java | 1 + megamek/src/megamek/common/actions/DfaAttackAction.java | 1 + megamek/src/megamek/common/actions/JumpJetAttackAction.java | 3 ++- megamek/src/megamek/common/actions/PushAttackAction.java | 3 ++- megamek/src/megamek/common/actions/TripAttackAction.java | 3 ++- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/megamek/src/megamek/common/actions/ChargeAttackAction.java b/megamek/src/megamek/common/actions/ChargeAttackAction.java index c28e8e092f..3a15cbc599 100644 --- a/megamek/src/megamek/common/actions/ChargeAttackAction.java +++ b/megamek/src/megamek/common/actions/ChargeAttackAction.java @@ -236,6 +236,7 @@ public ToHitData toHit(Game game, Targetable target, Coords src, int base = ae.getCrew().getPiloting(); toHit = new ToHitData(base, "base"); + toHit.addModifier(0, "Charge"); // attacker movement toHit.append(Compute.getAttackerMovementModifier(game, ae.getId(), movement)); diff --git a/megamek/src/megamek/common/actions/DfaAttackAction.java b/megamek/src/megamek/common/actions/DfaAttackAction.java index 1cbc6c55d4..19f2e21a36 100644 --- a/megamek/src/megamek/common/actions/DfaAttackAction.java +++ b/megamek/src/megamek/common/actions/DfaAttackAction.java @@ -302,6 +302,7 @@ public static ToHitData toHit(Game game, int attackerId, int base = ae.getCrew().getPiloting(); toHit = new ToHitData(base, "base"); + toHit.addModifier(0, "DFA"); // BMR(r), page 33. +3 modifier for DFA on infantry. if (te instanceof Infantry) { diff --git a/megamek/src/megamek/common/actions/JumpJetAttackAction.java b/megamek/src/megamek/common/actions/JumpJetAttackAction.java index c0b1708d39..650a18e1ce 100644 --- a/megamek/src/megamek/common/actions/JumpJetAttackAction.java +++ b/megamek/src/megamek/common/actions/JumpJetAttackAction.java @@ -227,10 +227,11 @@ public static ToHitData toHit(Game game, int attackerId, Targetable target, int } // Set the base BTH - int base = ae.getCrew().getPiloting() + 2; + int base = ae.getCrew().getPiloting(); // Start the To-Hit toHit = new ToHitData(base, "base"); + toHit.addModifier(+2, "Jump Jet"); setCommonModifiers(toHit, game, ae, target); diff --git a/megamek/src/megamek/common/actions/PushAttackAction.java b/megamek/src/megamek/common/actions/PushAttackAction.java index e2816f3817..6db806ef1b 100644 --- a/megamek/src/megamek/common/actions/PushAttackAction.java +++ b/megamek/src/megamek/common/actions/PushAttackAction.java @@ -246,9 +246,10 @@ public static ToHitData toHit(Game game, int attackerId, Targetable target) { } // Set the base BTH - int base = ae.getCrew().getPiloting() - 1; + int base = ae.getCrew().getPiloting(); toHit = new ToHitData(base, "base"); + toHit.addModifier(-1, "Push"); // attacker movement toHit.append(Compute.getAttackerMovementModifier(game, attackerId)); diff --git a/megamek/src/megamek/common/actions/TripAttackAction.java b/megamek/src/megamek/common/actions/TripAttackAction.java index 9eae15435b..4d3cacf547 100644 --- a/megamek/src/megamek/common/actions/TripAttackAction.java +++ b/megamek/src/megamek/common/actions/TripAttackAction.java @@ -160,10 +160,11 @@ public static ToHitData toHit(Game game, int attackerId, Targetable target) { } // Set the base BTH - int base = ae.getCrew().getPiloting() - 1; + int base = ae.getCrew().getPiloting(); // Start the To-Hit toHit = new ToHitData(base, "base"); + toHit.addModifier(-1, "Trip"); PhysicalAttackAction.setCommonModifiers(toHit, game, ae, target);