Class Aero

All Implemented Interfaces:
Serializable, BTObject, CombatRole, Deployable, ForceAssignable, IAero, IBomber, InGameObject, ITechnology, ITurnOrdered, PhaseUpdated, RoundUpdated, Targetable, Transporter
Direct Known Subclasses:
AeroSpaceFighter, Jumpship, SmallCraft, TeleMissile

public abstract class Aero extends Entity implements IAero, IBomber
Taharqa's attempt at creating an Aerospace entity
See Also:
  • Field Details

  • Constructor Details

    • Aero

      public Aero()
  • Method Details

    • getLocationAbbrs

      public String[] getLocationAbbrs()
      Specified by:
      getLocationAbbrs in class Entity
    • getLocationNames

      public String[] getLocationNames()
      Specified by:
      getLocationNames in class Entity
    • getUnitType

      public int getUnitType()
      Specified by:
      getUnitType in class Entity
      See Also:
    • getConstructionTechAdvancement

      public TechAdvancement getConstructionTechAdvancement()
      Description copied from class: Entity
      return - the base construction option tech advancement
      Specified by:
      getConstructionTechAdvancement in class Entity
    • getCockpitTechAdvancement

      public static TechAdvancement getCockpitTechAdvancement(int cockpitType)
    • getCockpitTechAdvancement

      public TechAdvancement getCockpitTechAdvancement()
    • addSystemTechAdvancement

      protected void addSystemTechAdvancement(CompositeTechLevel ctl)
      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 Entity
    • setDesignType

      public void setDesignType(int design)
      Sets the unit as either a civilian or military design
    • setDestroyed

      public void setDestroyed(boolean destroyed)
      Overrides:
      setDestroyed in class Entity
    • getDesignType

      public int getDesignType()
      Returns the unit's design type
    • isAeroSensorDestroyed

      public boolean isAeroSensorDestroyed()
      A method to determine if an aero has suffered 3 sensor hits. When double-blind is on, this affects both standard visibility and sensor rolls
      Overrides:
      isAeroSensorDestroyed in class Entity
    • getWalkMP

      public int getWalkMP(MPCalculationSetting mpCalculationSetting)
      Overrides:
      getWalkMP in class Entity
    • getCurrentThrust

      public int getCurrentThrust()
      Specified by:
      getCurrentThrust in interface IAero
      Returns:
      same as getWalkMP(megamek.common.MPCalculationSetting), but does not divide by 2 when grounded
    • locations

      public int locations()
      Returns the number of locations in the entity
      Specified by:
      locations in class Entity
    • getBodyLocation

      public int getBodyLocation()
      Description copied from class: Entity
      Determines where to place equipment that does not require a specific location. What this means varies by Entity type.
      Overrides:
      getBodyLocation in class Entity
      Returns:
      The location to place equipment that is not required to be assigned a location, defaulting to Entity.LOC_NONE for unit types that do not have such a location.
    • canChangeSecondaryFacing

      public boolean canChangeSecondaryFacing()
      Description copied from class: Entity
      Can this entity change secondary facing at all?
      Specified by:
      canChangeSecondaryFacing in class Entity
    • isValidSecondaryFacing

      public boolean isValidSecondaryFacing(int n)
      Description copied from class: Entity
      Can this entity torso/turret twist the given direction?
      Specified by:
      isValidSecondaryFacing in class Entity
    • clipSecondaryFacing

      public int clipSecondaryFacing(int n)
      Aerospace really can't torso twist?
      Specified by:
      clipSecondaryFacing in class Entity
      Returns:
      the closest valid secondary facing.
    • isOutControlTotal

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

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

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

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

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

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

      public void setLifeSupport(boolean b)
    • isRolled

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

      public void setOutControl(boolean outOfControl)
      Specified by:
      setOutControl in interface IAero
    • setOutCtrlHeat

      public void setOutCtrlHeat(boolean outOfControlHeat)
      Specified by:
      setOutCtrlHeat 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
    • setAccLast

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

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

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

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

      public void autoSetMaxBombPoints()
    • getIntBombChoices

      public int[] 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(int[] 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 int[] 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(int[] 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.
    • setWhoFirst

      public void setWhoFirst()
    • getWhoFirst

      public int getWhoFirst()
    • 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
    • getPotCrit

      public int getPotCrit()
    • setPotCrit

      public void setPotCrit(int crit)
    • getSI

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

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

      public int getNoseArmor()
      Used to determine modifier for landing; different for Aero and LAM.
      Specified by:
      getNoseArmor 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
    • getCurrentDamage

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

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

      public void setOSI(int si)
      Set the starting Structural Integrity of this unit. Also sets the current SI as if by setSI(int).
      Parameters:
      si - The new value for SI
    • autoSetSI

      public void autoSetSI()
    • autoSetCapArmor

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

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

      @Deprecated(since="0.50.05") public void initializeSI(int val)
      Deprecated.
      use setOSI(int) instead
    • setSI

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

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

      public void setSensorHits(int hits)
    • getFCSHits

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

      public void setFCSHits(int hits)
    • fuelTankHit

      public boolean fuelTankHit()
    • setFuelTankHit

      public void setFuelTankHit(boolean value)
    • setCICHits

      public void setCICHits(int hits)
    • getCICHits

      public int getCICHits()
    • setIgnoredCrewHits

      public void setIgnoredCrewHits(int hits)
    • getIgnoredCrewHits

      public int getIgnoredCrewHits()
    • getEngineHits

      public int getEngineHits()
      Specified by:
      getEngineHits in class Entity
    • setEngineHits

      public void setEngineHits(int hits)
    • getAvionicsHits

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

      public void setAvionicsHits(int hits)
    • isGearHit

      public boolean isGearHit()
    • 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
    • setOHeatSinks

      public void setOHeatSinks(int hs)
    • getOHeatSinks

      public int getOHeatSinks()
    • setHeatSinks

      public void setHeatSinks(int hs)
    • getHeatSinks

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

      public int getHeatSinkHits()
    • setHeatType

      public void setHeatType(int heatSinkType)
    • getPodHeatSinks

      public int getPodHeatSinks()
    • setPodHeatSinks

      public void setPodHeatSinks(int hs)
    • tracksHeat

      public boolean tracksHeat()
      Description copied from interface: Targetable
      Used to identify an target that tracks heat buildup (Meks, ASFs, and small craft).
      Specified by:
      tracksHeat in interface Targetable
      Returns:
      Whether the target tracks heat buildup.
    • setLeftThrustHits

      public void setLeftThrustHits(int hits)
    • getLeftThrustHits

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

      public void setRightThrustHits(int hits)
    • getRightThrustHits

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

      public int getOriginalFuel()
    • 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.
    • getStrategicFuelUse

      public double getStrategicFuelUse()
      Used by SmallCraft and Jumpship and their child classes.
      Returns:
      The tons of fuel burned in a day at 1G using strategic movement.
    • primitiveFuelFactor

      public double primitiveFuelFactor()
      Some primitive aerospace units have their fuel efficiency reduced by a factor based on construction year.
      Returns:
      The primitive fuel factor for the build year.
    • getHeatType

      public int getHeatType()
    • wasCritThresh

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

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

      public boolean isImmobile()
      Description copied from class: Entity
      Is this entity shut down or is the crew unconscious?
      Specified by:
      isImmobile in interface Targetable
      Overrides:
      isImmobile in class Entity
      Returns:
      true if the target is immobile (-4 to hit)
    • 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 Entity
      Parameters:
      roundNumber - the int number of the new round
    • getMovementString

      public String getMovementString(EntityMovementType entityMovementType)
      Returns the name of the type of movement used. This is tank-specific.
      Specified by:
      getMovementString in class Entity
    • getMovementAbbr

      public String getMovementAbbr(EntityMovementType entityMovementType)
      Returns the name of the type of movement used. This is tank-specific.
      Specified by:
      getMovementAbbr in class Entity
    • hasRearArmor

      public boolean hasRearArmor(int loc)
      Description copied from class: Entity
      Does this location have rear armor?
      Specified by:
      hasRearArmor in class Entity
    • getWeaponArc

      public int getWeaponArc(int wn)
      Returns the Compute.ARC that the weapon fires into.
      Specified by:
      getWeaponArc in class Entity
    • isSecondaryArcWeapon

      public boolean isSecondaryArcWeapon(int weaponId)
      Returns true if this weapon fires into the secondary facing arc. If false, assume it fires into the primary.
      Specified by:
      isSecondaryArcWeapon in class Entity
    • rollHitLocation

      public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMode aimingMode, int cover)
      Rolls up a hit location
      Specified by:
      rollHitLocation in class Entity
    • rollHitLocation

      public HitData rollHitLocation(int table, int side)
      Description copied from class: Entity
      Rolls up a hit location
      Specified by:
      rollHitLocation in class Entity
    • getTransferLocation

      public HitData getTransferLocation(HitData hit)
      Gets the location that excess damage transfers to
      Specified by:
      getTransferLocation in class Entity
    • getDependentLocation

      public int getDependentLocation(int loc)
      Gets the location that is destroyed recursively
      Specified by:
      getDependentLocation in class Entity
    • getBVTypeModifier

      public double getBVTypeModifier()
      Not used directly but is overwritten in 5 other classes.
      Returns:
      BV Type Modifier.
    • addEntityBonuses

      public PilotingRollData addEntityBonuses(PilotingRollData prd)
      Description copied from class: Entity
      Add in any piloting skill mods
      Specified by:
      addEntityBonuses in class Entity
    • victoryReport

      public Vector<Report> victoryReport()
      Description copied from class: Entity
      Generates a vector containing reports on all useful information about this entity.
      Specified by:
      victoryReport in class Entity
    • getNoOfSlots

      public int[] getNoOfSlots()
      Specified by:
      getNoOfSlots in class Entity
    • getRunMP

      public int getRunMP(MPCalculationSetting mpCalculationSetting)
      Overrides:
      getRunMP in class Entity
    • getHeatCapacity

      public int getHeatCapacity(boolean includeRadicalHeatSink)
      Specified by:
      getHeatCapacity in class Entity
    • getHeatCapacityWithWater

      public int getHeatCapacityWithWater()
      Description copied from class: Entity
      Returns the amount of heat that the entity can sink each turn, factoring in whether the entity is standing in water.
      Specified by:
      getHeatCapacityWithWater in class Entity
    • getEngineCritHeat

      public int getEngineCritHeat()
      Description copied from class: Entity
      Returns extra heat generated by engine crits
      Specified by:
      getEngineCritHeat in class Entity
    • autoSetInternal

      public void autoSetInternal()
      Description copied from class: Entity
      Sets the internal structure for every location to appropriate undamaged values for the unit and location.
      Specified by:
      autoSetInternal in class Entity
    • autoSetThresh

      public void autoSetThresh()
    • setThresh

      public void setThresh(int val, int loc)
    • initializeThresh

      public void initializeThresh(int loc)
    • getThresh

      public int getThresh(int loc)
      Specified by:
      getThresh in interface IAero
    • getHighestThresh

      public int getHighestThresh()
      Specified by:
      getHighestThresh in interface IAero
    • isRepairable

      public boolean isRepairable()
      Determine if the unit can be repaired, or only harvested for spares.
      Overrides:
      isRepairable in class Entity
      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:
    • canCharge

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

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

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

      @Deprecated(since="0.50.05", forRemoval=true) public int getSuspensionFactor()
      Deprecated, for removal: This API element is subject to removal in a future version.
      No indicated uses.
      Returns:
      suspension factor of vehicle
    • getCost

      public double getCost(CalculationReport calcReport, boolean ignoreAmmo)
      Description copied from class: Entity
      Calculates and returns the C-bill cost of the unit. The parameter ignoreAmmo can be used to include or exclude ("dry cost") the cost of ammunition on the unit. A report for the cost calculation will be written to the given calcReport.
      Specified by:
      getCost in class Entity
      Parameters:
      calcReport - A CalculationReport to write the report for the cost calculation to
      ignoreAmmo - When true, the cost of ammo on the unit will be excluded from the cost
      Returns:
      The cost in C-Bills of the 'Mek in question.
    • getPriceMultiplier

      public double getPriceMultiplier()
      Description copied from class: Entity
      Returns a multiplier that combines multiplicative construction cost modifiers for this Entity.

      This includes only modifiers that apply to an Entity's final, total cost (e.g. - the 1.25x modifier for being an omni-unit, or the 32.0x for being an aerodyne DropShip). It does NOT include multipliers that only apply to a sub-part of the unit (e.g. the weight based multiplier that applies to a vehicle's internal structure cost).

      This allows MekHQ to scale the price of a Unit's Parts in a more appropriate manner.

      Defaults to 1.0

      Overrides:
      getPriceMultiplier in class Entity
    • implicitClanCASE

      public int implicitClanCASE()
      Description copied from class: Entity
      Used to for cost calculations. Though the TM rules allow a Clan unit to be designed without CASE, MM assumes that CASE is present in any location that has explosive equipment.
      Overrides:
      implicitClanCASE in class Entity
      Returns:
      The number of locations protected by Clan CASE beyond what is explicitly mounted.
    • doomedInExtremeTemp

      public boolean doomedInExtremeTemp()
      Specified by:
      doomedInExtremeTemp in class Entity
    • doomedInVacuum

      public boolean doomedInVacuum()
      Specified by:
      doomedInVacuum in class Entity
    • doomedOnGround

      public boolean doomedOnGround()
      Specified by:
      doomedOnGround in class Entity
    • doomedInAtmosphere

      public boolean doomedInAtmosphere()
      Specified by:
      doomedInAtmosphere in class Entity
    • doomedInSpace

      public boolean doomedInSpace()
      Specified by:
      doomedInSpace in class Entity
    • setEngine

      public void setEngine(Engine e)
      Overrides:
      setEngine in class Entity
    • getInternalRemainingPercent

      public double getInternalRemainingPercent()
      Returns the percent of the SI remaining
      Overrides:
      getInternalRemainingPercent in class Entity
    • calculateWalk

      protected int calculateWalk()
    • isNuclearHardened

      public boolean isNuclearHardened()
      Description copied from class: Entity
      Checks if the unit is hardened against nuclear strikes.
      Specified by:
      isNuclearHardened in class Entity
      Returns:
      true if this is a hardened unit.
    • addEquipment

      public void addEquipment(Mounted<?> mounted, int loc, boolean rearMounted) throws LocationFullException
      Overrides:
      addEquipment in class Entity
      Throws:
      LocationFullException
    • getCriticalEffect

      public int getCriticalEffect(int roll, int target)
      get the type of critical caused by a critical roll, taking account of existing damage
      Parameters:
      roll - the final dice roll
      target - the hit location
      Returns:
      a critical type
    • setOmni

      public void setOmni(boolean omni)
      Overrides:
      setOmni in class Entity
    • addClanCase

      public void addClanCase()
      Description copied from class: Entity
      For clan units that get automatic Clan CASE, adds clan CASE in every location that has potentially explosive equipment (this includes uncharged PPC Capacitors).

      As clan CASE does not need critical slots, this method does not perform checks whether other CASE types are already present on a location.

      This method does nothing by default and must be overridden for unit types that get Clan CASE.

      Overrides:
      addClanCase in class Entity
    • hasCase

      public boolean hasCase()
      Description copied from class: Entity
      Returns whether there is CASE anywhere on this Entity.
      Overrides:
      hasCase in class Entity
      Returns:
      see if case is available anywhere
    • sideTableRam

      public int sideTableRam(Coords src)
      Used to determine net velocity of ramming attack
      Overrides:
      sideTableRam in class Entity
    • chooseSideRam

      public int chooseSideRam(Coords src)
    • getMaxEngineHits

      public int getMaxEngineHits()
    • getMaxElevationChange

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

      public boolean isStealthActive()
      Determine if this unit has an active and working stealth system. (stealth can be active and not working when under ECCM)

      Subclasses are encouraged to override this method.

      Overrides:
      isStealthActive in class Entity
      Returns:
      true if this unit has a stealth system that is currently active, false if there is no stealth system or if it is inactive.
    • isStealthOn

      public boolean isStealthOn()
      Determine if this unit has an active and working stealth system. (stealth can be active and not working when under ECCM)

      Subclasses are encouraged to override this method.

      Overrides:
      isStealthOn in class Entity
      Returns:
      true if this unit has a stealth system that is currently active, false if there is no stealth system or if it is inactive.
    • getStealthModifier

      public TargetRoll getStealthModifier(int range, Entity ae)
      Determine the stealth modifier for firing at this unit from the given range. If the value supplied for range is not one of the Entity class range constants, an IllegalArgumentException will be thrown.

      Subclasses are encouraged to override this method.

      Overrides:
      getStealthModifier in class Entity
      Parameters:
      range - - an int value that must match one of the Compute class range constants.
      ae - - entity making the attack
      Returns:
      a TargetRoll value that contains the stealth modifier for the given range.
    • setArmorType

      public void setArmorType(int armType)
      Overrides:
      setArmorType in class Entity
    • setArmorType

      public void setArmorType(int armType, boolean addMount)
    • isLocationProhibited

      public boolean isLocationProhibited(Coords c, int currElevation)
      Overrides:
      isLocationProhibited in class Entity
      Parameters:
      c - Coords Coordinates
      currElevation - Elevation level
      Returns:
      true if the specified hex contains some sort of prohibited terrain if the Entity is at the specified elevation. Elevation generally only matters for units like WiGEs or VTOLs.
    • 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.
    • 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
    • setSpheroid

      public void setSpheroid(boolean b)
    • getStraightMoves

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

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

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

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

      public void setVSTOL(boolean b)
    • 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
    • getTotalCommGearTons

      public int getTotalCommGearTons()
      Specified by:
      getTotalCommGearTons in class Entity
      Returns:
      the total tonnage of communications gear in this entity
    • getBadCriticals

      public int getBadCriticals(int type, int index, int loc)
      The number of critical slots that are destroyed in the component.
      Overrides:
      getBadCriticals in class Entity
    • getCockpitType

      public int getCockpitType()
    • setCockpitType

      public void setCockpitType(int type)
    • getCockpitTypeString

      public String getCockpitTypeString()
    • getCockpitTypeString

      public static String getCockpitTypeString(int inCockpitType)
    • hasCommandConsoleBonus

      public boolean hasCommandConsoleBonus()
      Description copied from class: Entity
      Units with a cockpit command console provide an initiative bonus to their side, provided that the commander is not currently functioning as pilot, the unit has advanced fire control, and the unit is heavy or assault weight class.
      Overrides:
      hasCommandConsoleBonus in class Entity
      Returns:
      Whether the Entity qualifies for initiative bonus from cockpit command console.
    • getArmorRemainingPercent

      public double getArmorRemainingPercent()
      Description copied from class: Entity
      Returns the percent of the armor remaining
      Overrides:
      getArmorRemainingPercent in class Entity
    • areWingsHit

      public boolean areWingsHit()
      keep track of whether the wings have suffered a weapon critical hit
    • setWingsHit

      public void setWingsHit(boolean b)
    • getOppositeLocation

      public int getOppositeLocation(int loc)
      what location is opposite the given one
    • getClusterMods

      public int getClusterMods()
      get modifications to the cluster hit table for critical hits
      Specified by:
      getClusterMods in interface IAero
    • 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.
    • getECCMStrength

      public double getECCMStrength()
      Overrides:
      getECCMStrength in class Entity
      Returns:
      the strength of the ECCM field this unit emits
    • setECCMRoll

      public void setECCMRoll(int i)
    • getECCMRoll

      public int getECCMRoll()
    • getECCMTarget

      public int getECCMTarget()
    • getECCMBonus

      public int getECCMBonus()
    • isCrewProtected

      public boolean isCrewProtected()
      Returns:
      is the crew of this vessel protected from gravitational effects, see StratOps, pg. 36
    • getGravSecondaryThreshold

      @Deprecated(since="0.50.05", forRemoval=true) public int getGravSecondaryThreshold()
      Deprecated, for removal: This API element is subject to removal in a future version.
      No indicated uses.
    • getGravPrimaryThreshold

      @Deprecated(since="0.50.05", forRemoval=true) public int getGravPrimaryThreshold()
      Deprecated, for removal: This API element is subject to removal in a future version.
      no indicated uses.
    • canLoad

      public boolean canLoad(Entity unit, boolean checkFalse)
      Determines if this object can accept the given unit. The unit may not be of the appropriate type or there may be no room for the unit.
      Overrides:
      canLoad in class Entity
      Parameters:
      unit - - the Entity to be loaded.
      Returns:
      true if the unit can be loaded, false otherwise.
    • getWeaponGroups

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

      public Map<String,Integer> groupWeaponsByLocation()
      Iterate through current weapons and count the number in each capital fighter location.
      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.
    • shouldMoveBackHex

      @Deprecated(since="0.50.05", forRemoval=true) public boolean shouldMoveBackHex(Aero other)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No indicated uses.
      Parameters:
      other - Aero
      Returns:
      whether another unit occupies the same hex, determine if this Aero should be moved back a hex for * targeting purposes
    • hasArmoredEngine

      public boolean hasArmoredEngine()
      Overrides:
      hasArmoredEngine in class Entity
    • getForwardArc

      public int getForwardArc()
      Overrides:
      getForwardArc in class Entity
    • getRearArc

      public int getRearArc()
      Overrides:
      getRearArc in class Entity
    • 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
    • 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.
    • canGoDown

      public boolean canGoDown()
      Overrides:
      canGoDown in class Entity
    • isPrimitive

      public boolean isPrimitive()
      Overrides:
      isPrimitive in class Entity
      Returns:
      Whether the unit uses primitive or retro tech construction rules
    • getLocationDamage

      public String getLocationDamage(int loc)
      Specified by:
      getLocationDamage in class Entity
    • getCritDamageString

      public String getCritDamageString()
    • isCrippled

      public boolean isCrippled()
      Description copied from class: Entity
      Returns TRUE if the entity meets the requirements for crippling damage as detailed in TW pg 258.
      Specified by:
      isCrippled in class Entity
      Returns:
      boolean
    • isCrippled

      public boolean isCrippled(boolean checkCrew)
      Description copied from class: Entity
      Returns TRUE if the entity meets the requirements for crippling damage as detailed in TW pg 258. Excepting dead or non-existing crew issues
      Specified by:
      isCrippled in class Entity
      Returns:
      boolean
    • isDmgHeavy

      public boolean isDmgHeavy()
      Description copied from class: Entity
      Returns TRUE if the entity has been heavily damaged.
      Specified by:
      isDmgHeavy in class Entity
      Returns:
      boolean
    • isDmgModerate

      public boolean isDmgModerate()
      Description copied from class: Entity
      Returns TRUE if the entity has been moderately damaged.
      Specified by:
      isDmgModerate in class Entity
      Returns:
      boolean
    • isDmgLight

      public boolean isDmgLight()
      Description copied from class: Entity
      Returns TRUE if the entity has been lightly damaged.
      Specified by:
      isDmgLight in class Entity
      Returns:
      boolean
    • 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
    • doDisbandDamage

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

      public int getNCrew()
      Overrides:
      getNCrew in class Entity
      Returns:
      The total number of crew available to supplement marines onboarding actions. Includes officers, enlisted, and bay personnel, but not marines/ba or passengers.
    • getNOfficers

      public int getNOfficers()
      Returns:
      The total number of officers for vessels.
    • getNGunners

      public int getNGunners()
      Returns:
      The total number of gunners for vessels.
    • getNPassenger

      public int getNPassenger()
      Overrides:
      getNPassenger in class Entity
      Returns:
      number of passengers on this unit Intended for spacecraft, where we want to get the crews of transported units plus actual passengers assigned to quarters
    • getEscapeCraft

      public Set<String> getEscapeCraft()
      Returns:
      Set of Entity IDs used by this ship as escape craft
    • addEscapeCraft

      public void addEscapeCraft(String id)
      Adds an Escape Craft. Used by MHQ to track where escaped crew and passengers end up.
      Parameters:
      id - The Entity ID of the ship to add.
    • removeEscapeCraft

      @Deprecated(since="0.50.05", forRemoval=true) public void removeEscapeCraft(String id)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No indicated uses.
      Removes an Escape Craft. Used by MHQ to track where escaped crew and passengers end up.
      Parameters:
      id - The Entity ID of the ship to remove.
    • getNBattleArmor

      public int getNBattleArmor()
      Returns:
      The number battle armored marines available to vessels for boarding actions.
    • getNMarines

      public int getNMarines()
      Overrides:
      getNMarines in class Entity
      Returns:
      The number conventional marines available to vessels for boarding actions.
    • getMarines

      public Map<UUID,Integer> getMarines()
      Returns:
      Map of unique individuals being transported as marines
    • addMarine

      @Deprecated(since="0.50.05", forRemoval=true) public void addMarine(UUID personId, int pointValue)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No indicated uses.
      Adds a marine. Used by MHQ to track where a given person ends up. Also used by MM to move marines around between ships
      Parameters:
      personId - The unique ID of the person to add.
      pointValue - The marine point value of the person being added
    • removeMarine

      @Deprecated(since="0.50.05", forRemoval=true) public void removeMarine(UUID personId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No indicated uses.
      Removes a marine. Used by MHQ to track where a given person ends up. Also used by MM to move marines around between ships
      Parameters:
      personId - The unique ID of the person to remove.
    • getMarineCount

      public int getMarineCount()
      Returns:
      number of marines assigned to a unit Used for abandoning a unit
    • getTotalAboard

      @Deprecated(since="0.50.05", forRemoval=true) public int getTotalAboard()
      Deprecated, for removal: This API element is subject to removal in a future version.
      no indicated uses.
      Convenience method that compiles the total number of people aboard a ship - Crew, Marines, Passengers...
      Returns:
      An integer representing everyone aboard
    • getEscapePods

      public int getEscapePods()
      Returns:
      The number of escape pods carried by the unit
    • getPodsLeft

      public int getPodsLeft()
      Returns:
      the number of escape pods remaining
    • getLifeBoats

      public int getLifeBoats()
      Returns:
      The number of lifeboats carried by the unit
    • getLaunchedEscapePods

      public int getLaunchedEscapePods()
      Returns the total number of escape pods launched so far
    • setLaunchedEscapePods

      public void setLaunchedEscapePods(int n)
      Updates the total number of escape pods launched so far
      Parameters:
      n - The number to change
    • getLaunchedLifeBoats

      public int getLaunchedLifeBoats()
      Returns the total number of lifeboats launched so far
    • getLifeBoatsLeft

      public int getLifeBoatsLeft()
      Returns:
      return the number of lifeboats remaining
    • setLaunchedLifeBoats

      public void setLaunchedLifeBoats(int n)
      Updates the total number of lifeboats launched so far
      Parameters:
      n - The number to change
    • hasEscapeSystemsLeft

      @Deprecated(since="0.50.05", forRemoval=true) public boolean hasEscapeSystemsLeft()
      Deprecated, for removal: This API element is subject to removal in a future version.
      No indicated uses
      Calculates whether this ship has any available escape systems remaining return
    • getEscapeCapacity

      @Deprecated(since="0.50.05", forRemoval=true) public int getEscapeCapacity()
      Deprecated, for removal: This API element is subject to removal in a future version.
      no indicated uses
      Calculates the total number of people that can be carried in this unit's escape systems 6 people per lifeboat/escape pod + troop capacity of any small craft Most small craft use cargo space instead of infantry bays, so we'll assume 0.1 tons/person (Taken from Infantry.getWeight() - foot trooper + .015t for the spacesuit everyone aboard is wearing ;) )
      Returns:
      The total escape count for the unit
    • getEntityType

      public long getEntityType()
      Specified by:
      getEntityType in class Entity
    • 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.
      Specified by:
      isAero in interface BTObject
      Returns:
      True when this may use aerospace movement (aerospace and LAM units)
    • isBomber

      public boolean isBomber()
      Fighters may carry external ordnance; Other Aerospace units with cargo bays and the Internal Bomb Bay quirk may carry bombs internally.
      Specified by:
      isBomber in interface Targetable
      Returns:
      boolean
    • 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.
    • getSpriteDrawPriority

      public int getSpriteDrawPriority()
      Description copied from class: Entity
      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 Entity
    • getActiveAMS

      public List<WeaponMounted> getActiveAMS()
      Overrides:
      getActiveAMS in class Entity
      Returns:
      currently operable AMS mounted in this Entity.
    • 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
    • hasEjectSeat

      public boolean hasEjectSeat()
      Returns:
      unit has an ejection seat
    • isAutoEject

      public boolean isAutoEject()
      Returns:
      Returns the autoEject.
    • setAutoEject

      public void setAutoEject(boolean autoEject)
      Parameters:
      autoEject - Turn the master auto-ejection system on or off
    • isCondEjectAmmo

      public boolean isCondEjectAmmo()
      Returns:
      Is Auto-Ejection enabled for ammo explosions?
    • setCondEjectAmmo

      public void setCondEjectAmmo(boolean condEjectAmmo)
      Used by Conditional Auto Ejection - will we eject when an ammo explosion is triggered?
      Parameters:
      condEjectAmmo - Sets auto-ejection for ammo explosions
    • isCondEjectFuel

      public boolean isCondEjectFuel()
      Returns:
      Is auto-ejection enabled for fuel explosions?
    • setCondEjectFuel

      public void setCondEjectFuel(boolean condEjectFuel)
      Used by Conditional Auto Ejection - will we eject when a fuel explosion is triggered?
      Parameters:
      condEjectFuel - Sets auto-ejection for fuel tank explosions
    • isCondEjectSIDest

      public boolean isCondEjectSIDest()
      Returns:
      Is auto-ejection enabled for SI destruction (Fighter only)?
    • setCondEjectSIDest

      public void setCondEjectSIDest(boolean condEjectSIDest)
      Used by Conditional Auto Ejection - will we eject when structural integrity is reduced to 0?
      Parameters:
      condEjectSIDest - Sets auto-ejection for structural integrity destruction
    • isEjecting

      public boolean isEjecting()
      Intended for large craft.
      Returns:
      Indicates that the ship is being abandoned.
    • setEjecting

      public void setEjecting(boolean ejecting)
      Changes the ejecting flag when the order to abandon ship is given
      Parameters:
      ejecting - Change to the ejecting status of this ship
    • 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