megamek.common
Class Mech

java.lang.Object
  extended by megamek.common.TurnOrdered
      extended by megamek.common.Entity
          extended by megamek.common.Mech
All Implemented Interfaces:
java.io.Serializable, RoundUpdated, Targetable, Transporter
Direct Known Subclasses:
BipedMech, QuadMech

public abstract class Mech
extends Entity
implements java.io.Serializable

You know what mechs are, silly.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class megamek.common.Entity
Entity.EntityFluff
 
Field Summary
static int ACTUATOR_FOOT
           
static int ACTUATOR_HAND
           
static int ACTUATOR_HIP
           
static int ACTUATOR_LOWER_ARM
           
static int ACTUATOR_LOWER_LEG
           
static int ACTUATOR_SHOULDER
           
static int ACTUATOR_UPPER_ARM
           
static int ACTUATOR_UPPER_LEG
           
static int COCKPIT_AIMED_SHOT
           
static int COCKPIT_COMMAND_CONSOLE
           
static int COCKPIT_DUAL
           
static int COCKPIT_INDUSTRIAL
           
static int COCKPIT_OFF
           
static int COCKPIT_ON
           
static int COCKPIT_PRIMITIVE
           
static int COCKPIT_PRIMITIVE_INDUSTRIAL
           
static java.lang.String[] COCKPIT_SHORT_STRING
           
static int COCKPIT_SMALL
           
static int COCKPIT_STANDARD
           
static java.lang.String[] COCKPIT_STRING
           
static int COCKPIT_TORSO_MOUNTED
           
static int COCKPIT_UNKNOWN
           
static java.lang.String FULL_HEAD_EJECT_STRING
           
static int GYRO_COMPACT
           
static int GYRO_HEAVY_DUTY
           
static java.lang.String[] GYRO_SHORT_STRING
           
static int GYRO_STANDARD
           
static java.lang.String[] GYRO_STRING
           
static int GYRO_UNKNOWN
           
static int GYRO_XL
           
static int HAS_FALSE
           
static int HAS_TRUE
           
static int HAS_UNKNOWN
           
static int JUMP_BOOSTER
           
static int JUMP_DISPOSABLE
           
static int JUMP_IMPROVED
           
static int JUMP_NONE
           
static int JUMP_STANDARD
           
static int JUMP_UNKNOWN
           
static int LOC_CT
           
static int LOC_HEAD
           
static int LOC_LARM
           
static int LOC_LLEG
           
static int LOC_LT
           
static int LOC_RARM
           
static int LOC_RLEG
           
static int LOC_RT
           
static int NUM_MECH_LOCATIONS
           
static int SYSTEM_COCKPIT
           
static int SYSTEM_ENGINE
           
static int SYSTEM_GYRO
           
static int SYSTEM_LIFE_SUPPORT
           
static int SYSTEM_SENSORS
           
static java.lang.String[] systemNames
           
 
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
Mech()
          Construct a new, blank, mech.
Mech(int inGyroType, int inCockpitType)
           
 
Method Summary
 void addClanCase()
          Adds clan CASE in every location
 boolean addCockpit()
          Add the critical slots necessary for a standard cockpit.
 boolean addCommandConsole()
          Dual Cockpits need to be implemented everywhere except here.
 boolean addCompactGyro()
          Add the critical slots necessary for a compact gyro.
 void addCoolantFailureAmount(int amount)
           
 boolean addDualCockpit()
          Dual Cockpits need to be implemented everywhere except here.
 boolean addEngineCrits()
          Add the critical slots necessary for the mek's engine.
 void addEngineSinks(int totalSinks, boolean dblSinks)
          Adds heat sinks to the engine.
 void addEngineSinks(int totalSinks, boolean dblSinks, boolean clan)
          Adds heat sinks to the engine.
 void addEngineSinks(int totalSinks, java.lang.String sinkName)
          base for adding engine sinks.
 void addEngineSinks(java.lang.String sinkName, int toAllocate)
          add heat sinks into the engine
 PilotingRollData addEntityBonuses(PilotingRollData roll)
          Add in any piloting skill mods
 void addEquipment(Mounted mounted, int loc, boolean rearMounted)
          Mounts the specified weapon in the specified location.
 boolean addGyro()
          Add the critical slots necessary for a standard gyro.
 boolean addHeavyDutyGyro()
          Add the critical slots necessary for a heavy-duty gyro.
 boolean addIndustrialCockpit()
          Add the critical slots necessary for an industrial cockpit.
 boolean addIndustrialPrimitiveCockpit()
          Add the critical slots necessary for an industrial primitive cockpit.
 boolean addPrimitiveCockpit()
          Add the critical slots necessary for an industrial cockpit.
 boolean addSmallCockpit()
          Add the critical slots necessary for a small cockpit.
 boolean addTorsoMountedCockpit()
          Add the critical slots necessary for a torso-mounted cockpit.
 boolean addXLGyro()
          Add the critical slots necessary for an extra-light gyro.
 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 mech.
protected  int calculateWalk()
          Used to set this Mech's original walk mp
 boolean canAssaultDrop()
           
 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
abstract  boolean cannotStandUpFromHullDown()
           
 boolean checkForMASCFailure(MovePath md, java.util.Vector<Report> vDesc, java.util.HashMap<java.lang.Integer,CriticalSlot> vCriticals)
          This function cheks for masc failure.
 void checkUnstall(java.util.Vector<Report> vPhaseReport)
          check for unstalling of this Entity's engine (only used for ICE industrial Mechs)
 void clearCockpitCrits()
          Remove all cockpit critical slots from the mek.
 void clearEngineCrits()
          Remove all engine critical slots from the mek.
 void clearGyroCrits()
          Remove all gyro critical slots from the mek.
 int clipSecondaryFacing(int dir)
          Return the nearest valid direction to torso twist in
 int countBadLegs()
          Count the number of destroyed or breached legs on the mech
 int countLegActuatorCrits(int loc)
          Count non-hip leg actuator crits
 int damageCowl(int amount)
          Damage the cowl.
 void destroyLocation(int loc)
          Marks all equipment in a location on this entity as destroyed.
 java.util.Vector<Report> doCheckEngineStallRoll(java.util.Vector<Report> vPhaseReport)
          possibly do a ICE-Engine stall PSR, only industrialmechs will actually do such a roll
 boolean doomedInAtmosphere()
           
 boolean doomedInSpace()
           
 boolean doomedInVacuum()
           
 boolean doomedOnGround()
           
 int getActiveSinks()
           
 int getActiveSinksNextRound()
           
protected  double getActuatorCost()
           
protected abstract  double getArmActuatorCost()
           
 int getArmor(int loc, boolean rear)
          Returns the amount of armor in the location specified.
 double getArmoredComponentBV()
           
 int getBARRating()
          Return the BAR-rating of this Entity's armor
 int getBattleForceArmorPoints()
           
 long getBattleForceJumpPoints()
           
 long getBattleForceMovementPoints()
           
 int getBattleForcePoints()
          Start of Battle Force Conversion Methods
 int getBattleForceSize()
           
 java.lang.String getBattleForceSpecialAbilites()
           
 int getBattleForceStandardWeaponsDamage(int range, int ammoType, boolean ignoreHeat, boolean ignoreSpecialAbility)
           
 int getBattleForceStructurePoints()
          this will be unit specific
static java.lang.String getCockpitDisplayString(int inType)
           
 int getCockpitStatus()
           
 int getCockpitStatusNextRound()
           
 int getCockpitType()
           
static int getCockpitTypeForString(java.lang.String inType)
           
 java.lang.String getCockpitTypeString()
           
