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
16 changes: 12 additions & 4 deletions MekHQ/resources/mekhq/resources/AlternateInjuries.properties
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ AlternateInjuries.COMPLEX_PROSTHETIC.simpleName=Complex Prosthetic {0}
AlternateInjuries.ADVANCED_PROSTHETIC.simpleName=Advanced Prosthetic {0}
AlternateInjuries.MYOMER.simpleName=Myomer {0}
AlternateInjuries.ELECTIVE_MYOMER.simpleName=Elective Myomer Implant ({0})
AlternateInjuries.DERMAL_MYOMER_ARMOR.simpleName=Dermal Myomer Implant ({0}, Armor)
AlternateInjuries.DERMAL_MYOMER_CAMO.simpleName=Dermal Myomer Implant ({0}, Camo)
AlternateInjuries.DERMAL_MYOMER_TRIPLE.simpleName=Dermal Myomer Implant ({0}, Triple-Strength)
AlternateInjuries.ENHANCED_IMAGING.simpleName=EI Neural Implant
AlternateInjuries.CLONED.simpleName=Cloned {0}
AlternateInjuries.EYE_IMPLANT.simpleName=Eye Implants
Expand All @@ -131,10 +134,11 @@ AlternateInjuries.COSMETIC_SURGERY_RECOVERY.simpleName=Cosmetic Surgery Recovery
AlternateInjuries.FAILED_SURGERY_RECOVERY.simpleName=Failed Surgery Recovery
AlternateInjuries.ELECTIVE_IMPLANT_RECOVERY.simpleName=Elective Implant Recovery
AlternateInjuries.EI_IMPLANT_RECOVERY.simpleName=EI Implant Recovery
AlternateInjuries.report.ei.fatigue={0}<b>MEDICAL ALERT:</b>{1} {2} has gained a point of permanent Fatigue from \
their EI Neural Implant.
AlternateInjuries.report.ei.degradation={0}<b>MEDICAL ALERT:</b>{1} {2} is suffering mental degradation from their \
neural implant. They have permanently gained the <b>{3}</b> Flaw.
AlternateInjuries.PAIN_SHUNT_RECOVERY.simpleName=Pain Shunt Recovery
AlternateInjuries.report.implant.fatigue={0}<b>MEDICAL ALERT:</b>{1} {2} has gained a point of permanent Fatigue from \
their Neural Implant.
AlternateInjuries.report.implant.degradation={0}<b>MEDICAL ALERT:</b>{1} {2} is suffering mental degradation from \
their neural implant. They have permanently gained the <b>{3}</b> Flaw.
AlternateInjuries.BONE_REINFORCEMENT.simpleName=Bone Reinforcement
AlternateInjuries.LIVER_FILTRATION_IMPLANT.simpleName=Filtration Implants
AlternateInjuries.BIONIC_LUNGS_WITH_TYPE_1_FILTER.simpleName=CyberLungs (T1 Air Filter)
Expand All @@ -154,3 +158,7 @@ AlternateInjuries.COSMETIC_HORROR_ENHANCEMENT.simpleName=Cosmetic Horror Enhance
AlternateInjuries.COSMETIC_TAIL_PROSTHETIC.simpleName=Cosmetic Tail Prosthetic
AlternateInjuries.COSMETIC_ANIMAL_EAR_PROSTHETIC.simpleName=Functioning Animal Ears
AlternateInjuries.COSMETIC_ANIMAL_LEG_PROSTHETIC.simpleName=Animalistic {0} Prosthetic
AlternateInjuries.VEHICULAR_DNI.simpleName=VDNI
AlternateInjuries.BUFFERED_VDNI.simpleName=Buffered VDNI
AlternateInjuries.BUFFERED_VDNI_TRIPLE_CORE.simpleName=Buffered VDNI (Triple-Core Processor)
AlternateInjuries.PAIN_SHUNT.simpleName=Pain Shunt
8 changes: 8 additions & 0 deletions MekHQ/resources/mekhq/resources/InjuryEffect.properties
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ InjuryEffect.TYPE_3_LIMB_REPLACEMENT.name=T3-Prosthetic
InjuryEffect.TYPE_4_LIMB_REPLACEMENT.name=T4-Prosthetic
InjuryEffect.TYPE_5_LIMB_REPLACEMENT.name=T5-Prosthetic
InjuryEffect.TYPE_6_LIMB_REPLACEMENT.name=T6-Prosthetic
InjuryEffect.MYOMER_IMPLANT_ARM.name=Myomer Implant (Arm)
InjuryEffect.MYOMER_IMPLANT_HAND.name=Myomer Implant (Hand)
InjuryEffect.MYOMER_IMPLANT_LEG.name=Myomer Implant (Leg)
InjuryEffect.TRIPLE_STRENGTH_MYOMER_IMPLANT_ARM.name=Triple-Strength Myomer Implant (Arm)
InjuryEffect.TRIPLE_STRENGTH_MYOMER_IMPLANT_LEG.name=Triple-Strength Myomer Implant (Leg)
InjuryEffect.TYPE_2_SENSORY_REPLACEMENT.name=T2-Sensory Replacement
InjuryEffect.TYPE_3_SENSORY_REPLACEMENT.name=T3-Sensory Replacement
InjuryEffect.TYPE_4_SENSORY_REPLACEMENT.name=T4-Sensory Replacement
Expand All @@ -115,4 +120,7 @@ InjuryEffect.PHEROMONE_EFFUSER.name=Pheromone Effuser
InjuryEffect.COSMETIC_BEAUTY_ENHANCEMENT.name=Beautiful
InjuryEffect.COSMETIC_HORROR_ENHANCEMENT.name=Horrific
InjuryEffect.COSMETIC_ANIMAL_LIMB_PROSTHETIC.name=Animal Prosthetic
InjuryEffect.TRIPLE_CORE_PROCESSOR.name=Triple-Core Processor
InjuryEffect.PAIN_SHUNT.name=Pain Shunt
InjuryEffect.PAIN_SHUNT_RECOVERY.name=Pain Shunt Recovery

