Class Warship

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

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

  • Constructor Details

    • Warship

      public Warship()
  • Method Details

    • getUnitType

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

      protected int[] getAsewAffectedTurns()
      Overrides:
      getAsewAffectedTurns in class Jumpship
    • getConstructionTechAdvancement

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

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

      public String[] getLocationNames()
      Overrides:
      getLocationNames in class Jumpship
    • locations

      public int locations()
      Description copied from class: Aero
      Returns the number of locations in the entity
      Overrides:
      locations in class Jumpship
    • initializeSailIntegrity

      public void initializeSailIntegrity()
      Overrides:
      initializeSailIntegrity in class Jumpship
    • initializeKFIntegrity

      public void initializeKFIntegrity()
      Overrides:
      initializeKFIntegrity in class Jumpship
    • getWeaponArc

      public int getWeaponArc(int weaponNumber)
      Description copied from class: Aero
      Returns the Compute.ARC that the weapon fires into.
      Overrides:
      getWeaponArc in class Jumpship
      Parameters:
      weaponNumber - integer equipment number, index from equipment list
      Returns:
      arc the specified weapon is in
    • 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 Jumpship
      Returns:
      The armor weight 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 Jumpship
      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 Jumpship
    • getECMRange

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

      public long getEntityType()
      Overrides:
      getEntityType in class Jumpship
    • canChangeSecondaryFacing

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

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

      public int clipSecondaryFacing(int dir)
      Description copied from class: Aero
      Aerospace really can't torso twist?
      Overrides:
      clipSecondaryFacing in class Aero
      Returns:
      the closest valid secondary facing.
    • 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 Jumpship
      Parameters:
      roundNumber - the int number of the new round
    • postProcessFacingChange

      public void postProcessFacingChange()
      Description copied from class: Entity
      Utility function that handles situations where a facing change imparts some kind of permanent effect to the entity.
      Overrides:
      postProcessFacingChange in class Entity
    • 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.
      Specified by:
      isJumpShip in interface BTObject
      Overrides:
      isJumpShip in class Jumpship
      Returns:
      True when this is a JumpShip
    • isWarShip

      public boolean isWarShip()
      Description copied from interface: BTObject
      Returns true when this object is a WarShip (but not a Space Station nor a JumpShip). Returns false for any type of unit group.
      Returns:
      True when this is a WarShip
    • getGenericBattleValue

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

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

      Overrides:
      getGenericBattleValue in class Jumpship
      Returns:
      The generic Battle value for this unit based on its tonnage and type
    • 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 Jumpship
      Returns:
      The recovery time in minutes. The default implementation returns 60 minutes.
    • canPerformSpaceSalvageOperations

      public boolean canPerformSpaceSalvageOperations()
      Description copied from class: Entity
      Determines whether salvage operations can be performed in space scenarios.

      The default implementation returns false, indicating that salvage operations are not permitted. Subclasses should override this method to provide specific logic for determining salvage eligibility based on scenario conditions, campaign settings, or other relevant factors.

      Overrides:
      canPerformSpaceSalvageOperations in class Entity
      Returns:
      true if salvage operations can be performed, false otherwise. The default implementation always returns false.