static java.lang.String getCockpitTypeString(int inCockpitType)
           
 int getCoolantFailureAmount()
           
 double getCost(boolean ignoreAmmo)
           
 double getCost(java.lang.StringBuffer detail, boolean ignoreAmmo)
          Calculate the C-bill cost of the mech.
 int getCowlArmor()
           
 int getDependentLocation(int loc)
          Gets the location that is destroyed recursively
 int getElevation()
          Returns the elevation of this entity.
 int getEngineCritHeat()
          Returns extra heat generated by engine crits
 int getGrappled()
           
 int getGrappleSide()
           
static java.lang.String getGyroDisplayString(int inType)
           
 double getGyroMultiplier()
           
 int getGyroType()
          Only Mechs have Gyros but this helps keep the code a bit cleaner.
static int getGyroTypeForString(java.lang.String inType)
           
static java.lang.String getGyroTypeShortString(int inGyroType)
           
 java.lang.String getGyroTypeString()
           
static java.lang.String getGyroTypeString(int inGyroType)
           
 int getHeatCapacity()
          Returns the about of heat that the entity can sink each turn.
 int getHeatCapacity(boolean includePartialWing)
           
 int getHeatCapacityWithWater()
          Returns the about of heat that the entity can sink each turn, factoring for water.
 int getHQIniBonus()
           
static int getInnerLocation(int location)
          Returns the location that transferred damage or crits will go to from a given location.
 int getJumpHeat(int movedMP)
          get the heat generated by this Entity when jumping for a certain amount of MP
 int getJumpMP()
          This mech's jumping MP modified for missing jump jets and gravity
 int getJumpMP(boolean gravity)
          This mech's jumping MP modified for missing jump jets and possibly gravity
 int getJumpMPWithTerrain()
          Returns this mech's jumping MP, modified for missing & underwater jets and gravity.
 int getJumpType()
          Returns the type of jump jet system the mech has.
protected abstract  double getLegActuatorCost()
           
 int getLevelsFallen()
          how many levels did this mech fall this turn?
 Mounted getMASC()
          get non-supercharger MASC mounted on this mech
 int getMASCTarget()
           
 int getMASCTurns()
          Get the number of turns MASC has been used continuously.
 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.
 java.lang.String getMtf()
          Get an '.mtf' file representation of the mech.
 int getNumberOfSinks()
           
 int getOArmor(int loc, boolean rear)
          Returns the original amount of armor in the location specified.
 int getOriginalRunMPwithoutMASC()
           
 int getOriginalSprintMPwithoutMASC()
           
 int getPartialWingJumpBonus(Mounted mount)
          Gives the bonus to Jump MP conferred by a mech partial wing.
 int getRunHeat()
          Depends on engine type
 int getRunMP(boolean gravity, boolean ignoreheat)
           
 java.lang.String getRunMPasString()
          Returns this entity's running/flank mp as a string.
 int getRunMPwithoutMASC(boolean gravity, boolean ignoreheat)
          Returns run MP without considering MASC, optionally figuring in gravity and possibly ignoring heat
 int getRunningGravityLimit()
          get the gravity limit for ground movement
 int getSprintHeat()
          Depends on engine type
 int getSprintMP()
          Returns this entity's running/flank mp modified for heat and gravity.
 int getSprintMP(boolean gravity, boolean ignoreheat)
           
 java.lang.String getSprintMPasString()
          Returns this entity's Sprint mp as a string.
 int getSprintMPwithoutMASC()
          Returns sprint MP without considering MASC
 int getSprintMPwithoutMASC(boolean gravity, boolean ignoreheat)
          Returns sprint MP without considering MASC, optionally figuring in gravity and possibly ignoring heat
 int getStandingHeat()
          get the heat generated by this Entity when standing still
 TargetRoll getStealthModifier(int range, Entity ae)
          Determine the stealth modifier for firing at this unit from the given range.
 Mounted getSuperCharger()
          get a supercharger mounted on this mech
 java.lang.String getSystemName(int index)
           
 int getTotalCommGearTons()
           
 HitData getTransferLocation(HitData hit)
          Gets the location that excess damage transfers to
 int getWalkHeat()
          get the heat generated by this Entity when walking/cruising
 int getWeaponArc(int wn)
          Returns the Compute.ARC that the weapon fires into.
 boolean hasActiveEiCockpit()
           
 boolean hasArmedMASC()
          Checks if a mech has an armed MASC system.
 boolean hasArmedMASCAndSuperCharger()
          checks if a mech has both a normal armed MASC system and a armed super- charger.
 boolean hasArmoredCockpit()
           
 boolean hasArmoredEngine()
           
 boolean hasArmoredGyro()
           
 boolean hasCASEII(int location)
          Only Meks have CASE II so all other entites return false.
 boolean hasChameleonShield()
          does this mech have a chameleon light polarization shield?
 boolean hasCompositeStructure()
          does this mech have composite internal structure?
 boolean hasCowl()
           
 boolean hasDoubleHeatSinks()
           
 boolean hasEiCockpit()
           
 boolean hasExtendedRetractableBlade()
          Does this mech have an extended retractable blade in working condition?
 boolean hasFullHeadEject()
           
 boolean hasHarJelIn(int loc)
          Does this mech have an undamaged HarJel system in this location?
 boolean hasHipCrit()
          Returns true if the entity has a hip crit.
 boolean hasIndustrialTSM()
          does this mech have industrial TSM=
 boolean hasJumpBoosters()
          does this mech have working jump boosters?
 boolean hasLaserHeatSinks()
           
 boolean hasMASC()
          does this mech mount MASC?
 boolean hasMASCAndSuperCharger()
          checks if a mech has both a normal MASC system and a supercharger, regardless of arming status
 boolean hasModularArmor()
           
 boolean hasModularArmor(int loc)
           
 boolean hasNullSig()
          does this mech have a null-sig-system?
 boolean hasRearArmor(int loc)
          Does this location have rear armor?
 boolean hasReinforcedStructure()
          does this mech have reinforced internal structure?
 boolean hasRetractedBlade(int loc)
          Does the entity have a retracted blade in the given location?
 boolean hasTracks()
          does this mech have tracks?
 boolean hasTSM()
          does this mech have TSM?
 boolean hasVoidSig()
          does this mech have a void-sig-system?
 int heatSinks()
          Returns the number of heat sinks, functional or not.
 int height()
          Return the height of this mech above the terrain.
 void initializeRearArmor(int val, int loc)
          Initializes the rear armor on the mech.
 boolean isArm(int loc)
          Is the passed in location an arm?
 boolean isAutoEject()
           
 boolean isCarefulStand()
           
 boolean isChameleonShieldActive()
          Does the mech have a functioning Chameleon Light Polarization Field?
 boolean isCheckForCrit()
          should this mech check for a critical hit at the end of turn due to being an industrial mech and having been the target of a succesfull physical attack or for falling
 boolean isEligibleForMovement()
          Pretty much anybody's eligible for movement.
 boolean isGrappleAttacker()
           
 boolean isHexProhibited(IHex hex)
          Returns true if the specified hex contains some sort of prohibited terrain.
 boolean isIndustrial()
          Is this an Industrial Mech?
 boolean isJustMovedIntoIndustrialKillingWater()
          did this mech just moved into water that would kill it because we lack environmental sealing?
 boolean isMASCUsed()
          Determine if MASC has been used this turn.
 boolean isNuclearHardened()
          Checks if the unit is hardened agaist nuclear strikes.
 boolean isNullSigActive()
          Does the mech have a functioning null signature system?
 boolean isPrimitive()
          Is this a primitive Mech?
 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 isShutDown()
           
 boolean isStalled()
          Is this Entity's ICE Engine stalled?
 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 isSystemIntact(int system)
          This function returns true iff the system is in perfect condition.
 boolean isValidSecondaryFacing(int dir)
          Can this mech torso twist in the given direction?
 boolean isVoidSigActive()
          Does the mech have a functioning void signature system?
