Class VTOL

All Implemented Interfaces:
Serializable, ICarryable, Transporter, InGameObject, CombatRole, ForceAssignable, ITechnology, ITurnOrdered, PhaseUpdated, RoundUpdated, BTObject, Deployable, Fortifiable, IBomber, RubbleClearer, Targetable
Direct Known Subclasses:
SupportVTOL

public class VTOL extends Tank implements IBomber
Since:
Jun 1, 2005
See Also:
  • Field Details

  • Constructor Details

    • VTOL

      public VTOL()
  • Method Details

    • getUnitType

      public int getUnitType()
      Overrides:
      getUnitType in class Tank
      See Also:
    • getLocationAbbreviations

      public String[] getLocationAbbreviations()
      Overrides:
      getLocationAbbreviations in class Tank
    • getLocationNames

      public String[] getLocationNames()
      Overrides:
      getLocationNames in class Tank
    • getLocTurret

      public int getLocTurret()
      Overrides:
      getLocTurret in class Tank
    • getLocTurret2

      public int getLocTurret2()
      Overrides:
      getLocTurret2 in class Tank
    • checkSkid

      public PilotingRollData checkSkid(EntityMovementType moveType, Hex prevHex, EntityMovementType overallMoveType, MoveStep prevStep, MoveStep currStep, int prevFacing, int curFacing, Coords lastPos, Coords curPos, boolean isInfantry, int distance)
      Description copied from class: Entity
      Checks if the entity might skid. If so, returns the target roll for the piloting skill check.
      Overrides:
      checkSkid in class Entity
    • canCharge

      public boolean canCharge()
      Overrides:
      canCharge in class Tank
      Returns:
      Whether this type of unit can perform charges
    • getMaxElevationChange

      public int getMaxElevationChange()
      Description copied from class: Entity
      The maximum elevation change the entity can cross
      Overrides:
      getMaxElevationChange in class Entity
    • isLocationProhibited

      public boolean isLocationProhibited(Coords c, int testBoardId, int elevation)
      Description copied from class: Tank
      Tanks have all sorts of prohibited terrain.
      Overrides:
      isLocationProhibited in class Tank
      Parameters:
      c - The position to test
      testBoardId - The board to test
      elevation - The elevation or altitude to test
      Returns:
      True when the location is illegal to be in for this unit, regardless of elevation
      See Also:
    • isRepairable

      public boolean isRepairable()
      Description copied from class: Tank
      Determine if the unit can be repaired, or only harvested for spares.
      Overrides:
      isRepairable in class Tank
      Returns:
      A boolean that is true if the unit can be repaired (given enough time and parts); if this value is false, the unit is only a source of spares.
      See Also:
    • rollHitLocation

      public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMode aimingMode, int cover)
      Description copied from class: Tank
      Rolls up a hit location
      Overrides:
      rollHitLocation in class Tank
    • doomedInVacuum

      public boolean doomedInVacuum()
      Overrides:
      doomedInVacuum in class Tank
      Returns:
      True when this unit will not survive vacuum conditions.
    • isBomber

      public boolean isBomber()
      Specified by:
      isBomber in interface Targetable
      Returns:
      if this is an Entity capable of carrying and using bombs
    • availableBombLocation

      public int availableBombLocation(int cost)
      Specified by:
      availableBombLocation in interface IBomber
      Parameters:
      cost - The cost of the bomb to be mounted
      Returns:
      A location with sufficient space to mount the bomb, or Entity.LOC_NONE if the unit does not have the space.
    • getMaxExtBombPoints

      public int getMaxExtBombPoints()
      Specified by:
      getMaxExtBombPoints in interface IBomber
      Returns:
      maximum number of bomb points this bomber can mount externally
    • getMaxIntBombPoints

      public int getMaxIntBombPoints()
      Specified by:
      getMaxIntBombPoints in interface IBomber
      Returns:
      maximum number of bomb points this bomber can mount internally
    • getMaxBombPoints

      public int getMaxBombPoints()
      Specified by:
      getMaxBombPoints in interface IBomber
      Returns:
      The total number of bomb points that the bomber can carry.
    • getIntBombChoices

      public BombLoadout getIntBombChoices()
      Specified by:
      getIntBombChoices in interface IBomber
      Returns:
      The number of each internally-mounted bomb type that was selected prior to deployment
    • setIntBombChoices

      public void setIntBombChoices(BombLoadout bc)
      Description copied from interface: IBomber
      Sets the bomb type selections prior to deployment.
      Specified by:
      setIntBombChoices in interface IBomber
      Parameters:
      bc - An array with the count of each bomb type as the value of the bomb type's index
    • getExtBombChoices

      public BombLoadout getExtBombChoices()
      Specified by:
      getExtBombChoices in interface IBomber
      Returns:
      The number of each externally-mounted bomb type that was selected prior to deployment
    • setExtBombChoices

      public void setExtBombChoices(BombLoadout bc)
      Description copied from interface: IBomber
      Sets the bomb type selections for external mounts.
      Specified by:
      setExtBombChoices in interface IBomber
      Parameters:
      bc - An array with the count of each bomb type as the value of the bomb type's index
    • clearBombChoices

      public void clearBombChoices()
      Description copied from interface: IBomber
      Sets the count of each bomb to zero
      Specified by:
      clearBombChoices in interface IBomber
    • reduceMPByBombLoad

      public int reduceMPByBombLoad(int t)
      Specified by:
      reduceMPByBombLoad in interface IBomber
      Returns:
      The calculates movement factoring in the load of bombs currently on unit, t is current movement
    • setUsedInternalBombs

      public void setUsedInternalBombs(int b)
      Description copied from interface: IBomber
      Set count of internal bombs used; this is used to reset, revert, or increase count of internal bombs a unit has dropped during a turn.
      Specified by:
      setUsedInternalBombs in interface IBomber
    • increaseUsedInternalBombs

      public void increaseUsedInternalBombs(int b)
      Description copied from interface: IBomber
      Increase count of internal bombs used this turn.
      Specified by:
      increaseUsedInternalBombs in interface IBomber
    • getUsedInternalBombs

      public int getUsedInternalBombs()
      Specified by:
      getUsedInternalBombs in interface IBomber
      Returns:
      the number of internal bombs used by this bomber during a turn, for IBB internal hit calculations.
    • getVTOLBombTarget

      public Targetable getVTOLBombTarget()
      Specified by:
      getVTOLBombTarget in interface IBomber
    • setVTOLBombTarget

      public void setVTOLBombTarget(Targetable t)
      Description copied from interface: IBomber
      Used by VTOLs and LAMs in AirMek mode to declare the target hex for a bomb attack during the movement phase.
      Specified by:
      setVTOLBombTarget in interface IBomber
    • getStrafingCoords

      public List<Coords> getStrafingCoords()
    • isMakingVTOLGroundAttack

      public boolean isMakingVTOLGroundAttack()
      Overrides:
      isMakingVTOLGroundAttack in class Entity
      Returns:
      true if the VTOL or LAM is making a VTOL strafe or VTOL/AirMek bomb attack
    • isNightwalker

      public boolean isNightwalker()
      Description copied from class: Entity
      Determines if the pilot has the Nightwalker SPA
      Overrides:
      isNightwalker in class Entity
      Returns:
      true when pilots have the SPA and are not in a flying vehicle.
    • setOnFire

      public void setOnFire(boolean inferno)
      Overrides:
      setOnFire in class Tank
    • getCriticalEffect

      public int getCriticalEffect(int roll, int loc, boolean damagedByFire)
      get the type of critical caused by a critical roll, taking account of existing damage
      Overrides:
      getCriticalEffect in class Tank
      Parameters:
      roll - the final dice roll
      loc - the hit location
      damagedByFire - whether or not the critical was caused by fire, which is distinct from damage for unofficial thresholding purposes.
      Returns:
      a critical type
    • addEntityBonuses

      public PilotingRollData addEntityBonuses(PilotingRollData prd)
      Description copied from class: Entity
      Add in any piloting skill mods
      Overrides:
      addEntityBonuses in class Tank
    • newRound

      public void newRound(int roundNumber)
      Description copied from class: Entity
      Start a new round
      Specified by:
      newRound in interface RoundUpdated
      Overrides:
      newRound in class Tank
      Parameters:
      roundNumber - the int number of the new round
    • getWalkMP

      public int getWalkMP(MPCalculationSetting mpCalculationSetting)
      Overrides:
      getWalkMP in class Tank
    • getMPBoosters

      public MPBoosters getMPBoosters(boolean onlyArmed)
      Overrides:
      getMPBoosters in class Entity
      Returns:
      if this Mek has MASC, Supercharger or both?
    • checkSideSlip

      public PilotingRollData checkSideSlip(EntityMovementType moveType, Hex prevHex, EntityMovementType overallMoveType, MoveStep prevStep, int prevFacing, int curFacing, Coords lastPos, Coords curPos, int distance, boolean speedBooster)
      Overrides:
      checkSideSlip in class Entity
    • height

      public int height()
      Description copied from class: Entity
      Returns the height of the unit, that is, how many levels above its elevation it is for LOS purposes. Default is 0.
      Overrides:
      height in class Entity
    • isSuperHeavy

      public boolean isSuperHeavy()
      Overrides:
      isSuperHeavy in class Entity
      Returns:
      True if this unit counts as superheavy (Combat Vehicles and Meks) or as a Large Support Vehicle.
    • locations

      public int locations()
      Description copied from class: Tank
      Returns the number of locations in the entity
      Overrides:
      locations in class Tank
    • getEntityType

      public long getEntityType()
      Overrides:
      getEntityType in class Tank
    • getChinTurretTA

      public static TechAdvancement getChinTurretTA()
    • addSystemTechAdvancement

      protected void addSystemTechAdvancement(CompositeTechLevel techLevel)
      Description copied from class: Entity
      Incorporate dates for components that are not in the equipment list, such as engines and structure.
      Overrides:
      addSystemTechAdvancement in class Tank
    • getSpriteDrawPriority

      public int getSpriteDrawPriority()
      Description copied from class: Tank
      Used to determine the draw priority of different Entity subclasses. This allows different unit types to always be draw above/below other types.
      Overrides:
      getSpriteDrawPriority in class Tank
    • getGenericBattleValue

      public int getGenericBattleValue()
      Description copied from class: Entity
      Calculates a "generic" Battle Value that is based on the average of all units of this type and tonnage. The purpose of this generic Battle Value is to allow a comparison of this unit's actual BV to that for units of its class. This can be used to balance forces without respect to unit or pilot quality.

      The generic BV values are calculated by a statistical elasticity model based on all data from the MegaMek database.

      Overrides:
      getGenericBattleValue in class Tank
      Returns:
      The generic Battle value for this unit based on its tonnage and type
    • processPickupStep

      public void processPickupStep(MoveStep step, Integer cargoPickupLocation, TWGameManager gameManager, Entity entityPickingUpTarget, EntityMovementType overallMoveType)
      Specified by:
      processPickupStep in interface ICarryable
      Overrides:
      processPickupStep in class Entity