Package megamek.common.equipment
Class WeaponMounted
- All Implemented Interfaces:
Serializable,PhaseUpdated,RoundUpdated
- Direct Known Subclasses:
InfantryWeaponMounted
- See Also:
-
Field Summary
Fields inherited from class megamek.common.equipment.Mounted
baseDamageAbsorptionRate, baseDamageCapacity, damageTaken, EQUIP_OFF_DIAGNOSTIC_LOGGER, MINE_ACTIVE, MINE_COMMAND_DETONATED, MINE_CONVENTIONAL, MINE_EMP, MINE_INFERNO, MINE_NONE, MINE_VIBRABOMB, MODE_NONE, MODE_OFF, MODE_ON, switchedReason -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAmmoToBay(int equipmentNum) Adds the ammo with the given equipment number to the bay.voidaddAmmoToBay(AmmoMounted ammo) voidaddWeaponToBay(int equipmentNum) Adds the weapon with the given equipment number to the bay.voidaddWeaponToBay(WeaponMounted weapon) booleanammoInBay(int mAmmoId) assignAPDS(List<WeaponHandler> vAttacks) Assign APDS systems to the most dangerous incoming missile attacks.booleanbayContains(int equipmentNum) Checks whether the bay contains the given weapon or ammo.booleanbayContains(Mounted<?> mounted) Deprecated, for removal: This API element is subject to removal in a future version.voidClears all ammo from the bay.voidRemoves all weapons from the bay.getBayWeapon(int index) Fetches the bay weapon at a given index in the bay weapons list.intreturns the heat for this weapon taking account of rapid-fire weapon statusintReturns how many shots the weapon is usingintintbooleanisAPDS()booleanbooleanbooleanChecks whether this mount is either one a one-shot weapon or ammo for a one-shot weapon.voidremoveAmmoFromBay(int equipmentNum) Deprecated, for removal: This API element is subject to removal in a future version.voidremoveFromBay(int equipmentNum) Removes the weapon or ammo with the given equipment number from the bay.voidremoveFromBay(Mounted<?> mounted) Removes the weapon or ammo from the bay.voidremoveWeaponFromBay(int equipmentNum) Removes the weapon with the given equipment number from the bay.voidremoveWeaponFromBay(WeaponMounted weapon) Deprecated, for removal: This API element is subject to removal in a future version.voidsetDisposableWeapon(boolean disposableWeapon) Marks this mount as a one-shot Disposable Weapon (TO:AuE p.116, Corrected Sixth Printing).Methods inherited from class megamek.common.equipment.Mounted
adaptToGameOptions, allLocations, canFire, canFire, canInstantSwitch, countQuirks, createMounted, curMode, directionalMountDebug, equipmentIndex, getArmorValue, getBaMountLoc, getBaseDesc, getBaseShotsLeft, getCalledShot, getChargeState, getCost, getCrossLinkedBy, getDesc, getDirectionalMountFacing, getEntity, getEquipmentNum, getFacing, getFoundCrits, getHittableShotsLeft, getLinked, getLinkedBy, getLocation, getMissingTrooperString, getMode, getModesCount, getName, getNumCriticalSlots, getNumShots, getNWeapons, getOriginalShots, getQuirkList, getQuirks, getSecondLocation, getShortName, getSize, getSwitchedReason, getTonnage, getTonnage, getType, getUsableShotsLeft, hasChargedCapacitor, hasChargedOrChargingCapacitor, hasDirectional360TorsoMount, hasDirectionalTorsoMount, hasModes, hasModeType, hasQuirk, hasUsableShotsLeft, is, isAmmoUsable, isAMSused, isAnyMissingTroopers, isAPMMounted, isArmored, isAutocannonHit, isBodyMounted, isBombMounted, isBreached, isCrippled, isDestroyed, isDirectionalMountAlreadyFlipped, isDirectionalMountLocked, isDirectionalMountRear, isDumping, isDWPMounted, isFired, isHit, isHomingAmmoInHomingMode, isHotLoaded, isInBearingsOnlyMode, isInoperable, isInternalBomb, isInWaypointLaunchMode, isJammed, isMekTurretMounted, isMissing, isMissingForTrooper, isModeSwitchable, isModeTurnedOff, isModeTurnedOffNextRound, isOmniPodMounted, isOneShotAmmo, isOperable, isPendingDump, isPintleTurretMounted, isRapidFire, isReady, isReady, isRearMounted, isRepairable, isSplit, isSplitable, isSponsonTurretMounted, isSquadSupportWeapon, isTSEMPDowntime, isTurret, isUsedThisRound, isWeaponGroup, jammedThisPhase, modeNextRound, newPhase, newRound, pendingMode, relevantToTargetingComputer, resetJam, restore, setAMSused, setAPMMounted, setArmored, setArmorValue, setAutocannonHit, setBaMountLoc, setBombMounted, setBreached, setByShot, setChargeState, setCrossLinked, setDestroyed, setDirectionalMountFacing, setDirectionalMountLocked, setDirectionalMountRear, setDumping, setDWPMounted, setFacing, setFired, setFoundCrits, setHit, setHotLoad, setInternalBomb, setJammed, setLinked, setLocation, setLocation, setMekTurretMounted, setMissing, setMissingForTrooper, setMode, setMode, setModeImmediately, setModesForMapType, setModeSwitchable, setNWeapons, setOmniPodMounted, setOriginalShots, setPendingDump, setPintleTurretMounted, setQuirks, setRapidFire, setRepairable, setSecondLocation, setSecondLocation, setShotsLeft, setSize, setSplit, setSponsonTurretMounted, setSquadSupportWeapon, setSwitchedReason, setTSEMPDowntime, setType, setUsedThisRound, setWeaponGroup, switchChargeLevel, switchMode, toString, usedInPhase
-
Constructor Details
-
WeaponMounted
-
-
Method Details
-
isDisposableWeapon
public boolean isDisposableWeapon()- Returns:
trueif this mount is a unit's one-shot Disposable Weapon (TO:AuE p.116, Corrected Sixth Printing)
-
setDisposableWeapon
public void setDisposableWeapon(boolean disposableWeapon) Marks this mount as a one-shot Disposable Weapon (TO:AuE p.116, Corrected Sixth Printing).- Parameters:
disposableWeapon- whether this mount is a Disposable Weapon
-
getExplosionDamage
public int getExplosionDamage()- Overrides:
getExplosionDamagein classMounted<WeaponType>
-
getCurrentHeat
public int getCurrentHeat()Description copied from class:Mountedreturns the heat for this weapon taking account of rapid-fire weapon status- Overrides:
getCurrentHeatin classMounted<WeaponType>
-
getLinkedAmmo
- Returns:
- The ammo currently linked by this weapon, or null if there is no linked ammo.
-
getCurrentShots
public int getCurrentShots()Returns how many shots the weapon is using -
isOneShot
public boolean isOneShot()Description copied from class:MountedChecks whether this mount is either one a one-shot weapon or ammo for a one-shot weapon.- Overrides:
isOneShotin classMounted<WeaponType>- Returns:
- Whether the equipment is one-shot
-
addWeaponToBay
public void addWeaponToBay(int equipmentNum) Adds the weapon with the given equipment number to the bay.- Parameters:
equipmentNum- The equipment number of the weapon to add- See Also:
-
addWeaponToBay
-
removeWeaponFromBay
public void removeWeaponFromBay(int equipmentNum) Removes the weapon with the given equipment number from the bay.- Parameters:
equipmentNum- The equipment number of the weapon to remove.- See Also:
-
removeWeaponFromBay
Deprecated, for removal: This API element is subject to removal in a future version.Removes a weapon from the bay.- Parameters:
weapon- The weapon to remove.
-
clearBayWeapons
public void clearBayWeapons()Removes all weapons from the bay. -
getBayWeapons
- Returns:
- All the weapon mounts in the bay.
-
getBayWeapon
Fetches the bay weapon at a given index in the bay weapons list.- Parameters:
index- The index- Returns:
- The weapon mount at that
-
addAmmoToBay
public void addAmmoToBay(int equipmentNum) Adds the ammo with the given equipment number to the bay.- Parameters:
equipmentNum- The equipment number of the ammo- See Also:
-
addAmmoToBay
-
removeAmmoFromBay
Deprecated, for removal: This API element is subject to removal in a future version.Removes the ammo with the given equipment number from the bay.- Parameters:
equipmentNum- The equipment number of the ammo.- See Also:
-
clearBayAmmo
public void clearBayAmmo()Clears all ammo from the bay. -
getBayAmmo
-
ammoInBay
public boolean ammoInBay(int mAmmoId) - Parameters:
mAmmoId- equipment number of ammo- Returns:
- whether the ammo is in this weapon's bay
-
removeFromBay
public void removeFromBay(int equipmentNum) Removes the weapon or ammo with the given equipment number from the bay.- Parameters:
equipmentNum- The weapon or ammo equipment number- See Also:
-
removeFromBay
Removes the weapon or ammo from the bay.- Parameters:
mounted- The weapon or ammo to remove.
-
bayContains
public boolean bayContains(int equipmentNum) Checks whether the bay contains the given weapon or ammo.- Parameters:
equipmentNum- The equipment number of the weapon or ammo.- Returns:
- Whether the bay contains the equipment.
- See Also:
-
bayContains
Deprecated, for removal: This API element is subject to removal in a future version.Checks whether the bay contains the given weapon or ammo.- Parameters:
mounted- The weapon or ammo.- Returns:
- Whether the bay contains the equipment.
-
bayComponentsToString
- Overrides:
bayComponentsToStringin classMounted<WeaponType>
-
assignAPDS
Assign APDS systems to the most dangerous incoming missile attacks. This should only be called once per turn, or AMS will get extra attacks -
isAPDS
public boolean isAPDS()- Returns:
- Whether this mount is an advanced point defense system.
-
getHeatByBay
public int getHeatByBay()- Returns:
- The heat generated by the bay, or the heat of the individual weapon if it's not a bay
-
isGroundBomb
public boolean isGroundBomb()- Overrides:
isGroundBombin classMounted<WeaponType>- Returns:
- True if this Mounted is a bomb capable of striking ground targets.
-