static int leastRestrictiveLoc(int location1, int location2)
          find the least restrictive location of the two locations passed in
 boolean legHasHipCrit(int loc)
          Return true is the location is a leg and has a hip crit
 boolean locationIsLeg(int loc)
          Returns true if the location in question is a leg
 boolean locationIsTorso(int loc)
          Returns true if the location in question is a torso location
 int locations()
          Returns the number of locations in the entity
static int mostRestrictiveLoc(int location1, int location2)
          Returns the location with the most restrictive firing arc for a weapon.
 void newRound(int roundNumber)
          Start a new round
 boolean removePartialCoverHits(int location, int cover, int side)
           
 void resetSinks()
           
static int restrictScore(int location)
          Helper function designed to give relative restrictiveness of locations.
 HitData rollHitLocation(int table, int side)
          Rolls up a hit location
 HitData rollHitLocation(int table, int side, int aimedLocation, int aimingMode)
          Rolls the to-hit number
 void setActiveSinksNextRound(int sinks)
           
 void setArmor(int val, int loc, boolean rear)
          Sets the amount of armor in the location specified.
 void setAutoEject(boolean autoEject)
           
 void setCheckForCrit(boolean check)
           
 void setCockpitStatus(int state)
           
 void setCockpitType(int type)
           
 void setEngine(Engine e)
          set this mech's Engine
 void setFullHeadEject(boolean fullHeadEject)
           
 void setGameOptions()
           
 void setGrappled(int id, boolean attacker)
           
 void setGrappleSide(int side)
           
 void setGyroType(int type)
           
abstract  void setInternal(int head, int ct, int t, int arm, int leg)
          Sets the internal structure for the mech.
 void setJustMovedIntoIndustrialKillingWater(boolean moved)
          set if this mech just moved into water that would kill it because of the lack of environmental sealing
 void setLevelsFallen(int levels)
           
 void setMASCTurns(int turns)
          Set the number of turns MASC has been used continuously.
 void setMASCUsed(boolean used)
          Set whether MASC has been used.
 void setOmni(boolean omni)
          OmniMechs have handles for Battle Armor squads to latch onto.
 void setStalled(boolean stalled)
          Set if this Mech's ICE Engine is stalled or not should only be used for industrial mechs carrying an ICE engine
 int shieldAbsorptionDamage(int damage, int location, boolean rear)
           
 boolean shouldDieAtEndOfTurnBecauseOfWater()
          should this mech die at the end of turn because it's an IndustrialMech without environmental sealing that moved into water last round and stayed there?
protected  HitData tac(int table, int side, int location, boolean rear)
          Called when a thru-armor-crit is rolled.
 int torsoJumpJets()
          Returns the number of (working) jump jets mounted in the torsos.
 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, addCritical, addCritical, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addFailedEquipment, addKill, addPassedThrough, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addTargetedBySwarm, addTransporter, addWeaponGroup, applyDamage, applyGravityEffectsOnMP, applySantaAnna, armorStringFor, assignAMS, attachINarcPod, attachNarcPod, baTaserShutdown, C3MasterIs, calcElevation, calcElevation, calculateFreeC3MNodes, calculateFreeC3Nodes, canAssist, canFlee, canFlipArms, canGoDown, canGoDown, canGoHullDown, canGoUp, canLayMine, canLoad, canLoad, canRam, canSpot, canTransferCriticals, canUnjamRAC, canUnstickByJumping, checkBogDown, checkDislodgeSwarmers, checkGetUp, checkLandingInHeavyWoods, checkLandingOnIce, checkLandingWithDamage, checkMovedTooFast, checkMovementInBuilding, checkRecklessMove, checkRubbleMove, checkRunningWithDamage, checkSideSlip, checkSkid, checkSprintingWithMASC, checkSprintingWithSupercharger, checkWaterMove, checkWaterMove, chooseSide, clearQuirks, climbMode, countQuirks, countQuirks, countWorkingMisc, damageBayDoor, damageDockCollar, damageDoorRecovery, decodeTransporters, deployOffBoard, destroy, destroyRetractableBlade, elevationOccupied, encodeTransporters, entityIsBiped, entityIsQuad, equals, extendBlade, findTargetedDisplacement, fixElevation, generateDisplayName, generateShortName, getActiveSensor, getActiveUMUCount, getActiveVibrobladeHeat, getAllUMUCount, getAltitude, getAmmo, getArmor, getArmor, getArmorRemainingPercent, getArmorString, getArmorString, getArmorTechLevel, getArmorType, getArmorWeight, getArmsFlipped, getBadCriticals, getBAPRange, getBasePilotingRoll, getBasePilotingRoll, getBattleForceDamageThresholdString, getBattleForceMovement, getBattleForceOverHeatValue, getBattleForceStandardWeaponsDamage, getBattleForceStandardWeaponsDamage, getBattleForceStandardWeaponsDamage, getBattleForceTotalHeatGeneration, getBayByAmmo, getBayLoadedUnits, getBlueShieldRounds, getBombLoadout, getBombs, getBombs, getBVText, getC3Master, getC3MasterId, getC3NetId, getC3Top, getCargoMpReduction, getChassis, getClubs, getCrew, getCritical, getDamageReductionFromModularArmor, getDeployRound, getDisplacementAttack, getDisplayName, getDocks, getDroppableUnits, getECCMStrength, getECMRange, getECMStrength, getEmptyCriticals, getEngine, getEquipment, getEquipment, getEquipmentNum, getEquipmentType, getEvasionBonus, getExteriorUnitAt, getExternalId, getExternalUnits, getExtraCommGearTons, getExtremeRangeModifier, getFacing, getFailedEquipment, getFighterBays, getFighterLaunchRate, getFirstBay, getFirstWeapon, getFluff, getForwardArc, getGame, getGaveKillCredit, getGhostTargetOverride, getGhostTargetRoll, getGhostTargetRollMoS, getGoodCriticals, getGoodCriticals, getHeading, getHeatFiringModifier, getHeatInArc, getHeatMPReduction, getHeight, getHitCriticals, getHittableCriticals, getId, getINarcPodsAttached, getInternal, getInternal, getInternalRemainingPercent, getInternalString, getKillNumber, getKills, getLastTarget, getLaunchableFighters, getLaunchableSmallCraft, getLoadedBay, getLoadedFighters, getLoadedSmallCraft, getLoadedUnits, getLocationAbbr, getLocationAbbr, getLocationAbbrs, getLocationFromAbbr, getLocationName, getLocationName, getLocationNames, getLocationStatus, getLongRangeModifier, getMDIniBonus, getMediumRangeModifier, getMisc, getModel, getMovementBeforeSkidPSRModifier, getMovementMode, getMovementModeAsBattleForceString, getMovementModeAsString, getNextSensor, getNextWeapon, getNoOfSlots, getNumberOf, getNumberOfCriticals, getNumberOfCriticals, getNumberOfCriticals, getNumberOfCriticals, getNumberOfShields, getOArmor, getOArmor, getOffBoardDirection, getOffBoardDistance, getOInternal, getOInternal, getOriginalJumpMP, getOriginalRunMP, getOriginalSprintMP, getOriginalWalkMP, getOwner, getOwnerId, getPassedThrough, getPickedUpMechWarriors, getPosition, getPriorPosition, getQuirkIniBonus, getQuirkList, getQuirks, getRearArc, getRecoveryTurn, getRemovalCondition, getRetreatedDirection, getRunMP, getRunMPwithoutMASC, getSecondaryFacing, getSecondaryPositions, getSensorCheck, getSensorDesc, getSensors, getShortName, getShortNameRaw, getShortRangeModifier, getSmallCraftBays, getSmallCraftLaunchRate, getSource, getSpotTargetId, getStartingPos, getStructureType, 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, getWalkMP, getWalkMP, getWeaponBayList, getWeaponGroupList, getWeaponList, getWeapons, getWeaponsAndEquipmentCost, getWeaponsAndEquipmentCost, getWeight, getWeightClass, getWeightClassName, getYear, hasActiveAngelECCM, hasActiveAngelECM, hasActiveBlueShield, hasActiveECCM, hasActiveECM, hasActiveECM, hasActiveShield, hasActiveShield, hasAimModeTargComp, hasArcFired, hasArmoredChassis, hasBAP, hasBAP, hasBARArmor, hasBattleArmorHandles, hasC3, hasC3i, hasC3M, hasC3MM, hasC3S, hasCASEII, hasDisplacementAttack, hasEnvironmentalSealing, hasFunctionalArmAES, hasFunctionalLegAES, hasGhostTargets, hasINarcPodsAttached, hasInfernoAmmo, hasLegActuatorCrit, hasLinkedMGA, hasNoDefenseShield, hasPassiveShield, hasPassiveShield, hasShield, hasSpotlight, hasStealth, hasSystem, hasTAG, hasTargComp, hasUMU, hasVibroblades, hasWorkingMisc, hasWorkingMisc, hasWorkingMisc, hasWorkingMisc, hasWorkingSystem, hasWorkingWeapon, hasWorkingWeapon, hasWorkingWeapon, hasWorkingWeapon, hitAllCriticals, illuminateTarget, initializeArmor, initializeInternal, isActive, isActive, isAirborne, isAirborneVTOL, isAssaultDropInProgress, isAttackingThisTurn, isBATaserShutdown, isBoardProhibited, isCanon, isCapitalFighter, isCapitalScale, isCaptured, isCarcass, isCharging, isClan, isClanArmor, isClearingMinefield, isCommander, isDeployed, isDesignValid, isDestroyed, isDone, isDoomed, isDropping, isElevationValid, isEligibleFor, isEligibleForFiring, isEligibleForOffboard, isEligibleForPhysical, isEligibleForTargetingPhase, isEnemyOf, isEvading, isFighter, isFindingClub, isHidden, isHullDown, isIlluminated, isImmobile, isINarcedBy, isINarcedWith, isLargeCraft, isLayingMines, isLoadableThisTurn, isLocationBad, isLocationDoomed, isMakingDfa, isMilitary, isMixedTech, isNarcedBy, isNOE, isOffBoard, isOmni, isOnSameSheet, isPartOfFighterSquadron, isProne, isPushing, isRamming, isReckless, isSalvage, isSeenByEnemy, isSelectableThisTurn, isShutDownThisPhase, isSpotting, isStuck, isSufferingEMI, isSurfaceNaval, isSystemRepairable, isTargetable, isTargetOfDisplacementAttack, isUnjammingRAC, isUnloadedThisTurn, isUsingManAce, isUsingSpotlight, isVisibleToEnemy, isWeaponBlockedAt, itemOppositeTech, load, load, loadAllWeapons, loadedUnitsHaveActiveECM, loadWeapon, loadWeapon, loadWeaponWithSameAmmo, loadWeaponWithSameAmmo, locationHasCase, needsRollToStand, onSameC3NetworkAs, onSameC3NetworkAs, passedThrough, passedThroughPrevious, passedWithin, pickUp, printDebugToFile, recover, refreshLocations, reloadEmptyWeapons, removeAllINarcPods, removeAllTransporters, removeCriticals, removeINarcPod, removeMisc, resetBayDoors, resetFiringArcs, restore, rollMovementInBuilding, setAltitude, setArcFired, setArmor, setArmor, setArmorTechLevel, setArmorType, 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, setFacing, setFindingClub, setGame, 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, setSecondaryFacing, setSeenByEnemy, setShutDown, setShutDownThisPhase, setSource, setSpotlight, setSpotlightState, setSpotTargetId, setSpotting, setStartingPos, setStructureType, 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

