Class Jumpship

All Implemented Interfaces:
Serializable, ICarryable, Transporter, InGameObject, CombatRole, ForceAssignable, ITechnology, ITurnOrdered, PhaseUpdated, RoundUpdated, ActiveHeatSinkController, BTObject, Deployable, IAero, IBomber, Targetable
Direct Known Subclasses:
SpaceStation, Warship

public class Jumpship extends Aero
Since:
Jun 17, 2007
See Also:
  • Field Details

  • Constructor Details

    • Jumpship

      public Jumpship()
  • Method Details

    • tracksHeat

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

      public int getUnitType()
      Overrides:
      getUnitType in class Aero
      See Also:
    • getAsewAffectedTurns

      protected int[] getAsewAffectedTurns()
    • setASEWAffected

      public void setASEWAffected(int arc, int turns)
    • getASEWAffected

      public int getASEWAffected(int arc)
    • getConstructionTechAdvancement

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

      public static TechAdvancement getLFBatteryTA()
      Tech advancement data for lithium fusion batteries
    • getJumpSailTA

      public static TechAdvancement getJumpSailTA()
      Tech advancement data for the jump sail
    • isAutoEject

      public boolean isAutoEject()
      Overrides:
      isAutoEject in class Aero
      Returns:
      Returns the autoEject setting (always off for large craft)
    • getCritDamageString

      public String getCritDamageString()
      Overrides:
      getCritDamageString in class Aero
    • defaultCrewType

      public CrewType defaultCrewType()
      Overrides:
      defaultCrewType in class Entity
    • locations

      public int locations()
      Description copied from class: Aero
      Returns the number of locations in the entity
      Overrides:
      locations in class Aero
    • 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 Aero
      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.
    • getDockingCollarType

      public int getDockingCollarType()
      Get the docking collar type used by the ship.
      Returns:
      the docking collar type
    • getFreeDockingCollars

      public int getFreeDockingCollars()
      Returns the number of free Docking Collars.
    • getTotalDamagedDockingCollars

      public int getTotalDamagedDockingCollars()
      Get the number of damaged docking collars on the ship. Used by crit damage string on unit display
      Returns:
      the number of damaged docking collars
    • getTotalGravDeck

      public int getTotalGravDeck()
      Get the number of grav decks on the ship.
      Returns:
      the total number of grav decks
    • getTotalDamagedGravDeck

      public int getTotalDamagedGravDeck()
      Get the number of damaged grav decks on the ship. Used by JS/WS MapSet widget to display critical hits
      Returns:
      the number of damaged grav decks
    • addGravDeck

      public void addGravDeck(int size)
      Adds a grav deck whose size in meters is specified.
      Parameters:
      size - The size in meters of the grav deck.
    • getGravDecks

      public List<Integer> getGravDecks()
      Get a list of all grav decks mounted on this ship. Returns the size in meters of the deck
      Returns:
      a list of grav deck diameters, in meters
    • initializeGravDeckDamage

      public void initializeGravDeckDamage(int index)
      Adds a grav deck damage value that maps to the index of each deck size in meters
    • getGravDeckDamageFlag

      public int getGravDeckDamageFlag(int key)
      Gets the damage flag for the grav deck with the specified key
      Returns:
      the damage status for the deck 0 (undamaged) or 1 (damaged)
    • setGravDeckDamageFlag

      public void setGravDeckDamageFlag(int key, int damaged)
      Sets the damage flag for the grav deck with the specified key to the specified value
      Parameters:
      key - - the id of the deck to affect
      damaged - - 0 (undamaged), 1 (damaged)
    • setGravDeck

      public void setGravDeck(int n)
      Old style for setting the number of grav decks. This allows the user to specify N standard grav decks, which will get added at a default value.
      Parameters:
      n - The number of grav decks
    • getGravDeck

      public int getGravDeck()
      Get the number of standard grav decks
      Returns:
      the number of 0-99 meter grav decks installed
    • setGravDeckLarge

      public void setGravDeckLarge(int n)
      Old style method for adding N large grav decks. A default value is chosen that is half-way between the standard and huge sizes.
      Parameters:
      n - The number of grav decks
    • getGravDeckLarge

      public int getGravDeckLarge()
      Get the number of large grav decks.
      Returns:
      the number of 100-249 meter grav decks installed
    • setGravDeckHuge

      public void setGravDeckHuge(int n)
      Old style method for adding N huge grav decks. A default value is chosen that is the current large maximum plus half that value.
      Parameters:
      n - The number of grav decks
    • getGravDeckHuge

      public int getGravDeckHuge()
      Get the number of huge grav decks.
      Returns:
      the number of 250 meter and larger grav decks installed
    • setHPG

      public void setHPG(boolean b)
    • hasHPG

      public boolean hasHPG()
    • isBattleStation

      public boolean isBattleStation()
    • setLF

      public void setLF(boolean b)
    • hasLF

      public boolean hasLF()
    • setEscapePods

      public void setEscapePods(int n)
    • getEscapePods

      public int getEscapePods()
      Overrides:
      getEscapePods in class Aero
      Returns:
      The number of escape pods carried by the unit
    • getLaunchedEscapePods

      public int getLaunchedEscapePods()
      Description copied from class: Aero
      Returns the total number of escape pods launched so far
      Overrides:
      getLaunchedEscapePods in class Aero
    • setLaunchedEscapePods

      public void setLaunchedEscapePods(int n)
      Description copied from class: Aero
      Updates the total number of escape pods launched so far
      Overrides:
      setLaunchedEscapePods in class Aero
      Parameters:
      n - The number to change
    • setLifeBoats

      public void setLifeBoats(int n)
    • getLifeBoats

      public int getLifeBoats()
      Overrides:
      getLifeBoats in class Aero
      Returns:
      The number of lifeboats carried by the unit
    • getLaunchedLifeBoats

      public int getLaunchedLifeBoats()
      Description copied from class: Aero
      Returns the total number of lifeboats launched so far
      Overrides:
      getLaunchedLifeBoats in class Aero
    • setLaunchedLifeBoats

      public void setLaunchedLifeBoats(int n)
      Description copied from class: Aero
      Updates the total number of lifeboats launched so far
      Overrides:
      setLaunchedLifeBoats in class Aero
      Parameters:
      n - The number to change
    • setNCrew

      public void setNCrew(int crew)
      Overrides:
      setNCrew in class Entity
    • getNCrew

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

      public void setNPassenger(int pass)
      Overrides:
      setNPassenger in class Entity
    • setNOfficers

      public void setNOfficers(int officer)
    • getNOfficers

      public int getNOfficers()
      Overrides:
      getNOfficers in class Aero
      Returns:
      The total number of officers for vessels.
    • setNGunners

      public void setNGunners(int gunners)
    • getNGunners

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

      public int getNPassenger()
      Overrides:
      getNPassenger in class Aero
      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
    • setNMarines

      public void setNMarines(int m)
      Description copied from class: Entity
      Updates the number of marines aboard
      Overrides:
      setNMarines in class Entity
      Parameters:
      m - The number of marines to add/subtract
    • getNMarines

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

      public void setNBattleArmor(int m)
    • getNBattleArmor

      public int getNBattleArmor()
      Overrides:
      getNBattleArmor in class Aero
      Returns:
      The number battle armored marines available to vessels for boarding actions.
    • setNOtherCrew

      public void setNOtherCrew(int m)
    • getNOtherCrew

      public int getNOtherCrew()
    • getFuelPointsPerTon

      public double getFuelPointsPerTon()
      Specified by:
      getFuelPointsPerTon in interface IAero
      Overrides:
      getFuelPointsPerTon in class Aero
    • getStrategicFuelUse

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

      public double primitiveFuelFactor()
      Description copied from class: Aero
      Some primitive aerospace units have their fuel efficiency reduced by a factor based on construction year.
      Overrides:
      primitiveFuelFactor in class Aero
      Returns:
      The primitive fuel factor for the build year.
    • getLocationAbbreviations

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

      public String[] getLocationNames()
      Overrides:
      getLocationNames in class Aero
    • setKFIntegrity

      public void setKFIntegrity(int kf)
    • getKFIntegrity

      public int getKFIntegrity()
    • setOKFIntegrity

      public void setOKFIntegrity(int kf)
    • getOKFIntegrity

      public int getOKFIntegrity()
    • getKFDriveDamage

      public int getKFDriveDamage()
    • isKFDriveDamaged

      public boolean isKFDriveDamaged()
    • setKFHeliumTankIntegrity

      public void setKFHeliumTankIntegrity(int ht)
    • getKFHeliumTankIntegrity

      public int getKFHeliumTankIntegrity()
    • setKFHeliumTankHit

      public void setKFHeliumTankHit(boolean hit)
    • getKFHeliumTankHit

      public boolean getKFHeliumTankHit()
    • setKFDriveCoilHit

      public void setKFDriveCoilHit(boolean hit)
    • getKFDriveCoilHit

      public boolean getKFDriveCoilHit()
    • setKFFieldInitiatorHit

      public void setKFFieldInitiatorHit(boolean hit)
    • getKFFieldInitiatorHit

      public boolean getKFFieldInitiatorHit()
    • setKFChargingSystemHit

      public void setKFChargingSystemHit(boolean hit)
    • getKFChargingSystemHit

      public boolean getKFChargingSystemHit()
    • setKFDriveControllerHit

      public void setKFDriveControllerHit(boolean hit)
    • getKFDriveControllerHit

      public boolean getKFDriveControllerHit()
    • getLFBatteryHit

      public boolean getLFBatteryHit()
    • setLFBatteryHit

      public void setLFBatteryHit(boolean hit)
    • setOSailIntegrity

      public void setOSailIntegrity(int sail)
    • getOSailIntegrity

      public int getOSailIntegrity()
    • getSailDamage

      @Deprecated(since="0.51.0", forRemoval=true) public int getSailDamage()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setSailIntegrity

      public void setSailIntegrity(int sail)
    • getSailIntegrity

      public int getSailIntegrity()
    • hasSail

      public boolean hasSail()
      Returns:
      Whether this ship has a jump sail (optional on space stations and primitive jumpships)
    • setSail

      public void setSail(boolean sail)
      Parameters:
      sail - Whether this ship has an energy collection sail
    • initializeSailIntegrity

      public void initializeSailIntegrity()
    • initializeKFIntegrity

      public void initializeKFIntegrity()
    • canJump

      public boolean canJump()
    • getDriveCoreType

      public int getDriveCoreType()
    • setDriveCoreType

      public void setDriveCoreType(int driveCoreType)
    • getJumpRange

      public int getJumpRange()
      Get maximum range of a jump
    • setJumpRange

      public void setJumpRange(int range)
      Set maximum jump range (used for primitive jumpships)
    • getJumpDriveWeight

      public double getJumpDriveWeight()
      Returns:
      The weight of the jump drive core for this unit
    • getWeaponArc

      public int getWeaponArc(int weaponNumber)
      Description copied from class: Aero
      Returns the Compute.ARC that the weapon fires into.
      Overrides:
      getWeaponArc in class Aero
      Parameters:
      weaponNumber - integer equipment number, index from equipment list
      Returns:
      arc the specified weapon is in
    • rollHitLocation

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

      public int getMaxEngineHits()
      Overrides:
      getMaxEngineHits in class Aero
    • getArcsWithGuns

      public int getArcsWithGuns()
    • hasWeaponInArc

      public boolean hasWeaponInArc(int loc)
    • getFuelPerTon

      public double getFuelPerTon()
    • getArmorWeight

      public double getArmorWeight()
      Description copied from class: Entity
      The total weight of the armor on this unit. This is guaranteed to be rounded properly for both single-type and patchwork armor.
      Overrides:
      getArmorWeight in class Entity
      Returns:
      The armor weight in tons.
    • getArmorWeight

      public double getArmorWeight(int locCount)
      Description copied from class: Entity
      Prior to TacOps errata 3.3, armor was rounded up to the nearest half ton As of TacOps errata 3.3, patchwork armor is not rounded by location. Previous editions of the rules required it to be rounded up to the nearest half ton by location. Note: Unless overridden, this should only be called on units with patchwork armor, as rounding behavior is not guaranteed to be correct or even the same for others and units with a single overall armor type have no real reason to specifically care about weight per location anyway.
      Overrides:
      getArmorWeight in class Entity
      Parameters:
      locCount - The code value for the location in question (unit type-specific).
      Returns:
      The weight of the armor in the location in tons.
    • 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.
      Overrides:
      getCost in class Aero
      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 Aero
    • doomedOnGround

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

      public boolean doomedInAtmosphere()
      Overrides:
      doomedInAtmosphere in class Aero
      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.
    • loadWeapon

      public boolean loadWeapon(WeaponMounted mounted, AmmoMounted mountedAmmo)
      Description copied from class: Entity
      Tries to load the specified weapon with the specified ammo. Returns true if successful, false otherwise.
      Overrides:
      loadWeapon in class Entity
    • getHQIniBonus

      public int getHQIniBonus()
      Overrides:
      getHQIniBonus in class Entity
      Returns:
      the initiative bonus this Entity grants for HQ
    • getOppositeLocation

      public int getOppositeLocation(int loc)
      Description copied from class: Aero
      what location is opposite the given one
      Overrides:
      getOppositeLocation in class Aero
    • hasActiveECM

      public boolean hasActiveECM()
      All military jumpships automatically have ECM if in space
      Overrides:
      hasActiveECM in class Entity
    • getECMRange

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

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

      public double getAccumulatedThrust()
    • setAccumulatedThrust

      public void setAccumulatedThrust(double d)
    • getStationKeepingThrust

      public double getStationKeepingThrust()
    • 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 Aero
      Parameters:
      roundNumber - the int number of the new round
    • getRunMP

      public int getRunMP(MPCalculationSetting mpCalculationSetting)
      Overrides:
      getRunMP in class Aero
    • hasStationKeepingDrive

      public boolean hasStationKeepingDrive()
      Returns:
      Whether this ship has station-keeping drive instead of transit drive.
    • getBVTypeModifier

      public double getBVTypeModifier()
      Description copied from class: Aero
      Not used directly but is overwritten in 5 other classes.
      Overrides:
      getBVTypeModifier in class Aero
      Returns:
      BV Type Modifier.
    • usesWeaponBays

      public boolean usesWeaponBays()
      Overrides:
      usesWeaponBays in class Entity
      Returns:
      True if this unit is using weapons bays
    • isPrimitive

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

      public long getEntityType()
      Overrides:
      getEntityType in class Aero
    • calculateWalk

      protected int calculateWalk()
      Overrides:
      calculateWalk in class Aero
    • isLargeAerospace

      public boolean isLargeAerospace()
      Description copied from interface: BTObject
      Returns true when this object is a large aerospace unit (SmallCraft, DropShip, JumpShip, WarShip, Space Station). Returns false for any type of unit group even if it is of the right type.
      Returns:
      True when this is a large aerospace unit
    • isCapitalScale

      public boolean isCapitalScale()
      Overrides:
      isCapitalScale in class Entity
      Returns:
      True when this unit has capital-scale armor.
    • isJumpShip

      public boolean isJumpShip()
      Description copied from interface: BTObject
      Returns true when this object is a JumpShip (but not a Space Station nor a WarShip). Returns false for any type of unit group.
      Returns:
      True when this is a JumpShip
    • 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.

      Specified by:
      getGenericBattleValue in class Entity
      Returns:
      The generic Battle value for this unit based on its tonnage and type
    • hasPatchworkArmor

      public boolean hasPatchworkArmor()
      Overrides:
      hasPatchworkArmor in class Entity
      Returns:
      True if this unit has patchwork armor. Note that this is checked by comparing actual armor types (and tech level) across the locations - in other words, it is *not* a simple boolean flag; instead, the result will always correspond to the unit's armoring.
    • getRecoveryTime

      public int getRecoveryTime()
      Description copied from class: Entity
      Returns the recovery time for this entity in minutes.

      This method provides the base recovery time required for this entity type. The recovery time represents the duration needed to recover, repair, or prepare the entity after deployment or damage.

      Subclasses should override this method to provide entity-specific recovery times based on their type, weight class, or other relevant characteristics.

      Manual Reference: CamOps pg 214

      Overrides:
      getRecoveryTime in class Entity
      Returns:
      The recovery time in minutes. The default implementation returns 60 minutes.
    • isChassisFamiliarityEligible

      public boolean isChassisFamiliarityEligible()
      Description copied from class: Entity
      Returns whether this unit is a chassis-familiarity-eligible type for MekHQ's Familiarity system
      Overrides:
      isChassisFamiliarityEligible in class Entity
      Returns:
      true if familiarity is tracked for this unit