Skip to content

Commit

Permalink
Merge pull request #4067 from SJuliez/AS_Corrections_2
Browse files Browse the repository at this point in the history
Field Gun CI Alpha Strike changes
  • Loading branch information
SJuliez authored Dec 26, 2022
2 parents 3c71348 + bbf870a commit 9b53ca4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,35 @@ protected ASConvInfantryDamageConverter(Entity entity, AlphaStrikeElement elemen

@Override
protected void processDamage() {
report.addEmptyLine();
report.addLine("--- Damage:", "");
int baseRange = 0;
if ((infantry.getSecondaryWeapon() != null) && (infantry.getSecondaryWeaponsPerSquad() >= 2)) {
baseRange = infantry.getSecondaryWeapon().getInfantryRange();
} else if (infantry.getPrimaryWeapon() != null) {
baseRange = infantry.getPrimaryWeapon().getInfantryRange();
}
int range = baseRange * 3;
finalSDamage = ASDamage.createDualRoundedUp(getConvInfantryStandardDamage());
String maxRangeText = "Range: S";
if (range > 3) {
finalMDamage = finalSDamage;
maxRangeText = "Ranges: S, M";
}
if (range > 15) {
finalLDamage = finalSDamage;
maxRangeText = "Ranges: S, M, L";
if (infantry.hasFieldWeapon()) {
processSDamage();
processMDamage();
processLDamage();
processFrontSpecialDamage(AC);
processFrontSpecialDamage(FLK);
} else {
int baseRange = 0;
if ((infantry.getSecondaryWeapon() != null) && (infantry.getSecondaryWeaponsPerSquad() >= 2)) {
baseRange = infantry.getSecondaryWeapon().getInfantryRange();
} else if (infantry.getPrimaryWeapon() != null) {
baseRange = infantry.getPrimaryWeapon().getInfantryRange();
}
int range = baseRange * 3;
String maxRangeText;
finalSDamage = ASDamage.createDualRoundedUp(getConvInfantryStandardDamage());
if (range > 15) {
finalLDamage = finalSDamage;
finalMDamage = finalSDamage;
maxRangeText = "Ranges: S, M, L";
} else if (range > 3) {
finalMDamage = finalSDamage;
maxRangeText = "Ranges: S, M";
} else {
maxRangeText = "Range: S";
}
report.addLine("Final Damage", "", finalSDamage + "");
report.addLine("Range:", range + " hexes", maxRangeText);
}
report.addLine("Final Damage", "", finalSDamage + "");
report.addLine("Range:", range + " hexes", maxRangeText);

processHT();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public static double damageLocationMultiplier(Entity en, int loc, Mounted mount)
// Don't count squad support weapons, these are handled separately
return ((mount.getLocation() <= 1) && !mount.isSquadSupportWeapon()) ? 1 : 0;
} else if (en instanceof Infantry) {
return (loc == mount.getLocation()) ? 1 : 0;
// CI only ever have loc == 0 (no TUR, REAR, arcs); do not count standard weapons when it has field guns
return (!((Infantry) en).hasFieldWeapon() || (mount.getLocation() == Infantry.LOC_FIELD_GUNS)) ? 1 : 0;
} else if (en instanceof TripodMech) {
return getTripodMekLocationMultiplier(loc, mount.getLocation(), mount.isRearMounted());
} else if (en instanceof QuadVee) {
Expand Down

0 comments on commit 9b53ca4

Please sign in to comment.