megamek.common
Class Protomech

java.lang.Object
  extended by megamek.common.TurnOrdered
      extended by megamek.common.Entity
          extended by megamek.common.Protomech
All Implemented Interfaces:
java.io.Serializable, RoundUpdated, Targetable, Transporter

public class Protomech
extends Entity

Protomechs. Level 2 Clan equipment.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class megamek.common.Entity
Entity.EntityFluff
 
Field Summary
static int LOC_HEAD
           
static int LOC_LARM
           
static int LOC_LEG
           
static int LOC_MAINGUN
           
static int LOC_NMISS
           
static int LOC_RARM
           
static int LOC_TORSO
           
static int NUM_PMECH_LOCATIONS
           
static int[] POSSIBLE_PILOT_DAMAGE
           
static int SYSTEM_ARMCRIT
           
static int SYSTEM_HEADCRIT
           
static int SYSTEM_LEGCRIT
           
static int SYSTEM_TORSO_WEAPON_A
           
static int SYSTEM_TORSO_WEAPON_B
           
static int SYSTEM_TORSOCRIT
           
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
Protomech()
          Construct a new, blank, pmech.
 
Method Summary
 PilotingRollData addEntityBonuses(PilotingRollData roll)
          Add in any piloting skill mods
 Mounted addEquipment(EquipmentType etype, int loc)
          Creates a new mount for this equipment and adds it in.
 Mounted addEquipment(EquipmentType etype, int loc, boolean rearMounted)
          Creates a new mount for this equipment and adds it in.
 Mounted addEquipment(EquipmentType etype, int loc, boolean rearMounted, int shots)
          mounting weapons needs to take account of ammo
protected  void addEquipment(Mounted mounted, int loc, boolean rearMounted, int shots)
          Mounts the specified weapon in the specified location.
 void autoSetInternal()
          Set the internal structure to the appropriate value for the pmech's weight class
 int calculateBattleValue()
          Calculates the battle value of this entity
 int calculateBattleValue(boolean ignoreC3, boolean ignorePilot)
          Calculates the battle value of this pmech.
 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
 boolean canTransferCriticals(int loc)
          Protos can't transfer crits.
 PilotingRollData checkSkid(EntityMovementType moveType, IHex prevHex, EntityMovementType overallMoveType, MoveStep prevStep, int prevFacing, int curFacing, Coords lastPos, Coords curPos, boolean isInfantry, int distance)
          Checks if the entity might skid on pavement.
 int clipSecondaryFacing(int dir)
          Return the nearest valid direction to torso twist in
 boolean doomedInAtmosphere()
           
 boolean doomedInSpace()
           
 boolean doomedInVacuum()
           
 boolean doomedOnGround()
           
 int getArmor(int loc, boolean rear)
          Returns the amount of armor in the location specified, or IArmorState.ARMOR_NA, or IArmorState.ARMOR_DESTROYED.
 PilotingRollData getBasePilotingRoll()
          Protos don't take piloting skill rolls.
 double getCost(boolean ignoreAmmo)
           
 int getCritsHit(int loc)
          Counts the # of crits taken by proto in the location.
 int getDependentLocation(int loc)
          Gets the location that is destroyed recursively
 int getEngineCritHeat()
          Returns extra heat generated by engine crits
 int getGrappled()
           
 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.
static int getInnerLocation(int location)
           
 int getInternal(int loc)
          Returns the amount of internal structure in the location specified, or ARMOR_NA, or ARMOR_DESTROYED.
 int getJumpMP()
          This pmech's jumping MP modified for missing jump jets and gravity.
 int getJumpMPWithTerrain()
          Returns this mech's jumping MP, modified for missing & underwater jets.
 java.lang.String getLocationAbbr(int loc)
          Returns the abbreviated name of the location specified.
 java.lang.String[] getLocationAbbrs()
           
 java.lang.String[] getLocationNames()
           
 int getMaxElevationChange()
          The maximum elevation change the entity can cross
 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.
