megamek.common
Class Tank

java.lang.Object
  extended by megamek.common.TurnOrdered
      extended by megamek.common.Entity
          extended by megamek.common.Tank
All Implemented Interfaces:
java.io.Serializable, RoundUpdated, Targetable, Transporter
Direct Known Subclasses:
GunEmplacement, SupportTank, VTOL

public class Tank
extends Entity

You know what tanks are, silly.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class megamek.common.Entity
Entity.EntityFluff
 
Field Summary
static int CRIT_AMMO
           
static int CRIT_CARGO
           
static int CRIT_COMMANDER
           
static int CRIT_CREW_KILLED
           
static int CRIT_CREW_STUNNED
           
static int CRIT_DRIVER
           
static int CRIT_ENGINE
           
static int CRIT_FUEL_TANK
           
static int CRIT_NONE
           
static int CRIT_SENSOR
           
static int CRIT_STABILIZER
           
static int CRIT_TURRET_DESTROYED
           
static int CRIT_TURRET_JAM
           
static int CRIT_TURRET_LOCK
           
static int CRIT_WEAPON_DESTROYED
           
static int CRIT_WEAPON_JAM
           
protected  boolean engineHit
           
static int LOC_BODY
           
static int LOC_FRONT
           
static int LOC_LEFT
           
static int LOC_REAR
           
static int LOC_RIGHT
           
static int LOC_TURRET
           
protected  boolean m_bHasNoTurret
           
protected  boolean m_bTurretEverJammed
           
protected  boolean m_bTurretJammed
           
protected  boolean m_bTurretLocked
           
protected  int movementDamage
           
 
Fields inherited from class megamek.common.Entity
_isEMId, altitude, ammoList, armorTechLevel, armorType, armsFlipped, aTracker, battleForceDebugString, BATTLEFORCEEXTREMERANGE, BATTLEFORCELONGRANGE, BATTLEFORCEMEDIUMRANGE, battleForceMinRangeModifier, BATTLEFORCESHORTRANGE, battleForceToHitModifier, bombList, bvText, c3CompanyMasterIndex, c3Master, c3NetIdString, canUnstickByJumping, carcass, chassis, crew, crits, damageThisPhase, damageThisRound, DEBUGBATTLEFORCE, delta_distance, designValid, destroyed, displacementAttack, displayName, dodging, done, doomed, duplicateMarker, elevation, endColumn, endRow, endTable, engine, engineHitsThisRound, equipmentList, externalId, facing, failedEquipmentList, findingClub, fluff, game, gotPavementBonus, GRAPPLE_BOTH, GRAPPLE_LEFT, GRAPPLE_RIGHT, hasSpotlight, heat, heatBuildup, heatFromExternal, heatSinkCoolantFailureFactor, hitThisRoundByAntiTSM, hullDown, id, illuminated, iNarcPods, infernos, inReverse, isCarefulStanding, isHidden, jumpMP, killerId, lastTarget, layingMines, LOC_DESTROYED, LOC_NONE, m_lNarcedBy, m_lPendingNarc, MAX_C3_NODES, miscList, mixedTech, model, moved, movementMode, mpUsed, mpUsedLastRound, narcPods, nl, NONE, omni, owner, ownerId, pendingINarcPods, pendingNarcPods, position, prone, reckless, rolledForEngineExplosion, sec_facing, secondaryPositions, shortName, shutDown, shutdownByBATaser, shutDownThisPhase, source, spotlightIsActive, spotting, startColumn, startRow, startTable, structureType, stuckInSwamp, taggedBy, taserFeedBackRounds, taserInterference, taserInterferenceRounds, taserShutdownRounds, techLevel, tmTracker, totalWeaponList, unjammingRAC, usedSearchlight, vectors, walkMP, weaponBayList, weaponGroupList, weaponList, weight, year
 
Fields inherited from interface megamek.common.Targetable
TYPE_BLDG_IGNITE, 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_INARC_POD, TYPE_MINEFIELD_CLEAR, TYPE_MINEFIELD_DELIVER, TYPE_SEARCHLIGHT
 
Constructor Summary
Tank()
           
 
Method Summary
 PilotingRollData addEntityBonuses(PilotingRollData prd)
          Add in any piloting skill mods
