Skip to content

Commit

Permalink
Merge pull request #6173 from DM0000/ShowPhysicalAttack
Browse files Browse the repository at this point in the history
Seperated physical modifiers from base and show them in toHit
  • Loading branch information
HammerGS authored Nov 4, 2024
2 parents 0540330 + 3b290ad commit a300c75
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions megamek/src/megamek/common/actions/ChargeAttackAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/actions/ClubAttackAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions megamek/src/megamek/common/actions/DfaAttackAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion megamek/src/megamek/common/actions/JumpJetAttackAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 3 additions & 1 deletion megamek/src/megamek/common/actions/KickAttackAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions megamek/src/megamek/common/actions/PunchAttackAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion megamek/src/megamek/common/actions/PushAttackAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 2 additions & 1 deletion megamek/src/megamek/common/actions/TripAttackAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a300c75

Please sign in to comment.