diff --git a/megamek/src/megamek/common/Mech.java b/megamek/src/megamek/common/Mech.java index d9425f84968..3062516158e 100644 --- a/megamek/src/megamek/common/Mech.java +++ b/megamek/src/megamek/common/Mech.java @@ -1971,7 +1971,8 @@ public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMod // normal front hits switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { getCrew().decreaseEdge(); @@ -1997,7 +1998,8 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) case 11: return new HitData(Mech.LOC_LARM); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); @@ -2012,7 +2014,8 @@ && getCrew().getOptions().booleanOption( // normal left side hits switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() && getCrew() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew() .getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { getCrew().decreaseEdge(); @@ -2049,7 +2052,8 @@ && getCrew().getOptions().booleanOption( case 11: return new HitData(Mech.LOC_RLEG); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); @@ -2064,7 +2068,8 @@ && getCrew().getOptions().booleanOption( // normal right side hits switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() && getCrew() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew() .getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { getCrew().decreaseEdge(); @@ -2101,7 +2106,8 @@ && getCrew().getOptions().booleanOption( case 11: return new HitData(Mech.LOC_LLEG); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); @@ -2119,7 +2125,8 @@ && getCrew().getOptions().booleanOption( && isProne()) { switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() && getCrew() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew() .getOptions() .booleanOption(OptionsConstants.EDGE_WHEN_TAC)) && !game.getOptions().booleanOption( @@ -2149,7 +2156,8 @@ && isProne()) { case 11: return new HitData(Mech.LOC_LARM, true); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); @@ -2164,7 +2172,8 @@ && getCrew().getOptions().booleanOption( } else { switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() && getCrew() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew() .getOptions() .booleanOption(OptionsConstants.EDGE_WHEN_TAC)) && !game.getOptions().booleanOption( @@ -2194,7 +2203,8 @@ && getCrew().getOptions().booleanOption( case 11: return new HitData(Mech.LOC_LARM, true); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); @@ -2239,7 +2249,8 @@ && getCrew().getOptions().booleanOption( case 5: return new HitData(Mech.LOC_RARM); case 6: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); @@ -2263,7 +2274,8 @@ && getCrew().getOptions().booleanOption( case 5: return new HitData(Mech.LOC_LARM); case 6: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); @@ -2287,7 +2299,8 @@ && getCrew().getOptions().booleanOption( case 5: return new HitData(Mech.LOC_RARM); case 6: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); @@ -2313,7 +2326,8 @@ && getCrew().getOptions().booleanOption( case 5: return new HitData(Mech.LOC_RARM, true); case 6: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); @@ -2392,7 +2406,8 @@ && getCrew().getOptions().booleanOption( // Swarm attack locations. switch (roll) { case 2: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); @@ -2419,7 +2434,8 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { case 11: return new HitData(Mech.LOC_CT, true, effects); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); @@ -2460,7 +2476,8 @@ && getCrew().getOptions().booleanOption( case 5: return new HitData(Mech.LOC_RARM, (side == ToHitData.SIDE_REAR)); case 6: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); diff --git a/megamek/src/megamek/common/QuadMech.java b/megamek/src/megamek/common/QuadMech.java index 83bc3ca0b02..a432f9d7d1c 100644 --- a/megamek/src/megamek/common/QuadMech.java +++ b/megamek/src/megamek/common/QuadMech.java @@ -458,9 +458,10 @@ public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMod // normal front hits switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) - && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { + && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); result.setUndoneLocation(tac(table, side, Mech.LOC_CT, cover, false)); @@ -484,7 +485,8 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) case 11: return new HitData(Mech.LOC_RLEG); case 12: - if ((getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT))) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); @@ -496,9 +498,10 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT))) { } else if (side == ToHitData.SIDE_REAR) { switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) - && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { + && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); result.setUndoneLocation(tac(table, side, Mech.LOC_CT, cover, true)); @@ -522,7 +525,8 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) case 11: return new HitData(Mech.LOC_RARM, true); case 12: - if ((getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT))) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); @@ -534,9 +538,10 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT))) { } else if (side == ToHitData.SIDE_LEFT) { switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) - && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { + && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); result.setUndoneLocation(tac(table, side, Mech.LOC_LT, cover, false)); @@ -560,7 +565,8 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) case 11: return new HitData(Mech.LOC_RLEG); case 12: - if ((getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT))) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); @@ -572,9 +578,10 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT))) { } else if (side == ToHitData.SIDE_RIGHT) { switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) - && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { + && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); result.setUndoneLocation(tac(table, side, Mech.LOC_RT, cover, false)); @@ -598,7 +605,8 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) case 11: return new HitData(Mech.LOC_LLEG); case 12: - if ((getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT))) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); @@ -639,8 +647,9 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT))) { case 5: return new HitData(Mech.LOC_RARM); case 6: - if (getCrew().hasEdgeRemaining() - && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() + && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); result.setUndoneLocation(new HitData(Mech.LOC_HEAD, true)); @@ -661,8 +670,9 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { case 5: return new HitData(Mech.LOC_RLEG, true); case 6: - if (getCrew().hasEdgeRemaining() - && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() + && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); result.setUndoneLocation(new HitData(Mech.LOC_HEAD, true)); @@ -682,8 +692,9 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { case 5: return new HitData(Mech.LOC_LLEG); case 6: - if (getCrew().hasEdgeRemaining() - && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() + && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); result.setUndoneLocation(new HitData(Mech.LOC_HEAD, true)); @@ -703,8 +714,9 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { case 5: return new HitData(Mech.LOC_RLEG); case 6: - if (getCrew().hasEdgeRemaining() - && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() + && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); result.setUndoneLocation(new HitData(Mech.LOC_HEAD, true)); @@ -773,7 +785,8 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { // Swarm attack locations. switch (roll) { case 2: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); @@ -800,7 +813,8 @@ && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { case 11: return new HitData(Mech.LOC_LT, false, effects); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_HEADHIT)) { getCrew().decreaseEdge(); HitData result = rollHitLocation(table, side, aimedLocation, aimingMode, cover); diff --git a/megamek/src/megamek/common/TripodMech.java b/megamek/src/megamek/common/TripodMech.java index 92ee039874d..2e7b7a504a6 100644 --- a/megamek/src/megamek/common/TripodMech.java +++ b/megamek/src/megamek/common/TripodMech.java @@ -1029,7 +1029,8 @@ public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMod // normal front hits switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() && getCrew() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew() .getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { getCrew().decreaseEdge(); @@ -1063,7 +1064,8 @@ public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMod case 11: return new HitData(Mech.LOC_LARM); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); @@ -1078,7 +1080,8 @@ && getCrew().getOptions().booleanOption( // normal left side hits switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() && getCrew() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew() .getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { getCrew().decreaseEdge(); @@ -1135,7 +1138,8 @@ && getCrew().getOptions().booleanOption( // normal right side hits switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() && getCrew() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew() .getOptions().booleanOption(OptionsConstants.EDGE_WHEN_TAC)) && !game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_NO_TAC)) { getCrew().decreaseEdge(); @@ -1177,7 +1181,8 @@ && getCrew().getOptions().booleanOption( case 10: return new HitData(Mech.LOC_LARM); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); @@ -1195,7 +1200,8 @@ && getCrew().getOptions().booleanOption( && isProne()) { switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() && getCrew() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew() .getOptions() .booleanOption(OptionsConstants.EDGE_WHEN_TAC)) && !game.getOptions().booleanOption( @@ -1231,7 +1237,8 @@ && isProne()) { case 11: return new HitData(Mech.LOC_LARM, true); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); @@ -1246,7 +1253,8 @@ && getCrew().getOptions().booleanOption( } else { switch (roll) { case 2: - if ((getCrew().hasEdgeRemaining() && getCrew() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && (getCrew().hasEdgeRemaining() && getCrew() .getOptions() .booleanOption(OptionsConstants.EDGE_WHEN_TAC)) && !game.getOptions().booleanOption( @@ -1282,7 +1290,8 @@ && getCrew().getOptions().booleanOption( case 11: return new HitData(Mech.LOC_LARM, true); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); @@ -1327,7 +1336,8 @@ && getCrew().getOptions().booleanOption( case 5: return new HitData(Mech.LOC_RARM); case 6: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); @@ -1351,7 +1361,8 @@ && getCrew().getOptions().booleanOption( case 5: return new HitData(Mech.LOC_LARM); case 6: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); @@ -1375,7 +1386,8 @@ && getCrew().getOptions().booleanOption( case 5: return new HitData(Mech.LOC_RARM); case 6: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); @@ -1401,7 +1413,8 @@ && getCrew().getOptions().booleanOption( case 5: return new HitData(Mech.LOC_RARM, true); case 6: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); @@ -1491,7 +1504,8 @@ && getCrew().getOptions().booleanOption( // Swarm attack locations. switch (roll) { case 2: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); @@ -1521,7 +1535,8 @@ && getCrew().getOptions().booleanOption( case 11: return new HitData(Mech.LOC_CT, true, effects); case 12: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); @@ -1562,7 +1577,8 @@ && getCrew().getOptions().booleanOption( case 5: return new HitData(Mech.LOC_RARM, (side == ToHitData.SIDE_REAR)); case 6: - if (getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && getCrew().hasEdgeRemaining() && getCrew().getOptions().booleanOption( "edge_when_headhit")) { getCrew().decreaseEdge(); diff --git a/megamek/src/megamek/server/GameManager.java b/megamek/src/megamek/server/GameManager.java index 2eca511c570..b26c347746d 100644 --- a/megamek/src/megamek/server/GameManager.java +++ b/megamek/src/megamek/server/GameManager.java @@ -8612,7 +8612,8 @@ private boolean checkMASCFailure(Entity entity, MovePath md) { if (entity.checkForMASCFailure(md, vReport, crits)) { boolean mascFailure = true; // Check to see if the pilot can reroll due to Edge - if (entity.getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && entity.getCrew().hasEdgeRemaining() && entity.getCrew().getOptions() .booleanOption(OptionsConstants.EDGE_WHEN_MASC_FAILS)) { entity.getCrew().decreaseEdge(); @@ -8665,7 +8666,8 @@ private boolean checkSuperchargerFailure(Entity entity, MovePath md) { if (entity.checkForSuperchargerFailure(md, vReport, crits)) { boolean superchargerFailure = true; // Check to see if the pilot can reroll due to Edge - if (entity.getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && entity.getCrew().hasEdgeRemaining() && entity.getCrew().getOptions() .booleanOption(OptionsConstants.EDGE_WHEN_MASC_FAILS)) { entity.getCrew().decreaseEdge(); @@ -20057,6 +20059,7 @@ private Vector resolveControl(Entity e) { if (e.getAltitude() <= 0 // Don't waste the edge if it won't help && origAltitude > 1 + && game.getOptions().booleanOption(OptionsConstants.EDGE) && e.getCrew().hasEdgeRemaining() && e.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_ALT_LOSS)) { Roll diceRoll3 = Compute.rollD6(1); @@ -20443,7 +20446,8 @@ private Vector resolveCrewDamage(Entity e, int damage, int crewPos) { } else { e.getCrew().setKoThisRound(true, crewPos); r.choose(false); - if (e.getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && e.getCrew().hasEdgeRemaining() && (e.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_KO) || e.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_KO))) { edgeUsed = true; @@ -20457,7 +20461,8 @@ private Vector resolveCrewDamage(Entity e, int damage, int crewPos) { // return true; } // else vDesc.add(r); - } while (e.getCrew().hasEdgeRemaining() + } while (game.getOptions().booleanOption(OptionsConstants.EDGE) + && e.getCrew().hasEdgeRemaining() && e.getCrew().isKoThisRound(crewPos) && (e.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_KO) || e.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_KO))); @@ -24222,7 +24227,8 @@ private Vector applyAeroCritical(Aero aero, int loc, CriticalSlot cs, in r.subject = aero.getId(); if (fuelroll >= boomTarget) { // A chance to reroll the explosion with edge - if (aero.getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && aero.getCrew().hasEdgeRemaining() && aero.getCrew().getOptions().booleanOption( OptionsConstants.EDGE_WHEN_AERO_EXPLOSION)) { // Reporting this is funky because 9120 only has room for 2 choices. Replace it. @@ -24468,7 +24474,8 @@ private Vector applyAeroCritical(Aero aero, int loc, CriticalSlot cs, in boomTarget = 10; r.choose(ammoRoll >= boomTarget); // A chance to reroll an explosion with edge - if (aero.getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && aero.getCrew().hasEdgeRemaining() && aero.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_EXPLOSION) && ammoRoll >= boomTarget) { // Report 9156 doesn't offer the right choices. Replace it. @@ -24523,7 +24530,8 @@ private Vector applyAeroCritical(Aero aero, int loc, CriticalSlot cs, in int ammoroll = Compute.d6(2); if (ammoroll >= 10) { // A chance to reroll an explosion with edge - if (aero.getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && aero.getCrew().hasEdgeRemaining() && aero.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_EXPLOSION)) { aero.getCrew().decreaseEdge(); r = new Report(6530); @@ -24552,7 +24560,8 @@ private Vector applyAeroCritical(Aero aero, int loc, CriticalSlot cs, in } } // If the weapon is explosive, use edge to roll up a new one - if (aero.getCrew().hasEdgeRemaining() + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && aero.getCrew().hasEdgeRemaining() && aero.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_EXPLOSION) && (equipmentHit.getType().isExplosive(equipmentHit) && !equipmentHit.isHit() && !equipmentHit.isDestroyed())) { @@ -24825,7 +24834,8 @@ private void applyCargoCritical(Aero aero, int damageCaused, Vector repo int roll = Compute.d6(1); // A hit on a bay filled with transported units is devastating // allow a reroll with edge - if (aero.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_UNIT_CARGO_LOST) + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && aero.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_UNIT_CARGO_LOST) && aero.getCrew().hasEdgeRemaining() && roll > 3) { aero.getCrew().decreaseEdge(); r = new Report(9172); @@ -25859,7 +25869,8 @@ private void checkAeroCrits(Vector vDesc, Aero a, HitData hit, if (diceRoll.getIntValue() >= capitalMissile) { // Allow a reroll with edge - if (a.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_NUKE_CRIT) + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && a.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_NUKE_CRIT) && a.getCrew().hasEdgeRemaining()) { a.getCrew().decreaseEdge(); r = new Report(9148); @@ -25913,7 +25924,8 @@ private void checkAeroCrits(Vector vDesc, Aero a, HitData hit, if (hit.rolledBoxCars()) { if (hit.isFirstHit()) { // Allow edge use to ignore the critical roll - if (a.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_LUCKY_CRIT) + if (game.getOptions().booleanOption(OptionsConstants.EDGE) + && a.getCrew().getOptions().booleanOption(OptionsConstants.EDGE_WHEN_AERO_LUCKY_CRIT) && a.getCrew().hasEdgeRemaining()) { a.getCrew().decreaseEdge(); r = new Report(9103); @@ -26280,6 +26292,7 @@ public Vector criticalEntity(Entity en, int loc, boolean isRear, } // if explosive use edge if ((en instanceof Mech) + && game.getOptions().booleanOption(OptionsConstants.EDGE) && (en.getCrew().hasEdgeRemaining() && en.getCrew().getOptions() .booleanOption(OptionsConstants.EDGE_WHEN_EXPLOSION)) && (slot.getType() == CriticalSlot.TYPE_EQUIPMENT)