Skip to content

Cluster artillery logic for when it doubles was poor#8150

Open
TenkawaBC wants to merge 3 commits intoMegaMek:mainfrom
TenkawaBC:Cluster-Artillery-Damage
Open

Cluster artillery logic for when it doubles was poor#8150
TenkawaBC wants to merge 3 commits intoMegaMek:mainfrom
TenkawaBC:Cluster-Artillery-Damage

Conversation

@TenkawaBC
Copy link
Copy Markdown
Contributor

It only into account Fortified or woods, not additional terrain types (eg: rough, jungle).

I took the terrain types from the infantryInOpen check, removed the buildings and inversed it.

Added new report line so that cluster artillery reports when it doubled when not in the open.

This was done as per TO:AUE p. 166. This should fix issue #8086.

… into account Fortified or woods, not additional terrain types.

I took the terrain types from the infantryInOpen check, removed the buildings and inversed it.

Added new report line so that cluster artillery reports when it doubled when not in the open
@TenkawaBC TenkawaBC requested a review from a team as a code owner March 31, 2026 16:35
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.90%. Comparing base (e6e0bc7) to head (334d386).
⚠️ Report is 36 commits behind head on main.

Files with missing lines Patch % Lines
...amek/common/weapons/handlers/AreaEffectHelper.java 0.00% 8 Missing ⚠️
megamek/src/megamek/server/ServerHelper.java 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8150      +/-   ##
============================================
- Coverage     29.91%   29.90%   -0.01%     
+ Complexity    17380    17379       -1     
============================================
  Files          3172     3172              
  Lines        307484   307537      +53     
  Branches      53752    53774      +22     
============================================
- Hits          91990    91979      -11     
- Misses       205901   205974      +73     
+ Partials       9593     9584       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

… place.

Fixed long term bug in infantryInOpen with pavement preventing the open bonus. It should have only been if urban guerrilla SPA was selected.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates artillery/infantry damage handling to better match TO:AUE p.166 by improving “in the open” determination and expanding cluster-munition doubling logic beyond just woods/fortified hexes.

Changes:

  • Fix ServerHelper.infantryInOpen() logic around Urban Guerrilla + road/pavement so it only affects those terrain types.
  • Update cluster-munition artillery damage to double against conventional infantry whenever they are not “in the open” (excluding buildings) and add a corresponding report line.
  • Add a new report message string (ID 6046) for the new cluster-doubling report.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
megamek/src/megamek/server/ServerHelper.java Corrects the Urban Guerrilla + pavement/road condition in the infantry “in open” check.
megamek/src/megamek/common/weapons/handlers/AreaEffectHelper.java Replaces narrow terrain checks with a broader “not in open” check for cluster-munition doubling and emits a new report line.
megamek/resources/megamek/common/report-messages.properties Adds report message 6046 used by the new report line.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TenkawaBC TenkawaBC force-pushed the Cluster-Artillery-Damage branch from 31173a3 to 334d386 Compare March 31, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants