diff --git a/MekHQ/src/mekhq/campaign/personnel/death/AbstractDeath.java b/MekHQ/src/mekhq/campaign/personnel/death/AbstractDeath.java index 53988dce0b..5da721ba6a 100644 --- a/MekHQ/src/mekhq/campaign/personnel/death/AbstractDeath.java +++ b/MekHQ/src/mekhq/campaign/personnel/death/AbstractDeath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022 - The MegaMek Team. All Rights Reserved. + * Copyright (c) 2020-2024 - The MegaMek Team. All Rights Reserved. * * This file is part of MekHQ. * @@ -18,18 +18,6 @@ */ package mekhq.campaign.personnel.death; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.time.LocalDate; -import java.util.HashMap; -import java.util.Map; -import java.util.ResourceBundle; - -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - import megamek.Version; import megamek.common.annotations.Nullable; import megamek.common.enums.Gender; @@ -45,6 +33,20 @@ import mekhq.campaign.personnel.enums.RandomDeathMethod; import mekhq.campaign.personnel.enums.TenYearAgeRange; import mekhq.utilities.MHQXMLUtility; +import mekhq.utilities.ReportingUtilities; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.time.LocalDate; +import java.util.HashMap; +import java.util.Map; +import java.util.ResourceBundle; + +import static mekhq.utilities.ReportingUtilities.CLOSING_SPAN_TAG; public abstract class AbstractDeath { private static final MMLogger logger = MMLogger.create(AbstractDeath.class); @@ -116,7 +118,7 @@ public Map>> get /** * This is used to determine if a person can die. - * + * * @param person the person to determine for * @param ageGroup the age group of the person in question * @param randomDeath if this is for random death or manual death @@ -144,7 +146,7 @@ public Map>> get // region New Day /** * Processes new day random death for an individual. - * + * * @param campaign the campaign to process * @param today the current day * @param person the person to process @@ -158,6 +160,13 @@ public boolean processNewDay(final Campaign campaign, final LocalDate today, } if (randomlyDies(age, person.getGender())) { + // We double-report here, to make sure the user definitely notices that a random death has occurred. + // Prior to this change, it was exceptionally easy to miss these events. + String color = MekHQ.getMHQOptions().getFontColorNegativeHexColor(); + String formatOpener = ReportingUtilities.spanOpeningWithCustomColor(color); + campaign.addReport(String.format("%s has %sdied%s.", + person.getHyperlinkedFullTitle(), formatOpener, CLOSING_SPAN_TAG)); + person.changeStatus(campaign, today, getCause(person, ageGroup, age)); return person.getStatus().isDead(); } else {