Skip to content

Commit

Permalink
BV Calculation, Artillery: Add special BV values for minefield arty r…
Browse files Browse the repository at this point in the history
…ounds
  • Loading branch information
SJuliez committed Oct 1, 2023
1 parent e685195 commit 5e175af
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
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

0 comments on commit 5e175af

Please sign in to comment.