-
Notifications
You must be signed in to change notification settings - Fork 291
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
Issue #2652 TacOps BA crits #4046
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -589,6 +589,16 @@ public String getMovementAbbr(EntityMovementType mtype) { | |
@Override | ||
public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMode aimingMode, | ||
int cover) { | ||
return rollHitLocation(table, side, aimedLocation, aimingMode, cover, false); | ||
} | ||
|
||
/** | ||
* Battle Armor units can only get hit in undestroyed troopers. | ||
* | ||
* @param isAttackingConvInfantry Set to true when attacked by CI, as these cannot score TacOps crits | ||
*/ | ||
public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMode aimingMode, | ||
int cover, boolean isAttackingConvInfantry) { | ||
Check notice Code scanning / CodeQL Useless parameter
The parameter 'cover' is never used.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why add this method with two unused parameters? Keeping it consistent with the general rollHitLocation methods? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More like, didn't think about it. I guess it's not worth getting the compiler warnings and github alerts for it, so I removed them. |
||
|
||
// If this squad was killed, target trooper 1 (just because). | ||
if (isDoomed()) { | ||
|
@@ -621,16 +631,13 @@ public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMod | |
loc = Compute.d6(); | ||
} | ||
|
||
int critLocation = Compute.d6(); | ||
// TacOps p. 108 Trooper takes a crit if a second roll is the same | ||
// location as the first. | ||
// TO:AR p.108: Trooper takes a crit if a second roll is the same location as the first. | ||
if (game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_BA_CRITICALS) | ||
&& (loc == critLocation)) { | ||
&& (loc == Compute.d6()) && !isAttackingConvInfantry) { | ||
return new HitData(loc, false, HitData.EFFECT_CRITICAL); | ||
} | ||
// Hit that trooper. | ||
return new HitData(loc); | ||
|
||
} | ||
|
||
@Override | ||
|
Check notice
Code scanning / CodeQL
Useless parameter