diff --git a/megamek/src/megamek/common/SpaceStation.java b/megamek/src/megamek/common/SpaceStation.java index a6885da71bc..14da6ecd2cf 100644 --- a/megamek/src/megamek/common/SpaceStation.java +++ b/megamek/src/megamek/common/SpaceStation.java @@ -22,9 +22,12 @@ */ public class SpaceStation extends Jumpship { private static final long serialVersionUID = -3160156173650960985L; - + + /** A station over this weight in may built as a modular station. */ + public static final double MODULAR_MININUM_WEIGHT = 100000.0; + // This only affects cost, but may have an effect in a large-scale strategic setting. - private boolean modular = false; + private boolean modularOrKFAdapter = false; @Override public int getUnitType() { @@ -43,6 +46,14 @@ public SpaceStation() { .setAvailability(RATING_C, RATING_D, RATING_C, RATING_C) .setStaticTechLevel(SimpleTechLevel.ADVANCED); + private static final TechAdvancement TA_SPACE_STATION_KF_ADAPTER = new TechAdvancement(TECH_BASE_ALL) + .setISAdvancement(2350, 2375, DATE_NONE, 2850, 3048).setClanAdvancement(2350, 2375) + .setPrototypeFactions(F_TH).setProductionFactions(F_TH) + // The adapter itself is tech rating C, but this is the base for a station with an adapter. + .setReintroductionFactions(F_FS).setTechRating(RATING_D) + .setAvailability(RATING_D, RATING_F, RATING_D, RATING_D) + .setStaticTechLevel(SimpleTechLevel.ADVANCED); + private static final TechAdvancement TA_SPACE_STATION_MODULAR = new TechAdvancement(TECH_BASE_ALL) .setISAdvancement(2565, 2585, DATE_NONE, 2790, 3090).setClanAdvancement(2565, 2585) .setPrototypeFactions(F_TH).setProductionFactions(F_TH) @@ -52,26 +63,43 @@ public SpaceStation() { @Override public TechAdvancement getConstructionTechAdvancement() { - return modular? TA_SPACE_STATION_MODULAR : TA_SPACE_STATION; + if (isModular()) { + return TA_SPACE_STATION_MODULAR; + } else if (hasKFAdapter()) { + return TA_SPACE_STATION_KF_ADAPTER; + } else { + return TA_SPACE_STATION; + } } - + + public static TechAdvancement getKFAdapterTA() { return TA_SPACE_STATION_KF_ADAPTER; } + public static TechAdvancement getModularTA() { return TA_SPACE_STATION_MODULAR; } - + /** * Designates whether this is a modular space station - * @param modular + * @param modularOrKFAdapter Whether the space station can be transported by jumpship. */ - public void setModular(boolean modular) { - this.modular = modular; + public void setModularOrKFAdapter(boolean modularOrKFAdapter) { + this.modularOrKFAdapter = modularOrKFAdapter; } /** - * @return True if this space station has a modular construction, otherwise false. + * @return True if this space station has a modular construction (or has a KF adapter for stations less than 100kt, + * otherwise false. */ + public boolean isModularOrKFAdapter() { + return modularOrKFAdapter; + } + public boolean isModular() { - return modular; + return modularOrKFAdapter && getWeight() > MODULAR_MININUM_WEIGHT; + } + + public boolean hasKFAdapter() { + return modularOrKFAdapter && getWeight() <= MODULAR_MININUM_WEIGHT; } @Override @@ -81,7 +109,13 @@ public double getCost(CalculationReport calcReport, boolean ignoreAmmo) { @Override public double getPriceMultiplier() { - return modular ? 50.0 : 5.0; + if (isModular()) { + return 50.0; + } else if (hasKFAdapter()) { + return 20.0; + } else { + return 5.0; + } } /** diff --git a/megamek/src/megamek/common/loaders/BLKFile.java b/megamek/src/megamek/common/loaders/BLKFile.java index 26ad00ea777..dbe02215953 100644 --- a/megamek/src/megamek/common/loaders/BLKFile.java +++ b/megamek/src/megamek/common/loaders/BLKFile.java @@ -26,8 +26,6 @@ import megamek.common.util.BuildingBlock; import megamek.common.weapons.bayweapons.BayWeapon; import megamek.common.weapons.infantry.InfantryWeapon; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; public class BLKFile { @@ -1106,7 +1104,7 @@ public static BuildingBlock getBlock(Entity t) { blk.writeBlockData("jump_range", ws.getJumpRange()); } } else if ((t instanceof SpaceStation) - && ((SpaceStation) t).isModular()) { + && ((SpaceStation) t).isModularOrKFAdapter()) { blk.writeBlockData("modular", 1); } diff --git a/megamek/src/megamek/common/loaders/BLKSpaceStationFile.java b/megamek/src/megamek/common/loaders/BLKSpaceStationFile.java index bd2d5a6af45..ab5d8335282 100644 --- a/megamek/src/megamek/common/loaders/BLKSpaceStationFile.java +++ b/megamek/src/megamek/common/loaders/BLKSpaceStationFile.java @@ -125,7 +125,7 @@ public Entity getEntity() throws EntityLoadingException { } if (dataFile.exists("modular")) { - a.setModular(true); + a.setModularOrKFAdapter(true); } // Grav Decks - two approaches