Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ AlternateInjuries.ORGAN_TRAUMA.simpleName=Organ Trauma
AlternateInjuries.DISEMBOWELED.simpleName=Disemboweled
AlternateInjuries.BLOOD_LOSS.simpleName=Blood Loss
AlternateInjuries.DISCONTINUATION_SYNDROME.simpleName=Discontinuation Syndrome
AlternateInjuries.POSTPARTUM_RECOVERY.simpleName=Postpartum Recovery
AlternateInjuries.TRANSIT_DISORIENTATION_SYNDROME.simpleName=Transit Disorientation Syndrome
AlternateInjuries.CRIPPLING_FLASHBACKS.simpleName=Crippling Flashbacks
AlternateInjuries.CHILDLIKE_REGRESSION.simpleName=Childlike Regression
AlternateInjuries.CATATONIA.simpleName=Chronic Dissociation
# Diseases
AlternateInjuries.GROWTHS_DISCOMFORT.simpleName=Uncomfortable Growths
AlternateInjuries.GROWTHS_SLIGHT.simpleName=Bursting Pustules
Expand Down
2 changes: 1 addition & 1 deletion MekHQ/resources/mekhq/resources/InjuryEffect.properties
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ InjuryEffect.PUNCTURED.name=Punctured
InjuryEffect.INTERNAL_BLEEDING.name=Internal Bleeding
InjuryEffect.SEVERED.name=Severed Limb
InjuryEffect.BLOOD_LOSS.name=Blood Loss
InjuryEffect.DISCONTINUATION_SYNDROME.name=Discontinuation Syndrome
InjuryEffect.STRESS.name=STRESS
# Diseases
InjuryEffect.DISEASE_DEADLY.name=Disease (Deadly)
InjuryEffect.DISEASE_GROWTHS_SLIGHT.name=Disease (Slight Growths)
Expand Down
4 changes: 3 additions & 1 deletion MekHQ/resources/mekhq/resources/Personnel.properties
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,10 @@ compulsion.clinicalParanoia=%s suffered a %s<b>Personality Break</b>%s. They are
them.
compulsion.regression=%s suffered a %s<b>Personality Break</b>%s. They have regressed to a childlike state.
compulsion.catatonia=%s suffered a %s<b>Personality Break</b>%s. They've entered a catatonic state.
compulsion.berserker=%s suffered a %s<b>Personality Break</b>%s. They lashed out in a berserker fury, hurting \
compulsion.berserker.normal=%s suffered a %s<b>Personality Break</b>%s. They lashed out in a berserker fury, hurting \
themselves and any nearby characters.
compulsion.berserker.restrained=%s suffered a %s<b>Personality Break</b>%s. They lashed out in a berserker fury but \
were restrained by those around them without further incident.
darkSecret.revealed.trivial=%s<b>Trivial Dark Secret Revealed:</b>%s rumors of %s's past indiscretion have begun to \
circulate, casting a long shadow over their reputation.
darkSecret.revealed.significant=%s<b>Significant Dark Secret Revealed:</b>%s %s's secret has come to light, straining \
Expand Down
3 changes: 3 additions & 0 deletions MekHQ/src/mekhq/campaign/CampaignNewDayManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,7 @@ private void processCompulsionsAndMadness(Person person, PersonnelOptions person
null, modifier);
person.processCripplingFlashbacks(campaign,
isUseAdvancedMedical,
isUseAltAdvancedMedical,
true,
failedWillpowerCheck);
}
Expand Down Expand Up @@ -1485,6 +1486,7 @@ private void processCompulsionsAndMadness(Person person, PersonnelOptions person
null, modifier);
String report = person.processChildlikeRegression(campaign,
isUseAdvancedMedical,
isUseAltAdvancedMedical,
true,
failedWillpowerCheck);
if (!report.isBlank()) {
Expand All @@ -1498,6 +1500,7 @@ private void processCompulsionsAndMadness(Person person, PersonnelOptions person
null, modifier);
String report = person.processCatatonia(campaign,
isUseAdvancedMedical,
isUseAltAdvancedMedical,
true,
failedWillpowerCheck);
if (!report.isBlank()) {
Expand Down
103 changes: 86 additions & 17 deletions MekHQ/src/mekhq/campaign/CurrentLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
import static megamek.common.compute.Compute.randomInt;
import static mekhq.campaign.Campaign.AdministratorSpecialization.TRANSPORT;
import static mekhq.campaign.personnel.PersonnelOptions.FLAW_TRANSIT_DISORIENTATION_SYNDROME;
import static mekhq.campaign.personnel.medical.BodyLocation.GENERIC;
import static mekhq.campaign.personnel.medical.BodyLocation.INTERNAL;
import static mekhq.campaign.personnel.medical.advancedMedical.InjuryTypes.TRANSIT_DISORIENTATION_SYNDROME;
import static mekhq.utilities.MHQInternationalization.getFormattedTextAt;

import java.io.PrintWriter;
Expand All @@ -57,6 +57,8 @@
import mekhq.campaign.mission.TransportCostCalculations;
import mekhq.campaign.personnel.Injury;
import mekhq.campaign.personnel.Person;
import mekhq.campaign.personnel.medical.advancedMedical.InjuryTypes;
import mekhq.campaign.personnel.medical.advancedMedicalAlternate.AlternateInjuries;
import mekhq.campaign.personnel.medical.advancedMedicalAlternate.Inoculations;
import mekhq.campaign.universe.Planet;
import mekhq.campaign.universe.PlanetarySystem;
Expand Down Expand Up @@ -327,22 +329,8 @@ public void newDay(Campaign campaign) {
}
if (isAtJumpPoint() && (rechargeTime >= neededRechargeTime)) {
// jump
if (campaignOptions.isPayForTransport()) {
if (campaignOptions.isUseAbilities()) {
for (Person person : campaign.getPersonnelFilteringOutDeparted()) {
if (person.getOptions().booleanOption(FLAW_TRANSIT_DISORIENTATION_SYNDROME)) {
Injury injury = TRANSIT_DISORIENTATION_SYNDROME.newInjury(campaign,
person,
INTERNAL,
1);
person.addInjury(injury);

if (campaignOptions.isUseFatigue()) {
person.changeFatigue(campaignOptions.getFatigueRate());
}
}
}
}
if (campaignOptions.isUseAbilities()) {
checkForTransitDisorientationSyndrome(campaign, campaignOptions);
}
campaign.addReport("Jumping to " + jumpPath.get(1).getPrintableName(campaign.getLocalDate()));
currentSystem = jumpPath.get(1);
Expand Down Expand Up @@ -393,6 +381,87 @@ public void newDay(Campaign campaign) {
}
}

/**
* Applies Transit Disorientation Syndrome effects to all personnel who have the corresponding flaw.
*
* <p>This method iterates over all active personnel (excluding departed and absent individuals) and checks
* whether each person has the {@code FLAW_TRANSIT_DISORIENTATION_SYNDROME} flag enabled. If so, one of two effects
* occurs depending on campaign medical rules:</p>
*
* <ul>
* <li><b>Advanced Medical enabled:</b>
* <ul>
* <li>An appropriate injury is created and added.</li>
* <li>If the Alternative Advanced Medical system is active, the Alternate Injury version is used;
* otherwise the standard injury is used.</li>
* </ul>
* </li>
* <li><b>Advanced Medical disabled:</b>
* <ul>
* <li>The character simply gains +1 hit.</li>
* </ul>
* </li>
* </ul>
*
* <p>If the Fatigue subsystem is enabled, the character also gains fatigue equal to the configured campaign
* fatigue rate.</p>
*
* @param campaign the current campaign, used for personnel state and injury construction
* @param campaignOptions the campaign's ruleset and configuration
*
* @author Illiani
* @since 0.50.10
*/
private static void checkForTransitDisorientationSyndrome(Campaign campaign, CampaignOptions campaignOptions) {
final boolean useAdvancedMedical = campaignOptions.isUseAdvancedMedical();
final boolean useAltAdvancedMedical = campaignOptions.isUseAlternativeAdvancedMedical();
final boolean useFatigue = campaignOptions.isUseFatigue();
final int fatigueRate = campaignOptions.getFatigueRate();

for (Person person : campaign.getPersonnelFilteringOutDepartedAndAbsent()) {
if (!person.getOptions().booleanOption(FLAW_TRANSIT_DISORIENTATION_SYNDROME)) {
continue;
}

if (useAdvancedMedical) {
Injury injury = createTransitDisorientationInjury(campaign, person, useAltAdvancedMedical);
person.addInjury(injury);
} else {
person.setHits(person.getHits() + 1);
}

if (useFatigue) {
person.changeFatigue(fatigueRate);
}
}
}

/**
* Creates the appropriate Transit Disorientation Syndrome injury instance based on the currently active medical
* ruleset.
*
* <p>If the Alternative Advanced Medical system is active, this method uses the {@code AlternateInjuries}
* version of the injury definition using a generic location. Otherwise it uses the standard {@code InjuryTypes}
* version with an internal location.</p>
*
* @param campaign the campaign context needed for injury construction
* @param person the affected character
* @param useAltAdvancedMedical whether the Alternative Advanced Medical system is active
*
* @return an {@link Injury} instance representing Transit Disorientation Syndrome
*
* @author Illiani
* @since 0.50.10
*/
private static Injury createTransitDisorientationInjury(Campaign campaign, Person person,
boolean useAltAdvancedMedical) {
return useAltAdvancedMedical
? AlternateInjuries.TRANSIT_DISORIENTATION_SYNDROME
.newInjury(campaign, person, GENERIC, 1)
: InjuryTypes.TRANSIT_DISORIENTATION_SYNDROME
.newInjury(campaign, person, INTERNAL, 1);
}

/**
* Tests for whether the campaign arrived at a contract location before it's due to start.
*
Expand Down
Loading
Loading