Class Mounted<T extends EquipmentType>

java.lang.Object
megamek.common.equipment.Mounted<T>
All Implemented Interfaces:
Serializable, PhaseUpdated, RoundUpdated
Direct Known Subclasses:
AmmoMounted, MiscMounted, WeaponMounted

public class Mounted<T extends EquipmentType> extends Object implements Serializable, RoundUpdated, PhaseUpdated
This describes equipment mounted on a Mek.
Since:
April 1, 2002, 1:29 PM
See Also:
  • Field Details

    • MINE_NONE

      public static final int MINE_NONE
      See Also:
    • MINE_CONVENTIONAL

      public static final int MINE_CONVENTIONAL
      See Also:
    • MINE_VIBRABOMB

      public static final int MINE_VIBRABOMB
      See Also:
    • MINE_ACTIVE

      public static final int MINE_ACTIVE
      See Also:
    • MINE_INFERNO

      public static final int MINE_INFERNO
      See Also:
    • MINE_EMP

      public static final int MINE_EMP
      See Also:
    • MINE_COMMAND_DETONATED

      public static final int MINE_COMMAND_DETONATED
      See Also:
    • MODE_ON

      public static final String MODE_ON
      Internal (non-localized) name of the generic "switched on" equipment mode used by equipment that can be activated and deactivated (activation/deactivation rules): active probes, C3 computers, heat sinks, improved heavy lasers and similar. Mode comparisons (EquipmentMode.equals(String)) always test this internal name; the localized text shown in the GUI comes from EquipmentMode.getDisplayableName().
      See Also:
    • MODE_OFF

      public static final String MODE_OFF
      Internal (non-localized) name of the "switched off" equipment mode. Equipment in this mode provides none of its game effects until reactivated.
      See Also:
    • MODE_NONE

      public static final String MODE_NONE
      Internal name of the sentinel mode reported when equipment has no current or pending mode set.
      See Also:
    • baseDamageAbsorptionRate

      protected int baseDamageAbsorptionRate
    • baseDamageCapacity

      protected int baseDamageCapacity
    • damageTaken

      protected int damageTaken
    • switchedReason

      protected int switchedReason
    • EQUIP_OFF_DIAGNOSTIC_LOGGER

      public static final String EQUIP_OFF_DIAGNOSTIC_LOGGER
      Dedicated logger name for equipment activation/deactivation diagnostics ([EquipOff] tag): mode-change reception and application, and rejected deactivations. A feature logger rather than a host-class logger so it can be enabled in log4j2.xml without the host classes' debug noise.
      See Also:
  • Constructor Details

    • Mounted

      protected Mounted(Entity entity, T type)
      Creates new Mounted
  • Method Details

    • createMounted

      public static Mounted<?> createMounted(Entity entity, EquipmentType type)
    • restore

      public void restore()
      Restores the equipment from the name
    • getType

      @Nullable public T getType()
      Returns:
      the equipment type of this mount, or null if it cannot be resolved - the mount was restored (from a save or over the network) with an equipment name unknown to this version of MegaMek
    • setType

      protected void setType(T type)
    • getModesCount

      public int getModesCount()
    • getMode

      protected EquipmentMode getMode(int mode)
    • hasModes

      public boolean hasModes()
    • hasModeType

      public boolean hasModeType(String mode)
    • adaptToGameOptions

      public void adaptToGameOptions(IGameOptions options)
    • curMode

      public EquipmentMode curMode()
      Returns:
      the current mode of the equipment, or null if it's not available.
    • isModeTurnedOff

      public boolean isModeTurnedOff()
      Returns whether the player has deactivated this equipment. Equipment that can be switched off (active probes, ECM suites, C3 computers, heat sinks, and similar items with an MODE_OFF mode per the activation/deactivation rules) provides none of its game effects while deactivated, but is otherwise undamaged and can be reactivated.
      Returns:
      true if this equipment has modes and its current mode is MODE_OFF
    • modeNextRound

      public EquipmentMode modeNextRound()
      Returns:
      the mode this equipment will be in next round: the pending mode if a switch is queued, otherwise the current mode
    • isModeTurnedOffNextRound

      public boolean isModeTurnedOffNextRound()
      Returns whether this equipment will be deactivated next round - either a pending switch to MODE_OFF, or already MODE_OFF with no pending switch away from it. Used to validate declarations that depend on other equipment operating next round (e.g. engaging stealth armor requires an ECM suite that will be running).
      Returns:
      true if this equipment has modes and its next-round mode is MODE_OFF
    • pendingMode

      public EquipmentMode pendingMode()
      Returns:
      the pending mode of the equipment.
    • switchMode

      public int switchMode(boolean forward)
      Switches the equipment mode to the next or previous available.
      Parameters:
      forward - Flag that determines whether the mode should be advanced forward or backwards.
      Returns:
      new mode number, or -1 if it's not available.
    • switchChargeLevel

      public int switchChargeLevel()
    • setMode

      public int setMode(String newMode)
      Sets the equipment mode to the mode denoted by the given mode name
      Parameters:
      newMode - the name of the desired new mode
      Returns:
      new mode number on success, -1 otherwise.
    • setModeImmediately

      public int setModeImmediately(String newMode)
      Sets the equipment mode at once, without the queued switch that setMode(String) uses for equipment whose mode changes only take effect at the start of the next round.

      This is for setting up equipment rather than for changing it in play: loading a unit, or deriving the mode of a built-in system from the game options. In those cases there is no turn boundary for a pending switch to cross, so queueing one would leave the equipment reporting the wrong mode until a round happened to tick over. A mode the player chooses during a game must still go through setMode(String) so the delay the rules call for is applied.

      Parameters:
      newMode - the name of the desired new mode
      Returns:
      the new mode number on success, -1 if this equipment has no mode of that name
    • setMode

      public boolean setMode(int newMode)
      Sets the equipment mode to the mode denoted by the given mode number TODO: Refactor so the equipment knows the phase they can be armed/disarmed
      Parameters:
      newMode - the number of the desired new mode
    • canInstantSwitch

      public boolean canInstantSwitch(int newMode)
      Can the switch from the current mode to the new mode happen instantly?
      Parameters:
      newMode - - integer that represents the new mode
      Returns:
      true if the new mode can be switched instantly
    • newRound

      public void newRound(int roundNumber)
      Specified by:
      newRound in interface RoundUpdated
    • newPhase

      public void newPhase(GamePhase phase)
      Specified by:
      newPhase in interface PhaseUpdated
    • getName

      public String getName()
      Shortcut to type.getName()
    • getShortName

      public String getShortName()
    • getBaseDesc

      protected String getBaseDesc()
    • getDesc

      public String getDesc()
    • getTonnage

      public double getTonnage()
      Returns:
      The weight of the equipment in this mount, using the default rounding method for the Entity.
    • getTonnage

      public double getTonnage(RoundWeight defaultRounding)
      Parameters:
      defaultRounding - The method to use in rounding the weight
      Returns:
      The weight of the equipment in this mount
    • getNumCriticalSlots

      public int getNumCriticalSlots()
    • getCost

      public double getCost()
      Returns:
      The cost of the mounted equipment
    • isReady

      public boolean isReady()
    • isReady

      public boolean isReady(boolean isStrafing, boolean evenIfAlreadyFired)
    • isUsedThisRound

      public boolean isUsedThisRound()
    • setUsedThisRound

      public void setUsedThisRound(boolean usedThisRound)
    • isAMSused

      public boolean isAMSused()
    • setAMSused

      public void setAMSused(boolean usedAMS)
    • usedInPhase

      public GamePhase usedInPhase()
    • isBreached

      public boolean isBreached()
    • setBreached

      public void setBreached(boolean breached)
    • isDestroyed

      public boolean isDestroyed()
    • setDestroyed

      public void setDestroyed(boolean destroyed)
      Set this Mounted's destroyed status NOTE: only set this if this Mounted cannot be used in the current phase anymore. If it still can, use setHit instead
      Parameters:
      destroyed - set this object as destroyed
      See Also:
    • isOperable

      public boolean isOperable()
      Returns true when this Mounted is not destroyed nor located in a blown-off or breached location. Does not check any other conditions such as DWP mounting or prior use. Also does not check if this mounted has been hit in this phase. This is equivalent to !isInoperable().
      Returns:
      True when this Mounted is operable
    • isInoperable

      public boolean isInoperable()
      Returns true when this Mounted destroyed or located in a blown-off or breached location. Does not check any other conditions such as DWP mounting or prior use. Also does not check if this mounted has been hit in this phase. Equivalent to !isOperable().
      Returns:
      True when this Mounted is operable
    • is

      public boolean is(String typeInternalName)
      Returns true if this Mounted's EquipmentType is that identified by the given typeInternalName String. The given typeInternalName is compared to the internal name of the EquipmentType of this Mounted, not the (display) name! Best use the constants defined in EquipmentTypeLookup.
      Parameters:
      typeInternalName - An Equipment internal name to check
      Returns:
      true if the internalName of this equipment matches the given type
    • isHit

      public boolean isHit()
    • setHit

      public void setHit(boolean hit)
      set that this mounted was or was not hit with a crit this phase Note: stuff that was hit in a phase can still be used in that phase, if that's not desired, use setDestroyed instead
      Parameters:
      hit - sets the object as hit
      See Also:
    • isMissing

      public boolean isMissing()
    • setMissing

      public void setMissing(boolean missing)
    • isJammed

      public boolean isJammed()
    • setJammed

      public void setJammed(boolean j)
    • jammedThisPhase

      public boolean jammedThisPhase()
    • resetJam

      public void resetJam()
      Clear all jam statuses - used by MHQ, because phase resetting doesn't work
    • getBaseShotsLeft

      public int getBaseShotsLeft()
      The number of shots of ammunition currently stored in this Mounted regardless of its operational status. Or in other words, the straight value last set by setShotsLeft(int), even if this ammo slot is no longer functional or indeed notionally no longer part of the unit formerly carrying it. This is the 'general' base value that should be used for display, reporting, entity encoding and salvage purposes.
      Returns:
      The base 'true' number of shots in this slot.
      See Also:
    • getHittableShotsLeft

      public int getHittableShotsLeft()
      Convenience method returning the number of shots of ammunition in this Mounted that may be affected by a critical hit. This method returns 0 if this Mounted is marked as destroyed or missing and the same value as getBaseShotsLeft() otherwise.
      Returns:
      The number of 'hittable' shots in this slot.
      See Also:
    • getUsableShotsLeft

      public int getUsableShotsLeft()
      Convenience method returning the number of shots of ammunition in this Mounted that can actually be used as ammunition. This method returns 0 if this Mounted is marked as destroyed, missing, or breached and thus nonfunctional and the same value as getBaseShotsLeft() otherwise.
      Returns:
      The number of usable shots in this slot.
      See Also:
    • hasUsableShotsLeft

      public boolean hasUsableShotsLeft()
      Returns:
      True when this ammunition Mounted has shots left and is operable.
      See Also:
    • setShotsLeft

      public void setShotsLeft(int shotsLeft)
    • getNumShots

      public static int getNumShots(WeaponType weaponType, EquipmentMode mode, boolean ignoreMode)
      Returns how many shots a weapon type would use. This can be used without an instantiation of Mounted, which is useful for computing Aero heat. If ignoreMode is true, then mode can be null.
    • isPendingDump

      public boolean isPendingDump()
    • setPendingDump

      public void setPendingDump(boolean b)
    • isDumping

      public boolean isDumping()
    • setDumping

      public void setDumping(boolean b)
    • getSize

      public double getSize()
      Used for equipment that can vary in size. This is not used for equipment for which size is computed by outside factors such as unit weight or targeting computer-linked weapons, but for equipment that comes in various weights, lengths, or capacities. The meaning of the size varies according to the equipment. For robotic control systems, this is the number of drones that can be controlled. For ladders this is the length in meters. For most other variable equipment this is the weight in tons. Non-variable equipment should return 1.0.
      Returns:
      The size of the mounted equipment
    • setSize

      public void setSize(double size)
      Sets the size of variable-sized equipment.
      Parameters:
      size - of the equipment
      See Also:
    • isRapidFire

      public boolean isRapidFire()
    • setRapidFire

      public void setRapidFire(boolean rapidFire)
    • isHotLoaded

      public boolean isHotLoaded()
      Checks to see if the current ammo for this weapon is hotLoaded
      Returns:
      true if ammo is hotLoaded or false if not
    • setHotLoad

      public void setHotLoad(boolean hotLoad)
      Sets the hot loading parameter for this weapons ammo.
      Parameters:
      hotLoad - set the ammo loaded as hotLoaded or not
    • hasChargedCapacitor

      public int hasChargedCapacitor()
      Returns 1 or 2 if this Mounted has a linked and charged (= set to charge in an earlier turn) PPC Capacitor.
    • hasChargedOrChargingCapacitor

      public int hasChargedOrChargingCapacitor()
      Returns 1 or 2 if this Mounted has a linked and charged (= set to charge in an earlier turn) or charging (= set to charge this turn) PPC Capacitor. Used to determine heat.
    • getLocation

      public int getLocation()
      Returns the location this equipment is mounted in, such as Tank.LOC_FRONT. May also return Entity.LOC_NONE for unallocated equipment and some special equipment. For BattleArmor, will return one of the trooper locations, such as BattleArmor.LOC_TROOPER_1. To get the equipment location on BA, use getBaMountLoc().
      Returns:
      The location of this equipment on its unit
    • getSecondLocation

      public int getSecondLocation()
    • isRearMounted

      public boolean isRearMounted()
    • setLocation

      public void setLocation(int location)
    • setSecondLocation

      public void setSecondLocation(int location)
    • setLocation

      public void setLocation(int location, boolean rearMounted)
    • setSecondLocation

      public void setSecondLocation(int location, boolean rearMounted)
    • allLocations

      public List<Integer> allLocations()
      Fetches all locations that contain this equipment. This is primarily for spreadable equipment, can be placed in locations other than the primary or secondary, but will also work for non-spreadable equipment.
      Returns:
      A list of indices for all locations that contain this equipment.
      See Also:
    • getLinked

      @Nullable public Mounted<?> getLinked()
    • getLinkedBy

      @Nullable public Mounted<?> getLinkedBy()
    • getCrossLinkedBy

      @Nullable public Mounted<?> getCrossLinkedBy()
    • setLinked

      public void setLinked(@Nullable Mounted<?> linked)
      Link this Mounted equipment to the given other equipment (or remove the link, if that other is null). When the other is not null, that equipment's linkedBy is set to the present Mounted. Typically, weapons link to their ammo; mounts (turrets, DWP etc) link to attached weapons. The other direction uses linkedBy.
      Parameters:
      linked - The equipment to link to
      See Also:
      • setLinkedBy(Mounted)
    • setCrossLinked

      public void setCrossLinked(Mounted<?> linked)
    • getFoundCrits

      public int getFoundCrits()
    • setFoundCrits

      public void setFoundCrits(int n)
    • isSplit

      public boolean isSplit()
    • isSplitable

      public boolean isSplitable()
    • setSplit

      public void setSplit(boolean b)
    • getExplosionDamage

      public int getExplosionDamage()
    • isFired

      public boolean isFired()
    • setFired

      public void setFired(boolean val)
    • isTSEMPDowntime

      public boolean isTSEMPDowntime()
    • setTSEMPDowntime

      public void setTSEMPDowntime(boolean val)
    • canFire

      public boolean canFire()
      Confirm that the given entity can fire the indicated equipment.
      Returns:
      true if the equipment can be fired by the entity; false otherwise.
    • canFire

      public boolean canFire(boolean isStrafing, boolean evenIfAlreadyFired)
    • isCrippled

      public boolean isCrippled()
      Determines whether this weapon should be considered crippled for damage level purposes.
      Returns:
      true if the weapon is at least one of: destroyed, missing, breached, jammed, a detachable weapon no longer attached to its original battle armor, or simply out of ammo (includes discharged one-shot weapons), false otherwise. A weapon bay is crippled only when every weapon it contains is crippled.
    • getEquipmentNum

      public int getEquipmentNum()
      Returns:
      The index of this mount in the entity's equipment list.
    • isAmmoUsable

      public boolean isAmmoUsable()
      Returns false if this ammo should not be loaded. Checks if the ammo is already destroyed or missing, is being dumped, has been breached, is already used up, or is location less (one shot ammo).
    • setByShot

      public void setByShot(boolean b)
    • isBombMounted

      public boolean isBombMounted()
    • setBombMounted

      public void setBombMounted(boolean b)
    • isGroundBomb

      public boolean isGroundBomb()
      Returns:
      True if this Mounted is a bomb capable of striking ground targets.
    • setInternalBomb

      public void setInternalBomb(boolean internal)
    • isInternalBomb

      public boolean isInternalBomb()
      Convenience method to determine if a bomb munition is mounted Externally (reduces MP) or Internally (no MP reduction).
      Returns:
      True if
    • getCurrentHeat

      public int getCurrentHeat()
      returns the heat for this weapon taking account of rapid-fire weapon status
    • isBodyMounted

      public boolean isBodyMounted()
    • isDWPMounted

      public boolean isDWPMounted()
      Returns:
      True if this equipment is mounted on a BA Detachable Weapon Pack, TO:AUE p.99. Note that when it is, the BA mount location (arm, body etc) is set to LOC_NONE. The location must be found via the DWP. The DWP can be obtained using getLinkedBy.
    • setDWPMounted

      public void setDWPMounted(boolean dwpMounted)
      Sets this mounted to be attached to a BA Detachable Weapon Pack, TO:AUE p.99. Note that when it is, the BA mount location (arm, body etc) must not be set or this equipment will also register as being normally allocated in that location (visible in MML). The location must be found via the DWP. The DWP should be set as linkedBy for this Mounted, and the DWP itself should have this mounted set as linked.
      Parameters:
      dwpMounted - True if this equipment is mounted in a DWP
    • isAPMMounted

      public boolean isAPMMounted()
    • setAPMMounted

      public void setAPMMounted(boolean apmMounted)
    • isOmniPodMounted

      public boolean isOmniPodMounted()
    • setOmniPodMounted

      public void setOmniPodMounted(boolean omniPodMounted)
    • isWeaponGroup

      public boolean isWeaponGroup()
    • setWeaponGroup

      public void setWeaponGroup(boolean b)
    • getNWeapons

      public int getNWeapons()
    • setNWeapons

      public void setNWeapons(int i)
    • setArmored

      public void setArmored(boolean armored)
      Sets the Mounted to be an armored component, TO:AUE p.95. This method checks if the EquipmentType allows armoring at all and sets the armored status to false if it doesn't.
      Parameters:
      armored - The armored status to be set
    • isArmored

      public boolean isArmored()
      Returns:
      True if this Mounted is an armored component, TO:AUE p.95
    • setQuirks

      public void setQuirks(WeaponQuirks quirks)
    • getQuirks

      public WeaponQuirks getQuirks()
      Retrieves the quirks object for mounted. DO NOT USE this to check boolean options, as it will not check game options for quirks. Use Mounted#hasQuirk instead
      Returns:
      the list of quirks
    • hasQuirk

      public boolean hasQuirk(String name)
    • countQuirks

      public int countQuirks()
      Count all the weapon quirks for this Mounted. Returns 0 when this Mounted is tied to an Entity and this Entity's game does not use quirks! In all other cases (e.g. outside of games), returns the quirk count of this Mounted.
      Returns:
      The number of active weapon quirks for this Mounted unless the game does not use quirks
    • getQuirkList

      public String getQuirkList(String sep)
      Returns a string of all the quirk "codes" for this entity, using sep as the separator
    • getCalledShot

      public CalledShot getCalledShot()
    • setRepairable

      public void setRepairable(boolean repair)
    • isRepairable

      public boolean isRepairable()
    • setAutocannonHit

      public void setAutocannonHit(boolean acHit)
    • isAutocannonHit

      public boolean isAutocannonHit()
    • getEntity

      public Entity getEntity()
    • isMekTurretMounted

      public boolean isMekTurretMounted()
    • setMekTurretMounted

      public void setMekTurretMounted(boolean turret)
    • setSponsonTurretMounted

      public void setSponsonTurretMounted(boolean turret)
    • isSponsonTurretMounted

      public boolean isSponsonTurretMounted()
    • setPintleTurretMounted

      public void setPintleTurretMounted(boolean turret)
    • isPintleTurretMounted

      public boolean isPintleTurretMounted()
    • setFacing

      public void setFacing(int facing)
    • getFacing

      public int getFacing()
    • hasDirectionalTorsoMount

      public boolean hasDirectionalTorsoMount()
      Returns:
      true if this weapon is in a Directional Torso Mount of either type (the 2-point front/rear version or the 3-point quad 360-degree version), per BMM p.83. This is true when the weapon carries a Directional Torso Mount weapon quirk directly, or when its unit carries the chassis-wide directional_torso_mount quirk and this weapon is in its scope (see isInUnitTorsoMountSet(String)). A weapon that is physically split across two locations can never ride the single-location mount, regardless of quirk source. Respects the quirks game option (see hasQuirk(String)).
    • hasDirectional360TorsoMount

      public boolean hasDirectional360TorsoMount()
      Returns:
      true if this weapon is in the 3-point Directional Torso Mount, which operates as a full 360-degree turret. This version is available only to quad Meks (BMM p.83) - enforced here as well as during construction so the 360-degree arc can never be granted to a biped. It is in effect when the weapon carries the 360 weapon quirk, or its unit's 360 chassis quirk lists this weapon's location.
    • directionalMountDebug

      public String directionalMountDebug()
      Builds a detailed one-line diagnostic of this weapon's Directional Torso Mount state (BMM p.83) for troubleshooting from the log. Reports every quirk source and the computed flags, so a playtest log can show why a weapon is (or is not) a flippable directional mount. Intended for log statements only, not the hot path.
      Returns:
      a human-readable description of the mount's quirk sources, flags and computed arc state
    • getDirectionalMountFacing

      public int getDirectionalMountFacing()
      Returns:
      the Directional Torso Mount's current facing, as an offset (0-5) from the unit's (secondary) facing: 0 = forward, 3 = rear (BMM p.83). The 2-point version uses only 0 or 3; the 3-point quad turret may use any of the six. Persists across rounds (unlike a torso twist).
    • setDirectionalMountFacing

      public void setDirectionalMountFacing(int facing)
      Sets the Directional Torso Mount's facing offset (0-5 from the unit's facing). Has no effect once the mount is locked (see isDirectionalMountLocked()) or once its facing was already changed in an earlier attack phase this turn (see isDirectionalMountAlreadyFlipped() - the once-per-turn rule, modeled on torso twists). The caller is responsible for restricting the value to the legal facings for the mount type (front/rear for 2-point, any for the 3-point quad turret).
      Parameters:
      facing - the facing offset; normalized into the range 0-5
    • isDirectionalMountAlreadyFlipped

      public boolean isDirectionalMountAlreadyFlipped()
      Returns:
      true if this Directional Torso Mount's facing was already changed in an earlier phase of the current turn. A mount's facing may be changed only once per turn - at the same time torso twists are made (BMM p.83) - so a mount flipped in the targeting/TAG phase cannot flip again in the weapon attack phase. Within the phase it was changed in, the facing remains freely adjustable (like a torso twist). Cleared at the start of each round.
    • isDirectionalMountRear

      public boolean isDirectionalMountRear()
      Returns:
      true if this weapon's Directional Torso Mount currently points to the rear arc (facing offset 3). Convenience for the 2-point front/rear case.
    • setDirectionalMountRear

      public void setDirectionalMountRear(boolean rear)
      Convenience setter for a 2-point Directional Torso Mount: points it to the rear (offset 3) or front (offset 0).
      Parameters:
      rear - true to point the mount to the rear arc, false for the front arc
    • isDirectionalMountLocked

      public boolean isDirectionalMountLocked()
      Returns:
      true if the Directional Torso Mount's rotation mechanism has been destroyed (2D6 9+ on a hit to its location, BMM p.83). The weapon still fires, but its arc can no longer be changed.
    • setDirectionalMountLocked

      public void setDirectionalMountLocked(boolean locked)
      Marks the Directional Torso Mount's rotation mechanism as destroyed, locking the weapon in its current arc. The weapon remains able to fire.
      Parameters:
      locked - true to lock the mount in its current arc
    • getOriginalShots

      public int getOriginalShots()
    • setOriginalShots

      public void setOriginalShots(int shots)
    • isModeSwitchable

      public boolean isModeSwitchable()
    • setModeSwitchable

      public void setModeSwitchable(boolean b)
    • isInBearingsOnlyMode

      public boolean isInBearingsOnlyMode()
      Returns:
      True if our capital missile bay is in bearings-only mode Only available in space games
    • isInWaypointLaunchMode

      public boolean isInWaypointLaunchMode()
      Returns:
      True if our capital missile bay is in waypoint launch mode Only available in space games
    • setModesForMapType

      public void setModesForMapType()
      Method that adds/removes available capital missile modes as we move between space and atmospheric maps Called by Entity.setGameOptions(), which is in turn called during a mode change by server.
    • getBaMountLoc

      public int getBaMountLoc()
      Returns:
      For BattleArmor, returns the location where a piece of equipment is mounted, e.g. BattleArmor.MOUNT_LOC_LEFT_ARM.
    • setBaMountLoc

      public void setBaMountLoc(int baMountLoc)
    • isOneShot

      public boolean isOneShot()
      Checks whether this mount is either one a one-shot weapon or ammo for a one-shot weapon.
      Returns:
      Whether the equipment is one-shot
    • isOneShotAmmo

      public boolean isOneShotAmmo()
    • isSquadSupportWeapon

      public boolean isSquadSupportWeapon()
    • setSquadSupportWeapon

      public void setSquadSupportWeapon(boolean squadSupportWeapon)
    • getArmorValue

      public int getArmorValue()
    • setArmorValue

      public void setArmorValue(int armorValue)
    • setMissingForTrooper

      public void setMissingForTrooper(int trooper, boolean b)
    • isMissingForTrooper

      public boolean isMissingForTrooper(int trooper)
    • isAnyMissingTroopers

      public boolean isAnyMissingTroopers()
    • getMissingTrooperString

      public String getMissingTrooperString()
    • isHomingAmmoInHomingMode

      public boolean isHomingAmmoInHomingMode()
      Returns true if this Mounted is ammunition in homing mode.
    • equipmentIndex

      public int equipmentIndex()
    • getSwitchedReason

      public int getSwitchedReason()
    • setSwitchedReason

      public void setSwitchedReason(int reason)
    • bayComponentsToString

      protected List<String> bayComponentsToString()
    • isTurret

      public boolean isTurret()
      Returns:
      True when this Mounted is a head, quad, shoulder, pintle or sponson turret.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • relevantToTargetingComputer

      public boolean relevantToTargetingComputer()
      Returns:
      True if this equipment counts for the size and weight of a Targeting Computer, and benefits from it in case of weapons.
      See Also:
    • getChargeState

      public ChargeLevel getChargeState()
      Gets the charge state of the weapon. This only currently applies to Bombast Lasers
      Returns:
    • setChargeState

      public void setChargeState(ChargeLevel setLevel)
      Set the charge state of the weapon. This only currently applies to the Bombast Laser
      Parameters:
      setLevel -