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

BV Calculation for Minefield Artillery rounds #4814

Merged
merged 1 commit into from
Oct 3, 2023
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
18 changes: 18 additions & 0 deletions megamek/src/megamek/common/AmmoType.java
Original file line number Diff line number Diff line change
Expand Up @@ -13419,30 +13419,40 @@ public AmmoType createMunitionType(AmmoType base) {
|| (munition.getAmmoType() == AmmoType.T_MML) || (munition.getAmmoType() == AmmoType.T_NLRM))
&& (munition.getMunitionType().contains(Munitions.M_THUNDER))) {
cost *= 2;
// TO:AUE, pp.185,197,198: Half the rack size on 7 hexes; standard mines
bv = base.rackSize * munition.shots / 5.0 * 4;
}

if (((munition.getAmmoType() == AmmoType.T_LRM) || (munition.getAmmoType() == AmmoType.T_LRM_IMP)
|| (munition.getAmmoType() == AmmoType.T_MML) || (munition.getAmmoType() == AmmoType.T_NLRM))
&& (munition.getMunitionType().contains(Munitions.M_THUNDER_AUGMENTED))) {
cost *= 4;
// TO:AUE, pp.185,197,198: Half the rack size on 7 hexes; standard mines
bv = Math.ceil(base.rackSize / 2.0) * 7 * munition.shots / 5.0 * 4;
}

if (((munition.getAmmoType() == AmmoType.T_LRM) || (munition.getAmmoType() == AmmoType.T_LRM_IMP)
|| (munition.getAmmoType() == AmmoType.T_MML) || (munition.getAmmoType() == AmmoType.T_NLRM))
&& (munition.getMunitionType().contains(Munitions.M_THUNDER_INFERNO))) {
cost *= 1;
// TO:AUE, pp.185,197,198
bv = base.rackSize * munition.shots;
}

if (((munition.getAmmoType() == AmmoType.T_LRM) || (munition.getAmmoType() == AmmoType.T_LRM_IMP)
|| (munition.getAmmoType() == AmmoType.T_MML) || (munition.getAmmoType() == AmmoType.T_NLRM))
&& (munition.getMunitionType().contains(Munitions.M_THUNDER_VIBRABOMB))) {
cost *= 2.5;
// TO:AUE, pp.185,197,198
bv = base.rackSize * munition.shots;
}

if (((munition.getAmmoType() == AmmoType.T_LRM) || (munition.getAmmoType() == AmmoType.T_LRM_IMP)
|| (munition.getAmmoType() == AmmoType.T_MML) || (munition.getAmmoType() == AmmoType.T_NLRM))
&& (munition.getMunitionType().contains(Munitions.M_THUNDER_ACTIVE))) {
cost *= 3;
// TO:AUE, pp.185,197,198
bv = base.rackSize * munition.shots / 5.0 * 6;
}

if (munition.getMunitionType().contains(Munitions.M_HOMING)) {
Expand All @@ -13454,13 +13464,21 @@ public AmmoType createMunitionType(AmmoType base) {

if (munition.getMunitionType().contains(Munitions.M_FASCAM)) {
cost *= 1.5;
// TO:AR, p.152 and TO:AUE, pp.197,198
int rackSize = base.getRackSize();
if (munition.getAmmoType() == AmmoType.T_ARROW_IV) {
rackSize = munition.isClan() ? 30 : 20;
}
bv = rackSize * munition.shots / 5.0 * 4;
}

if (munition.getMunitionType().contains(Munitions.M_INFERNO_IV)) {
cost *= 1;
}

if (munition.getMunitionType().contains(Munitions.M_VIBRABOMB_IV)) {
// TO:AR 152 and TO:AUE 197,198
bv = 20 * munition.shots;
cost *= 2;
}

Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/battlevalue/BVCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ protected void processAmmo() {
}
}

/** @return The unit's head dissipation for BV purposes. Override as necessary. */
/** @return The unit's heat dissipation for BV purposes. Override as necessary. */
protected int heatEfficiency() {
return NO_HEAT;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,10 @@ else if ((null != bestSpotter) && !(this instanceof ArtilleryWeaponDirectFireHan
return false;
}
if (atype.getMunitionType().contains(AmmoType.Munitions.M_FASCAM)) {
// Arrow IVs deliver fixed 30-point minefields.
int rackSize = (atype.getAmmoType() == AmmoType.T_ARROW_IV) ? 30 : atype.getRackSize();
int rackSize = atype.getRackSize();
if (atype.getAmmoType() == AmmoType.T_ARROW_IV) {
rackSize = atype.isClan() ? 30 : 20;
}
gameManager.deliverFASCAMMinefield(targetPos, ae.getOwner().getId(), rackSize, ae.getId());
return false;
}
Expand Down