NUM_MECH_LOCATIONS

public static final int NUM_MECH_LOCATIONS
See Also:
Constant Field Values

SYSTEM_LIFE_SUPPORT

public static final int SYSTEM_LIFE_SUPPORT
See Also:
Constant Field Values

SYSTEM_SENSORS

public static final int SYSTEM_SENSORS
See Also:
Constant Field Values

SYSTEM_COCKPIT

public static final int SYSTEM_COCKPIT
See Also:
Constant Field Values

SYSTEM_ENGINE

public static final int SYSTEM_ENGINE
See Also:
Constant Field Values

SYSTEM_GYRO

public static final int SYSTEM_GYRO
See Also:
Constant Field Values

ACTUATOR_SHOULDER

public static final int ACTUATOR_SHOULDER
See Also:
Constant Field Values

ACTUATOR_UPPER_ARM

public static final int ACTUATOR_UPPER_ARM
See Also:
Constant Field Values

ACTUATOR_LOWER_ARM

public static final int ACTUATOR_LOWER_ARM
See Also:
Constant Field Values

ACTUATOR_HAND

public static final int ACTUATOR_HAND
See Also:
Constant Field Values

ACTUATOR_HIP

public static final int ACTUATOR_HIP
See Also:
Constant Field Values

ACTUATOR_UPPER_LEG

public static final int ACTUATOR_UPPER_LEG
See Also:
Constant Field Values

ACTUATOR_LOWER_LEG

public static final int ACTUATOR_LOWER_LEG
See Also:
Constant Field Values

ACTUATOR_FOOT

public static final int ACTUATOR_FOOT
See Also:
Constant Field Values

systemNames

public static final java.lang.String[] systemNames

LOC_HEAD

public static final int LOC_HEAD
See Also:
Constant Field Values

LOC_CT

public static final int LOC_CT
See Also:
Constant Field Values

LOC_RT

public static final int LOC_RT
See Also:
Constant Field Values

LOC_LT

public static final int LOC_LT
See Also:
Constant Field Values

LOC_RARM

public static final int LOC_RARM
See Also:
Constant Field Values

LOC_LARM

public static final int LOC_LARM
See Also:
Constant Field Values

LOC_RLEG

public static final int LOC_RLEG
See Also:
Constant Field Values

LOC_LLEG

public static final int LOC_LLEG
See Also:
Constant Field Values

COCKPIT_OFF

public static final int COCKPIT_OFF
See Also:
Constant Field Values

COCKPIT_ON

public static final int COCKPIT_ON
See Also:
Constant Field Values

COCKPIT_AIMED_SHOT

public static final int COCKPIT_AIMED_SHOT
See Also:
Constant Field Values

GYRO_UNKNOWN

public static final int GYRO_UNKNOWN
See Also:
Constant Field Values

GYRO_STANDARD

public static final int GYRO_STANDARD
See Also:
Constant Field Values

GYRO_XL

public static final int GYRO_XL
See Also:
Constant Field Values

GYRO_COMPACT

public static final int GYRO_COMPACT
See Also:
Constant Field Values

GYRO_HEAVY_DUTY

public static final int GYRO_HEAVY_DUTY
See Also:
Constant Field Values

GYRO_STRING

public static final java.lang.String[] GYRO_STRING

GYRO_SHORT_STRING