protected  void addEquipment(Mounted mounted, int loc, boolean rearMounted)
           
 void addJammedWeapon(Mounted weapon)
           
 void addMovementDamage(int level)
          adds minor, moderate or heavy movement system damage
 void applyDamage()
          Applies any damage that the entity has suffered.
 void autoSetInternal()
          Set the internal structure to the appropriate value for the mech's weight class
 int calculateBattleValue()
          Calculates the battle value of this mech
 int calculateBattleValue(boolean ignoreC3, boolean ignorePilot)
          Calculates the battle value of this tank
 boolean canChangeSecondaryFacing()
          Can this entity change secondary facing at all?
 boolean canCharge()
          Whether this type of unit can perform charges
 boolean canDFA()
          Whether this type of unit can perform DFA attacks
 boolean canGoHullDown()
           
 boolean canSpot()
          Tanks can't spot when stunned.
 int clipSecondaryFacing(int n)
          Returns the closest valid secondary facing to the given direction.
 boolean doomedInAtmosphere()
           
 boolean doomedInSpace()
           
 boolean doomedInVacuum()
           
 boolean doomedOnGround()
           
 void engineHit()
          apply the effects of an "engine hit" crit
 void extinguishAll()
          extinguish all inferno fire on this Tank
 void extinguishLocation(int location)
           
 int getArmorType()
           
 double getCost(boolean ignoreAmmo)
           
 int getCriticalEffect(int roll, int loc)
          get the type of critical caused by a critical roll, taking account of existing damage
 int getDependentLocation(int loc)
          Gets the location that is destroyed recursively
 int getEngineCritHeat()
          Returns extra heat generated by engine crits
 int getForwardArc()
          see Entity.getForwardArc()
 int getHeatCapacity()
          Returns the amount of heat that the entity can sink each turn.
 int getHeatCapacityWithWater()
          Returns the amount of heat that the entity can sink each turn, factoring in whether the entity is standing in water.
 int getHQIniBonus()
           
 java.util.ArrayList<Mounted> getJammedWeapons()
           
 java.lang.String[] getLocationAbbrs()
           
 java.lang.String[] getLocationNames()
           
 int getMaxElevationChange()
          The maximum elevation change the entity can cross
 int getMaxElevationDown()
          by default, entities can move as far down as they can move up
 java.lang.String getMovementAbbr(EntityMovementType mtype)
          Returns the name of the type of movement used.
 java.lang.String getMovementString(EntityMovementType mtype)
          Returns the name of the type of movement used.
 int[] getNoOfSlots()
           
 int getRearArc()
          see Entity.getRearArc()
 int getRunMPwithoutMASC(boolean gravity, boolean ignoreheat)
          Tanks don't have MASC
 int getSensorHits()
           
 int getStructureType()
           
 int getStunnedTurns()
           
 int getSuspensionFactor()
           
 int getTotalCommGearTons()
           
 HitData getTransferLocation(HitData hit)
          Gets the location that excess damage transfers to
 int getWalkMP(boolean gravity, boolean ignoreheat)
          Returns this entity's walking/cruising mp, factored for heat, extreme temperatures, and gravity.
 int getWeaponArc(int wn)
          Returns the Compute.ARC that the weapon fires into.
 boolean hasArmoredEngine()
           
 boolean hasModularArmor()
           
 boolean hasModularArmor(int loc)
           
 boolean hasMovementDamage()
           
 boolean hasNoTurret()
           
 boolean hasRearArmor(int loc)
          Does this location have rear armor?
 void immobilize()
           
 boolean isCommanderHit()
           
 boolean isCommanderHitPS()
           
 boolean isCrewHitPS()
           
 boolean isDriverHit()
           
 boolean isDriverHitPS()
           
 boolean isHexProhibited(IHex hex)
          Tanks have all sorts of prohibited terrain.
 boolean isImmobile()
          Is this entity shut down or is the crew unconscious?
 boolean isInfernoFire()
           
 boolean isLocationBurning(int location)
           
 boolean isMovementHit()
           
 boolean isMovementHitPending()
           
 boolean isNuclearHardened()
          Checks if the unit is hardened agaist nuclear strikes.
 boolean isOnFire()
           
 boolean isRepairable()
          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 isStabiliserHit(int loc)
           
 boolean isStealthActive()
          Determine if this unit has an active and working stealth system.
 boolean isStealthOn()
          Determine if this unit has an active and working stealth system.
 boolean isTurretEverJammed()
           
 boolean isTurretJammed()
           
 boolean isTurretLocked()
           
 boolean isValidSecondaryFacing(int n)
          Can this entity torso/turret twist the given direction?
 void jamTurret()
           
 int locations()
          Returns the number of locations in the entity
 void lockTurret()
           
 void newRound(int roundNumber)
          Start a new round
 void resetMovementDamage()
           
 void restore()
          Restores the entity after serialization
 HitData rollHitLocation(int table, int side)
          Rolls up a hit location
 HitData rollHitLocation(int table, int side, int aimedLocation, int aimingMode)
          Rolls up a hit location
 void setArmorType(int type)
           
 void setCommanderHit(boolean hit)
           
 void setCommanderHitPS(boolean hit)
           
 void setCrewHitPS(boolean hit)
           
 void setDriverHit(boolean hit)
           
 void setDriverHitPS(boolean hit)
           
 void setEngine(Engine e)
           
 void setFacing(int facing)
          Sets the primary facing.
 void setHasNoTurret(boolean b)
           
 void setOmni(boolean omni)
          OmniVehicles have handles for Battle Armor squads to latch onto.
 void setOnFire(boolean inferno)
           
 void setSecondaryFacing(int sec_facing)
          Sets the secondary facing.
 void setSensorHits(int hits)
           
 void setStabiliserHit(int loc)
           
 void setStructureType(int type)
           
 void setStunnedTurns(int turns)
           
 void stunCrew()
           
 void unjamTurret()
           
 void unlockTurret()
           
 java.util.Vector<Report> victoryReport()
          Generates a vector containing reports on all useful information about this entity.
 
