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

Added Clan and Inner Sphere Resupply Restrictions #5747

Merged
merged 3 commits into from
Jan 15, 2025

Conversation

IllianiCBT
Copy link
Collaborator

  • Restricted Clan items to only appear in Resupplies if the employing faction is Clan or the resupply is after the Battle of Tukayyid.
  • Restricted Clan items to only appear in Resupplies if the purchase of Clan parts is enabled in Campaign Options
  • Restricted Inner Sphere items to only appear in Resupplies if the purchase of Inner Sphere parts is enabled in Campaign Options.

Fix #5746

Implemented conditions to differentiate purchase eligibility for Clan and Inner Sphere parts based on campaign settings and the timeline relative to the Battle of Tukayyid. This ensures faction-specific rules for resupply operations are enforced consistently.
Removed unnecessary `allowInnerSphere` check and streamlined logic for determining eligible parts based on clan status. Improved readability and maintainability by consolidating conditional checks.
Added checks to respect campaign settings for allowing Clan and Inner Sphere part purchases during resupply. This ensures purchase availability aligns with the configured campaign options.
@IllianiCBT IllianiCBT added the Bug label Jan 10, 2025
@IllianiCBT IllianiCBT self-assigned this Jan 10, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.20%. Comparing base (fd739ba) to head (6a03e7d).
Report is 16 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5747      +/-   ##
============================================
- Coverage     10.21%   10.20%   -0.01%     
+ Complexity     6076     6071       -5     
============================================
  Files          1010     1010              
  Lines        139310   139319       +9     
  Branches      20448    20453       +5     
============================================
- Hits          14231    14221      -10     
- Misses       123703   123726      +23     
+ Partials       1376     1372       -4     

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

@@ -68,6 +69,7 @@ public class Resupply {
public static final int CARGO_MULTIPLIER = 4;
public static final int RESUPPLY_AMMO_TONNAGE = 1;
public static final int RESUPPLY_ARMOR_TONNAGE = 5;
final LocalDate BATTLE_OF_TUKAYYID = LocalDate.of(3052, 5, 21);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this & the instance of it in AbstractUnitMarket.java be turned into a single constant somewhere? I see we have a similar final LocalDate linked to a historic event, FORTRESS_REPUBLIC in MHQConstants.java.

@HammerGS HammerGS merged commit 28c9749 into MegaMek:master Jan 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants