Class CapitalMissileBearingsOnlyHandler

All Implemented Interfaces:
Serializable, AttackHandler

public class CapitalMissileBearingsOnlyHandler extends AmmoBayWeaponHandler
Since:
Sep 24, 2004
See Also:
  • Constructor Details

    • CapitalMissileBearingsOnlyHandler

      protected CapitalMissileBearingsOnlyHandler()
      This constructor can only be used for deserialization.
    • CapitalMissileBearingsOnlyHandler

      public CapitalMissileBearingsOnlyHandler(ToHitData t, WeaponAttackAction w, Game g, TWGameManager m)
  • Method Details

    • cares

      public boolean cares(GamePhase phase)
      Description copied from class: WeaponHandler
      Do we care about the specified phase?
      Specified by:
      cares in interface AttackHandler
      Overrides:
      cares in class WeaponHandler
    • getMountedAmmo

      protected void getMountedAmmo()
    • useAmmo

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

      public boolean handle(GamePhase phase, Vector<Report> vPhaseReport)
      Description copied from class: BayWeaponHandler
      Sigh, according to the ruling linked below, when weapon bays are fired at ground targets, they should make one to-hit roll, but the AV of each weapon should be applied separately as damage - that needs a special handler
      Specified by:
      handle in interface AttackHandler
      Overrides:
      handle in class BayWeaponHandler
      Returns:
      a boolean value indicating whether this should be kept or not
    • convertHexTargetToEntityTarget

      @Deprecated(since="0.50.05") public void convertHexTargetToEntityTarget(Vector<Report> vPhaseReport)
      Deprecated.
      The parameter isn't used so replacing with version without the parameter.
    • convertHexTargetToEntityTarget

      public void convertHexTargetToEntityTarget()
      Find the available targets within sensor range. Bearings-only missiles scan within the nose arc and target the closest large craft within the preset range band. If none are found, it targets the closest small craft.
    • handleSpecialMiss

      protected boolean handleSpecialMiss(Entity entityTarget, boolean bldgDamagedOnMiss, Building bldg, Vector<Report> vPhaseReport)
      Overrides:
      handleSpecialMiss in class WeaponHandler
      Returns:
      a boolean value indicating whether or not this attack needs further calculating, like a missed shot hitting a building, or an AMS only shooting down some missiles.
    • canEngageCapitalMissile

      protected boolean canEngageCapitalMissile(WeaponMounted counter)
      Checks to see if this point defense/AMS bay can engage a capital missile This should return true. Only when handling capital missile attacks can this be false.
      Overrides:
      canEngageCapitalMissile in class WeaponHandler
    • setAMSBayReportingFlag

      protected void setAMSBayReportingFlag()
      Sets the appropriate AMS Bay reporting flag depending on what type of missile this is
      Overrides:
      setAMSBayReportingFlag in class WeaponHandler
    • setPDBayReportingFlag

      protected void setPDBayReportingFlag()
      Sets the appropriate PD Bay reporting flag depending on what type of missile this is
      Overrides:
      setPDBayReportingFlag in class WeaponHandler
    • calcAttackValue

      protected int calcAttackValue()
      Description copied from class: AmmoBayWeaponHandler
      Calculate the attack value based on range This needs to do additional work for Weapon Bays with ammo. I need to use the ammo within this function because I may run out of ammo while going through the loop Sine this function is called in the WeaponHandler constructor it should be ok to use the ammo here
      Overrides:
      calcAttackValue in class AmmoBayWeaponHandler
      Returns:
      an int representing the attack value at that range.
    • calcDamagePerHit

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

      protected int calcCapMissileAMSMod()
      Description copied from class: WeaponHandler
      Calculates the to-hit penalty inflicted on a capital missile attack by point defense fire this should return 0 unless this is a capital missile attack (otherwise, reporting and to-hit get screwed up)
      Overrides:
      calcCapMissileAMSMod in class WeaponHandler
    • initializeCapMissileArmor

      protected int initializeCapMissileArmor()
      Calculate the starting armor value of a flight of Capital Missiles Used for Aero Sanity. This is done in calcAttackValue() otherwise
      Overrides:
      initializeCapMissileArmor in class BayWeaponHandler
    • getCapMisMod

      protected int getCapMisMod()
      Overrides:
      getCapMisMod in class WeaponHandler
    • getCritMod

      protected int getCritMod(AmmoType ammoType)
    • updateAVforAmmo

      protected double updateAVforAmmo(double currentAttackValue, AmmoType ammoType, WeaponType bayWeaponType, int range, int wId)
      Overrides:
      updateAVforAmmo in class AmmoBayWeaponHandler