Methods inherited from class megamek.common.Entity
absHeight, addBomb, addBomb, addConditionBonuses, addCoolantFailureAmount, addCritical, addCritical, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addFailedEquipment, addKill, addPassedThrough, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addTargetedBySwarm, addTransporter, addWeaponGroup, applyGravityEffectsOnMP, applySantaAnna, armorStringFor, assignAMS, attachINarcPod, attachNarcPod, baTaserShutdown, C3MasterIs, calcElevation, calcElevation, calculateFreeC3MNodes, calculateFreeC3Nodes, canAssaultDrop, canAssist, canFlee, canFlipArms, canGoDown, canGoDown, canGoUp, canLayMine, canLoad, canLoad, canRam, canTransferCriticals, canUnjamRAC, canUnstickByJumping, checkBogDown, checkDislodgeSwarmers, checkGetUp, checkLandingInHeavyWoods, checkLandingOnIce, checkLandingWithDamage, checkMovedTooFast, checkMovementInBuilding, checkRecklessMove, checkRubbleMove, checkRunningWithDamage, checkSideSlip, checkSkid, checkSprintingWithMASC, checkSprintingWithSupercharger, checkUnstall, checkWaterMove, checkWaterMove, chooseSide, clearQuirks, climbMode, countQuirks, countQuirks, countWorkingMisc, damageBayDoor, damageDockCollar, damageDoorRecovery, decodeTransporters, deployOffBoard, destroy, destroyLocation, destroyRetractableBlade, doCheckEngineStallRoll, elevationOccupied, encodeTransporters, entityIsBiped, entityIsQuad, equals, extendBlade, findTargetedDisplacement, fixElevation, generateDisplayName, generateShortName, getActiveSensor, getActiveUMUCount, getActiveVibrobladeHeat, getAllUMUCount, getAltitude, getAmmo, getArmor, getArmor, getArmor, getArmorRemainingPercent, getArmorString, getArmorString, getArmorTechLevel, getArmorWeight, getArmsFlipped, getBadCriticals, getBAPRange, getBARRating, getBasePilotingRoll, getBasePilotingRoll, getBattleForceArmorPoints, getBattleForceDamageThresholdString, getBattleForceJumpPoints, getBattleForceMovement, getBattleForceMovementPoints, getBattleForceOverHeatValue, getBattleForcePoints, getBattleForceSize, getBattleForceSpecialAbilites, getBattleForceStandardWeaponsDamage, getBattleForceStandardWeaponsDamage, getBattleForceStandardWeaponsDamage, getBattleForceStandardWeaponsDamage, getBattleForceStructurePoints, getBattleForceTotalHeatGeneration, getBayByAmmo, getBayLoadedUnits, getBlueShieldRounds, getBombLoadout, getBombs, getBombs, getBVText, getC3Master, getC3MasterId, getC3NetId, getC3Top, getCargoMpReduction, getChassis, getClubs, getCoolantFailureAmount, getCrew, getCritical, getDamageReductionFromModularArmor, getDeployRound, getDisplacementAttack, getDisplayName, getDocks, getDroppableUnits, getECCMStrength, getECMRange, getECMStrength, getElevation, getEmptyCriticals, getEngine, getEquipment, getEquipment, getEquipmentNum, getEquipmentType, getEvasionBonus, getExteriorUnitAt, getExternalId, getExternalUnits, getExtraCommGearTons, getExtremeRangeModifier, getFacing, getFailedEquipment, getFighterBays, getFighterLaunchRate, getFirstBay, getFirstWeapon, getFluff, getGame, getGaveKillCredit, getGhostTargetOverride, getGhostTargetRoll, getGhostTargetRollMoS, getGoodCriticals, getGoodCriticals, getGrappled, getGrappleSide, getGyroType, getHeading, getHeatFiringModifier, getHeatInArc, getHeatMPReduction, getHeight, getHitCriticals, getHittableCriticals, getId, getINarcPodsAttached, getInternal, getInternal, getInternalRemainingPercent, getInternalString, getJumpHeat, getJumpMP, getJumpMP, getJumpMPWithTerrain, getJumpType, getKillNumber, getKills, getLastTarget, getLaunchableFighters, getLaunchableSmallCraft, getLoadedBay, getLoadedFighters, getLoadedSmallCraft, getLoadedUnits, getLocationAbbr, getLocationAbbr, getLocationFromAbbr, getLocationName, getLocationName, getLocationStatus, getLongRangeModifier, getMDIniBonus, getMediumRangeModifier, getMisc, getModel, getMovementBeforeSkidPSRModifier, getMovementMode, getMovementModeAsBattleForceString, getMovementModeAsString, getNextSensor, getNextWeapon, getNumberOf, getNumberOfCriticals, getNumberOfCriticals, getNumberOfCriticals, getNumberOfCriticals, getNumberOfShields, getOArmor, getOArmor, getOArmor, getOffBoardDirection, getOffBoardDistance, getOInternal, getOInternal, getOriginalJumpMP, getOriginalRunMP, getOriginalSprintMP, getOriginalWalkMP, getOwner, getOwnerId, getPassedThrough, getPickedUpMechWarriors, getPosition, getPriorPosition, getQuirkIniBonus, getQuirkList, getQuirks, getRecoveryTurn, getRemovalCondition, getRetreatedDirection, getRunHeat, getRunMP, getRunMP, getRunMPasString, getRunMPwithoutMASC, getRunningGravityLimit, getSecondaryFacing, getSecondaryPositions, getSensorCheck, getSensorDesc, getSensors, getShortName, getShortNameRaw, getShortRangeModifier, getSmallCraftBays, getSmallCraftLaunchRate, getSource, getSpotTargetId, getSprintHeat, getSprintMP, getSprintMP, getSprintMPasString, getSprintMPwithoutMASC, getSprintMPwithoutMASC, getStandingHeat, getStartingPos, getStealthModifier, getSwarmAttackerId, getSwarmTargetId, getTaggedBy, getTargetedBySwarm, getTargetId, getTargetType, getTaserFeedBackRounds, getTaserInterference, getTaserInterferenceRounds, getTaserShutdownRounds, getTechLevel, getTMTracker, getTotalAmmoOfType, getTotalArmor, getTotalInternal, getTotalMunitionsOfType, getTotalOArmor, getTotalOInternal, getTotalWeaponList, getTransferLocation, getTransportBays, getTransportId, getTransports, getTroopCarryingSpace, getTrooperAtLocation, getUnitNumber, getUnusedString, getVector, getVectors, getVelocity, getVibroClaws, getWalkHeat, getWalkMP, getWeaponBayList, getWeaponGroupList, getWeaponList, getWeapons, getWeaponsAndEquipmentCost, getWeaponsAndEquipmentCost, getWeight, getWeightClass, getWeightClassName, getYear, hasActiveAngelECCM, hasActiveAngelECM, hasActiveBlueShield, hasActiveECCM, hasActiveECM, hasActiveECM, hasActiveEiCockpit, hasActiveShield, hasActiveShield, hasAimModeTargComp, hasArcFired, hasArmoredChassis, hasBAP, hasBAP, hasBARArmor, hasBattleArmorHandles, hasC3, hasC3i, hasC3M, hasC3MM, hasC3S, hasCASEII, hasCASEII, hasDisplacementAttack, hasEiCockpit, hasEnvironmentalSealing, hasFunctionalArmAES, hasFunctionalLegAES, hasGhostTargets, hasHipCrit, hasINarcPodsAttached, hasInfernoAmmo, hasLegActuatorCrit, hasLinkedMGA, hasNoDefenseShield, hasPassiveShield, hasPassiveShield, hasShield, hasSpotlight, hasStealth, hasSystem, hasTAG, hasTargComp, hasUMU, hasVibroblades, hasWorkingMisc, hasWorkingMisc, hasWorkingMisc, hasWorkingMisc, hasWorkingSystem, hasWorkingWeapon, hasWorkingWeapon, hasWorkingWeapon, hasWorkingWeapon, height, hitAllCriticals, illuminateTarget, initializeArmor, initializeInternal, isActive, isActive, isAirborne, isAirborneVTOL, isAssaultDropInProgress, isAttackingThisTurn, isBATaserShutdown, isBoardProhibited, isCanon, isCapitalFighter, isCapitalScale, isCaptured, isCarcass, isCarefulStand, isChameleonShieldActive, isCharging, isClan, isClanArmor, isClearingMinefield, isCommander, isDeployed, isDesignValid, isDestroyed, isDone, isDoomed, isDropping, isElevationValid, isEligibleFor, isEligibleForFiring, isEligibleForMovement, isEligibleForOffboard, isEligibleForPhysical, isEligibleForTargetingPhase, isEnemyOf, isEvading, isFighter, isFindingClub, isGrappleAttacker, isHidden, isHullDown, isIlluminated, isINarcedBy, isINarcedWith, isLargeCraft, isLayingMines, isLoadableThisTurn, isLocationBad, isLocationDoomed, isMakingDfa, isMilitary, isMixedTech, isNarcedBy, isNOE, isNullSigActive, isOffBoard, isOmni, isOnSameSheet, isPartOfFighterSquadron, isProne, isPushing, isRamming, isReckless, isSalvage, isSeenByEnemy, isSelectableThisTurn, isShutDown, isShutDownThisPhase, isSpotting, isStalled, isStuck, isSufferingEMI, isSurfaceNaval, isSystemRepairable, isTargetable, isTargetOfDisplacementAttack, isUnjammingRAC, isUnloadedThisTurn, isUsingManAce, isUsingSpotlight, isVisibleToEnemy, isVoidSigActive, isWeaponBlockedAt, itemOppositeTech, load, load, loadAllWeapons, loadedUnitsHaveActiveECM, loadWeapon, loadWeapon, loadWeaponWithSameAmmo, loadWeaponWithSameAmmo, locationHasCase, locationIsLeg, needsRollToStand, onSameC3NetworkAs, onSameC3NetworkAs, passedThrough, passedThroughPrevious, passedWithin, pickUp, printDebugToFile, recover, refreshLocations, reloadEmptyWeapons, removeAllINarcPods, removeAllTransporters, removeCriticals, removeINarcPod, removeMisc, removePartialCoverHits, resetBayDoors, resetFiringArcs, rollMovementInBuilding, setAltitude, setArcFired, setArmor, setArmor, setArmor, setArmorTechLevel, setArmorType, setArmsFlipped, setAssaultDropInProgress, setBATaserShutdown, setC3Master, setC3Master, setC3NetId, setCanon, setCanUnstickByJumping, setCaptured, setCarcass, setCarefulStand, setChassis, setClearingMinefield, setClimbMode, setCommander, setCrew, setCritical, setDeployed, setDeployRound, setDesignValid, setDestroyed, setDisplacementAttack, setDone, setDoomed, setElevation, setEMI, setEvading, setExternalId, setFindingClub, setGame, setGameOptions, setGrappled, setGrappleSide, setHidden, setHullDown, setId, setIlluminated, setInternal, setInternal, setLandedAssaultDrop, setLastTarget, setLayingMines, setLocationStatus, setMixedTech, setModel, setMovementMode, setNextSensor, setOffBoard, setOriginalJumpMP, setOriginalWalkMP, setOwner, setPassedThrough, setPosition, setProne, setQuirks, setRamming, setRapidFire, setReckless, setRecoveryTurn, setRemovalCondition, setRetreatedDirection, setSalvage, setSeenByEnemy, setShutDown, setShutDownThisPhase, setSource, setSpotlight, setSpotlightState, setSpotTargetId, setSpotting, setStartingPos, setStructureType, setStuck, setSwarmAttackerId, setSwarmTargetId, setTaggedBy, setTaserFeedback, setTaserInterference, setTaserShutdownRounds, setTechLevel, setTransportId, setUnitNumber, setUnjammingRAC, setUnloaded, setUsedSearchlight, setVectors, setVisibleToEnemy, setWeaponHit, setWeight, setYear, shouldDeploy, sideTable, sideTable, sideTable, statusToString, statusToString, statusToString, toString, unload, updateBays, usedSearchlight, usedTag, usesWeaponBays, weaponFiredFrom, whichBay
 
