From f72b2d0eb36fb90db53698e3de353b11681f3f60 Mon Sep 17 00:00:00 2001 From: pheonixstorm Date: Fri, 13 Jan 2023 06:48:05 -0500 Subject: [PATCH 1/6] SPA: Terrain Master [Nightwalker] --- .../common/options/messages.properties | 2 ++ megamek/src/megamek/common/Aero.java | 5 ++++ megamek/src/megamek/common/Entity.java | 10 ++++++++ megamek/src/megamek/common/LandAirMech.java | 9 +++++++ megamek/src/megamek/common/MoveStep.java | 24 +++++++++++-------- megamek/src/megamek/common/VTOL.java | 5 ++++ .../common/options/OptionsConstants.java | 3 ++- .../megamek/common/options/PilotOptions.java | 1 + 8 files changed, 48 insertions(+), 11 deletions(-) diff --git a/megamek/i18n/megamek/common/options/messages.properties b/megamek/i18n/megamek/common/options/messages.properties index 9f614ddb2fb..6ec38250850 100644 --- a/megamek/i18n/megamek/common/options/messages.properties +++ b/megamek/i18n/megamek/common/options/messages.properties @@ -555,6 +555,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 82d063f1aa5..6fe290b8a98 100644 --- a/megamek/src/megamek/common/Aero.java +++ b/megamek/src/megamek/common/Aero.java @@ -2053,6 +2053,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 65cd72d1932..114ae3ec87a 100644 --- a/megamek/src/megamek/common/Entity.java +++ b/megamek/src/megamek/common/Entity.java @@ -12810,6 +12810,16 @@ public boolean isNaval() { || (getMovementMode() == EntityMovementMode.SUBMARINE); } + /** + * Determines if the pilot has the Nightwalker SPA + * @return true when pilots have the SPA and 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 2f83fa90ae1..8035be774ff 100644 --- a/megamek/src/megamek/common/LandAirMech.java +++ b/megamek/src/megamek/common/LandAirMech.java @@ -1142,6 +1142,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 aacf5ef2b99..04873ff1ed6 100644 --- a/megamek/src/megamek/common/MoveStep.java +++ b/megamek/src/megamek/common/MoveStep.java @@ -2953,16 +2953,20 @@ && getEntity().getPosition().equals(prev) break; } // Light - switch (game.getPlanetaryConditions().getLight()) { - case PlanetaryConditions.L_FULL_MOON: - mp += 1; - break; - case PlanetaryConditions.L_MOONLESS: - mp += 2; - break; - case PlanetaryConditions.L_PITCH_BLACK: - mp += 3; - break; + if (!entity.isNightwalker()) { + switch (game.getPlanetaryConditions().getLight()) { + case PlanetaryConditions.L_FULL_MOON: + mp += 1; + break; + case PlanetaryConditions.L_MOONLESS: + mp += 2; + break; + case PlanetaryConditions.L_PITCH_BLACK: + mp += 3; + break; + } + } else { + setRunProhibited(true); } } diff --git a/megamek/src/megamek/common/VTOL.java b/megamek/src/megamek/common/VTOL.java index 9cc7e430e10..9086014bd2c 100644 --- a/megamek/src/megamek/common/VTOL.java +++ b/megamek/src/megamek/common/VTOL.java @@ -292,6 +292,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 05de66207bd..20d10698de4 100644 --- a/megamek/src/megamek/common/options/OptionsConstants.java +++ b/megamek/src/megamek/common/options/OptionsConstants.java @@ -167,7 +167,8 @@ public class OptionsConstants { // public static final String PILOT_TM_= "tm_"; 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_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 1fe81e61551..012b9e22472 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); From 9d91b40865170132c38a9e089e239b4e94798880 Mon Sep 17 00:00:00 2001 From: pheonixstorm Date: Sat, 14 Jan 2023 21:21:12 -0500 Subject: [PATCH 2/6] Update megamek/src/megamek/common/Entity.java Co-authored-by: Justin Bowen <39067288+Windchild292@users.noreply.github.com> --- megamek/src/megamek/common/Entity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/megamek/src/megamek/common/Entity.java b/megamek/src/megamek/common/Entity.java index 114ae3ec87a..af30e1659b2 100644 --- a/megamek/src/megamek/common/Entity.java +++ b/megamek/src/megamek/common/Entity.java @@ -12812,7 +12812,7 @@ public boolean isNaval() { /** * Determines if the pilot has the Nightwalker SPA - * @return true when pilots have the SPA and not + * @return true when pilots have the SPA and are not * in a flying vehicle. */ From 343f5a5b3614b3267a651ec2d688ee7a1975e594 Mon Sep 17 00:00:00 2001 From: pheonixstorm Date: Sat, 14 Jan 2023 21:31:43 -0500 Subject: [PATCH 3/6] Update megamek/src/megamek/common/options/OptionsConstants.java Co-authored-by: Justin Bowen <39067288+Windchild292@users.noreply.github.com> --- megamek/src/megamek/common/options/OptionsConstants.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/megamek/src/megamek/common/options/OptionsConstants.java b/megamek/src/megamek/common/options/OptionsConstants.java index 20d10698de4..c1dcc5fc16a 100644 --- a/megamek/src/megamek/common/options/OptionsConstants.java +++ b/megamek/src/megamek/common/options/OptionsConstants.java @@ -167,8 +167,8 @@ public class OptionsConstants { // public static final String PILOT_TM_= "tm_"; 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_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"; From 587bd68b1b595f8387d0cad442e7e58633718b49 Mon Sep 17 00:00:00 2001 From: pheonixstorm Date: Sun, 15 Jan 2023 19:33:25 -0500 Subject: [PATCH 4/6] Update megamek/i18n/megamek/common/options/messages.properties Co-authored-by: Justin Bowen <39067288+Windchild292@users.noreply.github.com> --- megamek/i18n/megamek/common/options/messages.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/megamek/i18n/megamek/common/options/messages.properties b/megamek/i18n/megamek/common/options/messages.properties index 6ec38250850..eb2982e51eb 100644 --- a/megamek/i18n/megamek/common/options/messages.properties +++ b/megamek/i18n/megamek/common/options/messages.properties @@ -556,7 +556,7 @@ PilotOptionsInfo.option.tm_frogman.description=Movement in depth 2 or greater wa 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_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) From c23dd11d7517a8eca7ac5d2009ebc75173f6017e Mon Sep 17 00:00:00 2001 From: pheonixstorm Date: Mon, 16 Jan 2023 01:23:06 -0500 Subject: [PATCH 5/6] Fixed a bug that prevented running during daytime --- megamek/src/megamek/common/MoveStep.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/megamek/src/megamek/common/MoveStep.java b/megamek/src/megamek/common/MoveStep.java index 04873ff1ed6..d413524e1ce 100644 --- a/megamek/src/megamek/common/MoveStep.java +++ b/megamek/src/megamek/common/MoveStep.java @@ -2965,7 +2965,7 @@ && getEntity().getPosition().equals(prev) mp += 3; break; } - } else { + } else if ((game.getPlanetaryConditions().getLight() > PlanetaryConditions.L_DUSK)){ setRunProhibited(true); } } From 7a0bf8666981f0451e0ba9dc8dd76a4f107bc6c0 Mon Sep 17 00:00:00 2001 From: pheonixstorm Date: Sun, 29 Jan 2023 14:48:30 -0500 Subject: [PATCH 6/6] Remove unnecessary braces Co-authored-by: Justin Bowen <39067288+Windchild292@users.noreply.github.com> --- megamek/src/megamek/common/MoveStep.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/megamek/src/megamek/common/MoveStep.java b/megamek/src/megamek/common/MoveStep.java index d413524e1ce..83c4b04b27c 100644 --- a/megamek/src/megamek/common/MoveStep.java +++ b/megamek/src/megamek/common/MoveStep.java @@ -2965,7 +2965,7 @@ && getEntity().getPosition().equals(prev) mp += 3; break; } - } else if ((game.getPlanetaryConditions().getLight() > PlanetaryConditions.L_DUSK)){ + } else if (game.getPlanetaryConditions().getLight() > PlanetaryConditions.L_DUSK) { setRunProhibited(true); } }