MegaMek / megamek

MegaMek is a networked Java clone of BattleTech, a turn-based sci-fi boardgame for 2+ players. Fight using giant robots, tanks, and/or infantry on a hex-based map.
http://www.megamek.org
GNU General Public License v2.0
299 stars 288 forks source link

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

Closed Saklad5 closed 2 weeks ago

Saklad5 commented 2 months ago

Prerequisites and Pre-Issue Checklist

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

Sleet01 commented 2 months ago

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.

DM0000 commented 1 month ago

Has this been fixed? I wasn't able to reproduce this, mech just got pounded by mortars.