Methods inherited from class megamek.common.TurnOrdered
clearInitiative, generateTurnOrder, getAeroTurns, getDropshipTurns, getEvenTurns, getInitiative, getJumpshipTurns, getMultiTurns, getNormalTurns, getOtherTurns, getSmallCraftTurns, getSpaceStationTurns, getWarshipTurns, incrementAeroTurns, incrementDropshipTurns, incrementEvenTurns, incrementJumpshipTurns, incrementMultiTurns, incrementOtherTurns, incrementSmallCraftTurns, incrementSpaceStationTurns, incrementWarshipTurns, resetAeroTurns, resetDropshipTurns, resetEvenTurns, resetJumpshipTurns, resetMultiTurns, resetOtherTurns, resetSmallCraftTurns, resetSpaceStationTurns, resetWarshipTurns, rollInitAndResolveTies, rollInitiative
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_bHasNoTurret

protected boolean m_bHasNoTurret

m_bTurretLocked

protected boolean m_bTurretLocked

m_bTurretJammed

protected boolean m_bTurretJammed

m_bTurretEverJammed

protected boolean m_bTurretEverJammed

movementDamage

protected int movementDamage

engineHit

protected boolean engineHit

LOC_BODY

public static final int LOC_BODY
See Also:
Constant Field Values

