Skip to content

Commit

Permalink
Added charge,DFA,JumpJet,Push and Trip attacks
Browse files Browse the repository at this point in the history
  • Loading branch information
DM0000 committed Nov 3, 2024
1 parent cdfd28d commit 3b290ad
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 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
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
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 3b290ad

Please sign in to comment.