public static final java.lang.String[] GYRO_SHORT_STRING

COCKPIT_UNKNOWN

public static final int COCKPIT_UNKNOWN
See Also:
Constant Field Values

COCKPIT_STANDARD

public static final int COCKPIT_STANDARD
See Also:
Constant Field Values

COCKPIT_INDUSTRIAL

public static final int COCKPIT_INDUSTRIAL
See Also:
Constant Field Values

COCKPIT_PRIMITIVE

public static final int COCKPIT_PRIMITIVE
See Also:
Constant Field Values

COCKPIT_PRIMITIVE_INDUSTRIAL

public static final int COCKPIT_PRIMITIVE_INDUSTRIAL
See Also:
Constant Field Values

COCKPIT_SMALL

public static final int COCKPIT_SMALL
See Also:
Constant Field Values

COCKPIT_COMMAND_CONSOLE

public static final int COCKPIT_COMMAND_CONSOLE
See Also:
Constant Field Values

COCKPIT_TORSO_MOUNTED

public static final int COCKPIT_TORSO_MOUNTED
See Also:
Constant Field Values

COCKPIT_DUAL

public static final int COCKPIT_DUAL
See Also:
Constant Field Values

COCKPIT_STRING

public static final java.lang.String[] COCKPIT_STRING

COCKPIT_SHORT_STRING

public static final java.lang.String[] COCKPIT_SHORT_STRING

FULL_HEAD_EJECT_STRING

public static final java.lang.String FULL_HEAD_EJECT_STRING
See Also:
Constant Field Values

JUMP_UNKNOWN

public static final int JUMP_UNKNOWN
See Also:
Constant Field Values

JUMP_NONE

public static final int JUMP_NONE
See Also:
Constant Field Values

JUMP_STANDARD

public static final int JUMP_STANDARD
See Also:
Constant Field Values

JUMP_IMPROVED

public static final int JUMP_IMPROVED
See Also:
Constant Field Values

JUMP_BOOSTER

public static final int JUMP_BOOSTER
See Also:
Constant Field Values

JUMP_DISPOSABLE

public static final int JUMP_DISPOSABLE
See Also:
Constant Field Values

HAS_FALSE

public static final int HAS_FALSE
See Also:
Constant Field Values

HAS_UNKNOWN

public static final int HAS_UNKNOWN
See Also:
Constant Field Values

HAS_TRUE

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

Mech

public Mech()
Construct a new, blank, mech.


Mech

public Mech(int inGyroType,
            int inCockpitType)
Method Detail

cannotStandUpFromHullDown

public abstract boolean cannotStandUpFromHullDown()
Returns:
if this mech cannot stand up from hulldown

getCowlArmor

public int getCowlArmor()

hasCowl

public boolean hasCowl()

damageCowl

public int damageCowl(int amount)
Damage the cowl. Returns amount of excess damage

Parameters:
amount -
Returns:

getInnerLocation

public static int getInnerLocation(int location)
Returns the location that transferred damage or crits will go to from a given location.


mostRestrictiveLoc

public static int mostRestrictiveLoc(int location1,
                                     int location2)
Returns the location with the most restrictive firing arc for a weapon.


leastRestrictiveLoc

public static int leastRestrictiveLoc(int location1,
                                      int location2)
find the least restrictive location of the two locations passed in

Parameters:
location1 -
location2 -
Returns:

restrictScore

public static int restrictScore(int location)
Helper function designed to give relative restrictiveness of locations. Used for finding the most restrictive firing arc for a weapon.


getMASCTurns

public int getMASCTurns()
Get the number of turns MASC has been used continuously.

This method should only be used during serialization.

Returns:
the int number of turns MASC has been used.

setMASCTurns

public void setMASCTurns(int turns)
Set the number of turns MASC has been used continuously.

This method should only be used during deserialization.

Parameters:
turns - The int number of turns MASC has been used.

isMASCUsed

public boolean isMASCUsed()
Determine if MASC has been used this turn.

This method should only be used during serialization.

Returns:
true if MASC has been used.

setMASCUsed

public void setMASCUsed(boolean used)
Set whether MASC has been used.

This method should only be used during deserialization.

Parameters:
used - The boolean whether MASC has been used.

getMASCTarget

public int getMASCTarget()

checkForMASCFailure

public boolean checkForMASCFailure(MovePath md,
                                   java.util.Vector<Report> vDesc,
                                   java.util.HashMap<java.lang.Integer,CriticalSlot> vCriticals)
This function cheks for masc failure.

Parameters:
md - the movement path.
vDesc - the description off the masc failure. used as output.
vCriticals - contains tuple of intiger and critical slot. used as output.
Returns:
true if there was a masc failure.

setOmni

public void setOmni(boolean omni)
OmniMechs have handles for Battle Armor squads to latch onto. Please note, this method should only be called during this Mech's construction.

Overrides Entity#setOmni(boolean)

Overrides:
setOmni in class Entity

locations

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

Specified by:
locations 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

locationIsTorso

public boolean locationIsTorso(int loc)
Returns true if the location in question is a torso location


locationIsLeg

public boolean locationIsLeg(int loc)
Returns true if the location in question is a leg

Overrides:
locationIsLeg in class Entity
Parameters:
loc - the location to check.

countBadLegs

public int countBadLegs()
Count the number of destroyed or breached legs on the mech


hasHipCrit

public boolean hasHipCrit()
Returns true if the entity has a hip crit.

Overrides:
hasHipCrit in class Entity

legHasHipCrit

public boolean legHasHipCrit(int loc)
Return true is the location is a leg and has a hip crit


isSystemIntact

public boolean isSystemIntact(int system)
This function returns true iff the system is in perfect condition.

Parameters:
system - the system to check
Returns:
false if the system is damaged.

countLegActuatorCrits

public int countLegActuatorCrits(int loc)
Count non-hip leg actuator crits


hasCompositeStructure

public boolean hasCompositeStructure()
does this mech have composite internal structure?

Returns:

hasReinforcedStructure

public boolean hasReinforcedStructure()
does this mech have reinforced internal structure?

Returns:

hasMASC

public boolean hasMASC()
does this mech mount MASC?

Returns:

hasMASCAndSuperCharger

public boolean hasMASCAndSuperCharger()
checks if a mech has both a normal MASC system and a supercharger, regardless of arming status


hasJumpBoosters

public boolean hasJumpBoosters()
does this mech have working jump boosters?

Returns:

getMASC

public Mounted getMASC()
get non-supercharger MASC mounted on this mech

Returns:

getSuperCharger

public Mounted getSuperCharger()
get a supercharger mounted on this mech

Returns:

hasArmedMASC

public boolean hasArmedMASC()
Checks if a mech has an armed MASC system. Note that the mech will have to exceed its normal run to actually engage the MASC system


hasArmedMASCAndSuperCharger

public boolean hasArmedMASCAndSuperCharger()
checks if a mech has both a normal armed MASC system and a armed super- charger.


hasExtendedRetractableBlade

public boolean hasExtendedRetractableBlade()
Does this mech have an extended retractable blade in working condition?


hasRetractedBlade

public boolean hasRetractedBlade(int loc)
Does the entity have a retracted blade in the given location? Only true for biped mechs


hasTSM

public boolean hasTSM()
does this mech have TSM?


hasIndustrialTSM

public boolean hasIndustrialTSM()
does this mech have industrial TSM=

Returns:

hasNullSig

public boolean hasNullSig()
does this mech have a null-sig-system?

Returns:

hasVoidSig

public boolean hasVoidSig()
does this mech have a void-sig-system?

Returns:

hasTracks

public boolean hasTracks()
does this mech have tracks?

