Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPA: Terrain Master [Nightwalker] #4102

Merged
merged 7 commits into from
Jan 29, 2023
Merged
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
2 changes: 2 additions & 0 deletions megamek/i18n/megamek/common/options/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions megamek/src/megamek/common/Aero.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions megamek/src/megamek/common/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions megamek/src/megamek/common/LandAirMech.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 25 additions & 20 deletions megamek/src/megamek/common/MoveStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
5 changes: 5 additions & 0 deletions megamek/src/megamek/common/VTOL.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ public boolean isMakingVTOLGroundAttack() {
return bombTarget != null || !strafingCoords.isEmpty();
}

@Override
public boolean isNightwalker() {
return false;
}

@Override
public boolean doomedInSpace() {
return true;
Expand Down
1 change: 1 addition & 0 deletions megamek/src/megamek/common/options/OptionsConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions megamek/src/megamek/common/options/PilotOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down