22 changes: 20 additions & 2 deletions MekHQ/resources/mekhq/resources/ProstheticType.properties
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ ProstheticType.COSMETIC_SURGERY.name=Cosmetic Surgery
ProstheticType.ELECTIVE_MYOMER_ARM.name=Elective Myomer Arm Implant
ProstheticType.ELECTIVE_MYOMER_HAND.name=Elective Myomer Hand Implant
ProstheticType.ELECTIVE_MYOMER_LEG.name=Elective Myomer Leg Implant
ProstheticType.DERMAL_MYOMER_ARM_ARMOR.name=Dermal Armor Myomer Arm Implant
ProstheticType.DERMAL_MYOMER_LEG_ARMOR.name=Dermal Armor Myomer Leg Implant
ProstheticType.DERMAL_MYOMER_ARM_CAMO.name=Dermal Camouflage Myomer Arm Implant
ProstheticType.DERMAL_MYOMER_LEG_CAMO.name=Dermal Camouflage Myomer Leg Implant
ProstheticType.DERMAL_MYOMER_ARM_TRIPLE.name=Dermal Triple-Strength Myomer Arm Implant
ProstheticType.DERMAL_MYOMER_LEG_TRIPLE.name=Dermal Triple-Strength Myomer Arm Implant
ProstheticType.ENHANCED_IMAGING.name=Enhanced Imaging Neural Implant
ProstheticType.BONE_REINFORCEMENT.name=Bone Reinforcement
ProstheticType.LIVER_FILTRATION_IMPLANT.name=Bionic Organs with Filtration Implants
Expand All @@ -83,6 +89,10 @@ ProstheticType.COSMETIC_HORROR_ENHANCEMENT.name=Cosmetic Horror Enhancement
ProstheticType.COSMETIC_TAIL_PROSTHETIC.name=Cosmetic Tail Prosthetic
ProstheticType.COSMETIC_ANIMAL_EAR_PROSTHETIC.name=Functioning Animal Ear Prosthetics
ProstheticType.COSMETIC_ANIMAL_LEG_PROSTHETIC.name=Animal Leg Prosthetic
ProstheticType.VDNI.name=Vehicular DNI
ProstheticType.BUFFERED_VDNI.name=Buffered VDNI
ProstheticType.BUFFERED_VDNI_TRIPLE_CORE.name=Buffered VDNI (Triple-Core Processor)
ProstheticType.PAIN_SHUNT.name=Pain Shunt
# Tooltip
ProstheticType.tooltip.skill=<b>Required Surgeon Skill:</b> {0}+
ProstheticType.tooltip.cost=<b>Base Cost:</b> {0} C-Bills
Expand All @@ -98,5 +108,13 @@ ProstheticType.tooltip.interrogation=<b>Skill Modifier:</b> {0} (Interrogation)
ProstheticType.tooltip.acting=<b>Skill Modifier:</b> {0} (Acting)
ProstheticType.tooltip.acrobatics=<b>Skill Modifier:</b> {0} (Acrobatics)
ProstheticType.tooltip.attribute=<b>Attribute Modifier:</b> {0} ({1})
ProstheticType.tooltip.ei=Has an annual chance to inflict permanent Fatigue damage and Flaws. Chance reduced by 66% \
for characters with the Aerospace phenotype.
ProstheticType.tooltip.ei=Has an annual chance to inflict permanent Fatigue damage and Flaws due to mental \
degradation. Frequency decreased to every three years for characters with the Aerospace phenotype.
ProstheticType.tooltip.vdni=Has a biannual chance to inflict permanent Fatigue damage and Flaws due to mental \
degradation.
ProstheticType.tooltip.bvdni=Every three years, has a chance to inflict permanent Fatigue damage and Flaws due to \
mental degradation.
ProstheticType.tooltip.dermal.armor=Grants the benefits of the 'Myomer Implants (Dermal Armor)' implant if present in \
four limbs. Eligibility is checked daily.
ProstheticType.tooltip.dermal.camo=Grants the benefits of the 'Myomer Implants (Dermal Camouflage)' implant if \
present in four limbs. Eligibility is checked daily.
2 changes: 2 additions & 0 deletions MekHQ/src/mekhq/campaign/CampaignNewDayManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ public void processNewDayPersonnel() {

person.checkForIlliterateRemoval();

AdvancedMedicalAlternateImplants.checkForDermalEligibility(person);

// Weekly events
if (today.getDayOfWeek() == DayOfWeek.MONDAY) {
if (!campaign.getRandomDeath().processNewWeek(campaign, today, person)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,17 @@ public static synchronized void registerAll() {
"alt:COSMETIC_ANIMAL_LEG_PROSTHETIC",
AlternateInjuries.COSMETIC_ANIMAL_LEG_PROSTHETIC);
InjuryType.register(172, "alt:DISCONTINUATION_SYNDROME", AlternateInjuries.DISCONTINUATION_SYNDROME);
InjuryType.register(173, "alt:DERMAL_MYOMER_ARM_ARMOR", AlternateInjuries.DERMAL_MYOMER_ARM_ARMOR);
InjuryType.register(174, "alt:DERMAL_MYOMER_ARM_CAMO", AlternateInjuries.DERMAL_MYOMER_ARM_CAMO);
InjuryType.register(175, "alt:DERMAL_MYOMER_ARM_TRIPLE", AlternateInjuries.DERMAL_MYOMER_ARM_TRIPLE);
InjuryType.register(176, "alt:DERMAL_MYOMER_LEG_ARMOR", AlternateInjuries.DERMAL_MYOMER_LEG_ARMOR);
InjuryType.register(177, "alt:DERMAL_MYOMER_LEG_CAMO", AlternateInjuries.DERMAL_MYOMER_LEG_CAMO);
InjuryType.register(178, "alt:DERMAL_MYOMER_LEG_TRIPLE", AlternateInjuries.DERMAL_MYOMER_LEG_TRIPLE);
InjuryType.register(179, "alt:VEHICULAR_DNI", AlternateInjuries.VEHICULAR_DNI);
InjuryType.register(180, "alt:BUFFERED_VDNI", AlternateInjuries.BUFFERED_VDNI);
InjuryType.register(181, "alt:BUFFERED_VDNI_TRIPLE_CORE", AlternateInjuries.BUFFERED_VDNI_TRIPLE_CORE);
InjuryType.register(182, "alt:PAIN_SHUNT", AlternateInjuries.PAIN_SHUNT);
InjuryType.register(183, "alt:PAIN_SHUNT_RECOVERY", AlternateInjuries.PAIN_SHUNT_RECOVERY);

InjuryType.register("am:severed_spine", SEVERED_SPINE);
InjuryType.register("am:replacement_limb_recovery", REPLACEMENT_LIMB_RECOVERY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@
package mekhq.campaign.personnel.medical.advancedMedicalAlternate;

import static megamek.common.options.OptionsConstants.ATOW_COMBAT_PARALYSIS;
import static megamek.common.options.OptionsConstants.MD_BVDNI;
import static megamek.common.options.OptionsConstants.MD_DERMAL_ARMOR;
import static megamek.common.options.OptionsConstants.MD_DERMAL_CAMO_ARMOR;
import static megamek.common.options.OptionsConstants.MD_VDNI;
import static megamek.common.options.OptionsConstants.UNOFFICIAL_EI_IMPLANT;
import static megamek.common.options.PilotOptions.LVL3_ADVANTAGES;
import static mekhq.campaign.personnel.PersonnelOptions.*;
import static mekhq.campaign.personnel.medical.BodyLocation.HEAD;
import static mekhq.campaign.personnel.medical.BodyLocation.BRAIN;
import static mekhq.campaign.personnel.medical.advancedMedicalAlternate.AlternateInjuries.DERMAL_MYOMER_ARM_ARMOR;
import static mekhq.campaign.personnel.medical.advancedMedicalAlternate.AlternateInjuries.DERMAL_MYOMER_ARM_CAMO;
import static mekhq.campaign.personnel.medical.advancedMedicalAlternate.AlternateInjuries.DERMAL_MYOMER_LEG_ARMOR;
import static mekhq.campaign.personnel.medical.advancedMedicalAlternate.AlternateInjuries.DERMAL_MYOMER_LEG_CAMO;
import static mekhq.campaign.personnel.medical.advancedMedicalAlternate.AlternateInjuries.ENHANCED_IMAGING_IMPLANT;
import static mekhq.campaign.personnel.medical.advancedMedicalAlternate.ProstheticType.ENHANCED_IMAGING;
import static mekhq.utilities.MHQInternationalization.getFormattedTextAt;
Expand All @@ -52,6 +60,7 @@
import mekhq.campaign.Campaign;
import mekhq.campaign.campaignOptions.CampaignOptions;
import mekhq.campaign.personnel.Injury;
import mekhq.campaign.personnel.InjuryType;
import mekhq.campaign.personnel.Person;
import mekhq.campaign.personnel.PersonnelOptions;
import mekhq.campaign.personnel.SpecialAbility;
Expand Down Expand Up @@ -147,7 +156,12 @@ public class AdvancedMedicalAlternateImplants {
* @param person the {@link Person} to evaluate; must not be {@code null}
*/
public static void performEnhancedImagingDegradationCheck(Campaign campaign, Person person) {
if (!person.getOptions().booleanOption(UNOFFICIAL_EI_IMPLANT)) {
PersonnelOptions options = person.getOptions();
boolean hasEnhancedImaging = options.booleanOption(UNOFFICIAL_EI_IMPLANT);
boolean hasVDNI = options.booleanOption(MD_VDNI);
boolean hasBufferedVDNI = options.booleanOption(MD_BVDNI);

if (!hasEnhancedImaging && !hasVDNI && !hasBufferedVDNI) {
return;
}

Expand All @@ -161,15 +175,24 @@ public static void performEnhancedImagingDegradationCheck(Campaign campaign, Per

int gameYear = campaign.getGameYear();

// Occurs every year for most phenotypes, but every 3rd year for the Aerospace phenotype (ATOW pg 317). ATOW
// Occurs every year for most characters, but every 3rd year for the Aerospace phenotype (ATOW pg 317). ATOW
// states that this occurs every 3rd full year, but I didn't want to add even more tracking to Person for
// such a niche thing, so instead it hits every 3rd canonical year.
boolean incrementPermanentFatigueDamage = !person.getPhenotype().isAerospace() || gameYear % 3 == 0;
int frequency = 1;
if (person.getPhenotype().isAerospace() || hasBufferedVDNI) {
frequency = 3;
}

if (hasVDNI) {
frequency = 2;
}

boolean incrementPermanentFatigueDamage = !person.getPhenotype().isAerospace() || gameYear % frequency == 0;
if (incrementPermanentFatigueDamage) {
if (useFatigue) {
person.changePermanentFatigue(1);
campaign.addReport(getFormattedTextAt(RESOURCE_BUNDLE,
"AlternateInjuries.report.ei.fatigue",
"AlternateInjuries.report.implant.fatigue",
spanOpeningWithCustomColor(getWarningColor()),
CLOSING_SPAN_TAG,
person.getHyperlinkedFullTitle()));
Expand All @@ -184,7 +207,7 @@ public static void performEnhancedImagingDegradationCheck(Campaign campaign, Per
String flaw = getAndApplyEIDegradationFlaw(person);
if (!flaw.isBlank()) {
campaign.addReport(getFormattedTextAt(RESOURCE_BUNDLE,
"AlternateInjuries.report.ei.degradation",
"AlternateInjuries.report.implant.degradation",
spanOpeningWithCustomColor(getNegativeColor()),
CLOSING_SPAN_TAG,
person.getHyperlinkedFullTitle(), flaw));
Expand All @@ -210,7 +233,6 @@ public static void performEnhancedImagingDegradationCheck(Campaign campaign, Per
* selected Flaw
*/
public static String getAndApplyEIDegradationFlaw(Person person) {

String flaw = ObjectUtility.getRandomItem(POSSIBLE_FLAWS);
if (flaw.equals(COMPULSION_PLACEHOLDER)) {
flaw = ObjectUtility.getRandomItem(POSSIBLE_COMPULSIONS);
Expand All @@ -231,6 +253,28 @@ public static String getAndApplyEIDegradationFlaw(Person person) {
}
}

public static void checkForDermalEligibility(Person person) {
List<Injury> injuries = person.getInjuries();

int dermalArmorCount = 0;
int dermalCamoCount = 0;
for (Injury injury : injuries) {
InjuryType injuryType = injury.getType();
if (injuryType == DERMAL_MYOMER_ARM_ARMOR || injuries == DERMAL_MYOMER_LEG_ARMOR) {
dermalArmorCount++;
}

if (injuryType == DERMAL_MYOMER_ARM_CAMO || injuries == DERMAL_MYOMER_LEG_CAMO) {
dermalCamoCount++;
}
}

PersonnelOptions options = person.getOptions();
int requiredLimbCount = 4;
options.getOption(MD_DERMAL_ARMOR).setValue(dermalArmorCount >= requiredLimbCount);
options.getOption(MD_DERMAL_CAMO_ARMOR).setValue(dermalArmorCount >= requiredLimbCount);
}

/**
* Applies the Enhanced Imaging (EI) implant to the specified person.
*
Expand All @@ -242,7 +286,7 @@ public static String getAndApplyEIDegradationFlaw(Person person) {
* @param person the {@link Person} receiving the Enhanced Imaging implant
*/
public static void giveEIImplant(Campaign campaign, Person person) {
Injury injury = ENHANCED_IMAGING_IMPLANT.newInjury(campaign, person, HEAD, 0);
Injury injury = ENHANCED_IMAGING_IMPLANT.newInjury(campaign, person, BRAIN, 0);
person.addInjury(injury);

if (campaign.getCampaignOptions().isUseImplants()) {
Expand Down
Loading