Returns:

hasChameleonShield

public boolean hasChameleonShield()
does this mech have a chameleon light polarization shield?

Returns:

getStandingHeat

public int getStandingHeat()
Description copied from class: Entity
get the heat generated by this Entity when standing still

Overrides:
getStandingHeat in class Entity

setEngine

public void setEngine(Engine e)
set this mech's Engine

Parameters:
e - the Engine to set

calculateWalk

protected int calculateWalk()
Used to set this Mech's original walk mp

Returns:
this units calculated walking speed, dependent on engine rating and weight

getWalkHeat

public int getWalkHeat()
Description copied from class: Entity
get the heat generated by this Entity when walking/cruising

Overrides:
getWalkHeat in class Entity

getRunMP

public int getRunMP(boolean gravity,
                    boolean ignoreheat)
Overrides:
getRunMP in class Entity

getRunMPwithoutMASC

public int getRunMPwithoutMASC(boolean gravity,
                               boolean ignoreheat)
Description copied from class: Entity
Returns run MP without considering MASC, optionally figuring in gravity and possibly ignoring heat

Specified by:
getRunMPwithoutMASC in class Entity

getOriginalRunMPwithoutMASC

public int getOriginalRunMPwithoutMASC()

getRunMPasString

public java.lang.String getRunMPasString()
Returns this entity's running/flank mp as a string.

Overrides:
getRunMPasString in class Entity

getRunHeat

public int getRunHeat()
Depends on engine type

Overrides:
getRunHeat in class Entity

getSprintMP

public int getSprintMP()
Description copied from class: Entity
Returns this entity's running/flank mp modified for heat and gravity.

Overrides:
getSprintMP in class Entity

getSprintMP

public int getSprintMP(boolean gravity,
                       boolean ignoreheat)
Overrides:
getSprintMP in class Entity

getSprintMPwithoutMASC

public int getSprintMPwithoutMASC()
Description copied from class: Entity
Returns sprint MP without considering MASC

Overrides:
getSprintMPwithoutMASC in class Entity

getSprintMPwithoutMASC

public int getSprintMPwithoutMASC(boolean gravity,
                                  boolean ignoreheat)
Description copied from class: Entity
Returns sprint MP without considering MASC, optionally figuring in gravity and possibly ignoring heat

Overrides:
getSprintMPwithoutMASC in class Entity

getOriginalSprintMPwithoutMASC

public int getOriginalSprintMPwithoutMASC()

getSprintMPasString

public java.lang.String getSprintMPasString()
Returns this entity's Sprint mp as a string.

Overrides:
getSprintMPasString in class Entity

getRunningGravityLimit

public int getRunningGravityLimit()
Description copied from class: Entity
get the gravity limit for ground movement

Overrides:
getRunningGravityLimit in class Entity

getSprintHeat

public int getSprintHeat()
Depends on engine type

Overrides:
getSprintHeat in class Entity

getJumpMP

public int getJumpMP()
This mech's jumping MP modified for missing jump jets and gravity

Overrides:
getJumpMP in class Entity

getJumpMP

public int getJumpMP(boolean gravity)
This mech's jumping MP modified for missing jump jets and possibly gravity

Overrides:
getJumpMP in class Entity
Returns:

getPartialWingJumpBonus

public int getPartialWingJumpBonus(Mounted mount)
Gives the bonus to Jump MP conferred by a mech partial wing.

Parameters:
mount - The mounted location of the Wing
Returns:
The Jump MP bonus conferred by the wing

getJumpType

public int getJumpType()
Returns the type of jump jet system the mech has.

Overrides:
getJumpType in class Entity

getJumpHeat

public int getJumpHeat(int movedMP)
Description copied from class: Entity
get the heat generated by this Entity when jumping for a certain amount of MP

Overrides:
getJumpHeat in class Entity
Parameters:
movedMP - the number of movement points spent

getJumpMPWithTerrain

public int getJumpMPWithTerrain()
Returns this mech's jumping MP, modified for missing & underwater jets and gravity.

Overrides:
getJumpMPWithTerrain in class Entity

torsoJumpJets

public int torsoJumpJets()
Returns the number of (working) jump jets mounted in the torsos.


getElevation

public int getElevation()
Returns the elevation of this entity. Mechs do funny stuff in the middle of a DFA.

Specified by:
getElevation in interface Targetable
Overrides:
getElevation in class Entity
Returns:
elevation of the bottom (e.g. legs) of the target relative to surface

height

public int height()
Return the height of this mech above the terrain.

Overrides:
height in class Entity

addEngineSinks

public void addEngineSinks(int totalSinks,
                           boolean dblSinks)
Adds heat sinks to the engine. Uses clan/normal depending on the currently set techLevel


addEngineSinks

public void addEngineSinks(int totalSinks,
                           boolean dblSinks,
                           boolean clan)
Adds heat sinks to the engine. Adds either the engine capacity, or the entire number of heat sinks, whichever is less


addEngineSinks

public void addEngineSinks(int totalSinks,
                           java.lang.String sinkName)
base for adding engine sinks. Newer method allows externals to say how much are engine HS.

Parameters:
totalSinks - the amount of heatsinks to add to the engine
sinkName - the String determining the type of heatsink to add. must be a lookupname of a heatsinktype

addEngineSinks

public void addEngineSinks(java.lang.String sinkName,
                           int toAllocate)
add heat sinks into the engine

Parameters:
sinkName - the String determining the type of heatsink to add. must be a lookupname of a heatsinktype
toAllocate - Number of hs to add to the Engine.

getEngineCritHeat

public int getEngineCritHeat()
Returns extra heat generated by engine crits

Specified by:
getEngineCritHeat in class Entity

heatSinks

public int heatSinks()
Returns the number of heat sinks, functional or not.


getHeatCapacity

public int getHeatCapacity()
Returns the about of heat that the entity can sink each turn.

Specified by:
getHeatCapacity in class Entity

getHeatCapacity

public int getHeatCapacity(boolean includePartialWing)

getHeatCapacityWithWater

public int getHeatCapacityWithWater()
Returns the about of heat that the entity can sink each turn, factoring for water.

Specified by:
getHeatCapacityWithWater in class Entity

getMovementString

public java.lang.String getMovementString(EntityMovementType mtype)
Returns the name of the type of movement used. This is mech-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 mech-specific.

Specified by:
getMovementAbbr 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 dir)
Can this mech torso twist in the given direction?

Specified by:
isValidSecondaryFacing in class Entity

clipSecondaryFacing

public int clipSecondaryFacing(int dir)
Return the nearest valid direction to torso twist in

Specified by:
clipSecondaryFacing in class Entity
Returns:
the the closest valid secondary facing.

hasRearArmor

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

Specified by:
hasRearArmor in class Entity

getArmor

public int getArmor(int loc,
                    boolean rear)
Returns the amount of armor in the location specified. Mech version, handles rear armor.

Overrides:
getArmor in class Entity

getOArmor

public int getOArmor(int loc,
                     boolean rear)
Returns the original amount of armor in the location specified. Mech version, handles rear armor.

Overrides:
getOArmor in class Entity
Parameters:
loc - the location to check.
rear - if true inspect the rear armor, else check the front.

setArmor

public void setArmor(int val,
                     int loc,
                     boolean rear)
Sets the amount of armor in the location specified. Mech version, handles rear armor.

Overrides:
setArmor in class Entity
Parameters:
val - the value of the armor (eg how many armor points)
loc - the location of the armor
rear - true iff the armor is rear mounted.

initializeRearArmor

public void initializeRearArmor(int val,
                                int loc)