LOC_FRONT

public static final int LOC_FRONT
See Also:
Constant Field Values

LOC_RIGHT

public static final int LOC_RIGHT
See Also:
Constant Field Values

LOC_LEFT

public static final int LOC_LEFT
See Also:
Constant Field Values

LOC_REAR

public static final int LOC_REAR
See Also:
Constant Field Values

LOC_TURRET

public static final int LOC_TURRET
See Also:
Constant Field Values

CRIT_NONE

public static final int CRIT_NONE
See Also:
Constant Field Values

CRIT_DRIVER

public static final int CRIT_DRIVER
See Also:
Constant Field Values

CRIT_WEAPON_JAM

public static final int CRIT_WEAPON_JAM
See Also:
Constant Field Values

CRIT_WEAPON_DESTROYED

public static final int CRIT_WEAPON_DESTROYED
See Also:
Constant Field Values

CRIT_STABILIZER

public static final int CRIT_STABILIZER
See Also:
Constant Field Values

CRIT_SENSOR

public static final int CRIT_SENSOR
See Also:
Constant Field Values

CRIT_COMMANDER

public static final int CRIT_COMMANDER
See Also:
Constant Field Values

CRIT_CREW_KILLED

public static final int CRIT_CREW_KILLED
See Also:
Constant Field Values

