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 418a656 commit 5ce2a66
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/weapons/AmmoWeaponHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected boolean doAmmoFeedProblemCheck(Vector<Report> vPhaseReport) {
if (!weapon.hasQuirk(OptionsConstants.QUIRK_WEAP_NEG_AMMO_FEED_PROBLEMS)) {
return false;
// attack roll was a 2, may explode
} else if (roll.getIntValue() <= 2) {
} else if ((roll.getIntValue() <= 2) && !ae.isConventionalInfantry()) {
Roll diceRoll = Compute.rollD6(2);

Report r = new Report(3173);
Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/weapons/HVACWeaponHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected boolean doChecks(Vector<Report> vPhaseReport) {
return true;
}

if (roll.getIntValue() == 2) {
if ((roll.getIntValue() == 2) && !ae.isConventionalInfantry()) {
Report r = new Report(3162);
r.subject = subjectId;
weapon.setJammed(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected boolean doChecks(Vector<Report> vPhaseReport) {
return true;
}

if (roll.getIntValue() == 2) {
if ((roll.getIntValue() == 2) && !ae.isConventionalInfantry()) {
Report r = new Report(3161);
r.subject = subjectId;
r.newlines = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ protected boolean doChecks(Vector<Report> vPhaseReport) {
if (doAmmoFeedProblemCheck(vPhaseReport)) {
return true;
}
if (roll.getIntValue() == 2) {

if ((roll.getIntValue() == 2) && !ae.isConventionalInfantry()) {
Report r = new Report(3165);
r.subject = subjectId;
weapon.setJammed(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ protected boolean doChecks(Vector<Report> vPhaseReport) {
if (doAmmoFeedProblemCheck(vPhaseReport)) {
return true;
}
if (ae.isConventionalInfantry()) {
return false;
}

if ((roll.getIntValue() <= 3) && (howManyShots == 2)) {
Report r = new Report(3160);
Expand Down
4 changes: 2 additions & 2 deletions megamek/src/megamek/common/weapons/PrototypeGaussHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ protected boolean doChecks(Vector<Report> vPhaseReport) {
if (doAmmoFeedProblemCheck(vPhaseReport)) {
return true;
}
if (roll.getIntValue() == 2) {

if ((roll.getIntValue() == 2) && !ae.isConventionalInfantry()) {
Report r = new Report(3165);
r.subject = subjectId;
weapon.setJammed(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public PrototypeISUltraWeaponHandler(ToHitData t, WeaponAttackAction w, Game g,
protected boolean doChecks(Vector<Report> vPhaseReport) {
if (doAmmoFeedProblemCheck(vPhaseReport)) {
return true;
} else if (ae.isConventionalInfantry()) {
return false;
}

if (((roll.getIntValue() <= 4) && (howManyShots == 2))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected boolean doChecks(Vector<Report> vPhaseReport) {
return true;
}

if (roll.getIntValue() == 2) {
if ((roll.getIntValue() == 2) && !ae.isConventionalInfantry()) {
Report r = new Report(3165);
r.subject = subjectId;
weapon.setJammed(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected boolean doChecks(Vector<Report> vPhaseReport) {
if (kindRapidFire) {
jamLevel = 2;
}
if ((roll.getIntValue() <= jamLevel) && (howManyShots == 2) && !(ae instanceof Infantry)) {
if ((roll.getIntValue() <= jamLevel) && (howManyShots == 2) && !ae.isConventionalInfantry()) {
if (roll.getIntValue() > 2 || kindRapidFire) {
Report r = new Report(3161);
r.subject = subjectId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected boolean doChecks(Vector<Report> vPhaseReport) {
return true;
}

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

0 comments on commit 5ce2a66

Please sign in to comment.