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

#5995 - Prevent Field Guns from exploding/jamming #6024

Merged
merged 2 commits into from
Sep 22, 2024
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: 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;
} else if ((roll.getIntValue() <= 2) && !ae.isConventionalInfantry()) {
// attack roll was a 2, may explode
} else if (roll.getIntValue() <= 2) {
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
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 @@ -46,6 +46,8 @@ public PrototypeCLUltraWeaponHandler(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() <= 3) && (howManyShots == 2)) {
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
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
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
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