From 3ae25f4450fc12ef0f6a2bddb7629fdbf8cf5492 Mon Sep 17 00:00:00 2001 From: kuronekochomusuke Date: Sun, 29 Oct 2023 08:53:36 -0400 Subject: [PATCH 1/2] check for natural aptitude piloting when doing physical attacks rolls --- megamek/src/megamek/server/GameManager.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/megamek/src/megamek/server/GameManager.java b/megamek/src/megamek/server/GameManager.java index b5c0f9f7e10..33992665d29 100644 --- a/megamek/src/megamek/server/GameManager.java +++ b/megamek/src/megamek/server/GameManager.java @@ -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 (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; @@ -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); @@ -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); From d44a3325301c9f69413b9620c32bbcb9fe4c8512 Mon Sep 17 00:00:00 2001 From: kuronekochomusuke Date: Sun, 29 Oct 2023 15:15:04 -0400 Subject: [PATCH 2/2] check that the action is a physical attack --- megamek/src/megamek/server/GameManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/megamek/src/megamek/server/GameManager.java b/megamek/src/megamek/server/GameManager.java index 33992665d29..38f01ab3032 100644 --- a/megamek/src/megamek/server/GameManager.java +++ b/megamek/src/megamek/server/GameManager.java @@ -32047,7 +32047,7 @@ private PhysicalResult preTreatPhysicalAttack(AbstractAttackAction aaa) { int damage = 0; PhysicalResult pr = new PhysicalResult(); ToHitData toHit = new ToHitData(); - if (ae.getCrew() != null) { + if (aaa instanceof PhysicalAttackAction && ae.getCrew() != null) { pr.roll = ae.getCrew().rollPilotingSkill(); } else { pr.roll = Compute.d6(2);