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

check for natural aptitude piloting when doing physical attacks rolls #4862

Merged
merged 2 commits into from
Oct 31, 2023
Merged
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
18 changes: 15 additions & 3 deletions megamek/src/megamek/server/GameManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -32047,7 +32047,11 @@ private PhysicalResult preTreatPhysicalAttack(AbstractAttackAction aaa) {
int damage = 0;
PhysicalResult pr = new PhysicalResult();
ToHitData toHit = new ToHitData();
pr.roll = Compute.d6(2);
if (aaa instanceof PhysicalAttackAction && ae.getCrew() != null) {
pr.roll = ae.getCrew().rollPilotingSkill();
} else {
pr.roll = Compute.d6(2);
}
pr.aaa = aaa;
if (aaa instanceof BrushOffAttackAction) {
BrushOffAttackAction baa = (BrushOffAttackAction) aaa;
Expand All @@ -32061,7 +32065,11 @@ private PhysicalResult preTreatPhysicalAttack(AbstractAttackAction aaa) {
damage = BrushOffAttackAction.getDamageFor(ae, BrushOffAttackAction.LEFT);
pr.damageRight = BrushOffAttackAction.getDamageFor(ae, BrushOffAttackAction.RIGHT);
baa.setArm(arm);
pr.rollRight = Compute.d6(2);
if (ae.getCrew() != null) {
pr.rollRight = ae.getCrew().rollPilotingSkill();
} else {
pr.rollRight = Compute.d6(2);
}
} else if (aaa instanceof ChargeAttackAction) {
ChargeAttackAction caa = (ChargeAttackAction) aaa;
toHit = caa.toHit(game);
Expand Down Expand Up @@ -32151,7 +32159,11 @@ else if (clubType.hasSubType(MiscType.S_WRECKING_BALL)) {
}
pr.damageRight = damageRight;
pr.toHitRight = toHitRight;
pr.rollRight = Compute.d6(2);
if (ae.getCrew() != null) {
pr.rollRight = ae.getCrew().rollPilotingSkill();
} else {
pr.rollRight = Compute.d6(2);
}
} else if (aaa instanceof PushAttackAction) {
PushAttackAction paa = (PushAttackAction) aaa;
toHit = paa.toHit(game);
Expand Down