protected  int[] getNoOfSlots()
           
 int getNumberOfCriticals(int loc)
          Returns the number of total critical slots in a location
 int getPilotDamageTaken(int loc)
          Returns # of pilot damage points taken due to crits to the location so far.
 int getRunMP(boolean gravity, boolean ignoreheat)
           
 int getRunMPwithoutMASC(boolean gravity, boolean ignoreheat)
          Returns run MP without considering MASC, optionally figuring in gravity and possibly ignoring heat
 int getRunMPwithoutMyomerBooster(boolean gravity, boolean ignoreheat)
          get this ProtoMech's run MP without factoring in a possible myomer booster
 Mounted getTorsoWeapon(boolean isTorsoA)
          Get the weapon in the given torso location (if any).
 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 and possibly gravity.
 int getWeaponArc(int wn)
          Returns the Compute.ARC that the weapon fires into.
 boolean hasActiveEiCockpit()
           
 boolean hasMainGun()
           
 boolean hasMyomerBooster()
          does this protomech mount a myomer booster?
 boolean hasRearArmor(int loc)
          Does this location have rear armor?
 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 isNuclearHardened()
          Checks if the unit is hardened agaist nuclear strikes.
 boolean isSecondaryArcWeapon(int weaponId)
          Returns true if this weapon fires into the secondary facing arc.
 boolean isValidSecondaryFacing(int dir)
          Can this pmech torso twist in the given direction?
 int locations()
          Returns the number of locations in the entity
 void newRound(int roundNumber)
          Override Entity#newRound() method.
 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 setCrew(Pilot p)
          Protomechs have no piloting skill (set to 5 for BV purposes)
 void setEngine(Engine engine)
           
 void setGrappled(int id, boolean attacker)
           
 void setHasMainGun(boolean b)
           
 void setInternal(int head, int torso, int arm, int legs, int mainGun)
          Sets the internal structure for the pmech.
 void setPilotDamageTaken(int loc, int damage)
          Tells the Protomech to note pilot damage taken from crit damage to the location
 boolean shaded(int loc, int numHit)
          A "shaded" critical is a box shaded on the record sheet, implies pilot damage when hit.
 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, 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, canUnjamRAC, canUnstickByJumping, checkBogDown, checkDislodgeSwarmers, checkGetUp, checkLandingInHeavyWoods, checkLandingOnIce, checkLandingWithDamage, checkMovedTooFast, checkMovementInBuilding, checkRecklessMove, checkRubbleMove, checkRunningWithDamage, checkSideSlip, 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, getArmorRemainingPercent, getArmorString, getArmorString, getArmorTechLevel, getArmorType, getArmorWeight, getArmsFlipped, getBadCriticals, getBAPRange, getBARRating, 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, getForwardArc, getGame, getGaveKillCredit, getGhostTargetOverride, getGhostTargetRoll, getGhostTargetRollMoS, getGoodCriticals, getGoodCriticals, getGrappleSide, getGyroType, getHeading, getHeatFiringModifier, getHeatInArc, getHeatMPReduction, getHeight, getHitCriticals, getHittableCriticals, getHQIniBonus, getId, getINarcPodsAttached, getInternal, getInternalRemainingPercent, getInternalString, getJumpHeat, getJumpMP, getJumpType, getKillNumber, getKills, getLastTarget, getLaunchableFighters, getLaunchableSmallCraft, getLoadedBay, getLoadedFighters, getLoadedSmallCraft, getLoadedUnits, getLocationAbbr, getLocationFromAbbr, getLocationName, getLocationName, getLocationStatus, getLongRangeModifier, getMaxElevationDown, getMDIniBonus, getMediumRangeModifier, getMisc, getModel, getMovementBeforeSkidPSRModifier, getMovementMode, getMovementModeAsBattleForceString, getMovementModeAsString, getNextSensor, getNextWeapon, getNumberOf, getNumberOfCriticals, getNumberOfCriticals, getNumberOfCriticals, getNumberOfShields, getOArmor, getOArmor, getOArmor, getOffBoardDirection, getOffBoardDistance, getOInternal, getOInternal, getOriginalJumpMP, getOriginalRunMP, getOriginalSprintMP, getOriginalWalkMP, getOwner, getOwnerId, getPassedThrough, getPickedUpMechWarriors, getPosition, getPriorPosition, getQuirkIniBonus, getQuirkList, getQuirks, getRearArc, getRecoveryTurn, getRemovalCondition, getRetreatedDirection, getRunHeat, 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, 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, getWalkHeat, getWalkMP, getWeaponBayList, getWeaponGroupList, getWeaponList, getWeapons, getWeaponsAndEquipmentCost, getWeaponsAndEquipmentCost, getWeight, getWeightClass, getWeightClassName, getYear, hasActiveAngelECCM, hasActiveAngelECM, hasActiveBlueShield, hasActiveECCM, hasActiveECM, hasActiveECM, hasActiveShield, hasActiveShield, hasAimModeTargComp, hasArcFired, hasArmoredChassis, hasArmoredEngine, hasBAP, hasBAP, hasBARArmor, hasBattleArmorHandles, hasC3, hasC3i, hasC3M, hasC3MM, hasC3S, hasCASEII, hasCASEII, hasDisplacementAttack, hasEiCockpit, hasEnvironmentalSealing, hasFunctionalArmAES, hasFunctionalLegAES, hasGhostTargets, hasHipCrit, hasINarcPodsAttached, hasInfernoAmmo, hasLegActuatorCrit, hasLinkedMGA, hasModularArmor, hasModularArmor, 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, isEligibleForOffboard, isEligibleForPhysical, isEligibleForTargetingPhase, isEnemyOf, isEvading, isFighter, isFindingClub, isHidden, isHullDown, isIlluminated, isImmobile, isINarcedBy, isINarcedWith, isLargeCraft, isLayingMines, isLoadableThisTurn, isLocationBad, isLocationDoomed, isMakingDfa, isMilitary, isMixedTech, isNarcedBy, isNOE, isNullSigActive, isOffBoard, isOmni, isOnSameSheet, isPartOfFighterSquadron, isProne, isPushing, isRamming, isReckless, isRepairable, isSalvage, isSeenByEnemy, isSelectableThisTurn, isShutDown, isShutDownThisPhase, isSpotting, isStalled, isStealthActive, isStealthOn, 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, restore, rollMovementInBuilding, setAltitude, setArcFired, setArmor, setArmor, setArmor, setArmorTechLevel, setArmorType, setArmorType, setArmsFlipped, setAssaultDropInProgress, setBATaserShutdown, setC3Master, setC3Master, setC3NetId, setCanon, setCanUnstickByJumping, setCaptured, setCarcass, setCarefulStand, setChassis, setClearingMinefield, setClimbMode, setCommander, setCritical, setDeployed, setDeployRound, setDesignValid, setDestroyed, setDisplacementAttack, setDone, setDoomed, setElevation, setEMI, setEvading, setExternalId, setFacing, setFindingClub, setGame, setGameOptions, setGrappleSide, setHidden, setHullDown, setId, setIlluminated, setInternal, setInternal, setLandedAssaultDrop, setLastTarget, setLayingMines, setLocationStatus, setMixedTech, setModel, setMovementMode, setNextSensor, setOffBoard, setOmni, 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_PMECH_LOCATIONS

