10000 Improvement: Switched Medical Daily Notices from Reports to Log Entries by IllianiBird · Pull Request #6825 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improvement: Switched Medical Daily Notices from Reports to Log Entries #6825

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 1 commit into from
May 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions MekHQ/src/mekhq/campaign/personnel/medical/MedicalController.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,23 @@
*
* Catalyst Game Labs and the Catalyst Game Labs logo are trademarks of
* InMediaRes Productions, LLC.
*
* MechWarrior Copyright Microsoft Corporation. MekHQ was created under
* Microsoft's "Game Content Usage Rules"
* <https://www.xbox.com/en-US/developers/rules> and it is not endorsed by or
* affiliated with Microsoft.
*/
package mekhq.campaign.personnel.medical;

import static mekhq.campaign.personnel.medical.advancedMedical.InjuryUtil.resolveDailyHealing;
import static mekhq.campaign.personnel.skills.SkillType.S_DOCTOR;
import static mekhq.utilities.MHQInternationalization.getFormattedTextAt;

import java.util.ArrayList;
import java.util.List;

import megamek.common.TargetRollModifier;
import megamek.common.annotations.Nullable;
import megamek.logging.MMLogger;
import mekhq.MekHQ;
import mekhq.campaign.Campaign;
import mekhq.campaign.CampaignOptions;
Expand All @@ -37,13 +49,6 @@
import mekhq.campaign.personnel.skills.SkillCheckUtility;
import mekhq.campaign.unit.Unit;

import java.util.ArrayList;
import java.util.List;

import static mekhq.campaign.personnel.medical.advancedMedical.InjuryUtil.resolveDailyHealing;
import static mekhq.campaign.personnel.skills.SkillType.S_DOCTOR;
import static mekhq.utilities.MHQInternationalization.getFormattedTextAt;

/**
* The {@code MedicalController} class manages the healing process and medical-related tasks
* within the campaign. It handles natural healing, doctor-assisted healing, and advanced
Expand All @@ -53,6 +58,8 @@
* @since MekHQ 0.50.06
*/
public class MedicalController {
private static final MMLogger logger = MMLogger.create(MedicalController.class);

final String RESOURCE_BUNDLE = "mekhq.resources.MedicalController";

final private Campaign campaign;
Expand Down Expand Up @@ -106,7 +113,8 @@ public void processMedicalEvents(Person patient) {
if (doctor != null && patient.getDaysToWaitForHealing() <= 0) {
healPerson(patient, doctor);
} else if (checkNaturalHealing(patient)) {
campaign.addReport(getFormattedTextAt(RESOURCE_BUNDLE, "MedicalController.report.natural",
// TODO change logging level from info to debug in 50.08
logger.info(getFormattedTextAt(RESOURCE_BUNDLE, "MedicalController.report.natural",
patient.getHyperlinkedFullTitle()));
Unit unit = patient.getUnit();
if (unit != null) {
Expand Down Expand Up @@ -152,7 +160,8 @@ public boolean checkNaturalHealing(Person patient) {
* @param doctor the {@link Person} performing the treatment
*/
private void healPerson(Person patient, Person doctor) {
campaign.addReport(getFormattedTextAt(RESOURCE_BUNDLE, "MedicalController.report.intro",
// TODO change logging level from info to debug in 50.08
logger.info(getFormattedTextAt(RESOURCE_BUNDLE, "MedicalController.report.intro",
Comment on lines +163 to +164
Copy link
Collaborator

Choose a reason for hiding this comment

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

I get it, but I would prefer to have an option in campaign options where you can re-enable it to show in the campaign report, start with it disabled so if anyone complains they just have to click a button.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Even with small campaigns (I tested with just a few people in the infirmary) it quickly becomes really spammy. We need the information, but the player has never had access to this information so nobody will notice it missing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Coming back to this later, it's also worth mentioning that posting lots of messages to daily report on New Day actually slows down new day progression so it's something we should be avoiding.

doctor.getHyperlinkedFullTitle(), patient.getHyperlinkedFullTitle()));

SkillCheckUtility skillCheckUtility = new SkillCheckUtility(doctor,
Expand All @@ -162,7 +171,8 @@ private void healPerson(Person patient, Person doctor) {
isUseSupportEdge,
false);

campaign.addReport(skillCheckUtility.getResultsText());
// TODO change logging level from info to debug in 50.08
logger.info(skillCheckUtility.getResultsText());

if (skillCheckUtility.isSuccess()) {
patient.heal();
Expand Down
Loading
0