CRIT_CREW_STUNNED

public static final int CRIT_CREW_STUNNED
See Also:
Constant Field Values

CRIT_CARGO

public static final int CRIT_CARGO
See Also:
Constant Field Values

CRIT_ENGINE

public static final int CRIT_ENGINE
See Also:
Constant Field Values

CRIT_FUEL_TANK

public static final int CRIT_FUEL_TANK
See Also:
Constant Field Values

CRIT_AMMO

public static final int CRIT_AMMO
See Also:
Constant Field Values

CRIT_TURRET_JAM

public static final int CRIT_TURRET_JAM
See Also:
Constant Field Values

CRIT_TURRET_LOCK

public static final int CRIT_TURRET_LOCK
See Also:
Constant Field Values

CRIT_TURRET_DESTROYED

public static final int CRIT_TURRET_DESTROYED
See Also:
Constant Field Values
Constructor Detail

Tank

public Tank()
Method Detail

getLocationAbbrs

public java.lang.String[] getLocationAbbrs()
Specified by:
getLocationAbbrs in class Entity

getLocationNames

public java.lang.String[] getLocationNames()
Specified by:
getLocationNames in class Entity

hasNoTurret

public boolean hasNoTurret()

setHasNoTurret

public void setHasNoTurret(boolean b)

getWalkMP

public int getWalkMP(boolean gravity,
                     boolean ignoreheat)
Returns this entity's walking/cruising mp, factored for heat, extreme temperatures, and gravity.

Overrides:
getWalkMP in class Entity
Parameters:
gravity - Should the movement be factored for gravity
ignoreheat - Should heat be ignored?

isTurretLocked

public boolean isTurretLocked()

isTurretJammed

public boolean isTurretJammed()

locations

public int locations()
Returns the number of locations in the entity

Specified by:
locations in class Entity

canChangeSecondaryFacing

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

Specified by:
canChangeSecondaryFacing in class Entity

