8000 Improvement: Adjusted the Rate of Captured Clan Personnel Committing Bondsref; Added the Ability for Captured Combine Personnel to Commit Seppuku by IllianiBird · Pull Request #6907 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improvement: Adjusted the Rate of Captured Clan Personnel Committing Bondsref; Added the Ability for Captured Combine Personnel to Commit Seppuku #6907

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

Merged
merged 10 commits into from
May 8, 2025

Conversation

IllianiBird
Copy link
Collaborator

Bondsref was occurring more regularly than intended for capture by honorable factions, so I adjusted it so that it only occurs on a 2d6 roll of 2 when captured by another Clan. For capture by non-Clans I kept the original 1 in 6.

I also added the ability for captured Draconis Combine personnel to commit Seppuku on a 2d6 roll of 2. This is added to enhance the flavor of capturing these personnel and is something we see a lot in the fiction. There was a user suggestion to extend this to Liao forces, but I'm not aware of a canon source showing Liao forces committing seppuku in the same manner as Combine forces.

Copy link
codecov bot commented May 7, 2025

Codecov Report

Attention: Patch coverage is 24.00000% with 19 lines in your changes missing coverage. Please review.

Project coverage is 11.71%. Comparing base (e1ba6b7) to head (ddd18b6).
Report is 35 commits behind head on master.

Files with missing lines Patch % Lines
...paign/randomEvents/prisoners/CapturePrisoners.java 9.52% 16 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6907      +/-   ##
============================================
- Coverage     11.97%   11.71%   -0.26%     
+ Complexity     6785     6676     -109     
============================================
  Files          1101     1101              
  Lines        141414   141434      +20     
  Branches      21901    21907       +6     
============================================
- Hits          16937    16575     -362     
- Misses       122677   123155     +478     
+ Partials       1800     1704      -96     

☔ 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.

@IllianiBird IllianiBird added Bug Severity: Low Issues described as low severity as per the new issue form Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature labels May 7, 2025
@HammerGS HammerGS requested a review from Copilot May 7, 2025 23:51
Copy link
Contributor
@Copilot 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

This PR adjusts the probability logic for captured clan personnel committing Bondsref and introduces the ability for captured Combine personnel to commit Seppuku. In addition, the PersonnelStatus enum and associated test cases and resource messages have been updated to include the new SEPPUKU status.

  • Updated test cases to include SEPPUKU in relevant status lists.
  • Modified CapturePrisoners logic to simulate a 2d6 roll for clan personnel and added a branch for Combine personnel seppuku.
  • Added a new SEPPUKU entry in PersonnelStatus and updated resource files accordingly.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
MekHQ/unittests/mekhq/campaign/personnel/enums/PersonnelStatusTest.java Added SEPPUKU to test lists verifying status-related methods.
MekHQ/src/mekhq/campaign/randomEvents/prisoners/CapturePrisoners.java Adjusted dice roll calculation for Bondsref and added Seppuku branch.
MekHQ/src/mekhq/campaign/personnel/enums/PersonnelStatus.java Extended the enum with SEPPUKU and provided its accessor method.
MekHQ/resources/mekhq/resources/PrisonerEvents.properties Added resource entries for SEPPUKU event reporting.
MekHQ/resources/mekhq/resources/PersonnelStatus.properties Added SEPPUKU resource entries for labels, tooltips, reports, and logs.

Comment on lines 283 to +284
if (capturingFaction != null && capturingFaction.isClan()) {
if (isMekHQCaptureStyle && prisoner.isClanPersonnel() && (bondsmanRoll == 1)) {
if (isMekHQCaptureStyle && prisoner.isClanPersonnel() && (bondsmanRoll + d6(1) == 2)) {
Copy link
Preview
Copilot AI May 7, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider extracting the dice roll calculation (bondsmanRoll + d6(1)) into a clearly named variable to clarify that it simulates a 2d6 roll, which would improve overall readability.

Copilot uses AI. Check for mistakes.

}

if (isMekHQCaptureStyle) {
if (Objects.equals(prisoner.getOriginFaction().getShortName(), "DC")) {
Copy link
Preview
Copilot AI May 7, 2025

Choose a reason for hiding this comment

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

[nitpick] The hard-coded faction short name "DC" appears as a magic string; consider defining it as a constant for improved maintainability and clarity.

Copilot uses AI. Check for mistakes.

@HammerGS HammerGS merged commit 07b91cd into MegaMek:master May 8, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Improvement to Existing Feature Used with the RFE tag to indicate an improvement to an existing feature Scenario Resolution Severity: Low Issues described as low severity as per the new issue form
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0