Skip to content

Commit

Permalink
Merge pull request #4814 from SJuliez/arty_minefield
Browse files Browse the repository at this point in the history
BV Calculation for Minefield Artillery rounds
  • Loading branch information
SJuliez authored Oct 3, 2023
2 parents a17bfd8 + 5e175af commit 516a8d8
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 @@ -13366,30 +13366,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 @@ -13401,13 +13411,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 516a8d8

Please sign in to comment.