diff --git a/megamek/i18n/megamek/common/options/messages.properties b/megamek/i18n/megamek/common/options/messages.properties index 33ffcb96cf3..a500c422052 100644 --- a/megamek/i18n/megamek/common/options/messages.properties +++ b/megamek/i18n/megamek/common/options/messages.properties @@ -556,6 +556,8 @@ PilotOptionsInfo.option.tm_frogman.displayableName=Terrain Master [Frogman] (Cam PilotOptionsInfo.option.tm_frogman.description=Movement in depth 2 or greater water costs 1 MP less.\nAlso grants -1 to all PSR checks (including physicals) as well as -2 to Crush Depth checks. PilotOptionsInfo.option.tm_mountaineer.displayableName=Terrain Master [Mountaineer] (CamOps) PilotOptionsInfo.option.tm_mountaineer.description=Movement in rubble or rough cost 1 less MP and elevation changes also cost 1 MP less.\nThe mountaineer also recieves a -1 to PSR checks for the given terrain. +PilotOptionsInfo.option.tm_nightwalker.displayableName=Terrain Master [Nightwalker] (CamOps) +PilotOptionsInfo.option.tm_nightwalker.description=Nightwalker ignores all darkness move penalties when using Walk / Cruise movement but does not affect gunnery modifiers for lighting conditions. PilotOptionsInfo.option.tm_swamp_beast.displayableName=Terrain Master [Swamp Beast] (CamOps) PilotOptionsInfo.option.tm_swamp_beast.description=Movement in mud or swamp costs 1 less MP.\nUsing run/flank MP while in mud/swamp gives +1 BTH when being attacked PilotOptionsInfo.option.zweihander.displayableName= Zweihander (CamOps) diff --git a/megamek/src/megamek/common/Aero.java b/megamek/src/megamek/common/Aero.java index bbfacead3d3..624f02f6d2a 100644 --- a/megamek/src/megamek/common/Aero.java +++ b/megamek/src/megamek/common/Aero.java @@ -2061,6 +2061,11 @@ public boolean isLocationProhibited(Coords c, int currElevation) { || (hex.terrainLevel(Terrains.GEYSER) == 2); } + @Override + public boolean isNightwalker() { + return false; + } + @Override public boolean isSpheroid() { return spheroid; diff --git a/megamek/src/megamek/common/Entity.java b/megamek/src/megamek/common/Entity.java index 73424d64ae0..112a776e2d6 100644 --- a/megamek/src/megamek/common/Entity.java +++ b/megamek/src/megamek/common/Entity.java @@ -12800,6 +12800,16 @@ public boolean isNaval() { || (getMovementMode() == EntityMovementMode.SUBMARINE); } + /** + * Determines if the pilot has the Nightwalker SPA + * @return true when pilots have the SPA and are not + * in a flying vehicle. + */ + + public boolean isNightwalker() { + return getCrew().getOptions().booleanOption(OptionsConstants.PILOT_TM_NIGHTWALKER); + } + /** * used to set the source of the creation of this entity, i.e RS PPU Custom * what not Fluff for MMLab diff --git a/megamek/src/megamek/common/LandAirMech.java b/megamek/src/megamek/common/LandAirMech.java index e0ad84508db..01c2fb22e2e 100644 --- a/megamek/src/megamek/common/LandAirMech.java +++ b/megamek/src/megamek/common/LandAirMech.java @@ -1153,6 +1153,15 @@ public boolean isMakingVTOLGroundAttack() { return airmechBombTarget != null; } + @Override + public boolean isNightwalker() { + if (isAirborne()) { + return false; + } else { + return getCrew().getOptions().booleanOption(OptionsConstants.PILOT_TM_NIGHTWALKER); + } + } + @Override public int getCurrentVelocity() { // if using advanced movement then I just want to sum up diff --git a/megamek/src/megamek/common/MoveStep.java b/megamek/src/megamek/common/MoveStep.java index deed2766594..85cbb58312e 100644 --- a/megamek/src/megamek/common/MoveStep.java +++ b/megamek/src/megamek/common/MoveStep.java @@ -2961,27 +2961,32 @@ && getEntity().getPosition().equals(prev) } break; } + // Light - switch (game.getPlanetaryConditions().getLight()) { - case PlanetaryConditions.L_FULL_MOON: - if (!isLightSpecialist) { - mp += 1; - } - break; - case PlanetaryConditions.L_MOONLESS: - if (!isLightSpecialist) { - mp += 2; - } else { - mp += 1; - } - break; - case PlanetaryConditions.L_PITCH_BLACK: - if (!isLightSpecialist) { - mp += 3; - } else { - mp += 1; - } - break; + if (!entity.isNightwalker()) { + switch (game.getPlanetaryConditions().getLight()) { + case PlanetaryConditions.L_FULL_MOON: + if (!isLightSpecialist) { + mp += 1; + } + break; + case PlanetaryConditions.L_MOONLESS: + if (!isLightSpecialist) { + mp += 2; + } else { + mp += 1; + } + break; + case PlanetaryConditions.L_PITCH_BLACK: + if (!isLightSpecialist) { + mp += 3; + } else { + mp += 1; + } + break; + } + } else if (game.getPlanetaryConditions().getLight() > PlanetaryConditions.L_DUSK) { + setRunProhibited(true); } } diff --git a/megamek/src/megamek/common/VTOL.java b/megamek/src/megamek/common/VTOL.java index 94d5b653857..8b8bc15e0ba 100644 --- a/megamek/src/megamek/common/VTOL.java +++ b/megamek/src/megamek/common/VTOL.java @@ -298,6 +298,11 @@ public boolean isMakingVTOLGroundAttack() { return bombTarget != null || !strafingCoords.isEmpty(); } + @Override + public boolean isNightwalker() { + return false; + } + @Override public boolean doomedInSpace() { return true; diff --git a/megamek/src/megamek/common/options/OptionsConstants.java b/megamek/src/megamek/common/options/OptionsConstants.java index b19f040b940..83152b3702b 100644 --- a/megamek/src/megamek/common/options/OptionsConstants.java +++ b/megamek/src/megamek/common/options/OptionsConstants.java @@ -165,6 +165,7 @@ public class OptionsConstants { public static final String PILOT_TM_FOREST_RANGER = "tm_forest_ranger"; public static final String PILOT_TM_FROGMAN = "tm_frogman"; public static final String PILOT_TM_MOUNTAINEER = "tm_mountaineer"; + public static final String PILOT_TM_NIGHTWALKER = "tm_nightwalker"; public static final String PILOT_TM_SWAMP_BEAST = "tm_swamp_beast"; // public static final String PILOT_WIND_WALKER = "wind_walker"; public static final String PILOT_ZWEIHANDER = "zweihander"; diff --git a/megamek/src/megamek/common/options/PilotOptions.java b/megamek/src/megamek/common/options/PilotOptions.java index 57ce35bf526..4d9ef71012c 100755 --- a/megamek/src/megamek/common/options/PilotOptions.java +++ b/megamek/src/megamek/common/options/PilotOptions.java @@ -59,6 +59,7 @@ public void initialize() { addOption(adv, OptionsConstants.PILOT_TM_FOREST_RANGER, false); addOption(adv, OptionsConstants.PILOT_TM_FROGMAN, false); addOption(adv, OptionsConstants.PILOT_TM_MOUNTAINEER, false); + addOption(adv, OptionsConstants.PILOT_TM_NIGHTWALKER, false); addOption(adv, OptionsConstants.PILOT_TM_SWAMP_BEAST, false); // addOption(adv, OptionsConstants.PILOT_WIND_WALKER, false); addOption(adv, OptionsConstants.PILOT_ZWEIHANDER, false);