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

Field Gun CI Alpha Strike changes #4067

Merged
merged 3 commits into from
Dec 26, 2022
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
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