Class LandAirMek

All Implemented Interfaces:
Serializable, ICarryable, Transporter, InGameObject, CombatRole, ForceAssignable, ITechnology, ITurnOrdered, PhaseUpdated, RoundUpdated, ActiveHeatSinkController, BTObject, Deployable, Fortifiable, IAero, IBomber, RubbleClearer, Targetable

public class LandAirMek extends BipedMek implements IAero, IBomber
See Also:
  • Field Details

  • Constructor Details

    • LandAirMek

      public LandAirMek(int inGyroType, int inCockpitType, int inLAMType)
  • Method Details

    • getAeroLocation

      public static int getAeroLocation(int loc)
      Translate a `Mek location to the equivalent Aero location.
    • getNoOfSlots

      protected int[] getNoOfSlots()
      Returns a vector of slot counts for all locations
      Overrides:
      getNoOfSlots in class BipedMek
    • getLocationNames

      public String[] getLocationNames()
      Returns a vector of names for all locations
      Overrides:
      getLocationNames in class BipedMek
    • getLocationAbbreviations

      public String[] getLocationAbbreviations()
      Returns a vector of abbreviations for all locations
      Overrides:
      getLocationAbbreviations in class BipedMek
    • clearEngineCrits

      public void clearEngineCrits()
      Description copied from class: Mek
      Remove all engine critical slots from the mek. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.
      Overrides:
      clearEngineCrits in class Mek
    • addEngineCrits

      public void addEngineCrits()
      Description copied from class: Mek
      Add the critical slots necessary for the mek's engine. Calling this method before setting a mek's engine object will result in a NPE. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.
      Overrides:
      addEngineCrits in class Mek
    • setCrew

      public void setCrew(Crew newCrew)
      Overrides:
      setCrew in class Entity
    • getSystemName

      public String getSystemName(int index)
      Overrides:
      getSystemName in class Mek
    • getRawSystemName

      public String getRawSystemName(int index)
      Overrides:
      getRawSystemName in class Mek
    • getLAMType

      public int getLAMType()
    • setLAMType

      public void setLAMType(int lamType)
    • getLAMTypeString

      public String getLAMTypeString(int lamType)
    • getLAMTypeString

      public String getLAMTypeString()
    • getLAMTypeForString

      public static int getLAMTypeForString(String inType)
    • doomedInAtmosphere

      public boolean doomedInAtmosphere()
      Overrides:
      doomedInAtmosphere in class Entity
      Returns:
      True when this unit is not allowed to be or will not survive in any hex of a low altitude a.k.a. atmospheric map (unless it is being transported). Note that this has nothing to do with the atmosphere (or lack of it, depending on planetary conditions), only the map type and scale.
    • doomedInSpace

      public boolean doomedInSpace()
      Overrides:
      doomedInSpace in class Entity
      Returns:
      True when this unit is not allowed to be or will not survive in any hex of a space map (unless it is being transported).
    • getWalkMP

      public int getWalkMP(MPCalculationSetting mpCalculationSetting)
      Current MP is calculated differently depending on the LAM's mode. AirMek mode returns cruise/flank; walk/run is treated as a special case of WiGE ground movement.
      Overrides:
      getWalkMP in class BipedMek
    • getRunMP

      public int getRunMP(MPCalculationSetting mpCalculationSetting)
      Overrides:
      getRunMP in class MekWithArms
    • getSprintMP

      public int getSprintMP(MPCalculationSetting mpCalculationSetting)
      Description copied from class: Entity
      Returns this entity's sprinting MP, modified according to the given setting. For units that can't sprint, this is equal to the modified run/flank MP.
      Overrides:
      getSprintMP in class Mek
      Returns:
      This entity's modified sprinting MP
    • getAirMekCruiseMP

      public int getAirMekCruiseMP(MPCalculationSetting mpCalculationSetting)
    • getAirMekFlankMP

      public int getAirMekFlankMP(MPCalculationSetting mpCalculationSetting)
    • getAirMekWalkMP

      public int getAirMekWalkMP()
    • getAirMekWalkMP

      public int getAirMekWalkMP(MPCalculationSetting mpCalculationSetting)
    • getAirMekRunMP

      public int getAirMekRunMP()
    • getAirMekRunMP

      public int getAirMekRunMP(MPCalculationSetting mpCalculationSetting)
    • getFighterModeWalkMP

      public int getFighterModeWalkMP(MPCalculationSetting mpCalculationSetting)
    • getFighterModeRunMP

      public int getFighterModeRunMP(MPCalculationSetting mpCalculationSetting)
    • getCurrentThrust

      public int getCurrentThrust()
      Specified by:
      getCurrentThrust in interface IAero
    • getCurrentThrust

      public int getCurrentThrust(MPCalculationSetting mpCalculationSetting)
    • getAirMekCruiseMP

      public int getAirMekCruiseMP()
    • getAirMekFlankMP

      public int getAirMekFlankMP()
    • getMPBoosters

      public MPBoosters getMPBoosters()
      LAMs cannot benefit from MASC in AirMek or fighter mode and cannot mount a supercharger.
      Overrides:
      getMPBoosters in class Entity
      Returns:
      does this Mek have MASC, Supercharger or both?
    • getArmedMPBoosters

      public MPBoosters getArmedMPBoosters()
      Overrides:
      getArmedMPBoosters in class Entity
      Returns:
      does this Mek have Armed MASC, Supercharger or both?
    • isImmobile

      public boolean isImmobile()
      Description copied from class: Entity
      Returns true if the target is considered immobile (-4 to hit) as a target and also if it is considered immobile or temporarily or permanently immbolized for active movement. Overriding methods should check the status of the unit (shutdown, damage) and also the status of the crew (unconscious).
      Specified by:
      isImmobile in interface Targetable
      Overrides:
      isImmobile in class BipedMek
      Returns:
      True if the target is considered immobile as a target and unable to move actively.
    • getWalkHeat

      public int getWalkHeat()
      Description copied from class: Entity
      get the heat generated by this Entity when walking/cruising
      Overrides:
      getWalkHeat in class Mek
    • getRunHeat

      public int getRunHeat()
      Description copied from class: Mek
      Depends on engine type
      Overrides:
      getRunHeat in class Mek
    • getAirMekHeat

      public int getAirMekHeat()
    • getEngineCritHeat

      public int getEngineCritHeat()
      Description copied from class: Mek
      Returns extra heat generated by engine crits
      Overrides:
      getEngineCritHeat in class Mek
      Returns:
      The extra heat generated by engine crits.
    • getHeatSinks

      public int getHeatSinks()
      Specified by:
      getHeatSinks in interface IAero
    • usesTurnMode

      public boolean usesTurnMode()
      Description copied from class: Entity
      Only check for satisfied turn mode for Tanks or QuadVees in vehicle mode, or LAMs in AirMek mode. Except for LAMs, check whether advanced vehicle ground movement is enabled.
      Overrides:
      usesTurnMode in class Entity
      Returns:
      True if this Entity must make a driving check for turning too sharply.
    • getPreviousMovementMode

      public EntityMovementMode getPreviousMovementMode()
      When cycling through possible movement modes, we need to know if we've returned to the previous mode, which means that no conversion is actually going to take place.
      Returns:
      The movement mode on the previous turn.
    • getPreviousConversionMode

      public int getPreviousConversionMode()
    • setMovementMode

      public void setMovementMode(EntityMovementMode mode)
      Description copied from class: Entity
      Set the movement type of the entity
      Overrides:
      setMovementMode in class Entity
    • setConversionMode

      public void setConversionMode(int mode)
      Description copied from class: Entity
      Sets the unit to be in the given mode.
      Overrides:
      setConversionMode in class Entity
      Parameters:
      mode - The new mode
    • canAssaultDrop

      public boolean canAssaultDrop()
      Overrides:
      canAssaultDrop in class Mek
    • isLocationProhibited

      public boolean isLocationProhibited(Coords c, int testBoardId, int testElevation)
      Description copied from class: Entity
      Returns true when the given location cannot legally be entered or deployed into by this unit at the given elevation or altitude. Also returns true when the location doesn't exist. Even when this method returns true, the location need not be deadly to the unit.
      Overrides:
      isLocationProhibited in class Mek
      Parameters:
      c - The position to test
      testBoardId - The board to test
      testElevation - The elevation or altitude to test
      Returns:
      True when the location is illegal to be in for this unit, regardless of elevation
      See Also:
    • getMovementString

      public String getMovementString(EntityMovementType movementType)
      Description copied from class: Mek
      Returns the name of the type of movement used. This is Mek-specific.
      Overrides:
      getMovementString in class Mek
    • getMovementAbbr

      public String getMovementAbbr(EntityMovementType movementType)
      Description copied from class: Mek
      Returns the name of the type of movement used. This is Mek-specific.
      Overrides:
      getMovementAbbr in class Mek
    • getECMRange

      public int getECMRange()
      What's the range of the ECM equipment?
      Overrides:
      getECMRange in class Entity
      Returns:
      the int range of this unit's ECM. This value will be Entity.NONE if no ECM is active.
    • addEntityBonuses

      public PilotingRollData addEntityBonuses(PilotingRollData roll)
      Add in any piloting skill mods
      Overrides:
      addEntityBonuses in class BipedMek
    • checkAirMekLanding

      public PilotingRollData checkAirMekLanding()
      Landing in AirMek mode requires a control roll only if the gyro or any of the hip or leg actuators are damaged.
      Returns:
      The control roll that must be passed to land safely.
    • getMaxElevationDown

      public int getMaxElevationDown(int currElevation)
      Description copied from class: Entity
      Returns the maximum number of downward elevation changes a unit can make. For some units (namely, WiGEs), this can depend upon their current elevation (since elevation determines if the WiGEs is using WiGE movement or not).
      Overrides:
      getMaxElevationDown in class Mek
    • canChangeSecondaryFacing

      public boolean canChangeSecondaryFacing()
      Description copied from class: Entity
      Can this entity change secondary facing at all?
      Overrides:
      canChangeSecondaryFacing in class Mek
    • newRound

      public void newRound(int roundNumber)
      Start a new round
      Specified by:
      newRound in interface RoundUpdated
      Overrides:
      newRound in class Mek
      Parameters:
      roundNumber - the int number of the new round
    • isEligibleForPhysical

      public boolean isEligibleForPhysical()
      Cannot make any physical attacks in fighter mode except ramming, which is handled in the movement phase.
      Overrides:
      isEligibleForPhysical in class Entity
    • canCharge

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

      public boolean canRam()
      Overrides:
      canRam in class Entity
      Returns:
      Whether this type of unit can perform Ramming attacks
    • nextConversionMode

      public EntityMovementMode nextConversionMode(EntityMovementMode afterMode)
      Description copied from class: Entity
      Entities that can convert movement modes (LAMs, QuadVees) report the next mode to assume when a convert movement command is processed. This provides a set order for cycling through available modes.
      Overrides:
      nextConversionMode in class Mek
      Parameters:
      afterMode - The movement mode to convert from.
      Returns:
      The next movement mode in the sequence.
    • canConvertTo

      public boolean canConvertTo(EntityMovementMode toMode)
    • canConvertTo

      public boolean canConvertTo(int fromMode, int toMode)
      Determines whether it is possible to assume a particular mode based on damage and type of map.
      Parameters:
      fromMode - The mode to convert from (one of CONV_MODE_MEK, CONV_MODE_AIR_MEK, or CONV_MODE_FIGHTER)
      toMode - The mode to convert to (one of CONV_MODE_MEK, CONV_MODE_AIR_MEK, or CONV_MODE_FIGHTER)
      Returns:
      true if it is possible for the LAM to convert to the given mode.
    • getConversionModeFor

      public int getConversionModeFor(EntityMovementMode movementMode)
    • canFall

      public boolean canFall(boolean gyroLegDamage)
      Description copied from class: Mek
      QuadVees and LAMs may not have to make PSRs to avoid falling depending on their mode, and Meks using tracks for movement do not have to make PSRs for damage to gyro or leg actuators.
      Overrides:
      canFall in class Mek
      Parameters:
      gyroLegDamage - Whether the PSR is due to damage to gyro or leg actuators
      Returns:
      true if the Mek can fall due to failed PSR.
    • getConstructionTechAdvancement

      public TechAdvancement getConstructionTechAdvancement()
      Description copied from class: Entity
      return - the base construction option tech advancement
      Overrides:
      getConstructionTechAdvancement in class Mek
    • height

      public int height()
      Description copied from class: Mek
      Return the height of this Mek above the terrain.
      Specified by:
      height in interface IAero
      Overrides:
      height in class Mek
    • canLoad

      public boolean canLoad(Entity unit, boolean checkElev)
      LAMs can only carry mechanized BA in mek mode
      Overrides:
      canLoad in class Entity
      Parameters:
      unit - - the Entity to be loaded.
      checkElev - - Whether to compare elevations (e.g. for VTOL loading infantry)
      Returns:
      true if the unit can be loaded, false otherwise.
    • hasInfernoAmmo

      public boolean hasInfernoAmmo()
      Bomb ordnance is treated as inferno ammo for purposes of avoiding explosion due to heat.
      Overrides:
      hasInfernoAmmo in class Entity
      Returns:
      true if the unit is still loaded with inferno rounds or bomb ordnance.
    • setWhoFirst

      public void setWhoFirst()
      Fighter Mode
    • getMaxBombPoints

      public int getMaxBombPoints()
      Specified by:
      getMaxBombPoints in interface IBomber
      Returns:
      The total number of bomb points that the bomber can carry.
    • 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
    • getMaxIntBombSize

      public int getMaxIntBombSize()
      Description copied from interface: IBomber
      Fighters and VTOLs can carry any size bomb up to the maximum number of points per location (internal/external), but LAMs are limited to the number of bays in a single location.
      Specified by:
      getMaxIntBombSize in interface IBomber
      Returns:
      Largest empty bay size
    • 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
    • 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.
    • 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
    • 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
    • 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.
    • getCurrentVelocity

      public int getCurrentVelocity()
      Specified by:
      getCurrentVelocity in interface IAero
    • setCurrentVelocity

      public void setCurrentVelocity(int velocity)
      Specified by:
      setCurrentVelocity in interface IAero
    • getNextVelocity

      public int getNextVelocity()
      Specified by:
      getNextVelocity in interface IAero
    • setNextVelocity

      public void setNextVelocity(int velocity)
      Specified by:
      setNextVelocity in interface IAero
    • getCurrentVelocityActual

      public int getCurrentVelocityActual()
      Specified by:
      getCurrentVelocityActual in interface IAero
    • isRolled

      public boolean isRolled()
      Specified by:
      isRolled in interface IAero
    • isOutControlTotal

      public boolean isOutControlTotal()
      Specified by:
      isOutControlTotal in interface IAero
    • isOutControl

      public boolean isOutControl()
      Specified by:
      isOutControl in interface IAero
    • setOutControl

      public void setOutControl(boolean outControl)
      Specified by:
      setOutControl in interface IAero
    • isOutControlHeat

      public boolean isOutControlHeat()
      Specified by:
      isOutControlHeat in interface IAero
    • setOutControlHeat

      public void setOutControlHeat(boolean outControlHeat)
      Specified by:
      setOutControlHeat in interface IAero
    • isRandomMove

      public boolean isRandomMove()
      Specified by:
      isRandomMove in interface IAero
    • setRandomMove

      public void setRandomMove(boolean randomMove)
      Specified by:
      setRandomMove in interface IAero
    • setRolled

      public void setRolled(boolean roll)
      Specified by:
      setRolled in interface IAero
    • didAccLast

      public boolean didAccLast()
      Specified by:
      didAccLast in interface IAero
    • setAccLast

      public void setAccLast(boolean b)
      Specified by:
      setAccLast in interface IAero
    • setSI

      public void setSI(int si)
      Specified by:
      setSI in interface IAero
    • getSI

      public int getSI()
      Specified by:
      getSI in interface IAero
    • getOSI

      public int getOSI()
      Specified by:
      getOSI in interface IAero
    • hasLifeSupport

      public boolean hasLifeSupport()
      Specified by:
      hasLifeSupport in interface IAero
    • getNoseArmor

      public int getNoseArmor()
      Used to determine modifier for landing.
      Specified by:
      getNoseArmor in interface IAero
    • getLocationStatus

      public int getLocationStatus(int loc)
      returns exposure or breached flag for location
      Overrides:
      getLocationStatus in class Entity
    • getAvionicsHits

      public int getAvionicsHits()
      Specified by:
      getAvionicsHits in interface IAero
    • getSensorHits

      public int getSensorHits()
      Specified by:
      getSensorHits in interface IAero
    • getFCSHits

      public int getFCSHits()
      Specified by:
      getFCSHits in interface IAero
    • getLeftThrustHits

      public int getLeftThrustHits()
      Specified by:
      getLeftThrustHits in interface IAero
    • getRightThrustHits

      public int getRightThrustHits()
      Specified by:
      getRightThrustHits in interface IAero
    • setGearHit

      public void setGearHit(boolean hit)
      Specified by:
      setGearHit in interface IAero
    • getLandingGearMod

      public int getLandingGearMod(boolean vTakeoff)
      Modifier to landing or vertical takeoff roll for landing gear damage.
      Specified by:
      getLandingGearMod in interface IAero
      Parameters:
      vTakeoff - true if this is for a vertical takeoff, false if for a landing
      Returns:
      the control roll modifier
    • getLandingGearPartialRepairs

      public int getLandingGearPartialRepairs()
      Specified by:
      getLandingGearPartialRepairs in interface IAero
    • getAvionicsMisReplaced

      public int getAvionicsMisReplaced()
      Specified by:
      getAvionicsMisReplaced in interface IAero
    • getAvionicsMisrepaired

      public int getAvionicsMisrepaired()
      Specified by:
      getAvionicsMisrepaired in interface IAero
    • getWeaponArc

      public int getWeaponArc(int weaponNumber)
      In fighter mode the weapon arcs need to be translated to Aero arcs.
      Overrides:
      getWeaponArc in class Mek
      Parameters:
      weaponNumber - integer equipment number, index from equipment list
      Returns:
      arc the specified weapon is in
    • rollHitLocation

      public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMode aimingMode, int cover)
      Hit location table for fighter mode
      Overrides:
      rollHitLocation in class Mek
      Returns:
      HitData, possibly re-rolled once (once!) with Edge.
    • rollHitLocation

      public HitData rollHitLocation(int table, int side)
      Description copied from class: Entity
      Rolls up a hit location
      Overrides:
      rollHitLocation in class Mek
    • getFuel

      public int getFuel()
      Specified by:
      getFuel in interface IAero
    • getCurrentFuel

      public int getCurrentFuel()
      Specified by:
      getCurrentFuel in interface IAero
    • setFuel

      public void setFuel(int gas)
      Sets the number of fuel points.
      Specified by:
      setFuel in interface IAero
      Parameters:
      gas - Number of fuel points.
    • setCurrentFuel

      public void setCurrentFuel(int gas)
      Specified by:
      setCurrentFuel in interface IAero
    • getFuelPointsPerTon

      public double getFuelPointsPerTon()
      Specified by:
      getFuelPointsPerTon in interface IAero
    • setFuelTonnage

      public void setFuelTonnage(double fuelTons)
      Set number of fuel points based on fuel tonnage.
      Specified by:
      setFuelTonnage in interface IAero
      Parameters:
      fuelTons - The number of tons of fuel
    • getFuelTonnage

      public double getFuelTonnage()
      Gets the fuel for this Aero in terms of tonnage.
      Specified by:
      getFuelTonnage in interface IAero
      Returns:
      The number of tons of fuel on this Aero.
    • getThresh

      public int getThresh(int loc)
      Exceeding damage threshold does not result in critical, but requires control roll.
      Specified by:
      getThresh in interface IAero
    • getHighestThresh

      public int getHighestThresh()
      Specified by:
      getHighestThresh in interface IAero
      Returns:
      the highest damage threshold for the LAM unit
    • wasCritThresh

      public boolean wasCritThresh()
      Specified by:
      wasCritThresh in interface IAero
    • setCritThresh

      public void setCritThresh(boolean b)
      Specified by:
      setCritThresh in interface IAero
    • isSpheroid

      public boolean isSpheroid()
      Description copied from interface: BTObject
      Returns true when this object has the distinction between aerodyne and spheroid, i.e. if it is a DropShip or SmallCraft, and it is spheroid, false for any other type of object. Returns false for any type of unit group and for any unit that does not have the distinction.
      Specified by:
      isSpheroid in interface BTObject
      Specified by:
      isSpheroid in interface IAero
      Returns:
      True when this is object is spheroid
    • getStraightMoves

      public int getStraightMoves()
      Specified by:
      getStraightMoves in interface IAero
    • setStraightMoves

      public void setStraightMoves(int i)
      Specified by:
      setStraightMoves in interface IAero
    • getAltLoss

      public int getAltLoss()
      Specified by:
      getAltLoss in interface IAero
    • setAltLoss

      public void setAltLoss(int i)
      Specified by:
      setAltLoss in interface IAero
    • resetAltLoss

      public void resetAltLoss()
      Specified by:
      resetAltLoss in interface IAero
    • getAltLossThisRound

      public int getAltLossThisRound()
      Specified by:
      getAltLossThisRound in interface IAero
    • setAltLossThisRound

      public void setAltLossThisRound(int i)
      Specified by:
      setAltLossThisRound in interface IAero
    • resetAltLossThisRound

      public void resetAltLossThisRound()
      Specified by:
      resetAltLossThisRound in interface IAero
    • isVSTOL

      public boolean isVSTOL()
      Specified by:
      isVSTOL in interface IAero
    • isSTOL

      public boolean isSTOL()
      Specified by:
      isSTOL in interface IAero
    • getElevation

      public int getElevation()
      Description copied from interface: Targetable
      Returns the elevation of this target, relative to the position Hex's surface
      Specified by:
      getElevation in interface Targetable
      Overrides:
      getElevation in class Entity
      Returns:
      The elevation of this Entity, relative to the current Hex's surface. When the unit is transported, returns the elevation of the carrier.
    • getFuelUsed

      public int getFuelUsed(int thrust)
      Specified by:
      getFuelUsed in interface IAero
    • didFailManeuver

      public boolean didFailManeuver()
      Specified by:
      didFailManeuver in interface IAero
    • setFailedManeuver

      public void setFailedManeuver(boolean b)
      Specified by:
      setFailedManeuver in interface IAero
    • setAccDecNow

      public void setAccDecNow(boolean b)
      Specified by:
      setAccDecNow in interface IAero
    • didAccDecNow

      public boolean didAccDecNow()
      Specified by:
      didAccDecNow in interface IAero
    • getCapArmor

      public int getCapArmor()
      Specified by:
      getCapArmor in interface IAero
    • setCapArmor

      public void setCapArmor(int i)
      Specified by:
      setCapArmor in interface IAero
    • getCap0Armor

      public int getCap0Armor()
      Specified by:
      getCap0Armor in interface IAero
    • getFatalThresh

      public int getFatalThresh()
      Specified by:
      getFatalThresh in interface IAero
    • autoSetCapArmor

      public void autoSetCapArmor()
      Specified by:
      autoSetCapArmor in interface IAero
    • autoSetFatalThresh

      public void autoSetFatalThresh()
      Specified by:
      autoSetFatalThresh in interface IAero
    • getCurrentDamage

      public int getCurrentDamage()
      Specified by:
      getCurrentDamage in interface IAero
    • setCurrentDamage

      public void setCurrentDamage(int i)
      Specified by:
      setCurrentDamage in interface IAero
    • getWeaponGroups

      public Map<String,Integer> getWeaponGroups()
      Specified by:
      getWeaponGroups in interface IAero
    • groupWeaponsByLocation

      public Map<String,Integer> groupWeaponsByLocation()
      Provide weapon groups for capital fighters. For capital fighter purposes we use Aero locations.
      Specified by:
      groupWeaponsByLocation in interface IAero
      Returns:
      A map with keys in the format "weaponName:loc", with the number of weapons of that type in that location as the value.
    • doDisbandDamage

      public void doDisbandDamage()
      Specified by:
      doDisbandDamage in interface IAero
    • getTilesetModeString

      public String getTilesetModeString()
      Description copied from class: Entity
      Entities that use different sprites for different modes should override this
      Overrides:
      getTilesetModeString in class Entity
      Returns:
      a code identifying the mode, or an empty string for the default sprite
    • isAero

      public boolean isAero()
      Description copied from interface: BTObject
      Returns true when this object uses or can use aerospace movement. This includes all aerospace units as well as LAMs (in fighter mode when in a TW game). Returns false for any type of unit group even if it is of the right type.

      Note that this is not equivalent to "this instanceof Aero" as LAMs are not an Aero subclass. It is also not equivalent to "this instanceof IAero" as LAMs are always IAero but only return true for isAero() when they are in fighter conversion mode. The following cast can be safely made:

      if (entity.isAero()) {
           IAero iAero = (IAero) entity;
       }
      Specified by:
      isAero in interface BTObject
      Returns:
      True when this may use aerospace movement (aerospace and LAM units)
    • 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)
      Try to find a location that has enough empty bomb bays to accommodate the bomb size
      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.
    • addBomb

      protected void addBomb(Mounted<?> mounted, int loc) throws LocationFullException
      Overrides:
      addBomb in class Entity
      Throws:
      LocationFullException
    • addEquipment

      public Mounted<?> addEquipment(EquipmentType equipmentType, int loc, boolean rearMounted) throws LocationFullException
      Description copied from class: Entity
      Creates a new mount for this equipment and adds it in.
      Overrides:
      addEquipment in class Entity
      Throws:
      LocationFullException
    • canSpot

      public boolean canSpot()
      Description copied from class: Entity
      Um, basically everything can spot for LRM indirect fire. Except for off-board units, units that sprinted, and units evading.
      Overrides:
      canSpot in class Entity
      Returns:
      true, if the entity is eligible to spot
    • getEntityType

      public long getEntityType()
      Overrides:
      getEntityType in class BipedMek
    • updateSensorOptions

      public void updateSensorOptions()
      A method to add/remove sensors that only work in space as we transition in and out of an atmosphere
      Specified by:
      updateSensorOptions in interface IAero
    • getEnginesLostRound

      public int getEnginesLostRound()
      Description copied from interface: IAero
      Check which turn engines were destroyed in.
      Specified by:
      getEnginesLostRound in interface IAero
    • setEnginesLostRound

      public void setEnginesLostRound(int enginesLostRound)
      Description copied from interface: IAero
      Set round that engines were completely destroyed; needed for crash-landing check
      Specified by:
      setEnginesLostRound in interface IAero
    • isFlyingOff

      public boolean isFlyingOff()
      Specified by:
      isFlyingOff in interface IAero
    • setFlyingOff

      public void setFlyingOff(OffBoardDirection direction)
      Specified by:
      setFlyingOff in interface IAero
    • getFlyingOffDirection

      public OffBoardDirection getFlyingOffDirection()
      Specified by:
      getFlyingOffDirection in interface IAero
    • getExitAltitude

      public int getExitAltitude()
      Description copied from interface: IAero
      Gets the altitude at which this unit climbed out of the atmosphere. Used for returning units that left via vertical climb out at altitude 10.
      Specified by:
      getExitAltitude in interface IAero
      Returns:
      The exit altitude (0 if not a climb out, typically 10 for climb outs)
    • setExitAltitude

      public void setExitAltitude(int altitude)
      Description copied from interface: IAero
      Sets the altitude at which this unit is climbing out of the atmosphere. Should be set when a unit leaves the map vertically at altitude 10.
      Specified by:
      setExitAltitude in interface IAero
      Parameters:
      altitude - The exit altitude (typically 10 for climb out, 0 to clear)