Class AmmoWeaponHandler

java.lang.Object
megamek.common.weapons.handlers.WeaponHandler
megamek.common.weapons.handlers.AmmoWeaponHandler
All Implemented Interfaces:
Serializable, AttackHandler
Direct Known Subclasses:
ACFlechetteHandler, ACWeaponHandler, AR10Handler, ArtilleryCannonWeaponHandler, ArtilleryWeaponIndirectFireHandler, BarracudaHandler, BATaserHandler, BPodHandler, CapitalMissileHandler, ChemicalLaserHandler, FluidGunCoolHandler, GRHandler, HAGWeaponHandler, KillerWhaleHandler, LBXHandler, MantaRayHandler, MekMortarAirburstHandler, MekMortarAntiPersonnelHandler, MekMortarFlareHandler, MekMortarHandler, MekMortarSmokeHandler, MekTaserHandler, MGHandler, MicroBombHandler, MissileMineClearanceHandler, MissileWeaponHandler, NailRivetGunHandler, PiranhaHandler, PlasmaCannonHandler, PlasmaRifleHandler, PopUpMineLauncherHandler, RifleWeaponHandler, ScreenLauncherHandler, StingrayHandler, SwordfishHandler, UltraWeaponHandler, VehicleFlamerCoolHandler, VehicleFlamerHandler, VGLWeaponHandler, WhiteSharkHandler

public class AmmoWeaponHandler extends WeaponHandler
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • useAmmo

      protected void useAmmo()
      Overrides:
      useAmmo in class WeaponHandler
    • checkAmmo

      protected void checkAmmo()
    • getNumberWeapons

      protected int getNumberWeapons()
      For ammo weapons, this number can be less than the full number if the amount of ammo is not high enough.
      Overrides:
      getNumberWeapons in class WeaponHandler
      Returns:
      the number of weapons of this type firing (for squadron weapon groups)
    • doChecks

      protected boolean doChecks(Vector<Report> vPhaseReport)
      Overrides:
      doChecks in class WeaponHandler
      Parameters:
      vPhaseReport - - A Vector containing the phase report.
      Returns:
      a boolean value indicating whether the attack misses because of a failed check.
    • doAmmoFeedProblemCheck

      protected boolean doAmmoFeedProblemCheck(Vector<Report> vPhaseReport)
      Carry out an 'ammo feed problems' check on the weapon. Return true if it blew up.
      Overrides:
      doAmmoFeedProblemCheck in class WeaponHandler
    • explodeRoundInBarrel

      protected void explodeRoundInBarrel(Vector<Report> vPhaseReport)
      Worker function that explodes a round in the barrel of the attack's weapon