8000 Feature: Added Monthly Food and Housing Expenses from A Time of War by IllianiBird · Pull Request #6863 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feature: Added Monthly Food and Housing Expenses from A Time of War #6863

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 9 commits into from
May 19, 2025

Conversation

IllianiBird
Copy link
Collaborator
@IllianiBird IllianiBird commented May 3, 2025

This adds a small, optional, money sink to campaign play. If enabled, each month the player will pay a small housing and/or food expenses fee. Expenses are calculated based on the number of active personnel, prisoners, or students (in in-unit academies).

This process has full Unit Test coverage.

Food Expenses

If enabled, food will always be deducted at a rate based on each character's status and rank:

  • Prisoner or Dependent: 120 C-Bills
  • Enlisted: 240 C-Bills
  • Warrant Officer or Officer: 480 C-Bills

These values are taken from ATOW pg. 336.

Housing Expenses

If enabled, housing costs will be deducted at a rate based on each character's status and rank. Characters assigned to WarShips, JumpShips, or Space Stations do not incur a housing cost. All housing costs are waived while the campaign is in transit.

  • Prisoner or Dependent: 228 C-Bills
  • Enlisted: 312 C-Bills
  • Warrant Officer or Officer: 780 C-Bills

These values are derived from those found in ATOW pg. 336 and include all necessary utilities and additional expenses.

@IllianiBird IllianiBird added Tests Issues or Pull Requests related to the project tests Finances For New Dev Cycle Campaign Options Relates to, or includes, campaign option changes New Feature Used with the RFE tag to indicate a new feature labels May 3, 2025
@IllianiBird IllianiBird self-assigned this May 3, 2025
Copy link
codecov bot commented May 3, 2025

Codecov Report

Attention: Patch coverage is 43.69748% with 67 lines in your changes missing coverage. Please review.

Project coverage is 12.06%. Comparing base (49d3af0) to head (a78dd92).
Report is 60 commits behind head on master.

Files with missing lines Patch % Lines
MekHQ/src/mekhq/campaign/finances/Finances.java 0.00% 27 Missing ⚠️
...ekhq/gui/campaignOptions/contents/FinancesTab.java 0.00% 15 Missing ⚠️
MekHQ/src/mekhq/campaign/CampaignOptions.java 14.28% 12 Missing ⚠️
...paign/personnel/education/EducationController.java 0.00% 8 Missing ⚠️
MekHQ/src/mekhq/campaign/finances/Accountant.java 90.90% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6863      +/-   ##
============================================
+ Coverage     12.03%   12.06%   +0.03%     
- Complexity     6889     6917      +28     
============================================
  Files          1103     1103              
  Lines        142284   142388     +104     
  Branches      21991    22016      +25     
============================================
+ Hits          17121    17184      +63     
- Misses       123328   123370      +42     
+ Partials       1835     1834       -1     

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

@HammerGS HammerGS requested a review from Copilot May 7, 2025 23:50
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 pull request introduces new monthly expenses functionality for food and housing, adding optional fees that are deducted each month based on active personnel and in-unit students.

  • Updated FinancesTab UI to include new checkboxes for enabling food and housing expenses.
  • Enhanced Finances and Accountant logic to calculate and debit monthly food and housing expenses.
  • Modified CampaignOptions, Campaign, and resource files to support the new expense configuration.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
MekHQ/src/mekhq/gui/campaignOptions/contents/FinancesTab.java Added new checkboxes for food and housing expenses in the UI.
MekHQ/src/mekhq/campaign/finances/Finances.java Updated campaign daily operations to debit food and housing expenses.
MekHQ/src/mekhq/campaign/finances/Accountant.java Introduced methods and constants to calculate the monthly food and housing expenses.
MekHQ/src/mekhq/campaign/CampaignOptions.java Added new configuration options (get/set) for food and housing expense settings.
MekHQ/src/mekhq/campaign/Campaign.java Added helper method for retrieving active personnel including in-unit students.
MekHQ/resources/mekhq/resources/Finances.properties Updated properties with new resource strings for food and housing expenses.
MekHQ/resources/mekhq/resources/CampaignOptionsDialog.properties Updated dialog labels and tooltips for the new expense options.

# Conflicts:
#	MekHQ/src/mekhq/campaign/Campaign.java
#	MekHQ/src/mekhq/gui/campaignOptions/contents/FinancesTab.java
@IllianiBird IllianiBird marked this pull request as ready for review May 19, 2025 23:11
@IllianiBird IllianiBird requested a review from a team as a code owner May 19, 2025 23:11
@IllianiBird IllianiBird merged commit a57660d into MegaMek:master May 19, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Campaign Options Relates to, or includes, campaign option changes Finances New Feature Used with the RFE tag to indicate a new feature Tests Issues or Pull Requests related to the project tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0