public static final int NUM_PMECH_LOCATIONS
See Also:
Constant Field Values

LOC_HEAD

public static final int LOC_HEAD
See Also:
Constant Field Values

LOC_TORSO

public static final int LOC_TORSO
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_LEG

public static final int LOC_LEG
See Also:
Constant Field Values

LOC_MAINGUN

public static final int LOC_MAINGUN
See Also:
Constant Field Values

LOC_NMISS

public static final int LOC_NMISS
See Also:
Constant Field Values

SYSTEM_ARMCRIT

public static final int SYSTEM_ARMCRIT
See Also:
Constant Field Values

SYSTEM_LEGCRIT

public static final int SYSTEM_LEGCRIT
See Also:
Constant Field Values

SYSTEM_HEADCRIT

public static final int SYSTEM_HEADCRIT
See Also:
Constant Field Values

SYSTEM_TORSOCRIT

public static final int SYSTEM_TORSOCRIT
See Also:
Constant Field Values

SYSTEM_TORSO_WEAPON_A

public static final int SYSTEM_TORSO_WEAPON_A
See Also:
Constant Field Values

SYSTEM_TORSO_WEAPON_B

public static final int SYSTEM_TORSO_WEAPON_B
See Also:
Constant Field Values

POSSIBLE_PILOT_DAMAGE

public static final int[] POSSIBLE_PILOT_DAMAGE

systemNames

public static final java.lang.String[] systemNames
Constructor Detail

Protomech

public Protomech()
Construct a new, blank, pmech.

Method Detail

getNoOfSlots

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

getPilotDamageTaken

public int getPilotDamageTaken(int loc)
Returns # of pilot damage points taken due to crits to the location so far.


getTorsoWeapon

public Mounted getTorsoWeapon(boolean isTorsoA)
Get the weapon in the given torso location (if any).

Parameters:
isTorsoA - - a boolean that is true if the weapon in "Torso A" is needed; false if the weapon in "Torso B" is needed.
Returns:
the Mounted weapon at the needed location. This value will be null if no weapon is in the indicated location.

setPilotDamageTaken

public void setPilotDamageTaken(int loc,
                                int damage)
Tells the Protomech to note pilot damage taken from crit damage to the location


getBasePilotingRoll

public PilotingRollData getBasePilotingRoll()
Protos don't take piloting skill rolls.

Overrides:
getBasePilotingRoll in class Entity

shaded

public boolean shaded(int loc,
                      int numHit)
A "shaded" critical is a box shaded on the record sheet, implies pilot damage when hit. Returns whether shaded.


getWalkMP

public int getWalkMP(boolean gravity,
                     boolean ignoreheat)
Description copied from class: Entity
Returns this entity's walking/cruising mp, factored for heat and possibly gravity.

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

getCritsHit

public int getCritsHit(int loc)
Counts the # of crits taken by proto in the location. Needed in several places, due to proto set criticals.


getInnerLocation

public static int getInnerLocation(int location)

addEntityBonuses

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

Specified by:
addEntityBonuses in class Entity

getNumberOfCriticals

public int getNumberOfCriticals(int loc)
Returns the number of total critical slots in a location