Initializes the rear armor on the mech. Sets the original and starting point of the armor to the same number.


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)
Description copied from class: Entity
Rolls up a hit location

Specified by:
rollHitLocation in class Entity

rollHitLocation

public HitData rollHitLocation(int table,
                               int side,
                               int aimedLocation,
                               int aimingMode)
Description copied from class: Entity
Rolls the to-hit number

Specified by:
rollHitLocation in class Entity

tac

protected HitData tac(int table,
                      int side,
                      int location,
                      boolean rear)
Called when a thru-armor-crit is rolled. Checks the game options and either returns no critical hit, rolls a floating crit, or returns a TAC in the specified location.


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

setInternal

public abstract void setInternal(int head,
                                 int ct,
                                 int t,
                                 int arm,
                                 int leg)
Sets the internal structure for the mech.

Parameters:
head - head
ct - center torso
t - right/left torso
arm - right/left arm
leg - right/left leg

autoSetInternal

public void autoSetInternal()
Set the internal structure to the appropriate value for the mech's weight class

Specified by:
autoSetInternal in class Entity

addClanCase

public void addClanCase()
Adds clan CASE in every location


addEquipment

public void addEquipment(Mounted mounted,
                         int loc,
                         boolean rearMounted)
                  throws LocationFullException
Mounts the specified weapon in the specified location.

Overrides:
addEquipment in class Entity
Throws:
LocationFullException

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 mech. If the parameter is true, then the battle value for c3 won't be added whether the mech is currently part of a network or not.

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

getCost

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

getCost

public double getCost(java.lang.StringBuffer detail,
                      boolean ignoreAmmo)
Calculate the C-bill cost of the mech. Passing null as the argument will skip the detailed report processing.

Parameters:
detail - buffer to append the detailed cost report to
Returns:
The cost in C-Bills of the 'Mech in question.

getActuatorCost

protected double getActuatorCost()

getArmActuatorCost

protected abstract double getArmActuatorCost()

getLegActuatorCost

protected abstract double getLegActuatorCost()

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

addEntityBonuses

public PilotingRollData addEntityBonuses(PilotingRollData roll)
Add in any piloting skill mods

Specified by:
addEntityBonuses 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

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.

isNullSigActive

public boolean isNullSigActive()
Does the mech have a functioning null signature system?

Overrides:
isNullSigActive in class Entity
Returns:
true if this unit has a null signature system that is currently active, false if there is no stealth system or if it is inactive.

isVoidSigActive

public boolean isVoidSigActive()
Does the mech have a functioning void signature system?

Overrides:
isVoidSigActive in class Entity
Returns:
true if this unit has a void signature system that is currently active, false if there is no stealth system or if it is inactive.

isChameleonShieldActive

public boolean isChameleonShieldActive()
Does the mech have a functioning Chameleon Light Polarization Field?

Overrides:
isChameleonShieldActive in class Entity
Returns:
true if this unit has a void signature system that is currently active, false if there is no stealth system or if it is inactive.

getStealthModifier

public TargetRoll getStealthModifier(int range,
                                     Entity ae)
Determine the stealth modifier for firing at this unit from the given range. If the value supplied for range is not one of the Entity class range constants, an IllegalArgumentException will be thrown.

Sub-classes are encouraged to override this method.

Overrides:
getStealthModifier in class Entity
Parameters:
range - - an int value that must match one of the Compute class range constants.
ae - - entity making the attack
Returns:
a TargetRoll value that contains the stealth modifier for the given range.

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

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

getNumberOfSinks

public int getNumberOfSinks()

hasDoubleHeatSinks

public boolean hasDoubleHeatSinks()

hasLaserHeatSinks

public boolean hasLaserHeatSinks()

setActiveSinksNextRound

public void setActiveSinksNextRound(int sinks)

getActiveSinks

public int getActiveSinks()

resetSinks

public void resetSinks()

getActiveSinksNextRound

public int getActiveSinksNextRound()

isAutoEject

public boolean isAutoEject()
Returns:
Returns the autoEject.

setAutoEject

public void setAutoEject(boolean autoEject)
Parameters:
autoEject - The autoEject to set.

removePartialCoverHits

public boolean removePartialCoverHits(int location,
                                      int cover,
                                      int side)
Overrides:
removePartialCoverHits 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

hasEiCockpit

public boolean hasEiCockpit()
Overrides:
hasEiCockpit in class Entity

hasActiveEiCockpit

public boolean hasActiveEiCockpit()
Overrides:
hasActiveEiCockpit in class Entity

getCockpitStatus

public int getCockpitStatus()

getCockpitStatusNextRound

public int getCockpitStatusNextRound()

setCockpitStatus

public void setCockpitStatus(int state)

getGyroType

public int getGyroType()
Description copied from class: Entity
Only Mechs have Gyros but this helps keep the code a bit cleaner.

Overrides:
getGyroType in class Entity
Returns:
-1

getCockpitType

public int getCockpitType()

setGyroType

public void setGyroType(int type)

setCockpitType

public void setCockpitType(int type)

getGyroTypeString

public java.lang.String getGyroTypeString()

getCockpitTypeString

public java.lang.String getCockpitTypeString()

getGyroTypeString

public static java.lang.String getGyroTypeString(int inGyroType)

getGyroTypeShortString

public static java.lang.String getGyroTypeShortString(int inGyroType)

getCockpitTypeString

public static java.lang.String getCockpitTypeString(int inCockpitType)

getGyroTypeForString

public static int getGyroTypeForString(java.lang.String inType)

getCockpitTypeForString

public static int getCockpitTypeForString(java.lang.String inType)

getSystemName

public java.lang.String getSystemName(int index)

getGyroDisplayString

public static java.lang.String getGyroDisplayString(int inType)

getCockpitDisplayString

public static java.lang.String getCockpitDisplayString(int inType)

canAssaultDrop

public boolean canAssaultDrop()
Overrides:
canAssaultDrop in class Entity

isHexProhibited

public boolean isHexProhibited(IHex hex)
Description copied from class: Entity
Returns true if the specified hex contains some sort of prohibited terrain.

Overrides:
isHexProhibited in class Entity

getMtf

public java.lang.String getMtf()
Get an '.mtf' file representation of the mech. This string can be directly written to disk as a file and later loaded by the MtfFile class. Known missing level 3 features: mixed tech, laser heatsinks


addCockpit

public boolean addCockpit()
Add the critical slots necessary for a standard cockpit. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

addIndustrialCockpit

public boolean addIndustrialCockpit()
Add the critical slots necessary for an industrial cockpit. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

addPrimitiveCockpit

public boolean addPrimitiveCockpit()
Add the critical slots necessary for an industrial cockpit. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

addIndustrialPrimitiveCockpit

public boolean addIndustrialPrimitiveCockpit()
Add the critical slots necessary for an industrial primitive cockpit. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

addSmallCockpit

public boolean addSmallCockpit()
Add the critical slots necessary for a small cockpit. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

addCommandConsole

public boolean addCommandConsole()
Dual Cockpits need to be implemented everywhere except here. FIXME


addDualCockpit

public boolean addDualCockpit()
Dual Cockpits need to be implemented everywhere except here. FIXME


addTorsoMountedCockpit

public boolean addTorsoMountedCockpit()
Add the critical slots necessary for a torso-mounted cockpit. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

addGyro

public boolean addGyro()
Add the critical slots necessary for a standard gyro. Also set the gyro type variable. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

addCompactGyro

public boolean addCompactGyro()
Add the critical slots necessary for a compact gyro. Also set the gyro type variable. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

addXLGyro

public boolean addXLGyro()
Add the critical slots necessary for an extra-light gyro. Also set the gyro type variable. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

