Class InfantryWeaponHandler

java.lang.Object
megamek.common.weapons.handlers.WeaponHandler
megamek.common.weapons.infantry.InfantryWeaponHandler
All Implemented Interfaces:
Serializable, AttackHandler
Direct Known Subclasses:
InfantryDisposableWeaponHandler, InfantryHeatWeaponHandler

public class InfantryWeaponHandler extends WeaponHandler
Since:
Sept 24, 2004
See Also:
  • Constructor Details

  • Method Details

    • calcDamagePerHit

      protected int calcDamagePerHit()
      Description copied from class: WeaponHandler
      Calculate the damage per hit.
      Overrides:
      calcDamagePerHit in class WeaponHandler
      Returns:
      an int representing the damage dealt per hit.
    • calculateNumCluster

      protected int calculateNumCluster()
      Description copied from class: WeaponHandler
      Calculate the clustering of the hits
      Overrides:
      calculateNumCluster in class WeaponHandler
      Returns:
      a int value saying how much hits are in each cluster of damage.
    • calcHits

      protected int calcHits(Vector<Report> vPhaseReport)
      Description copied from class: WeaponHandler
      Calculate the number of hits
      Overrides:
      calcHits in class WeaponHandler
      Parameters:
      vPhaseReport - - the Vector containing the phase report.
      Returns:
      an int containing the number of hits.
    • calculateNumClusterAero

      protected int calculateNumClusterAero(Entity entityTarget)
      Overrides:
      calculateNumClusterAero in class WeaponHandler
    • calcAttackValue

      protected int calcAttackValue()
      Description copied from class: WeaponHandler
      Calculate the attack value based on range
      Overrides:
      calcAttackValue in class WeaponHandler
      Returns:
      an int representing the attack value at that range.
    • useAmmo

      public void useAmmo()
      Overrides:
      useAmmo in class WeaponHandler
    • calculateBaseDamage

      public static double calculateBaseDamage(Entity ae, Mounted<?> weapon, WeaponType weaponType)
      Utility function to calculate variable damage based only on the firing entity.
    • initHit

      protected void initHit(Entity entityTarget)
      Description copied from class: WeaponHandler
      Worker function that initializes the actual hit, including a hit location and various other properties.
      Overrides:
      initHit in class WeaponHandler
      Parameters:
      entityTarget - Entity being hit.