isValidSecondaryFacing

public boolean isValidSecondaryFacing(int n)
Description copied from class: Entity
Can this entity torso/turret twist the given direction?

Specified by:
isValidSecondaryFacing in class Entity

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 class Entity
Returns:
the the closest valid secondary facing.

setSecondaryFacing

public void setSecondaryFacing(int sec_facing)
Description copied from class: Entity
Sets the secondary facing.

Overrides:
setSecondaryFacing in class Entity

setFacing

public void setFacing(int facing)
Description copied from class: Entity
Sets the primary facing.

Overrides:
setFacing in class Entity

isStabiliserHit

public boolean isStabiliserHit(int loc)

setStabiliserHit

public void setStabiliserHit(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)

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()

isMovementHitPending

public boolean isMovementHitPending()

immobilize

public void immobilize()

isImmobile

public boolean isImmobile()
Description copied from class: Entity
Is this entity shut down or is the crew unconscious?

Specified by:
isImmobile in interface Targetable
Overrides:
isImmobile in class Entity
Returns:
true if the target is immobile (-4 to hit)

isHexProhibited

public boolean isHexProhibited(IHex hex)
Tanks have all sorts of prohibited terrain.

Overrides:
isHexProhibited in class Entity

lockTurret

public void lockTurret()

jamTurret

public void jamTurret()

unjamTurret

public void unjamTurret()

isTurretEverJammed

public boolean isTurretEverJammed()

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 class Entity

newRound

public void newRound(int roundNumber)
Description copied from class: Entity
Start a new round

Specified by:
newRound in interface RoundUpdated
Overrides:
newRound in class Entity
Parameters:
roundNumber - the int number of the new round

getMovementString

public java.lang.String getMovementString(EntityMovementType mtype)
Returns the name of the type of movement used. This is tank-specific.

Specified by:
getMovementString in class Entity

getMovementAbbr

public java.lang.String getMovementAbbr(EntityMovementType mtype)
Returns the name of the type of movement used. This is tank-specific.

Specified by:
getMovementAbbr in class Entity

hasRearArmor

public boolean hasRearArmor(int loc)
Description copied from class: Entity
Does this location have rear armor?

Specified by:
hasRearArmor in class Entity

getWeaponArc

public int getWeaponArc(int wn)
Returns the Compute.ARC that the weapon fires into.

Specified by:
getWeaponArc in class Entity

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 class Entity

rollHitLocation

public HitData rollHitLocation(int table,
                               int side,
                               int aimedLocation,
                               int aimingMode)
Rolls up a hit location

Specified by:
rollHitLocation in class Entity

rollHitLocation

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

Specified by:
rollHitLocation in class Entity

getTransferLocation

public HitData getTransferLocation(HitData hit)
Gets the location that excess damage transfers to

Specified by:
getTransferLocation in class Entity

getDependentLocation

public int getDependentLocation(int loc)
Gets the location that is destroyed recursively

Specified by:
getDependentLocation in class Entity

calculateBattleValue

public int calculateBattleValue()
Calculates the battle value of this mech

Specified by:
calculateBattleValue in class Entity

calculateBattleValue

public int calculateBattleValue(boolean ignoreC3,
                                boolean ignorePilot)
Calculates the battle value of this tank

Overrides:
calculateBattleValue in class Entity
Parameters:
ignoreC3 - if the contribution of the C3 computer should be ignored when calculating BV.
ignorePilot - if the extra BV due to piloting skill should be ignore, needed for c3 bv

addEntityBonuses

public PilotingRollData addEntityBonuses(PilotingRollData prd)
Description copied from class: Entity
Add in any piloting skill mods

Specified by:
addEntityBonuses in class Entity

victoryReport

public java.util.Vector<Report> victoryReport()
Description copied from class: Entity
Generates a vector containing reports on all useful information about this entity.

Specified by:
victoryReport in class Entity

getNoOfSlots

public int[] getNoOfSlots()
Specified by:
getNoOfSlots in class Entity

getRunMPwithoutMASC

public int getRunMPwithoutMASC(boolean gravity,
                               boolean ignoreheat)
Tanks don't have MASC

Specified by:
getRunMPwithoutMASC in class Entity

getHeatCapacity

public int getHeatCapacity()
Description copied from class: Entity
Returns the amount of heat that the entity can sink each turn.

Specified by:
getHeatCapacity in class Entity

getHeatCapacityWithWater

public int getHeatCapacityWithWater()
Description copied from class: Entity
Returns the amount of heat that the entity can sink each turn, factoring in whether the entity is standing in water.

