Skip to content

Commit

Permalink
switch hardcoded string to OptionsConstants
Browse files Browse the repository at this point in the history
  • Loading branch information
Algebro7 committed Aug 5, 2024
1 parent d240884 commit 62ec6e8
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions megamek/src/megamek/common/TripodMech.java
Original file line number Diff line number Diff line change
Expand Up @@ -1062,8 +1062,7 @@ public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMod
case 11:
return new HitData(Mech.LOC_LARM);
case 12:
if (shouldUseEdge(
"edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand Down Expand Up @@ -1117,9 +1116,7 @@ public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMod
case 10:
return new HitData(Mech.LOC_RARM);
case 12:
if (getCrew().hasEdgeRemaining()
&& getCrew().getOptions().booleanOption(
"edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand Down Expand Up @@ -1173,8 +1170,7 @@ && getCrew().getOptions().booleanOption(
case 10:
return new HitData(Mech.LOC_LARM);
case 12:
if (shouldUseEdge(
"edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand Down Expand Up @@ -1224,8 +1220,7 @@ && isProne()) {
case 11:
return new HitData(Mech.LOC_LARM, true);
case 12:
if (shouldUseEdge(
"edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand Down Expand Up @@ -1272,8 +1267,7 @@ && isProne()) {
case 11:
return new HitData(Mech.LOC_LARM, true);
case 12:
if (shouldUseEdge(
"edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand Down Expand Up @@ -1316,8 +1310,7 @@ && isProne()) {
case 5:
return new HitData(Mech.LOC_RARM);
case 6:
if (shouldUseEdge(
"edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand All @@ -1339,8 +1332,7 @@ && isProne()) {
case 5:
return new HitData(Mech.LOC_LARM);
case 6:
if (shouldUseEdge(
"edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand All @@ -1362,8 +1354,7 @@ && isProne()) {
case 5:
return new HitData(Mech.LOC_RARM);
case 6:
if (shouldUseEdge(
"edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand All @@ -1387,7 +1378,7 @@ && isProne()) {
case 5:
return new HitData(Mech.LOC_RARM, true);
case 6:
if (shouldUseEdge("edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand Down Expand Up @@ -1475,7 +1466,7 @@ && isProne()) {
// Swarm attack locations.
switch (roll) {
case 2:
if (shouldUseEdge("edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand Down Expand Up @@ -1503,7 +1494,7 @@ && isProne()) {
case 11:
return new HitData(Mech.LOC_CT, true, effects);
case 12:
if (shouldUseEdge("edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand Down Expand Up @@ -1542,7 +1533,7 @@ && isProne()) {
case 5:
return new HitData(Mech.LOC_RARM, (side == ToHitData.SIDE_REAR));
case 6:
if (shouldUseEdge("edge_when_headhit")) {
if (shouldUseEdge(OptionsConstants.EDGE_WHEN_HEADHIT)) {
getCrew().decreaseEdge();
HitData result = rollHitLocation(table, side,
aimedLocation, aimingMode, cover);
Expand Down

0 comments on commit 62ec6e8

Please sign in to comment.