Skip to content

Commit

Permalink
prevent weapon jams/explosions for CI Field Guns
Browse files Browse the repository at this point in the history
  • Loading branch information
SJuliez committed Sep 21, 2024
1 parent 5ce2a66 commit a70aa0e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/weapons/ACCaselessHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected boolean doChecks(Vector<Report> vPhaseReport) {
return true;
}

if ((roll.getIntValue() <= 2) && !(ae instanceof Infantry)) {
if ((roll.getIntValue() <= 2) && !ae.isConventionalInfantry()) {
Roll diceRoll = Compute.rollD6(2);

Report r = new Report(3164);
Expand Down
4 changes: 2 additions & 2 deletions megamek/src/megamek/common/weapons/AmmoWeaponHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ protected boolean doAmmoFeedProblemCheck(Vector<Report> vPhaseReport) {
// don't have neg ammo feed problem quirk
if (!weapon.hasQuirk(OptionsConstants.QUIRK_WEAP_NEG_AMMO_FEED_PROBLEMS)) {
return false;
// attack roll was a 2, may explode
} else if ((roll.getIntValue() <= 2) && !ae.isConventionalInfantry()) {
// attack roll was a 2, may explode
Roll diceRoll = Compute.rollD6(2);

Report r = new Report(3173);
Expand Down Expand Up @@ -142,8 +142,8 @@ protected boolean doAmmoFeedProblemCheck(Vector<Report> vPhaseReport) {
vPhaseReport.addElement(r);
return false;
}
// attack roll was not 2, won't explode
} else {
// attack roll was not 2, won't explode
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public PrototypeCLUltraWeaponHandler(ToHitData t, WeaponAttackAction w, Game g,
protected boolean doChecks(Vector<Report> vPhaseReport) {
if (doAmmoFeedProblemCheck(vPhaseReport)) {
return true;
}
if (ae.isConventionalInfantry()) {
} else if (ae.isConventionalInfantry()) {
return false;
}

Expand Down
4 changes: 1 addition & 3 deletions megamek/src/megamek/common/weapons/RACHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ public RACHandler(ToHitData t, WeaponAttackAction w, Game g, TWGameManager m) {
protected boolean doChecks(Vector<Report> vPhaseReport) {
if (doAmmoFeedProblemCheck(vPhaseReport)) {
return true;
}

if (ae instanceof Infantry) {
} else if (ae.isConventionalInfantry()) {
return false;
}
boolean jams = false;
Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/weapons/UltraWeaponHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ protected boolean doChecks(Vector<Report> vPhaseReport) {
return true;
}

if ((roll.getIntValue() == 2) && (howManyShots == 2) && !(ae instanceof Infantry)) {
if ((roll.getIntValue() == 2) && (howManyShots == 2) && !ae.isConventionalInfantry()) {
Report r = new Report();
r.subject = subjectId;
weapon.setJammed(true);
Expand Down

0 comments on commit a70aa0e

Please sign in to comment.