Skip to content

Commit 0ce9b29

Browse files
committed
Revert "Implement Obsolete quirk effects for campaign play"
This reverts commit f3bf055.
1 parent f3bf055 commit 0ce9b29

File tree

5 files changed

+1
-46
lines changed

5 files changed

+1
-46
lines changed

MekHQ/resources/mekhq/resources/Maintenance.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,3 @@ Maintenance.unableToMaintain={0}<b>Warning:</b>{1} {2} has realized they don''t
3333
This unit should be immediately reassigned to another tech, or maintenance time should be reduced.
3434
Maintenance.largeVessel={0}<b>Warning:</b>{1} {2} has realized they don''t have enough time to maintain {3}. \
3535
Maintenance time should be immediately reduced.
36-
# Modifier descriptions
37-
Maintenance.modifier.obsolete=obsolete

MekHQ/resources/mekhq/resources/Parts.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,3 @@ PartRepairType.MEK_LOCATION.text=Locations
4949
PartRepairType.PHYSICAL_WEAPON.text=Physical Weapon
5050
PartRepairType.POD_SPACE.text=Pod
5151
PartRepairType.UNKNOWN_LOCATION.text=Error: Unknown Repair Type
52-
# Modifier descriptions
53-
Part.modifier.obsolete=obsolete

MekHQ/src/mekhq/campaign/parts/Part.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
*/
3434
package mekhq.campaign.parts;
3535

36-
import static mekhq.utilities.MHQInternationalization.getFormattedTextAt;
37-
3836
import java.io.PrintWriter;
3937
import java.text.DecimalFormat;
4038
import java.util.ArrayList;
@@ -106,7 +104,6 @@
106104
*/
107105
public abstract class Part implements IPartWork, ITechnology {
108106
private static final MMLogger LOGGER = MMLogger.create(Part.class);
109-
private static final String RESOURCE_BUNDLE = "mekhq.resources.Parts";
110107

111108
private static final DecimalFormat TONNAGE_FORMATTER = new DecimalFormat("0.#");
112109

@@ -978,13 +975,6 @@ public TargetRoll getAllMods(final @Nullable Person tech) {
978975
mods.addModifier(1, "difficult to maintain");
979976
}
980977

981-
// Apply obsolete quirk modifier
982-
int obsoleteMod = getUnit().getEntity().getObsoleteRepairModifier(campaign.getGameYear());
983-
if (obsoleteMod > 0) {
984-
mods.addModifier(obsoleteMod,
985-
getFormattedTextAt(RESOURCE_BUNDLE, "Part.modifier.obsolete"));
986-
}
987-
988978
if (getUnit().hasPrototypeTSM() &&
989979
((this instanceof MekLocation) ||
990980
(this instanceof MissingMekLocation) ||
@@ -1043,13 +1033,6 @@ public TargetRoll getAllModsForMaintenance() {
10431033
mods.addModifier(1, "difficult to maintain");
10441034
}
10451035

1046-
// Apply obsolete quirk modifier
1047-
int obsoleteMod = getUnit().getEntity().getObsoleteRepairModifier(campaign.getGameYear());
1048-
if (obsoleteMod > 0) {
1049-
mods.addModifier(obsoleteMod,
1050-
getFormattedTextAt(RESOURCE_BUNDLE, "Part.modifier.obsolete"));
1051-
}
1052-
10531036
if (getUnit().getTech() != null) {
10541037
if (getUnit().getTech().getOptions().booleanOption(PersonnelOptions.TECH_WEAPON_SPECIALIST) &&
10551038
((IPartWork.findCorrectRepairType(this) == PartRepairType.WEAPON) ||

MekHQ/src/mekhq/campaign/unit/Maintenance.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -420,16 +420,6 @@ public static TargetRoll getTargetForMaintenance(Campaign campaign, IPartWork pa
420420

421421
target.append(partWork.getAllModsForMaintenance());
422422

423-
// Apply obsolete quirk modifier
424-
Unit unit = partWork.getUnit();
425-
if (unit != null && unit.getEntity() != null) {
426-
int obsoleteMod = unit.getEntity().getObsoleteRepairModifier(campaign.getGameYear());
427-
if (obsoleteMod > 0) {
428-
target.addModifier(obsoleteMod,
429-
getFormattedTextAt(RESOURCE_BUNDLE, "Maintenance.modifier.obsolete"));
430-
}
431-
}
432-
433423
if (campaignOptions.isUseEraMods()) {
434424
target.addModifier(campaign.getFaction().getEraMod(campaign.getGameYear()), "era");
435425
}

MekHQ/src/mekhq/campaign/unit/Unit.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,22 +1459,14 @@ public Money getSellValue() {
14591459
Money unitCost = Money.of(entity.getAlternateCost());
14601460
double[] usedPartPriceMultipliers = campaign.getCampaignOptions().getUsedPartPriceMultipliers();
14611461

1462-
Money infantryValue = switch (this.getQuality()) {
1462+
return switch (this.getQuality()) {
14631463
case QUALITY_A -> unitCost.multipliedBy(usedPartPriceMultipliers[0]);
14641464
case QUALITY_B -> unitCost.multipliedBy(usedPartPriceMultipliers[1]);
14651465
case QUALITY_C -> unitCost.multipliedBy(usedPartPriceMultipliers[2]);
14661466
case QUALITY_D -> unitCost.multipliedBy(usedPartPriceMultipliers[3]);
14671467
case QUALITY_E -> unitCost.multipliedBy(usedPartPriceMultipliers[4]);
14681468
case QUALITY_F -> unitCost.multipliedBy(usedPartPriceMultipliers[5]);
14691469
};
1470-
1471-
// Apply obsolete quirk resale modifier
1472-
double obsoleteMult = entity.getObsoleteResaleModifier(campaign.getGameYear());
1473-
if (obsoleteMult < 1.0) {
1474-
infantryValue = infantryValue.multipliedBy(obsoleteMult);
1475-
}
1476-
1477-
return infantryValue;
14781470
}
14791471

14801472
// We need to adjust this for equipment that doesn't show up as parts
@@ -1561,12 +1553,6 @@ public Money getSellValue() {
15611553
// Scale the final value by the entity's price multiplier
15621554
partsValue = partsValue.multipliedBy(entity.getPriceMultiplier());
15631555

1564-
// Apply obsolete quirk resale modifier
1565-
double obsoleteMult = entity.getObsoleteResaleModifier(campaign.getGameYear());
1566-
if (obsoleteMult < 1.0) {
1567-
partsValue = partsValue.multipliedBy(obsoleteMult);
1568-
}
1569-
15701556
return partsValue;
15711557
}
15721558

0 commit comments

Comments
 (0)