MegaMek/megamek

'Mech Mortars should not be targetable by Anti-Missile Systems

Opened this issue · 1 comments

Prerequisites and Pre-Issue Checklist

  • I'm reporting the issue to the correct repository:

  • MegaMek

  • MegaMekLab

  • MekHQ

  • I've tested the issue against at least the latest MILESTONE version

  • I've asked on the MegaMek Discord about the error

  • I've reviewed the BattleTech rules and MegaMek documentation, and I've confirmed that something isn't working as intended.

  • I've searched the Github tracker and haven't found the issue listed

Severity *

Medium (Gameplay Limitation): Non-core functionality is impaired, providing a suboptimal but playable experience.

Brief Description *

image

Page 136 of the sixth printing of Tactical Operations: Advanced Units & Equipment says this:

Anti-Missile Systems (including Standard and Laser types) may not engage incoming ’Mech Mortar flights.

However, MegaMek currently allows AMS to target incoming mortar attacks anyway. Curiously, it does not seem to actually fire AMS if the user selects it. This implies that the check is happening after the AMS prompt is shown.

Steps to Reproduce

  1. Ensure AMS is being activated manually.
  2. Have a 'Mech Mortar on an enemy unit successfully target a friendly unit with an active Anti-Missile System of any variety.

You will be given the option to engage the incoming 'Mech Mortar flight with your AMS, in violation of the rules.

Operating System *

Mac

Java Version *

20.0.2

MegaMek Suite Version *

v0.50.0

Custom MegaMekLab Version

No response

Attach Files

gamelog.html

Final Checklist

  • I've checked to make sure that this issue has not already been filed
  • I'm reporting only one issue in this ticket for clarity and focus

As we discussed on the Discord, this is due to not filtering any of the incoming WeaponAttackActions when constructing the list of options with which to populate the AMS target option box.

In the current code state, this occurs after line 2371 of ClientGUI.java, which begins a switch/case block:

                case CFR_AMS_ASSIGN:

We need to add a conditional in the following for loop to continue; if the current WAA is a Mek Mortar attack.
The fix will need to wait for all current incoming Mech -> Mek fix PRs to get merged, and any subsequent fixes to be applied, but is an excellent beginner bug candidate.