Specified by:
getHeatCapacityWithWater in class Entity

getEngineCritHeat

public int getEngineCritHeat()
Description copied from class: Entity
Returns extra heat generated by engine crits

Specified by:
getEngineCritHeat in class Entity

autoSetInternal

public void autoSetInternal()
Description copied from class: Entity
Set the internal structure to the appropriate value for the mech's weight class

Specified by:
autoSetInternal in class Entity

getMaxElevationChange

public int getMaxElevationChange()
Description copied from class: Entity
The maximum elevation change the entity can cross

Specified by:
getMaxElevationChange in class Entity

getMaxElevationDown

public int getMaxElevationDown()
Description copied from class: Entity
by default, entities can move as far down as they can move up

Overrides:
getMaxElevationDown in class Entity

isRepairable

public boolean isRepairable()
Determine if the unit can be repaired, or only harvested for spares.

Overrides:
isRepairable in class Entity
Returns:
A boolean that is true if the unit can be repaired (given enough time and parts); if this value is false, the unit is only a source of spares.
See Also:
Entity.isSalvage()

restore

public void restore()
Restores the entity after serialization

Overrides:
restore in class Entity

canCharge

public boolean canCharge()
Description copied from class: Entity
Whether this type of unit can perform charges

Overrides:
canCharge in class Entity

canDFA

public boolean canDFA()
Description copied from class: Entity
Whether this type of unit can perform DFA attacks

Overrides:
canDFA in class Entity

getArmorType

public int getArmorType()
Overrides:
getArmorType in class Entity

setArmorType

public void setArmorType(int type)
Overrides:
setArmorType in class Entity

getStructureType

public int getStructureType()
Overrides:
getStructureType in class Entity

setStructureType

public void setStructureType(int type)
Overrides:
setStructureType in class Entity

getSuspensionFactor

public int getSuspensionFactor()
Returns:
suspension factor of vehicle

getCost

public double getCost(boolean ignoreAmmo)
Specified by:
getCost in class Entity

doomedInVacuum

public boolean doomedInVacuum()
Specified by:
doomedInVacuum in class Entity

doomedOnGround

public boolean doomedOnGround()
Specified by:
doomedOnGround in class Entity

doomedInAtmosphere

public boolean doomedInAtmosphere()
Specified by:
doomedInAtmosphere in class Entity

doomedInSpace

public boolean doomedInSpace()
Specified by:
doomedInSpace in class Entity

canGoHullDown

public boolean canGoHullDown()
Overrides:
canGoHullDown in class Entity

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 - a int representing minor damage (1), moderate damage (2), or heavy damage (3)

setEngine

public void setEngine(Engine e)

isNuclearHardened

public boolean isNuclearHardened()
Description copied from class: Entity
Checks if the unit is hardened agaist nuclear strikes.

Specified by:
isNuclearHardened in class Entity
Returns:
true if this is a hardened unit.

addEquipment

protected void addEquipment(Mounted mounted,
                            int loc,
                            boolean rearMounted)
                     throws LocationFullException
Overrides:
addEquipment in class Entity
Throws:
LocationFullException

getCriticalEffect

public int getCriticalEffect(int roll,
                             int loc)
get the type of critical caused by a critical roll, taking account of existing damage

Parameters:
roll - the final dice roll
loc - the hit location
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)

Overrides:
setOmni in class Entity

canSpot

public boolean canSpot()
Tanks can't spot when stunned.

Overrides:
canSpot in class Entity
Returns:
true, if the entity is active

addJammedWeapon

public void addJammedWeapon(Mounted weapon)

getJammedWeapons

public java.util.ArrayList<Mounted> getJammedWeapons()

engineHit

public void engineHit()
apply the effects of an "engine hit" crit


hasModularArmor

public boolean hasModularArmor()
Overrides:
hasModularArmor in class Entity

hasModularArmor

public boolean hasModularArmor(int loc)
Overrides:
hasModularArmor in class Entity

getTotalCommGearTons

public int getTotalCommGearTons()
Specified by:
getTotalCommGearTons in class Entity
Returns:
the total tonnage of communications gear in this entity

getHQIniBonus

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

hasArmoredEngine

public boolean hasArmoredEngine()
Overrides:
hasArmoredEngine in class Entity

getForwardArc

public int getForwardArc()
see Entity.getForwardArc()

Overrides:
getForwardArc in class Entity

getRearArc

public int getRearArc()
see Entity.getRearArc()

Overrides:
getRearArc in class Entity

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 class Entity
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 class Entity
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.