addHeavyDutyGyro

public boolean addHeavyDutyGyro()
Add the critical slots necessary for a heavy-duty gyro. Also set the gyro type variable. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

addEngineCrits

public boolean addEngineCrits()
Add the critical slots necessary for the mek's engine. Calling this method before setting a mek's engine object will result in a NPE. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.

Returns:
false if insufficient critical space

clearEngineCrits

public void clearEngineCrits()
Remove all engine critical slots from the mek. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.


clearCockpitCrits

public void clearCockpitCrits()
Remove all cockpit critical slots from the mek. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.


clearGyroCrits

public void clearGyroCrits()
Remove all gyro critical slots from the mek. Note: This is part of the mek creation public API, and might not be referenced by any MegaMek code.


shieldAbsorptionDamage

public int shieldAbsorptionDamage(int damage,
                                  int location,
                                  boolean rear)

hasHarJelIn

public boolean hasHarJelIn(int loc)
Does this mech have an undamaged HarJel system in this location?

Parameters:
loc - the int location to check
Returns:
a boolean value indicating a present HarJel system

setGrappled

public void setGrappled(int id,
                        boolean attacker)
Overrides:
setGrappled in class Entity

isGrappleAttacker

public boolean isGrappleAttacker()
Overrides:
isGrappleAttacker in class Entity

getGrappled

public int getGrappled()
Overrides:
getGrappled in class Entity

isEligibleForMovement

public boolean isEligibleForMovement()
Description copied from class: Entity
Pretty much anybody's eligible for movement. If the game option is toggled on, inactive and immobile entities are not eligible. OffBoard units are always ineligible

Overrides:
isEligibleForMovement in class Entity
Returns:
whether or not the entity is allowed to move

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.

destroyLocation

public void destroyLocation(int loc)
Description copied from class: Entity
Marks all equipment in a location on this entity as destroyed.

Overrides:
destroyLocation in class Entity
Parameters:
loc - The location that is destroyed.

hasCASEII

public boolean hasCASEII(int location)
Description copied from class: Entity
Only Meks have CASE II so all other entites return false.

Overrides:
hasCASEII in class Entity
Returns:
true iff the mech has CASE II at this location.

setGameOptions

public void setGameOptions()
Overrides:
setGameOptions in class Entity

setGrappleSide

public void setGrappleSide(int side)
Overrides:
setGrappleSide in class Entity

getGrappleSide

public int getGrappleSide()
Overrides:
getGrappleSide in class Entity

isCarefulStand

public boolean isCarefulStand()
Overrides:
isCarefulStand in class Entity

hasModularArmor

public boolean hasModularArmor()
Overrides:
hasModularArmor in class Entity

hasModularArmor

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

getCoolantFailureAmount

public int getCoolantFailureAmount()
Overrides:
getCoolantFailureAmount in class Entity

addCoolantFailureAmount

public void addCoolantFailureAmount(int amount)
Overrides:
addCoolantFailureAmount 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

getBARRating

public int getBARRating()
Description copied from class: Entity
Return the BAR-rating of this Entity's armor

Overrides:
getBARRating in class Entity
Returns:
the BAR rating

isIndustrial

public boolean isIndustrial()
Is this an Industrial Mech?

Returns:
if this mech has an industrial inner structure

setJustMovedIntoIndustrialKillingWater

public void setJustMovedIntoIndustrialKillingWater(boolean moved)
set if this mech just moved into water that would kill it because of the lack of environmental sealing

Parameters:
moved -

isJustMovedIntoIndustrialKillingWater

public boolean isJustMovedIntoIndustrialKillingWater()
did this mech just moved into water that would kill it because we lack environmental sealing?

Returns:

shouldDieAtEndOfTurnBecauseOfWater

public boolean shouldDieAtEndOfTurnBecauseOfWater()
should this mech die at the end of turn because it's an IndustrialMech without environmental sealing that moved into water last round and stayed there?

Returns:

setStalled

public void setStalled(boolean stalled)
Set if this Mech's ICE Engine is stalled or not should only be used for industrial mechs carrying an ICE engine

Parameters:
stalled -

isStalled

public boolean isStalled()
Description copied from class: Entity
Is this Entity's ICE Engine stalled?

Overrides:
isStalled in class Entity
Returns:
if this Entity's ICE engine is stalled

isShutDown

public boolean isShutDown()
Overrides:
isShutDown in class Entity

doCheckEngineStallRoll

public java.util.Vector<Report> doCheckEngineStallRoll(java.util.Vector<Report> vPhaseReport)
Description copied from class: Entity
possibly do a ICE-Engine stall PSR, only industrialmechs will actually do such a roll

Overrides:
doCheckEngineStallRoll in class Entity
Parameters:
vPhaseReport - the Vector containing the phase reports
Returns:
a Vector containing the passed in reports, and any additional ones

checkUnstall

public void checkUnstall(java.util.Vector<Report> vPhaseReport)
Description copied from class: Entity
check for unstalling of this Entity's engine (only used for ICE industrial Mechs)

Overrides:
checkUnstall in class Entity
Parameters:
vPhaseReport - the Vector containing the phase reports

isPrimitive

public boolean isPrimitive()
Is this a primitive Mech?

Returns:

hasArmoredCockpit

public boolean hasArmoredCockpit()

hasArmoredGyro

public boolean hasArmoredGyro()

hasArmoredEngine

public boolean hasArmoredEngine()
Overrides:
hasArmoredEngine in class Entity

isCheckForCrit

public boolean isCheckForCrit()
should this mech check for a critical hit at the end of turn due to being an industrial mech and having been the target of a succesfull physical attack or for falling


getLevelsFallen

public int getLevelsFallen()
how many levels did this mech fall this turn?

Returns:

setLevelsFallen

public void setLevelsFallen(int levels)

setCheckForCrit

public void setCheckForCrit(boolean check)

isArm

public boolean isArm(int loc)
Is the passed in location an arm?

Parameters:
loc -
Returns:

getArmoredComponentBV

public double getArmoredComponentBV()

getGyroMultiplier

public double getGyroMultiplier()

setFullHeadEject

public void setFullHeadEject(boolean fullHeadEject)

hasFullHeadEject

public boolean hasFullHeadEject()

getBattleForcePoints

public int getBattleForcePoints()
Start of Battle Force Conversion Methods

Overrides:
getBattleForcePoints in class Entity

getBattleForceMovementPoints

public long getBattleForceMovementPoints()
Overrides:
getBattleForceMovementPoints in class Entity

getBattleForceJumpPoints

public long getBattleForceJumpPoints()
Overrides:
getBattleForceJumpPoints in class Entity

getBattleForceArmorPoints

public int getBattleForceArmorPoints()
Overrides:
getBattleForceArmorPoints in class Entity

getBattleForceStructurePoints

public int getBattleForceStructurePoints()
Description copied from class: Entity
this will be unit specific

Overrides:
getBattleForceStructurePoints in class Entity
Returns:

getBattleForceStandardWeaponsDamage

public int getBattleForceStandardWeaponsDamage(int range,
                                               int ammoType,
                                               boolean ignoreHeat,
                                               boolean ignoreSpecialAbility)
Overrides:
getBattleForceStandardWeaponsDamage in class Entity
ignoreHeat - if set to true then heat modifier is not used on damage
ignoreSpecialAbility - calculate special attacks into total damage if set to true
Returns:

getBattleForceSpecialAbilites

public java.lang.String getBattleForceSpecialAbilites()
Overrides:
getBattleForceSpecialAbilites in class Entity

getBattleForceSize

public int getBattleForceSize()
Overrides:
getBattleForceSize in class Entity