Class SwarmWeaponAttackHandler

java.lang.Object
megamek.common.weapons.handlers.WeaponHandler
megamek.common.weapons.handlers.SwarmWeaponAttackHandler
All Implemented Interfaces:
Serializable, AttackHandler

public class SwarmWeaponAttackHandler extends WeaponHandler
Since:
Feb 21, 2013
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.
    • 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.
    • handleEntityDamage

      protected void handleEntityDamage(Entity entityTarget, Vector<Report> vPhaseReport, IBuilding bldg, int hits, int nCluster, int bldgAbsorbs)
      Override to handle zero-damage swarm attacks. Per BattleTech rules, critical hits are a separate outcome from damage - even with zero damage, swarm attacks should still roll for critical hits. See issue #5584.
      Overrides:
      handleEntityDamage in class WeaponHandler