Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seperated physical modifiers from base and show them in toHit #6173

Merged
merged 2 commits into from
Nov 4, 2024
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
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