Overrides:
getNumberOfCriticals in class Entity

newRound

public void newRound(int roundNumber)
Override Entity#newRound() method.

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

getJumpMP

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

Overrides:
getJumpMP in class Entity

getJumpMPWithTerrain

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

Overrides:
getJumpMPWithTerrain 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

getHeatCapacity

public int getHeatCapacity()
Returns the amount of heat that the entity can sink each turn. Pmechs have no heat. //FIXME However, the number of heat sinks they have IS importnat... For cost and validation purposes.

Specified by:
getHeatCapacity in class Entity

getLocationNames

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

getMovementString

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

getEngineCritHeat

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

Specified by:
getEngineCritHeat in class Entity

isValidSecondaryFacing

public boolean isValidSecondaryFacing(int dir)
Can this pmech 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

getRunMPwithoutMyomerBooster

public int getRunMPwithoutMyomerBooster(boolean gravity,
                                        boolean ignoreheat)
get this ProtoMech's run MP without factoring in a possible myomer booster

Parameters:
gravity -
ignoreheat -
Returns:

getRunMP

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

hasMyomerBooster

public boolean hasMyomerBooster()
does this protomech mount a myomer booster?

Returns:

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

canTransferCriticals

public boolean canTransferCriticals(int loc)
Protos can't transfer crits.

Overrides:
canTransferCriticals 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

setInternal

public void setInternal(int head,
                        int torso,
                        int arm,
                        int legs,
                        int mainGun)
Sets the internal structure for the pmech.

Parameters:
head - head
torso - center torso
arm - right/left arm
legs - right/left leg
mainGun - main gun

autoSetInternal

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

Specified by:
autoSetInternal in class Entity

addEquipment

public Mounted addEquipment(EquipmentType etype,
                            int loc)
                     throws LocationFullException
Creates a new mount for this equipment and adds it in.

Overrides:
addEquipment in class Entity
Throws:
LocationFullException

addEquipment

public Mounted addEquipment(EquipmentType etype,
                            int loc,
                            boolean rearMounted)
                     throws LocationFullException
Description copied from class: Entity
Creates a new mount for this equipment and adds it in.

Overrides:
addEquipment in class Entity
Throws:
LocationFullException

addEquipment

public Mounted addEquipment(EquipmentType etype,
                            int loc,
                            boolean rearMounted,
                            int shots)
                     throws LocationFullException
Description copied from class: Entity
mounting weapons needs to take account of ammo

Overrides:
addEquipment in class Entity
Returns:
Throws:
LocationFullException

addEquipment

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

Overrides:
addEquipment in class Entity
Throws:
LocationFullException

calculateBattleValue

public int calculateBattleValue()
Description copied from class: Entity
Calculates the battle value of this entity

Specified by:
calculateBattleValue in class Entity

calculateBattleValue

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

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

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

getMaxElevationChange

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

Specified by:
getMaxElevationChange in class Entity

getArmor

public int getArmor(int loc,
                    boolean rear)
Description copied from class: Entity
Returns the amount of armor in the location specified, or IArmorState.ARMOR_NA, or IArmorState.ARMOR_DESTROYED.

Overrides:
getArmor in class Entity

getInternal

public int getInternal(int loc)
Description copied from class: Entity
Returns the amount of internal structure in the location specified, or ARMOR_NA, or ARMOR_DESTROYED.

Overrides:
getInternal in class Entity

getLocationAbbrs

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

getLocationAbbr

public java.lang.String getLocationAbbr(int loc)
Description copied from class: Entity
Returns the abbreviated name of the location specified.

Overrides:
getLocationAbbr in class Entity

hasMainGun

public boolean hasMainGun()

setHasMainGun

public void setHasMainGun(boolean b)

locations

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

Specified by:
locations in class Entity

setCrew

public void setCrew(Pilot p)
Protomechs have no piloting skill (set to 5 for BV purposes)

Overrides:
setCrew 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

getCost

public double getCost(boolean ignoreAmmo)
Specified by:
getCost in class Entity
Returns:
The cost in C-Bills of the ProtoMech in question.

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

hasActiveEiCockpit

public boolean hasActiveEiCockpit()
Overrides:
hasActiveEiCockpit in class Entity

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

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.

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

getTotalCommGearTons

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

checkSkid

public PilotingRollData checkSkid(EntityMovementType moveType,
                                  IHex prevHex,
                                  EntityMovementType overallMoveType,
                                  MoveStep prevStep,
                                  int prevFacing,
                                  int curFacing,
                                  Coords lastPos,
                                  Coords curPos,
                                  boolean isInfantry,
                                  int distance)
Description copied from class: Entity
Checks if the entity might skid on pavement. If so, returns the target roll for the piloting skill check.

Overrides:
checkSkid 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

setEngine

public void setEngine(Engine engine)