Class Tank
- All Implemented Interfaces:
Serializable
,BTObject
,CombatRole
,Deployable
,ForceAssignable
,InGameObject
,ITechnology
,ITurnOrdered
,PhaseUpdated
,RoundUpdated
,Targetable
,Transporter
- Direct Known Subclasses:
GunEmplacement
,SuperHeavyTank
,SupportTank
,VTOL
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class megamek.common.Entity
Entity.InvalidSourceBuildReason
Nested classes/interfaces inherited from interface megamek.common.ITechnology
ITechnology.AvailabilityValue, ITechnology.Era, ITechnology.Faction, ITechnology.FactionAffiliation, ITechnology.TechBase, ITechnology.TechRating
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Keeps track of the base weight of the turret for omni tanks.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected boolean
protected boolean
protected boolean
static final int
static final int
static final int
static final int
static final int
static final int
for dual turret tanks, this is the rear turretstatic final int
for dual turret tanks, this is the front turretprotected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected int
protected int
Fields inherited from class megamek.common.Entity
_isEMId, ALTERNATE_MASC_FAILURE, ALTERNATE_MASC_FAILURE_ENHANCED, altitude, ammoList, armorTechLevel, armorTechRating, armorTonnage, armorType, armsFlipped, asewAffectedTurns, aTracker, BLOOD_STALKER_TARGET_CLEARED, bMASCWentUp, bombList, boobyTrapInitiated, bSuperchargerWentUp, c3CompanyMasterIndex, c3Master, c3NetIdString, camouflage, canUnstickByJumping, carcass, chassis, clanChassisName, consecutiveRHSUses, convertingNow, coolFromExternal, crits, damageThisPhase, damageThisRound, delta_distance, designValid, destroyed, displacementAttack, DMG_CRIPPLED, DMG_HEAVY, DMG_LIGHT, DMG_MODERATE, DMG_NONE, dodging, DOES_NOT_TRACK_HEAT, done, doomed, elevation, engineHitsThisPhase, engineTechRating, equipmentList, ETYPE_AERO, ETYPE_AEROSPACEFIGHTER, ETYPE_ARMLESS_MEK, ETYPE_BATTLEARMOR, ETYPE_BIPED_MEK, ETYPE_CONV_FIGHTER, ETYPE_DROPSHIP, ETYPE_FIGHTER_SQUADRON, ETYPE_FIXED_WING_SUPPORT, ETYPE_GUN_EMPLACEMENT, ETYPE_HANDHELD_WEAPON, ETYPE_INFANTRY, ETYPE_JUMPSHIP, ETYPE_LAND_AIR_MEK, ETYPE_LARGE_SUPPORT_TANK, ETYPE_MEK, ETYPE_MEKWARRIOR, ETYPE_PROTOMEK, ETYPE_QUAD_MEK, ETYPE_QUADVEE, ETYPE_SMALL_CRAFT, ETYPE_SPACE_STATION, ETYPE_SUPER_HEAVY_TANK, ETYPE_SUPPORT_TANK, ETYPE_SUPPORT_VTOL, ETYPE_TANK, ETYPE_TELEMISSILE, ETYPE_TRIPOD_MEK, ETYPE_VTOL, ETYPE_WARSHIP, externalId, facing, failedEquipmentList, fell, findingClub, firingSolutions, fluff, game, gotPavementOrRoadBonus, GRAPPLE_BOTH, GRAPPLE_LEFT, GRAPPLE_RIGHT, hardenedArmorDamaged, hasDamagedRHS, hasExternalSearchlight, heat, heatBuildup, heatFromExternal, heatSinkCoolantFailureFactor, hiddenActivationPhase, hullDown, icon, id, iGame, illuminated, iNarcPods, incomingGuidedAttacks, infernos, initialBV, inReverse, isCarefulStanding, isHidden, isJumpingNow, jumpMP, killerId, lastTarget, lastTargetDisplayName, layingMines, LOC_DESTROYED, LOC_NONE, locationBlownOff, locationBlownOffThisPhase, m_lNarcedBy, m_lPendingNarc, madePointblankShot, manualBV, manualShutdown, MASC_FAILURE, MAX_C3_NODES, MAX_C3i_NODES, military, miscList, mixedTech, model, moved, movedLastRound, movementMode, mpUsed, mpUsedLastRound, mulId, narcPods, nCrew, nMarines, nMASCLevel, nPassenger, nSuperchargerLevel, omni, owner, ownerId, pendingINarcPods, pendingNarcPods, previousMovementMode, prone, reckless, rolledForEngineExplosion, searchlightIsActive, sec_facing, secondaryPositions, selfDestructedThisTurn, selfDestructing, selfDestructInitiated, sensorContacts, shutDown, shutdownByBATaser, shutDownThisPhase, source, spotting, STARTING_ANY_NONE, startupThisPhase, struck, structuralTechRating, structureTechLevel, structureType, stuckInSwamp, TA_ARMORED_COMPONENT, TA_MIXED_TECH, TA_OMNI, TA_PATCHWORK_ARMOR, taggedBy, targetBay, taserFeedBackRounds, taserInterference, taserInterferenceHeat, taserInterferenceRounds, taserShutdownRounds, techLevel, tmTracker, totalWeaponList, traitorId, twistedPhase, underwaterRounds, unjammingRAC, UNLIMITED_JUMP_DOWN, usedMASC, usedSearchlight, usedSupercharger, useManualBV, vectors, walkMP, weaponBayList, weaponGroupList, weaponList, weight, wigeBonus, year
Fields inherited from interface megamek.common.ITechnology
DATE_ES, DATE_NONE, DATE_PS
Fields inherited from interface megamek.common.Targetable
TYPE_BLDG_IGNITE, TYPE_BLDG_TAG, TYPE_BUILDING, TYPE_ENTITY, TYPE_FLARE_DELIVER, TYPE_FUEL_TANK, TYPE_FUEL_TANK_IGNITE, TYPE_HEX_AERO_BOMB, TYPE_HEX_ARTILLERY, TYPE_HEX_BOMB, TYPE_HEX_CLEAR, TYPE_HEX_EXTINGUISH, TYPE_HEX_IGNITE, TYPE_HEX_SCREEN, TYPE_HEX_TAG, TYPE_INARC_POD, TYPE_MINEFIELD_CLEAR, TYPE_MINEFIELD_DELIVER, TYPE_SEARCHLIGHT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd in any piloting skill modsvoid
addEquipment
(Mounted<?> mounted, int loc, boolean rearMounted) void
addJammedWeapon
(Mounted<?> weapon) Adds the provided weapon as a weapon that is jammed via the vehicle "weapon malfunction" critical hitvoid
addMovementDamage
(int level) adds minor, moderate or heavy movement system damageprotected void
Incorporate dates for components that are not in the equipment list, such as engines and structure.void
Applies any damage that the entity has suffered.void
Applies movement damage to the Tank.void
Sets the internal structure for every location to appropriate undamaged values for the unit and location.boolean
Can this entity change secondary facing at all?boolean
boolean
Convenience function that determines if this tank can issue a "clear turret" command.boolean
canDFA()
boolean
Checks to see if a Tank is capable of going hull-down.boolean
canSpot()
Tanks can't spot when stunned.boolean
Convenience function that determines if this tank can issue an "unjam weapon" command.void
clearStabiliserHit
(int loc) int
clipSecondaryFacing
(int n) Returns the closest valid secondary facing to the given direction.boolean
void
void
apply the effects of an "engine hit" critvoid
extinguish all inferno fire on this Tankvoid
extinguishLocation
(int location) int
double
Calculates fuel mass based on engine type and mass.double
Used for omni vehicles, which must set the weight of sponson or pintle mounts in the base chassis, limiting the amount of pod space in the turret(s).double
Used for omni vehicles, which must set the weight of turrets the base chassis, limiting the amount of pod space in the turret.double
Used for omni vehicles, which must set the weight of turrets the base chassis, limiting the amount of pod space in the turret.int
Determines where to place equipment that does not require a specific location.return - the base construction option tech advancementdouble
getCost
(CalculationReport calcReport, boolean ignoreAmmo) Calculates and returns the C-bill cost of the unit.int
getCriticalEffect
(int roll, int loc, boolean damagedByFire) get the type of critical caused by a critical roll, taking account of existing damageint
static TechAdvancement
int
getDugIn()
int
long
int
int
int
get the free item slots for this tankdouble
Returns the mass of the fuel, which is used for calculating operating range.int
Calculates a "generic" Battle Value that is based on the average of all units of this type and tonnage.int
The type of fuel for internal combustion engines.All weapons that a vehicle could use "unjam weapon" forString[]
getLocationDamage
(int loc) String[]
int
int
int
The maximum elevation change the entity can crossint
getMaxElevationDown
(int currElevation) Returns the maximum number of downward elevation changes a unit can make.int
int
Returns the name of the type of movement used.Returns the name of the type of movement used.int[]
boolean
int
double
Returns a multiplier that combines multiplicative construction cost modifiers for this Entity.int
int
getRunMP
(MPCalculationSetting mpCalculationSetting) getRunMPasString
(boolean gameState) Returns this entity's running/flank mp as a string.int
get the gravity limit for ground movementboolean
int
int
Returns this entity's sprinting MP, modified for all its current circumstances such as gravity and damage.int
getSprintMP
(MPCalculationSetting mpCalculationSetting) Returns this entity's sprinting MP, modified according to the given setting.int
Used to determine the draw priority of different Entity subclasses.getStealthModifier
(int range, Entity ae) Determine the stealth modifier for firing at this unit from the given range.int
int
static int
getSuspensionFactor
(EntityMovementMode movementMode, double weight) Static method to calculate suspension factor without needing a vehicleint
int
get the total amount of item slots available for this tankGets the location that excess damage transfers toint
int
int
getWalkMP
(MPCalculationSetting mpCalculationSetting) int
getWeaponArc
(int weaponNumber) Returns the Compute.ARC that the weapon fires into.boolean
Checks if a mek has an armed MASC system.boolean
boolean
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.boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
protected boolean
Check to see if the unit has a trailer hitch transporter already We need this to prevent duplicate transporters being createdvoid
Marks this tank for immobilization, most likely from a related motive system hit.int
Used to for cost calculations.boolean
Returns True if this tank moved backwards before going Hull Downboolean
Returns true when this object is a ground Combat Vehicle, including VTOL but not including Support Vehicles, or of type CV for Alpha Strike.boolean
boolean
boolean
boolean
Returns TRUE if the entity meets the requirements for crippling damage as detailed in TW pg 258.boolean
isCrippled
(boolean checkCrew) Returns TRUE if the entity meets the requirements for crippling damage as detailed in TW pg 258.boolean
Returns TRUE if the entity has been heavily damaged.boolean
Returns TRUE if the entity has been lightly damaged.boolean
Returns TRUE if the entity has been moderately damaged.boolean
boolean
boolean
boolean
isEligibleFor
(GamePhase phase) Determines if an entity is eligible for a phase.boolean
Tanks and certain other units can get a +1 bonus to MP if their move is entirely on pavement.boolean
boolean
isImmobile
(boolean checkCrew) Is this entity shut down, or if applicable is the crew unconscious?boolean
Per https://bg.battletech.com/forums/index.php/topic,78336.msg1869386.html#msg1869386 CVs with working engines and Jump Jets should still have the option to jump during the movement phase, even if reduced to 0 MP by motive hits, or rolling 12 on the Motive System Damage table.boolean
boolean
isLocationBurning
(int location) boolean
isLocationProhibited
(Coords c, int testBoardId, int currElevation) Tanks have all sorts of prohibited terrain.boolean
isLocationProhibitedWiGE
(Coords c, int currElevation) boolean
Determines whether the unit is considered to have suffered a movement hit.boolean
boolean
Checks if the unit is hardened against nuclear strikes.boolean
isOnFire()
boolean
isPermanentlyImmobilized
(boolean checkCrew) Whether this unit is irreversibly immobilized for the rest of the game.boolean
Determine if the unit can be repaired, or only harvested for spares.boolean
isSecondaryArcWeapon
(int weaponId) Returns true if this weapon fires into the secondary facing arc.boolean
isSideLocation
(int location) boolean
isStabiliserHit
(int loc) boolean
Determine if this unit has an active and working stealth system.boolean
Determine if this unit has an active and working stealth system.boolean
Used to determine if this vehicle can be the engine/tractor for a bunch of trailersboolean
Used to determine if this vehicle can be towed by a tractorboolean
isTurretEverJammed
(int turret) boolean
isTurretJammed
(int turret) boolean
isTurretLocked
(int turret) boolean
boolean
isValidSecondaryFacing
(int n) Can this entity torso/turret twist the given direction?void
jamTurret
(int turret) int
Returns the number of locations in the entityvoid
lockTurret
(int turret) void
newRound
(int roundNumber) Start a new roundint
Calculates the operating range of the vehicle based on engine type and fuel mass.void
Resets the list of weapons a vehicle has jammed via "weapon malfunction" crits to emptyvoid
rollHitLocation
(int table, int side) Rolls up a hit locationrollHitLocation
(int table, int side, int aimedLocation, AimingMode aimingMode, int cover) Rolls up a hit locationvoid
setArmorType
(int armType) void
setArmorType
(int armType, boolean addMount) void
void
setBaseChassisSponsonPintleWeight
(double baseChassisSponsonPintleWeight) Sets the fixed weight of any pintle (small SV) or sponson (CV, M/L SV) turrets on an omnivehicle.void
setBaseChassisTurret2Weight
(double baseChassisTurret2Weight) Sets the fixed weight of the second turret on a dual-turret omnivehicle.void
setBaseChassisTurretWeight
(double baseChassisTurretWeight) Sets the fixed weight of the primary turret on a dual-turret omnivehicle.void
setCommanderHit
(boolean hit) void
setCommanderHitPS
(boolean hit) void
setCrewHitPS
(boolean hit) void
setDriverHit
(boolean hit) void
setDriverHitPS
(boolean hit) void
setDualTurretOffset
(int offset) void
setDugIn
(int i) void
setExtraCrewSeats
(int seats) void
setFacing
(int facing) Sets the primary facing.void
setFuelTonnage
(double fuel) Sets the fuel mass for support vehicles.void
setHasNoControlSystems
(boolean hasNoControlSystems) void
setHasNoDualTurret
(boolean b) void
setHasNoTurret
(boolean b) void
setHullDown
(boolean down) Tanks go Hull Down slightly differently, this method accounts for thisvoid
setICEFuelType
(FuelType fuelType) void
setMotiveDamage
(int d) void
setMotivePenalty
(int p) void
setOmni
(boolean omni) OmniVehicles have handles for Battle Armor squads to latch onto.void
setOnFire
(boolean inferno) void
setOverThresh
(boolean tf) void
setPotCrit
(int crit) void
setSecondaryFacing
(int sec_facing) void
setSensorHits
(int hits) void
setStabiliserHit
(int loc) void
setStunnedTurns
(int turns) void
setTrailer
(boolean trailer) Marks whether the tank is constructed as a trailer.void
Add a transporter for each trailer hitch the unit is equipped with, with a maximum of one each in the front and the rear.void
setUsingConsoleCommander
(boolean b) void
stunCrew()
void
unjamTurret
(int turret) void
boolean
Only check for satisfied turn mode for Tanks or QuadVees in vehicle mode, or LAMs in AirMek mode.Generates a vector containing reports on all useful information about this entity.Methods inherited from class megamek.common.Entity
addAttackedByThisTurn, addBeenDetectedBy, addBeenSeenBy, addBomb, addBomb, addClanCase, addConditionBonuses, addCoolantFailureAmount, addCritical, addCritical, addCritical, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addFailedEquipment, addFiringSolution, addGroundAttackedByThisTurn, addIMPHits, addKill, addOffBoardObserver, addPassedThrough, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addSensorContact, addTargetedBySwarm, addTechComponent, addTowedUnit, addTransporter, addTransporter, addTsempHitThisTurn, addWeaponGroup, antiTSMVulnerable, applyGravityEffectsOnMP, armorStringFor, assignAMS, assignTMAMS, assignWeaponQuirk, attachINarcPod, attachNarcPod, braceLocation, C3MasterIs, calcElevation, calcElevation, calculateBattleValue, calculateBattleValue, calculateBattleValue, calculateBattleValue, calculateFreeC3MNodes, calculateFreeC3Nodes, canActivateBloodStalker, canAssaultDrop, canAssist, canBrace, canEscape, canFall, canFall, canFireWeapon, canFlee, canFlee, canFlipArms, canGoDown, canGoDown, canGoUp, canLayMine, canLoad, canLoad, canonUnitWithInvalidBuild, canPickupGroundObject, canRam, canTow, canTransferCriticals, canUnjamRAC, canUnstickByJumping, checkBogDown, checkDislodgeSwarmers, checkForMASCFailure, checkForSuperchargerFailure, checkGetUp, checkGunningIt, checkLandingInHeavyWoods, checkLandingOnBlackIce, checkLandingOnIce, checkLandingWithDamage, checkLandingWithPrototypeJJ, checkMovedTooFast, checkMovementInBuilding, checkRecklessMove, checkRubbleMove, checkRunningWithDamage, checkSideSlip, checkSkid, checkSprintingWithMASCAndSupercharger, checkSprintingWithMASCXorSupercharger, checkTurnModeFailure, checkUnstall, checkUsingOverdrive, checkWaterMove, checkWaterMove, chooseSide, clearAttackedByThisTurn, clearBombs, clearDestroyedNarcPods, clearDetectedBy, clearFiringSolutions, clearNarcAndiNarcPods, clearPartialRepairs, clearSeenBy, clearSensorContacts, climbMode, countEquipment, countForStrengthSum, countMisc, countPartialRepairs, countQuirks, countQuirks, countWeaponQuirks, countWorkingMisc, countWorkingMisc, countWorkingMisc, critStateCount, damageBayDoor, damagedJumpJets, damageDockCollar, damageDoorRecovery, damagedSCMCritCount, damageSystem, damageSystem, deactivateRadicalHS, deployOffBoard, destroy, destroyLocation, destroyLocation, destroyOneSearchlight, destroyRetractableBlade, disconnectUnit, doBattleValueCalculation, doCheckEngineStallRoll, doomedInAtmosphere, doomedInExtremeTemp, doomedInSpace, doomedOnGround, dropGroundObject, dropGroundObject, dropGroundObjects, elevationOccupied, elevationOccupied, endOfTurnCargoInteraction, entityIsQuad, equals, extendBlade, factionTechLevel, findTargetedDisplacement, fixElevation, formatHeat, gameOptions, generalName, generateDisplayName, generateShortName, getActiveAMS, getActiveSensor, getActiveSubEntities, getActiveUMUCount, getActiveVibrobladeHeat, getActiveVibrobladeHeat, getAllGyroCodeName, getAllowedPhysicalAttacks, getAllTowedUnits, getAllUMUCount, getAlreadyTwisted, getAlternateCost, getAltitude, getAmmo, getAmmo, getAmmo, getAnyTypeMaxJumpMP, getArmedMPBoosters, getArmor, getArmor, getArmor, getArmoredComponentTechAdvancement, getArmorForReal, getArmorForReal, getArmorRemainingPercent, getArmorString, getArmorString, getArmorTechLevel, getArmorTechRating, getArmorType, getArmorWeight, getArmorWeight, getArmsFlipped, getASEWAffected, getAttackedByThisTurn, getBadCriticals, getBAPRange, getBARRating, getBase64Icon, getBaseAvailability, getBaseChassisFireConWeight, getBaseChassisValue, getBaseEngineValue, getBasePilotingRoll, getBasePilotingRoll, getBay, getBayByAmmo, getBayById, getBayLoadedUnitIds, getBayPersonnel, getBlockedFiringLocations, getBloodStalkerTarget, getBlueShieldRounds, getBoardId, getBombLoadout, getBombLoadout, getBombs, getBombs, getBoobyTrap, getBoobyTrapDamage, getBraceMPCost, getBvCalculator, getC3iNextUUIDAsString, getC3Master, getC3MasterId, getC3MasterIsUUIDAsString, getC3NetId, getC3Top, getC3UUIDAsString, getCamouflage, getCamouflageOrElse, getCamouflageOrElse, getCamouflageOrElseOwners, getCargoMpReduction, getCarriedObject, getCarriedObjects, getChassis, getClanChassisName, getClubs, getCollarById, getCommonDate, getCommonDateRange, getConnectedUnits, getConsecutiveRHSUses, getConversionMode, getCoolantFailureAmount, getCost, getCrew, getCritical, getCriticalSlots, getCustomWeaponOrder, getCustomWeaponOrder, getDamagedCriticals, getDamageLevel, getDamageLevel, getDamageReductionFromModularArmor, getDefaultPickupLocations, getDependentLocation, getDeployRound, getDisplacementAttack, getDisplayName, getDistinctCarriedObjects, getDockingCollars, getDocks, getDocks, getDroppableUnits, getDuplicateMarker, getEarliestTechDate, getEarliestTechDateAndEra, getECCMInfo, getECCMStrength, getECMInfo, getECMRange, getECMStrength, getElevation, getEmptyCriticals, getEngine, getEngineCritHeat, getEngineTechRating, getEngineType, getEntityMajorTypeName, getEntityTypeName, getEquipment, getEquipment, getEquipmentForWeaponQuirk, getEquipmentNum, getEquipmentType, getEvasionBonus, getExteriorUnitAt, getExternalBombLoadout, getExternalId, getExternalIdAsString, getExternalUnits, getExtinctionDate, getExtinctionDate, getExtinctionRange, getExtraC3BV, getExtraCommGearTons, getExtremeRangeModifier, getFacing, getFacingName, getFailedEquipment, getFighterBays, getFiringSolutions, getFleeZone, getFluff, getFluffImage, getForceId, getForceString, getFreeC3iUUID, getFreeNC3UUID, getFullChassis, getGame, getGaveKillCredit, getGhostTargetOverride, getGhostTargetRoll, getGhostTargetRollMoS, getGoodCriticals, getGrappled, getGrappleSide, getGroundAttackedByThisTurn, getGyroType, getHeading, getHeat, getHeatCapacity, getHeatCapacity, getHeatCapacityWithWater, getHeatFiringModifier, getHeatInArc, getHeatMPReduction, getHeight, getHiddenActivationPhase, getHitchCarrying, getHitchLocations, getHitCriticals, getHittableCriticals, getIcon, getId, getINarcPodsAttached, getIndividualWeaponList, getInitialBV, getInternal, getInternal, getInternalBombLoadout, getInternalForReal, getInternalRemainingPercent, getInternalString, getIntroductionDate, getIntroductionDate, getIntroductionDateAndEra, getInvalidSourceBuildReasons, getIsJumpingNow, getJumpHeat, getJumpMP, getJumpMP, getJumpMPWithTerrain, getJumpType, getKillerId, getKillNumber, getKills, getLabArmorTonnage, getLabTotalArmorPoints, getLastTarget, getLastTargetDisplayName, getLaunchableDropships, getLaunchableFighters, getLaunchableSmallCraft, getLoadedKeepers, getLoadedTrailers, getLoadedUnits, getLocationAbbr, getLocationAbbr, getLocationFromAbbr, getLocationName, getLocationName, getLocationStatus, getLongRangeModifier, getLOSRangeModifier, getManualBV, getMASC, getMASCTarget, getMASCTurns, getMaxElevationDown, getMaxWeaponRange, getMaxWeaponRange, getMechanicalJumpBoosterMP, getMechanicalJumpBoosterMP, getMediumRangeModifier, getMisc, getMisc, getMiscEquipment, getMixedTechAdvancement, getModel, getMotiveSideMod, getMovedBackwards, getMovementBeforeSkidPSRModifier, getMovementMode, getMovementModeAsString, getMPBoosters, getMPBoosters, getMpUsedLastRound, getMulId, getNC3NextUUIDAsString, getNCrew, getNewRoundNovaNetworkString, getNextSensor, getNMarines, getNPassenger, getNumberOfCriticals, getNumberOfCriticals, getNumberOfCriticals, getNumberOfCriticals, getNumberOfShields, getOArmor, getOArmor, getOArmor, getOccupiedCoords, getOffBoardDirection, getOffBoardDistance, getOInternal, getOInternal, getOmniAdvancement, getOmniAdvancement, getOriginalBuildYear, getOriginalJumpMP, getOriginalJumpMP, getOriginalNovaC3NetId, getOriginalRunMP, getOriginalWalkMP, getOwner, getOwnerId, getPartialRepairs, getPassedThrough, getPassedThroughBoardId, getPassedThroughFacing, getPatchworkArmorAdvancement, getPickedUpMekWarriors, getPlayerPickedPassThrough, getPodMountedTroopCarryingSpace, getPosition, getPowerAmplifierWeight, getPriorPosition, getProductionDate, getProductionDate, getProductionDateRange, getPrototypeDate, getPrototypeDate, getPrototypeRangeDate, getQuirkIniBonus, getQuirkList, getQuirks, getRecoveryTurn, getReintroductionDate, getReintroductionDate, getRemovalCondition, getRetreatedDirection, getRole, getRunHeat, getRunMP, getRunMPasString, getRunMPwithoutMASC, getSecondaryFacing, getSecondaryPositions, getSelfDestructedThisTurn, getSelfDestructing, getSelfDestructInitiated, getSensorCheck, getSensorContacts, getSensors, getShortName, getShortNameRaw, getShortRangeModifier, getSource, getSpotTargetId, getSprintHeat, getSprintMPwithOneMASC, getSprintMPwithoutMASC, getStandingHeat, getStartingAnyNWx, getStartingAnyNWx, getStartingAnyNWy, getStartingAnyNWy, getStartingAnySEx, getStartingAnySEx, getStartingAnySEy, getStartingAnySEy, getStartingOffset, getStartingOffset, getStartingPos, getStartingPos, getStartingWidth, getStartingWidth, getStaticTechLevel, getStrength, getStructuralTechRating, getStructureTechLevel, getStructureType, getSubEntities, getSuperCharger, getSuperchargerTarget, getSuperchargerTurns, getSwarmAttackerId, getSwarmTargetId, getTaggedBy, getTargetBay, getTargetedBySwarm, getTargetType, getTaserFeedBackRounds, getTaserInterference, getTaserInterferenceHeat, getTaserInterferenceRounds, getTaserShutdownRounds, getTechBase, getTechBaseDescription, getTechBaseDescriptions, getTechLevel, getTechLevelYear, getTechRating, getTilesetModeString, getTMTracker, getTotalAmmoOfType, getTotalArmor, getTotalInternal, getTotalMunitionsOfType, getTotalOArmor, getTotalOInternal, getTotalWeaponList, getTowedBy, getTowing, getTractor, getTraitorId, getTransferLocation, getTransportBays, getTransportId, getTransports, getTroopCarryingSpace, getTrooperAtLocation, getTsempEffect, getTsempHitsThisTurn, getUnitNumber, getUnitsUnloadableFromBays, getUnitsUnloadableFromNonBays, getUnloadableUnits, getUnused, getUnused, getUnusedString, getUnusedString, getUseManualBV, getValidBraceLocations, getValidHalfWeightPickupLocations, getVector, getVectors, getVelocity, getVibroClaws, getWalkHeat, getWalkMP, getWeapon, getWeaponBayList, getWeaponGroupList, getWeaponList, getWeapons, getWeaponSortOrder, getWeight, getWeightClass, getWeightClassName, getWhoCanDetect, getWhoCanSee, getYear, hasAbility, hasAbility, hasActivatedRadicalHS, hasActiveBlueShield, hasActiveECCM, hasActiveECM, hasActiveECM, hasActiveEiCockpit, hasActiveNovaCEWS, hasActiveShield, hasActiveShield, hasAimModeTargComp, hasAnyC3System, hasAnyTypeNarcPodsAttached, hasArcFired, hasArmoredChassis, hasBAP, hasBAP, hasBARArmor, hasBattleArmorHandles, hasBoobyTrap, hasBoostedC3, hasC3, hasC3i, hasC3M, hasC3MM, hasC3S, hasCase, hasCASEII, hasCASEII, hasDamagedRHS, hasDetectedEntity, hasDisplacementAttack, hasDroneOs, hasECM, hasEiCockpit, hasEmbeddedIcon, hasEngine, hasETypeFlag, hasExternalSearchlight, hasFallen, hasFiredTsemp, hasFiringSolutionFor, hasFleeZone, hasFlotationHull, hasFunctionalArmAES, hasFunctionalLegAES, hasGhostTargets, hasHardenedArmor, hasHarJelIn, hashCode, hasHierarchicalC3, hasHipCrit, hasINarcPodsAttached, hasInfernoAmmo, hasLegActuatorCrit, hasLinkedMGA, hasMisc, hasMisc, hasMisc, hasModularArmor, hasModularArmor, hasMulId, hasNarcPodsAttached, hasNavalC3, hasNhC3, hasNoDefenseShield, hasNovaCEWS, hasOccupiedHex, hasPassiveShield, hasPassiveShield, hasPatchworkArmor, hasQuirk, hasRearArmor, hasSCM, hasSearchlight, hasSeenEntity, hasSensorContactFor, hasShield, hasStealth, hasSystem, hasTAG, hasTargComp, hasUMU, hasUndamagedCriticalSlots, hasUnloadedUnitsFromBays, hasViableWeapons, hasVibroblades, hasWorkingMisc, hasWorkingMisc, hasWorkingMisc, hasWorkingMisc, hasWorkingSCM, hasWorkingSystem, height, hitAllCriticals, incrementMASCAndSuperchargerLevels, initializeArmor, initializeInternal, initMilitary, initTechAdvancement, isActive, isActive, isActiveOption, isAeroLandedOnGroundMap, isAeroSensorDestroyed, isAirborne, isAirborneAeroOnGroundMap, isAirborneVTOLorWIGE, isAssaultDropInProgress, isAttackingThisTurn, isBATaserShutdown, isBoardProhibited, isBoardProhibited, isBoobyTrapInitiated, isBracing, isC3CompanyCommander, isC3IndependentMaster, isCanon, isCapitalFighter, isCapitalFighter, isCapitalScale, isCaptured, isCarcass, isCarefulStand, isChainWhipGrappled, isChameleonShieldActive, isChameleonShieldOn, isCharging, isClan, isClanArmor, isClearingMinefield, isCommander, isConvertingNow, isDeployed, isDesignValid, isDestroyed, isDetectedByEnemy, isDone, isDoomed, isDropping, isElevationValid, isEligibleForArtyAutoHitHexes, isEligibleForFiring, isEligibleForMovement, isEligibleForOffboard, isEligibleForPhysical, isEligibleForTargetingPhase, isEnemyOf, isEvading, isEverSeenByEnemy, isFindingClub, isFiredTsempThisTurn, isGrappleAttacker, isGrappledThisRound, isGyroDestroyed, isHardenedArmorDamaged, isHidden, isHullDown, isIlluminated, isImmobile, isINarcedBy, isINarcedWith, isInBuilding, isIntroLevel, isJumpingWithMechanicalBoosters, isLargeCraft, isLayingMines, isLoadableThisTurn, isLocationBad, isLocationBlownOff, isLocationBlownOffThisPhase, isLocationDeadly, isLocationDeadly, isLocationDoomed, isLocationProhibited, isLocationProhibited, isLocationProhibited, isLocationProhibited, isLocationTrulyDestroyed, isMakingDfa, isMakingVTOLGroundAttack, isManualShutdown, isMASCUsed, isMilitary, isMixedTech, isNarcedBy, isNaval, isNightwalker, isNOE, isNullSigActive, isNullSigOn, isOffBoard, isOffBoardObserved, isOmni, isOnAtmosphericGroundMap, isPartOfFighterSquadron, isPodMountedTransport, isPowerReverse, isPrimitive, isProne, isPushing, isRamming, isReckless, isSalvage, isSelectableThisTurn, isSensorReturn, isShutDown, isShutDownThisPhase, isSpaceborne, isSpotting, isStalled, isStartupThisPhase, isStuck, isSufferingEMI, isSuperchargerUsed, isSuperHeavy, isSurfaceNaval, isTargetable, isTargetOfDisplacementAttack, isTransported, isTrapped, isUnderwater, isUnjammingRAC, isUnloadedThisTurn, isUnofficial, isUsingManAce, isUsingSearchlight, isVisibleToEnemy, isVoidSigActive, isVoidSigOn, isWeaponBlockedAt, isWeaponBlockedByTowing, isWeaponValidForPhase, isWeapOrderChanged, itemOppositeTech, joinLocationAbbr, load, load, load, load, loadAllWeapons, loadDefaultCustomWeaponOrder, loadedUnitsHaveActiveECM, loadQuirks, loadWeapon, loadWeapon, loadWeaponWithSameAmmo, loadWeaponWithSameAmmo, locationHasCase, locationIsLeg, madePointblankShot, maxGroundObjectTonnage, modifyPhysicalDamageForMeleeSpecialist, needsRollToStand, newPhase, newRoundNovaNetSwitch, nextConversionMode, onSameC3NetworkAs, onSameC3NetworkAs, passedOver, passedThrough, passedThroughPrevious, passedWithin, performManualShutdown, performManualStartup, pickUp, pickupGroundObject, postProcessFacingChange, recalculateTechAdvancement, recover, refreshLocations, relHeight, reloadEmptyWeapons, removeAllINarcPods, removeAllTransporters, removeCriticals, removeFiringSolution, removeINarcPod, removeMisc, removePartialCoverHits, removeSensorContact, removeTowedUnit, removeTransporter, resetBayDoors, resetBays, resetBombAttacks, resetCoolantFailureAmount, resetFiringArcs, resetTransporter, restore, rollMovementInBuilding, scmCritStateCount, setAlreadyTwisted, setAltitude, setArcFired, setArmor, setArmor, setArmor, setArmorTechLevel, setArmorTechLevel, setArmorTechRating, setArmorTechRating, setArmorTonnage, setArmorType, setArmorType, setArmorType, setArmsFlipped, setArmsFlipped, setASEWAffected, setAssaultDropInProgress, setBARRating, setBARRating, setBaseChassisFireConWeight, setBATaserShutdown, setBloodStalkerTarget, setBoardId, setBoobyTrapInitiated, setBraceLocation, setC3iNextUUIDAsString, setC3Master, setC3Master, setC3MasterIsUUIDAsString, setC3NetId, setC3NetId, setC3NetIdSelf, setC3UUID, setC3UUIDAsString, setCamouflage, setCanon, setCanUnstickByJumping, setCaptured, setCarcass, setCarefulStand, setCarriedObjects, setChassis, setClanChassisName, setClearingMinefield, setClimbMode, setCommander, setConsecutiveRHSUses, setConversionMode, setConvertingNow, setCrew, setCritical, setCustomWeaponOrder, setCustomWeaponOrder, setDeployed, setDeployRound, setDesignValid, setDestroyed, setDetectedByEnemy, setDisplacementAttack, setDisplayName, setDone, setDoomed, setDuplicateMarker, setElevation, setEMI, setEngine, setEngineTechRating, setEngineTechRating, setEvading, setEverSeenByEnemy, setExternalId, setExternalIdAsString, setExternalSearchlight, setFallen, setFindingClub, setFiredTsempThisTurn, setFleeZone, setForceId, setForceString, setGame, setGameOptions, setGrappled, setGrappledThisRound, setGrappleSide, setHardenedArmorDamaged, setHasDamagedRHS, setHasFiredTsemp, setHidden, setHiddenActivationPhase, setIcon, setId, setIGame, setIlluminated, setInitialBV, setInternal, setInternal, setInvalidSourceBuildReasons, setIsJumpingNow, setJumpingWithMechanicalBoosters, setLandedAssaultDrop, setLastTarget, setLastTargetDisplayName, setLayingMines, setLoadedKeepers, setLoadedThisTurn, setLocationBlownOff, setLocationBlownOffThisPhase, setLocationStatus, setLocationStatus, setMadePointblankShot, setManualBV, setManualShutdown, setMASCUsed, setMixedTech, setModel, setMovedBackwards, setMovementMode, setMulId, setNC3NextUUIDAsString, setNCrew, setNeverDeployed, setNewRoundNovaNetworkString, setNextSensor, setNMarines, setNPassenger, setOffBoard, setOriginalBuildYear, setOriginalJumpMP, setOriginalWalkMP, setOwner, setOwnerId, setPassedThrough, setPassedThroughBoardId, setPassedThroughFacing, setPlayerPickedPassThrough, setPosition, setPosition, setPowerReverse, setProne, setQuirks, setRamming, setRapidFire, setReckless, setRecoveryTurn, setRemovalCondition, setRetreatedDirection, setSalvage, setSearchlightState, setSecondaryFacing, setSelfDestructedThisTurn, setSelfDestructing, setSelfDestructInitiated, setShutDown, setShutDownThisPhase, setSource, setSpotTargetId, setSpotting, setStartingAnyNWx, setStartingAnyNWy, setStartingAnySEx, setStartingAnySEy, setStartingOffset, setStartingPos, setStartingWidth, setStartupThisPhase, setStruck, setStructuralTechRating, setStructuralTechRating, setStructureTechLevel, setStructureType, setStructureType, setStuck, setSuperchargerUsed, setSwarmAttackerId, setSwarmTargetId, setTaggedBy, setTargetBay, setTaserFeedback, setTaserInterference, setTaserShutdownRounds, setTechLevel, setTowedBy, setTowing, setTractor, setTraitorId, setTransportId, setTsempEffect, setTurnInterrupted, setUnitNumber, setUnitRole, setUnjammingRAC, setUnloaded, setUsedSearchlight, setUseManualBV, setVectors, setVisibleToEnemy, setWeaponHit, setWeaponSortOrder, setWeapOrderChanged, setWeight, setWhoCanDetect, setWhoCanSee, setWigeLiftoffHover, setYear, shouldDeploy, shouldOffBoardDeploy, shouldUseEdge, sideTable, sideTable, sideTable, sideTable, sideTableRam, sideTableRam, slotNumber, specificName, statusToString, statusToString, statusToString, taserShutdown, toggleConversionMode, toString, towUnit, turnWasInterrupted, unload, updateBays, updateDuplicateMarkerAfterDelete, usedSearchlight, usedTag, usesWeaponBays, wasLoadedThisTurn, wasNeverDeployed, wasStruck, weaponFired, weaponFiredFrom, whichBay, wigeLiftoffHover
Methods inherited from class megamek.common.TurnOrdered
clearInitiative, generateTurnOrder, getAeroTurns, getDropshipTurns, getEvenTurns, getInitCompensationBonus, getInitiative, getJumpshipTurns, getMultiTurns, getNormalTurns, getOtherTurns, getSmallCraftTurns, getSpaceStationTurns, getTeleMissileTurns, getWarshipTurns, incrementAeroTurns, incrementDropshipTurns, incrementEvenTurns, incrementJumpshipTurns, incrementMultiTurns, incrementOtherTurns, incrementSmallCraftTurns, incrementSpaceStationTurns, incrementTeleMissileTurns, incrementWarshipTurns, resetAeroTurns, resetDropshipTurns, resetEvenTurns, resetInitiativeCompensation, resetJumpshipTurns, resetMultiTurns, resetOtherTurns, resetSmallCraftTurns, resetSpaceStationTurns, resetTeleMissileTurns, resetWarshipTurns, rollInitAndResolveTies, rollInitAndResolveTies, rollInitiative, rollInitiative, setInitCompensationBonus, setInitiative
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface megamek.common.BTObject
hasAerodyneSpheroidDistinction, isAero, isAerodyne, isAerospace, isAerospaceFighter, isAerospaceSV, isBattleArmor, isBattleMek, isCarryableObject, isConventionalFighter, isConventionalInfantry, isDropShip, isFighter, isFixedWingSupport, isGround, isHandheldWeapon, isIndustrialMek, isInfantry, isJumpShip, isLargeAerospace, isMek, isObjectiveMarker, isProtoMek, isQuadMek, isSingleUnit, isSmallCraft, isSpaceStation, isSpheroid, isSupportVehicle, isTripodMek, isUnitGroup, isVehicle, isWarShip
Methods inherited from interface megamek.common.CombatRole
hasRole
Methods inherited from interface megamek.common.ForceAssignable
partOfForce
Methods inherited from interface megamek.common.InGameObject
hasOwner
Methods inherited from interface megamek.common.ITechnology
calcEraAvailability, calcEraAvailability, calcYearAvailability, calcYearAvailability, calcYearAvailability, findMinimumRulesLevel, findMinimumRulesLevel, getAdvancedRange, getAdvancedRange, getCodeFromIOAbbr, getCodeFromMMAbbr, getCommonDate, getEraAvailabilityName, getEraAvailabilityName, getExperimentalRange, getExperimentalRange, getExtinctionDate, getExtinctionRange, getFullRatingName, getFullRatingName, getIntroductionDate, getProductionDate, getPrototypeDate, getReintroductionDate, getSimpleLevel, getSimpleLevel, getSimpleLevel, getStandardRange, getStandardRange, getTechLevel, getTechLevel, getTechRatingName, isAvailableIn, isAvailableIn, isAvailableIn, isExtinct, isExtinct, isExtinct, isLegal, isLegal
Methods inherited from interface megamek.common.Targetable
getBoardLocation, isBomber, isHexBeingBombed, isOnBoard, tracksHeat
Methods inherited from interface megamek.common.Transporter
canTow, getNumberLoadedThisTurn, getNumberUnloadedThisTurn, getType, hardpointCost
-
Field Details
-
m_bHasNoTurret
protected boolean m_bHasNoTurret -
m_bTurretLocked
protected boolean m_bTurretLocked -
m_bTurretJammed
protected boolean m_bTurretJammed -
m_bTurretEverJammed
protected boolean m_bTurretEverJammed -
m_bHasNoDualTurret
protected boolean m_bHasNoDualTurret -
m_bDualTurretLocked
protected boolean m_bDualTurretLocked -
m_bDualTurretJammed
protected boolean m_bDualTurretJammed -
m_bDualTurretEverJammed
protected boolean m_bDualTurretEverJammed -
motivePenalty
protected int motivePenalty -
motiveDamage
protected int motiveDamage -
engineHit
protected boolean engineHit -
LOC_BODY
public static final int LOC_BODY- See Also:
-
LOC_FRONT
public static final int LOC_FRONT- See Also:
-
LOC_RIGHT
public static final int LOC_RIGHT- See Also:
-
LOC_LEFT
public static final int LOC_LEFT- See Also:
-
LOC_REAR
public static final int LOC_REAR- See Also:
-
LOC_TURRET
public static final int LOC_TURRETfor dual turret tanks, this is the rear turret- See Also:
-
LOC_TURRET_2
public static final int LOC_TURRET_2for dual turret tanks, this is the front turret- See Also:
-
CRIT_NONE
public static final int CRIT_NONE- See Also:
-
CRIT_DRIVER
public static final int CRIT_DRIVER- See Also:
-
CRIT_WEAPON_JAM
public static final int CRIT_WEAPON_JAM- See Also:
-
CRIT_WEAPON_DESTROYED
public static final int CRIT_WEAPON_DESTROYED- See Also:
-
CRIT_STABILIZER
public static final int CRIT_STABILIZER- See Also:
-
CRIT_SENSOR
public static final int CRIT_SENSOR- See Also:
-
CRIT_COMMANDER
public static final int CRIT_COMMANDER- See Also:
-
CRIT_CREW_KILLED
public static final int CRIT_CREW_KILLED- See Also:
-
CRIT_CREW_STUNNED
public static final int CRIT_CREW_STUNNED- See Also:
-
CRIT_CARGO
public static final int CRIT_CARGO- See Also:
-
CRIT_ENGINE
public static final int CRIT_ENGINE- See Also:
-
CRIT_FUEL_TANK
public static final int CRIT_FUEL_TANK- See Also:
-
CRIT_AMMO
public static final int CRIT_AMMO- See Also:
-
CRIT_TURRET_JAM
public static final int CRIT_TURRET_JAM- See Also:
-
CRIT_TURRET_LOCK
public static final int CRIT_TURRET_LOCK- See Also:
-
CRIT_TURRET_DESTROYED
public static final int CRIT_TURRET_DESTROYED- See Also:
-
CRIT_SENSOR_MAX
public static final int CRIT_SENSOR_MAX- See Also:
-
DUG_IN_NONE
public static final int DUG_IN_NONE- See Also:
-
DUG_IN_FORTIFYING1
public static final int DUG_IN_FORTIFYING1- See Also:
-
DUG_IN_FORTIFYING2
public static final int DUG_IN_FORTIFYING2- See Also:
-
DUG_IN_FORTIFYING3
public static final int DUG_IN_FORTIFYING3- See Also:
-
SIDE_LOC_MAPPING
-
hasSponsons
protected boolean hasSponsons -
hasPintle
protected boolean hasPintle -
BASE_CHASSIS_TURRET_WT_UNASSIGNED
public static final int BASE_CHASSIS_TURRET_WT_UNASSIGNEDKeeps track of the base weight of the turret for omni tanks.- See Also:
-
-
Constructor Details
-
Tank
public Tank()
-
-
Method Details
-
getUnitType
public int getUnitType()- Specified by:
getUnitType
in classEntity
- See Also:
-
getLocationAbbrs
- Specified by:
getLocationAbbrs
in classEntity
-
getLocationNames
- Specified by:
getLocationNames
in classEntity
-
getLocTurret
public int getLocTurret() -
getLocTurret2
public int getLocTurret2() -
defaultCrewType
- Overrides:
defaultCrewType
in classEntity
-
getPotCrit
public int getPotCrit() -
setPotCrit
public void setPotCrit(int crit) -
getOverThresh
public boolean getOverThresh() -
setOverThresh
public void setOverThresh(boolean tf) -
hasNoTurret
public boolean hasNoTurret() -
hasNoDualTurret
public boolean hasNoDualTurret() -
getTurretCount
public int getTurretCount() -
setHasNoTurret
public void setHasNoTurret(boolean b) -
setHasNoDualTurret
public void setHasNoDualTurret(boolean b) -
getMotiveDamage
public int getMotiveDamage() -
setMotiveDamage
public void setMotiveDamage(int d) -
getMotivePenalty
public int getMotivePenalty() -
setMotivePenalty
public void setMotivePenalty(int p) -
getConstructionTechAdvancement
Description copied from class:Entity
return - the base construction option tech advancement- Specified by:
getConstructionTechAdvancement
in classEntity
-
getDualTurretTA
-
addSystemTechAdvancement
Description copied from class:Entity
Incorporate dates for components that are not in the equipment list, such as engines and structure.- Overrides:
addSystemTechAdvancement
in classEntity
-
getWalkMP
-
isEligibleForPavementOrRoadBonus
public boolean isEligibleForPavementOrRoadBonus()Description copied from class:Entity
Tanks and certain other units can get a +1 bonus to MP if their move is entirely on pavement.- Overrides:
isEligibleForPavementOrRoadBonus
in classEntity
- Returns:
- true if the
Entity
gets a movement bonus on pavement
-
isTurretLocked
public boolean isTurretLocked(int turret) -
isTurretJammed
public boolean isTurretJammed(int turret) -
locations
public int locations()Returns the number of locations in the 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 byEntity
type.- Overrides:
getBodyLocation
in classEntity
- 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 classEntity
-
isValidSecondaryFacing
public boolean isValidSecondaryFacing(int n) Description copied from class:Entity
Can this entity torso/turret twist the given direction?- Specified by:
isValidSecondaryFacing
in classEntity
-
clipSecondaryFacing
public int clipSecondaryFacing(int n) Description copied from class:Entity
Returns the closest valid secondary facing to the given direction.- Specified by:
clipSecondaryFacing
in classEntity
- Returns:
- the closest valid secondary facing.
-
setSecondaryFacing
public void setSecondaryFacing(int sec_facing) - Overrides:
setSecondaryFacing
in classEntity
-
setFacing
public void setFacing(int facing) Description copied from class:Entity
Sets the primary facing. -
getDualTurretFacing
public int getDualTurretFacing() -
setDualTurretOffset
public void setDualTurretOffset(int offset) -
isStabiliserHit
public boolean isStabiliserHit(int loc) -
setStabiliserHit
public void setStabiliserHit(int loc) -
clearStabiliserHit
public void clearStabiliserHit(int loc) -
getSensorHits
public int getSensorHits() -
setSensorHits
public void setSensorHits(int hits) -
isDriverHit
public boolean isDriverHit() -
setDriverHit
public void setDriverHit(boolean hit) -
isCommanderHit
public boolean isCommanderHit() -
setCommanderHit
public void setCommanderHit(boolean hit) -
isUsingConsoleCommander
public boolean isUsingConsoleCommander() -
setUsingConsoleCommander
public void setUsingConsoleCommander(boolean b) -
getExtraCrewSeats
public int getExtraCrewSeats()- Returns:
- Additional seats beyond the minimum crew requirements
-
setExtraCrewSeats
public void setExtraCrewSeats(int seats) -
isDriverHitPS
public boolean isDriverHitPS() -
setDriverHitPS
public void setDriverHitPS(boolean hit) -
isCommanderHitPS
public boolean isCommanderHitPS() -
setCommanderHitPS
public void setCommanderHitPS(boolean hit) -
isCrewHitPS
public boolean isCrewHitPS() -
setCrewHitPS
public void setCrewHitPS(boolean hit) -
isMovementHit
public boolean isMovementHit()Determines whether the unit is considered to have suffered a movement hit.A unit is considered to have a movement hit if:
- It is not a trailer (its original walking movement points is greater than 0), and
- It is flagged as immobile, or
- It is a VTOL unit and its rotor is destroyed, or
- Its motive damage is greater than or equal to its original walking movement points.
- Returns:
true
if the unit qualifies as having a movement hit according to these criteria;false
otherwise.- See Also:
-
isMovementHitPending
public boolean isMovementHitPending() -
immobilize
public void immobilize()Marks this tank for immobilization, most likely from a related motive system hit. To actually immobilize it,applyDamage()
must also be invoked; until then,isMovementHitPending()
will return true after this but neitherisMovementHit()
norEntity.isImmobile()
will have been updated yet (because the tank is technically not immobile just yet until damage is actually resolved). -
isImmobile
public boolean isImmobile(boolean checkCrew) Description copied from class:Entity
Is this entity shut down, or if applicable is the crew unconscious?- Overrides:
isImmobile
in classEntity
- Parameters:
checkCrew
- If true, consider the fitness of the crew when determining if the entity is immobile.
-
isPermanentlyImmobilized
public boolean isPermanentlyImmobilized(boolean checkCrew) Whether this unit is irreversibly immobilized for the rest of the game. Tanks have some additional criteria.- Overrides:
isPermanentlyImmobilized
in classEntity
- Returns:
- true if unit is permanently immobile
-
isImmobileForJump
public boolean isImmobileForJump()Per https://bg.battletech.com/forums/index.php/topic,78336.msg1869386.html#msg1869386 CVs with working engines and Jump Jets should still have the option to jump during the movement phase, even if reduced to 0 MP by motive hits, or rolling 12 on the Motive System Damage table.- Overrides:
isImmobileForJump
in classEntity
-
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 classEntity
- Returns:
- Whether the Entity qualifies for initiative bonus from cockpit command console.
-
isLocationProhibited
Tanks have all sorts of prohibited terrain.- Overrides:
isLocationProhibited
in classEntity
- Parameters:
c
- The position to testtestBoardId
- The board to testcurrElevation
- The elevation or altitude to test- Returns:
- True when the location is illegal to be in for this unit, regardless of elevation
- See Also:
-
isLocationProhibitedWiGE
-
lockTurret
public void lockTurret(int turret) -
jamTurret
public void jamTurret(int turret) -
unjamTurret
public void unjamTurret(int turret) -
isTurretEverJammed
public boolean isTurretEverJammed(int turret) -
getStunnedTurns
public int getStunnedTurns() -
setStunnedTurns
public void setStunnedTurns(int turns) -
stunCrew
public void stunCrew() -
applyDamage
public void applyDamage()Description copied from class:Entity
Applies any damage that the entity has suffered. When anything gets hit it is simply marked as "hit" but does not stop working until this is called.- Overrides:
applyDamage
in classEntity
-
applyMovementDamage
public void applyMovementDamage()Applies movement damage to the Tank. -
isEligibleFor
Description copied from class:Entity
Determines if an entity is eligible for a phase.- Overrides:
isEligibleFor
in classEntity
-
newRound
public void newRound(int roundNumber) Description copied from class:Entity
Start a new round- Specified by:
newRound
in interfaceRoundUpdated
- Overrides:
newRound
in classEntity
- Parameters:
roundNumber
- theint
number of the new round
-
setDugIn
public void setDugIn(int i) -
getDugIn
public int getDugIn() -
getMovementString
Returns the name of the type of movement used. This is tank-specific.- Specified by:
getMovementString
in classEntity
-
getMovementAbbr
Returns the name of the type of movement used. This is tank-specific.- Specified by:
getMovementAbbr
in classEntity
-
firstArmorIndex
public int firstArmorIndex()- Overrides:
firstArmorIndex
in classEntity
- Returns:
- The index of the first armored location (skipping vehicle body, et. al.)
-
getWeaponArc
public int getWeaponArc(int weaponNumber) Returns the Compute.ARC that the weapon fires into.- Specified by:
getWeaponArc
in classEntity
- Parameters:
weaponNumber
- integer equipment number, index from equipment list- Returns:
- arc the specified weapon is in
-
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 classEntity
-
rollHitLocation
public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMode aimingMode, int cover) Rolls up a hit location- Specified by:
rollHitLocation
in classEntity
-
rollHitLocation
Description copied from class:Entity
Rolls up a hit location- Specified by:
rollHitLocation
in classEntity
-
getTransferLocation
Gets the location that excess damage transfers to- Specified by:
getTransferLocation
in classEntity
-
addEntityBonuses
Description copied from class:Entity
Add in any piloting skill mods- Specified by:
addEntityBonuses
in classEntity
-
usesTurnMode
public boolean usesTurnMode()Description copied from class:Entity
Only check for satisfied turn mode for Tanks or QuadVees in vehicle mode, or LAMs in AirMek mode. Except for LAMs, check whether advanced vehicle ground movement is enabled.- Overrides:
usesTurnMode
in classEntity
- Returns:
- True if this
Entity
must make a driving check for turning too sharply.
-
victoryReport
Description copied from class:Entity
Generates a vector containing reports on all useful information about this entity.- Specified by:
victoryReport
in classEntity
-
getNoOfSlots
public int[] getNoOfSlots()- Specified by:
getNoOfSlots
in classEntity
-
getRunMP
-
getSprintMP
public int getSprintMP()Description copied from class:Entity
Returns this entity's sprinting MP, modified for all its current circumstances such as gravity and damage. SeeMPCalculationSetting.STANDARD
. For units that can't sprint, this is equal to the modified run/flank MP.- Overrides:
getSprintMP
in classEntity
- Returns:
- This entity's modified sprinting MP
-
getSprintMP
Description copied from class:Entity
Returns this entity's sprinting MP, modified according to the given setting. For units that can't sprint, this is equal to the modified run/flank MP.- Overrides:
getSprintMP
in classEntity
- Returns:
- This entity's modified sprinting MP
-
getRunningGravityLimit
public int getRunningGravityLimit()Description copied from class:Entity
get the gravity limit for ground movement- Overrides:
getRunningGravityLimit
in classEntity
-
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 classEntity
-
getMaxElevationChange
public int getMaxElevationChange()Description copied from class:Entity
The maximum elevation change the entity can cross- Specified by:
getMaxElevationChange
in classEntity
-
getMaxElevationDown
public int getMaxElevationDown(int currElevation) Description copied from class:Entity
Returns the maximum number of downward elevation changes a unit can make. For some units (namely, WiGEs), this can depend upon their current elevation (since elevation determines if the WiGEs is using WiGE movement or not).- Overrides:
getMaxElevationDown
in classEntity
- Returns:
-
isRepairable
public boolean isRepairable()Determine if the unit can be repaired, or only harvested for spares.- Overrides:
isRepairable
in classEntity
- Returns:
- A
boolean
that istrue
if the unit can be repaired (given enough time and parts); if this value isfalse
, the unit is only a source of spares. - See Also:
-
canCharge
public boolean canCharge() -
canDFA
public boolean canDFA() -
getSuspensionFactor
public int getSuspensionFactor()- Returns:
- suspension factor of vehicle
-
getSuspensionFactor
Static method to calculate suspension factor without needing a vehicle -
getCost
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. -
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 classEntity
-
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 classEntity
- Returns:
- The number of locations protected by Clan CASE beyond what is explicitly mounted.
-
doomedInVacuum
public boolean doomedInVacuum()- Overrides:
doomedInVacuum
in classEntity
- Returns:
- True when this unit will not survive vacuum conditions.
-
hasEnvironmentalSealing
public boolean hasEnvironmentalSealing()- Overrides:
hasEnvironmentalSealing
in classEntity
- Returns:
- True if this unit has Environmental Sealing
-
canGoHullDown
public boolean canGoHullDown()Checks to see if a Tank is capable of going hull-down. This is true if hull-down rules are enabled and the Tank is in a fortified hex.- Overrides:
canGoHullDown
in classEntity
- Returns:
- True if hull-down is enabled and the Tank is in a fortified hex.
-
setOnFire
public void setOnFire(boolean inferno) -
isOnFire
public boolean isOnFire() -
isInfernoFire
public boolean isInfernoFire() -
isLocationBurning
public boolean isLocationBurning(int location) -
extinguishLocation
public void extinguishLocation(int location) -
extinguishAll
public void extinguishAll()extinguish all inferno fire on this Tank -
addMovementDamage
public void addMovementDamage(int level) adds minor, moderate or heavy movement system damage- Parameters:
level
- aint
representing minor damage (1), moderate damage (2), heavy damage (3), or immobilized (4)
-
hasMinorMovementDamage
public boolean hasMinorMovementDamage() -
hasModerateMovementDamage
public boolean hasModerateMovementDamage() -
hasHeavyMovementDamage
public boolean hasHeavyMovementDamage() -
isNuclearHardened
public boolean isNuclearHardened()Description copied from class:Entity
Checks if the unit is hardened against nuclear strikes.- Specified by:
isNuclearHardened
in classEntity
- Returns:
- true if this is a hardened unit.
-
addEquipment
public void addEquipment(Mounted<?> mounted, int loc, boolean rearMounted) throws LocationFullException - Overrides:
addEquipment
in classEntity
- Throws:
LocationFullException
-
getCriticalEffect
public int getCriticalEffect(int roll, int loc, boolean damagedByFire) get the type of critical caused by a critical roll, taking account of existing damage- Parameters:
roll
- the final dice rollloc
- the hit locationdamagedByFire
- whether or not the critical was caused by fire, which is distinct from damage for unofficial thresholding purposes.- Returns:
- a critical type
-
setOmni
public void setOmni(boolean omni) OmniVehicles have handles for Battle Armor squads to latch onto. Please note, this method should only be called during this Tank's construction.Overrides
Entity#setOmni(boolean)
-
setBAGrabBars
public void setBAGrabBars() -
setTrailerHitches
public void setTrailerHitches()Add a transporter for each trailer hitch the unit is equipped with, with a maximum of one each in the front and the rear. Any tractor that does not have an explicit hitch installed as equipment will get a rear-facing transporter. -
hasTrailerHitchTransporter
protected boolean hasTrailerHitchTransporter()Check to see if the unit has a trailer hitch transporter already We need this to prevent duplicate transporters being created -
canSpot
public boolean canSpot()Tanks can't spot when stunned. -
canUnjamWeapon
public boolean canUnjamWeapon()Convenience function that determines if this tank can issue an "unjam weapon" command.- Returns:
- True if there are any jammed weapons and the crew isn't stunned
-
canClearTurret
public boolean canClearTurret()Convenience function that determines if this tank can issue a "clear turret" command.- Returns:
- True if there are any jammed turrets and the crew isn't stunned
-
addJammedWeapon
Adds the provided weapon as a weapon that is jammed via the vehicle "weapon malfunction" critical hit- Parameters:
weapon
- Weapon that suffered a "Weapon Malfunction" crit and should be jammed
-
getJammedWeapons
All weapons that a vehicle could use "unjam weapon" for- Returns:
- all weapons that are jammed via the vehicle "weapon malfunction" critical hit
-
resetJammedWeapons
public void resetJammedWeapons()Resets the list of weapons a vehicle has jammed via "weapon malfunction" crits to empty -
engineHit
public void engineHit()apply the effects of an "engine hit" crit -
engineFix
public void engineFix() -
isEngineHit
public boolean isEngineHit() -
getTotalCommGearTons
public int getTotalCommGearTons()- Specified by:
getTotalCommGearTons
in classEntity
- Returns:
- the total tonnage of communications gear in this entity
-
getHQIniBonus
public int getHQIniBonus()- Overrides:
getHQIniBonus
in classEntity
- Returns:
- the initiative bonus this Entity grants for HQ
-
hasArmoredEngine
public boolean hasArmoredEngine()- Overrides:
hasArmoredEngine
in classEntity
-
getForwardArc
public int getForwardArc()- Overrides:
getForwardArc
in classEntity
-
getRearArc
public int getRearArc()- Overrides:
getRearArc
in classEntity
-
hasMovementDamage
public boolean hasMovementDamage() -
resetMovementDamage
public void resetMovementDamage() -
unlockTurret
public void unlockTurret() -
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)Sub-classes are encouraged to override this method.
- Overrides:
isStealthActive
in classEntity
- 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)Sub-classes are encouraged to override this method.
- Overrides:
isStealthOn
in classEntity
- 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.
-
getTotalSlots
public int getTotalSlots()get the total amount of item slots available for this tank- Returns:
-
getFreeSlots
public int getFreeSlots()get the free item slots for this tank- Returns:
-
setArmorType
public void setArmorType(int armType) - Overrides:
setArmorType
in classEntity
-
setArmorType
public void setArmorType(int armType, boolean addMount) -
hasArmedMASC
public boolean hasArmedMASC()Checks if a mek has an armed MASC system. Note that the mek will have to exceed its normal run to actually engage the MASC system -
getRunMPasString
Returns this entity's running/flank mp as a string.- Overrides:
getRunMPasString
in classEntity
- Parameters:
gameState
- Set this totrue
to include information about the current state of equipment like MASC.- Returns:
- A string like
9(15)
ifgameState
isfalse
or there is no currentGame
, or a string like9(15) MASC:0(3+)
otherwise.
-
getStealthModifier
Determine the stealth modifier for firing at this unit from the given range. If the value supplied forrange
is not one of theEntity
class range constants, anIllegalArgumentException
will be thrown.Sub-classes are encouraged to override this method.
- Overrides:
getStealthModifier
in classEntity
- Parameters:
range
- - anint
value that must match one of theCompute
class range constants.ae
- - entity making the attack- Returns:
- a
TargetRoll
value that contains the stealth modifier for the given range.
-
getEngineHits
public int getEngineHits()- Specified by:
getEngineHits
in classEntity
-
getLocationDamage
- Specified by:
getLocationDamage
in classEntity
-
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 classEntity
- 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 classEntity
- Returns:
- boolean
-
isDmgHeavy
public boolean isDmgHeavy()Description copied from class:Entity
Returns TRUE if the entity has been heavily damaged.- Specified by:
isDmgHeavy
in classEntity
- Returns:
- boolean
-
isDmgModerate
public boolean isDmgModerate()Description copied from class:Entity
Returns TRUE if the entity has been moderately damaged.- Specified by:
isDmgModerate
in classEntity
- Returns:
- boolean
-
isDmgLight
public boolean isDmgLight()Description copied from class:Entity
Returns TRUE if the entity has been lightly damaged.- Specified by:
isDmgLight
in classEntity
- Returns:
- boolean
-
getFuelTonnage
public double getFuelTonnage()Returns the mass of the fuel, which is used for calculating operating range. For combat vehicles this is considered part of the engine weight. For support vehicles it is in addition to the engine weight.- Returns:
- fuel tonnage
-
setFuelTonnage
public void setFuelTonnage(double fuel) Sets the fuel mass for support vehicles. Has no effect on combat vehicles.- Parameters:
fuel
- The mass of the fuel in tons
-
operatingRange
public int operatingRange()Calculates the operating range of the vehicle based on engine type and fuel mass. Vehicles that do not require fuel report an operating range ofInteger.MAX_VALUE
.- Returns:
- The vehicle's operating range in km
-
fuelTonnagePer100km
public double fuelTonnagePer100km()Calculates fuel mass based on engine type and mass. Engines that do not require allocating fuel mass return a value of 0.0.- Returns:
- The fuel mass required for every 100 km of vehicle range.
-
getICEFuelType
The type of fuel for internal combustion engines. This has no meaning for other engine types.- Returns:
- The ICE fuel type
-
setICEFuelType
-
setHullDown
public void setHullDown(boolean down) Tanks go Hull Down slightly differently, this method accounts for this- Overrides:
setHullDown
in classEntity
- See Also:
-
isBackedIntoHullDown
public boolean isBackedIntoHullDown()Returns True if this tank moved backwards before going Hull Down- Returns:
-
getEntityType
public long getEntityType()- Specified by:
getEntityType
in classEntity
-
isEjectionPossible
public boolean isEjectionPossible()- Overrides:
isEjectionPossible
in classEntity
-
getBaseChassisTurretWeight
public double getBaseChassisTurretWeight()Used for omni vehicles, which must set the weight of turrets the base chassis, limiting the amount of pod space in the turret.- Returns:
- The weight of the primary turret
-
setBaseChassisTurretWeight
public void setBaseChassisTurretWeight(double baseChassisTurretWeight) Sets the fixed weight of the primary turret on a dual-turret omnivehicle.- Parameters:
baseChassisTurretWeight
- The weight of the turret
-
getBaseChassisTurret2Weight
public double getBaseChassisTurret2Weight()Used for omni vehicles, which must set the weight of turrets the base chassis, limiting the amount of pod space in the turret.- Returns:
- The weight of the second turret
-
setBaseChassisTurret2Weight
public void setBaseChassisTurret2Weight(double baseChassisTurret2Weight) Sets the fixed weight of the second turret on a dual-turret omnivehicle.- Parameters:
baseChassisTurret2Weight
- The weight of the turret
-
getBaseChassisSponsonPintleWeight
public double getBaseChassisSponsonPintleWeight()Used for omni vehicles, which must set the weight of sponson or pintle mounts in the base chassis, limiting the amount of pod space in the turret(s).- Returns:
- The weight of any pintle mounts (small support vee) or sponson mounts (combat vee and M/L support vee)
-
setBaseChassisSponsonPintleWeight
public void setBaseChassisSponsonPintleWeight(double baseChassisSponsonPintleWeight) Sets the fixed weight of any pintle (small SV) or sponson (CV, M/L SV) turrets on an omnivehicle.- Parameters:
baseChassisSponsonPintleWeight
- The weight of the sponson/pintle turrets.
-
hasNoControlSystems
public boolean hasNoControlSystems() -
setHasNoControlSystems
public void setHasNoControlSystems(boolean hasNoControlSystems) -
getSpriteDrawPriority
public int getSpriteDrawPriority()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 classEntity
- Returns:
-
isTrailer
public boolean isTrailer()Used to determine if this vehicle can be towed by a tractor -
setTrailer
public void setTrailer(boolean trailer) Marks whether the tank is constructed as a trailer. This has no effect on support vehicles, which determine trailer status by the trailer chassis modification.- Parameters:
trailer
- Whether the tank is constructed as a trailer.
-
isTractor
public boolean isTractor()Used to determine if this vehicle can be the engine/tractor for a bunch of trailers -
isCombatVehicle
public boolean isCombatVehicle()Description copied from interface:BTObject
Returns true when this object is a ground Combat Vehicle, including VTOL but not including Support Vehicles, or of type CV for Alpha Strike. Returns false for any type of unit group even if it is of the right type.- Returns:
- True when this is a ground Combat Vehicle (not including Support Vehicle)
-
getsAutoExternalSearchlight
public boolean getsAutoExternalSearchlight()- Overrides:
getsAutoExternalSearchlight
in classEntity
- Returns:
- True for unit types that have an automatic external searchlight (Meks and Tanks).
-
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 classEntity
- Returns:
- The generic Battle value for this unit based on its tonnage and type
-
isSideLocation
public boolean isSideLocation(int location) - Parameters:
location
- The location to check- Returns:
- True when the given location is a side location, i.e. left, right or, on superheavy units, front or rear left/right.
-