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

Hex areas and use for Deployment, Flee Zones and Triggers #6045

Merged
merged 19 commits into from
Oct 2, 2024

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Sep 28, 2024

This PR continues my work to implement some (pretty simple) Kell Hounds scenarios from the old Kell Hounds book as MM scenarios with a bit of control. Changes:

  • adds hex areas; they come in various basic forms and can be combined by adding, subtracting and intersecting to form more complex areas; hex areas are always evaluated against a board to determine if they contain a hex or to get all their coords; currently implemented areas include geometric ones like hex lines, half planes, circles, rays; others are board-dependent such as the board edges or hexes with a given terrain or hex level; hex areas are lightweight and good for transfer between server and client as they don't store hexes, only rules to create them;
  • hex areas can be used to set deployment areas via code; it uses the same system as the terrain-type deployment zones
  • players and individual units can now be given a hex area as a flee zone from which they are allowed to leave the battlefield; this can be anywhere, even in the middle of the board; the default behavior is unchanged from before (units dont have their own zone and players use the board edges); there is now a menu item to show the flee zone of a unit; note that Princess currently makes no use of this
  • hex areas can be used to trigger events when one or more units are within a hex area
  • MM scenario parsing for the above
  • limits fleeing in Lowering the Boom and Saving A Prince scenarios in accordance with scenario rule

Copy link

codecov bot commented Sep 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.06%. Comparing base (497e040) to head (db3216f).
Report is 50 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6045      +/-   ##
============================================
- Coverage     29.09%   29.06%   -0.04%     
- Complexity    13972    13981       +9     
============================================
  Files          2580     2601      +21     
  Lines        267172   267592     +420     
  Branches      47710    47792      +82     
============================================
+ Hits          77744    77771      +27     
- Misses       185530   185919     +389     
- Partials       3898     3902       +4     

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

Copy link
Member

@HammerGS HammerGS left a comment

Choose a reason for hiding this comment

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

Tested and works, just waiting for Tex to confirm the Javadoc bit.

@rjhancock
Copy link
Collaborator

rjhancock commented Oct 2, 2024

/home/runner/work/megamek/megamek/megamek/megamek/src/megamek/common/hexarea/RectangleHexArea.java:36: error: malformed HTML

Replace the < with & lt; (without the space - html entity for less than sign) to fix the Javadoc issue

Fixing misformed HTML
@HammerGS HammerGS merged commit 44a0297 into MegaMek:master Oct 2, 2024
7 checks passed
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.

3 participants