megamek.common
Class Infantry

java.lang.Object
  extended by megamek.common.TurnOrdered
      extended by megamek.common.Entity
          extended by megamek.common.Infantry
All Implemented Interfaces:
java.io.Serializable, RoundUpdated, Targetable, Transporter
Direct Known Subclasses:
BattleArmor, MechWarrior

public class Infantry
extends Entity
implements java.io.Serializable

This class represents the lowest of the low, the ground pounders, the city rats, the PBI (Poor Bloody Infantry).

PLEASE NOTE!!! This class just represents unarmored infantry platoons as described by CitiTech (c) 1986. I've never seen the rules for powered armor, "anti-mech" troops, or Immortals.

Version:
$revision:$
Author:
Suvarov454@sourceforge.net (James A. Damour )
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class megamek.common.Entity
Entity.EntityFluff
 
Field Summary
static int DUG_IN_COMPLETE
           
static int DUG_IN_FORTIFYING1
           
static int DUG_IN_FORTIFYING2
           
static int DUG_IN_NONE
           
static int DUG_IN_WORKING
           
static int INF_PLT_CLAN_MAX_MEN
          The maximum number of men in an infantry platoon.
static int INF_PLT_FOOT_MAX_MEN
          The maximum number of men in an infantry platoon.
static int INF_PLT_JUMP_MAX_MEN
          The maximum number of men in an infantry platoon.
static int INF_PLT_MAX_MEN
          The maximum number of men in an infantry platoon.
static java.lang.String LEG_ATTACK
          The internal names of the anti-Mek attacks.
static int LOC_FIELD_GUNS
           
static int LOC_INFANTRY
          The location for infantry equipment.
protected  int squadn
          squad size and number
static java.lang.String STOP_SWARM
           
static java.lang.String SWARM_MEK
           
 int turnsLayingExplosives
           
 
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
Infantry()
          Generate a new, blank, infantry platoon.
 
Method Summary
 PilotingRollData addEntityBonuses(PilotingRollData prd)
          Infantry don't need piloting rolls.
 void applyDamage()
          Update the platoon to reflect damages taken in this phase.
 void autoSetInternal()
          Set the men in the platoon based on squad size and number
 int calculateBattleValue()
          Calculates the battle value of this entity
 int calculateBattleValue(boolean ignoreC3, boolean ignorePilot)
          Calculates the battle value of this platoon.
 boolean canAssaultDrop()
           
 boolean canAttackMeks()
           
 boolean canChangeSecondaryFacing()
          Infantry can face freely (except when dug in)
 boolean canCharge()
          Whether this type of unit can perform charges
 boolean canDFA()
          Whether this type of unit can perform DFA attacks
 PilotingRollData checkBogDown(MoveStep step, IHex curHex, Coords lastPos, Coords curPos, boolean isPavementStep)
          Checks if the entity is moving into a swamp.
 int clipSecondaryFacing(int dir)
          Infantry can face freely
 boolean doomedInAtmosphere()
           
 boolean doomedInSpace()
           
 boolean doomedInVacuum()
           
 boolean doomedOnGround()
           
 java.lang.String getArmorDesc()
           
 double getCost(boolean ignoreAmmo)
           
 double getDamageDivisor()
           
 double getDamagePerTrooper()
           
 int getDependentLocation(int loc)
          Gets the location that is destroyed recursively.
 int getDugIn()
           
 int getEngineCritHeat()
          Infantry build no heat.
 int getHeatCapacity()
          Infantry build no heat.
 int getHeatCapacityWithWater()
          Infantry build no heat.
 int getInternal(int loc)
          Returns the number of men left in the platoon, or IArmorState.ARMOR_DESTROYED.
 double getInternalRemainingPercent()
          Returns the percent of the men remaining in the platoon.
 int getJumpMP(boolean gravity)
          return this entity's current jump MP, possibly affected by gravity
 java.lang.String[] getLocationAbbrs()
           
 java.lang.String[] getLocationNames()
           
 int getMaxElevationChange()
          Infantry can only change 1 elevation level at a time.
 java.lang.String getMovementAbbr(EntityMovementType mtype)
          Returns the abbreviation of the type of movement used.
 java.lang.String getMovementString(EntityMovementType mtype)
          Returns the name of the type of movement used.
protected  int[] getNoOfSlots()
          Infantry have no critical slots.
 int getOInternal(int loc)
          Returns the number of men originally the platoon.
 InfantryWeapon getPrimaryWeapon()
           
 int getRunMP(boolean gravity, boolean ignoreheat)
          Return this Infantry's run MP, which is identical to its walk MP
 int getRunMPwithoutMASC(boolean gravity, boolean ignoreheat)
          Infantry don't have MASC
 int getSecondaryN()
           
 InfantryWeapon getSecondaryWeapon()
           
 int getShootingStrength()
          Get the number of men in the platoon (before damage is applied).
 int getSquadN()
           
 int getSquadSize()
           
 TargetRoll getStealthModifier(int range, Entity ae)
          Determine the stealth modifier for firing at this unit from the given range.
 int getTotalCommGearTons()
           
 HitData getTransferLocation(HitData hit)
          Infantry only have one hit location.
 int getWalkMP(boolean gravity, boolean ignoreheat)
          return this infantry's walk mp, adjusted for planetary conditions
 int getWeaponArc(int wn)
          Infantry can fire all around themselves.
 float getWeight()
           
 boolean hasActiveFieldArtillery()
           
 boolean hasDEST()
           
 boolean hasHittableCriticals(int loc)
          Infantry criticals can't be hit.
 boolean hasRearArmor(int loc)
          Infantry have no rear armor.
 boolean hasSneakCamo()
           
 boolean hasSneakECM()
           
 boolean hasSneakIR()
           
 boolean hasSpaceSuit()
           
 void initializeInternal(int val, int loc)
          Initializes the number of men in the platoon.
 boolean isAntiMek()
           
 boolean isArmorEncumbering()
           
 boolean isEligibleFor(IGame.Phase phase)
          Determines if an entity is eligible for a phase.
 boolean isEligibleForFiring()
          An entity is eligible if its to-hit number is anything but impossible.
 boolean isHexProhibited(IHex hex)
          Infantry can not enter water unless they have UMU mp or hover.
 boolean isMechanized()
           
 boolean isNuclearHardened()
          Checks if the unit is hardened agaist nuclear strikes.
protected  boolean isPlatoon()
          Infantry platoons do wierd and wacky things with armor and internals, but not all Infantry objects are platoons.
 boolean isSecondaryArcWeapon(int wn)
          Infantry can fire all around themselves.
 boolean isSquad()
           
 boolean isValidSecondaryFacing(int dir)
          Infantry can face freely
 boolean loadWeapon(Mounted mounted, Mounted mountedAmmo)
          Tries to load the specified weapon with the specified ammo.
 boolean loadWeaponWithSameAmmo(Mounted mounted, Mounted mountedAmmo)
          Tries to load the specified weapon with the specified ammo.
 int locations()
          Returns the number of locations in this platoon
 void newRound(int roundNumber)
          Start a new round
 void restore()
          Restores the entity after serialization
 HitData rollHitLocation(int table, int side)
          Rolls up a hit location
 HitData rollHitLocation(int table, int side, int aimedLocation, int aimingMode)
          Infantry only have one hit location.
 void setAntiMek(boolean b)
           
 void setArmorEncumbering(boolean b)
           
 void setDamageDivisor(double d)
           
 void setDEST(boolean b)
           
 void setDugIn(int i)
           
 void setInternal(int val, int loc)
          Sets the amount of men remaining in the platoon.
 void setMovementMode(EntityMovementMode movementMode)
          Set the movement type of the entity
 void setPrimaryWeapon(InfantryWeapon w)
           
 void setSecondaryN(int n)
           
 void setSecondaryWeapon(InfantryWeapon w)
           
 void setSneakCamo(boolean b)
           
 void setSneakECM(boolean b)
           
 void setSneakIR(boolean b)
           
 void setSpaceSuit(boolean b)
           
 void setSquadN(int n)
           
 void setSquadSize(int size)
           
 void setTransportID(int transportID)
          This function is called when loading a unit into a transport.
 java.util.Vector<Report> victoryReport()
          Generates a vector containing reports on all useful information about this entity.
 
Methods inherited from class megamek.common.Entity
absHeight, addBomb, addBomb, addConditionBonuses, addCoolantFailureAmount, addCritical, addCritical, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addEquipment, addFailedEquipment, addKill, addPassedThrough, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addPilotingModifierForTerrain, addTargetedBySwarm, addTransporter, addWeaponGroup, 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, checkUnstall, checkWaterMove, checkWaterMove, chooseSide, clearQuirks, climbMode, countQuirks, countQuirks, countWorkingMisc, damageBayDoor, damageDockCollar, damageDoorRecovery, decodeTransporters, deployOffBoard, destroy, destroyLocation, destroyRetractableBlade, doCheckEngineStallRoll, elevationOccupied, encodeTransporters, entityIsBiped, entityIsQuad, equals, extendBlade, findTargetedDisplacement, fixElevation, generateDisplayName, generateShortName, getActiveSensor, getActiveUMUCount, getActiveVibrobladeHeat, getAllUMUCount, getAltitude, getAmmo, getArmor, getArmor, getArmor, getArmorRemainingPercent, getArmorString, getArmorString, getArmorTechLevel, getArmorType, getArmorWeight, getArmsFlipped, getBadCriticals, getBAPRange, getBARRating, getBasePilotingRoll, getBasePilotingRoll, getBattleForceArmorPoints, getBattleForceDamageThresholdString, getBattleForceJumpPoints, getBattleForceMovement, getBattleForceMovementPoints, getBattleForceOverHeatValue, getBattleForcePoints, getBattleForceSize, getBattleForceSpecialAbilites, getBattleForceStandardWeaponsDamage, getBattleForceStandardWeaponsDamage, getBattleForceStandardWeaponsDamage, getBattleForceStandardWeaponsDamage, getBattleForceStructurePoints, getBattleForceTotalHeatGeneration, getBayByAmmo, getBayLoadedUnits, getBlueShieldRounds, getBombLoadout, getBombs, getBombs, getBVText, getC3Master, getC3MasterId, getC3NetId, getC3Top, getCargoMpReduction, getChassis, getClubs, getCoolantFailureAmount, getCrew, getCritical, getDamageReductionFromModularArmor, getDeployRound, getDisplacementAttack, getDisplayName, getDocks, getDroppableUnits, getECCMStrength, getECMRange, getECMStrength, getElevation, getEmptyCriticals, getEngine, getEquipment, getEquipment, getEquipmentNum, getEquipmentType, getEvasionBonus, getExteriorUnitAt, getExternalId, getExternalUnits, getExtraCommGearTons, getExtremeRangeModifier, getFacing, getFailedEquipment, getFighterBays, getFighterLaunchRate, getFirstBay, getFirstWeapon, getFluff, getForwardArc, getGame, getGaveKillCredit, getGhostTargetOverride, getGhostTargetRoll, getGhostTargetRollMoS, getGoodCriticals, getGoodCriticals, getGrappled, getGrappleSide, getGyroType, getHeading, getHeatFiringModifier, getHeatInArc, getHeatMPReduction, getHeight, getHitCriticals, getHittableCriticals, getHQIniBonus, getId, getINarcPodsAttached, getInternal, getInternalString, getJumpHeat, getJumpMP, getJumpMPWithTerrain, getJumpType, getKillNumber, getKills, getLastTarget, getLaunchableFighters, getLaunchableSmallCraft, getLoadedBay, getLoadedFighters, getLoadedSmallCraft, getLoadedUnits, getLocationAbbr, getLocationAbbr, getLocationFromAbbr, getLocationName, getLocationName, getLocationStatus, getLongRangeModifier, getMaxElevationDown, getMDIniBonus, getMediumRangeModifier, getMisc, getModel, getMovementBeforeSkidPSRModifier, getMovementMode, getMovementModeAsBattleForceString, getMovementModeAsString, getNextSensor, getNextWeapon, getNumberOf, getNumberOfCriticals, getNumberOfCriticals, getNumberOfCriticals, getNumberOfCriticals, getNumberOfShields, getOArmor, getOArmor, getOArmor, getOffBoardDirection, getOffBoardDistance, 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, 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, getWeightClass, getWeightClassName, getYear, hasActiveAngelECCM, hasActiveAngelECM, hasActiveBlueShield, hasActiveECCM, hasActiveECM, hasActiveECM, hasActiveEiCockpit, 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, 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, isEligibleForMovement, isEligibleForOffboard, isEligibleForPhysical, isEligibleForTargetingPhase, isEnemyOf, isEvading, isFighter, isFindingClub, isGrappleAttacker, 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, loadWeaponWithSameAmmo, locationHasCase, locationIsLeg, needsRollToStand, onSameC3NetworkAs, onSameC3NetworkAs, passedThrough, passedThroughPrevious, passedWithin, pickUp, printDebugToFile, recover, refreshLocations, reloadEmptyWeapons, removeAllINarcPods, removeAllTransporters, removeCriticals, removeINarcPod, removeMisc, removePartialCoverHits, resetBayDoors, resetFiringArcs, rollMovementInBuilding, setAltitude, setArcFired, setArmor, setArmor, setArmor, setArmorTechLevel, setArmorType, 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, setGameOptions, setGrappled, setGrappleSide, setHidden, setHullDown, setId, setIlluminated, setInternal, setLandedAssaultDrop, setLastTarget, setLayingMines, setLocationStatus, setMixedTech, setModel, 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

squadn

protected int squadn
squad size and number


LOC_INFANTRY

public static final int LOC_INFANTRY
The location for infantry equipment.

See Also:
Constant Field Values

LOC_FIELD_GUNS

public static final int LOC_FIELD_GUNS
See Also:
Constant Field Values

turnsLayingExplosives

public int turnsLayingExplosives

DUG_IN_NONE

public static final int DUG_IN_NONE
See Also:
Constant Field Values

DUG_IN_WORKING

public static final int DUG_IN_WORKING
See Also:
Constant Field Values

DUG_IN_COMPLETE

public static final int DUG_IN_COMPLETE
See Also:
Constant Field Values

DUG_IN_FORTIFYING1

public static final int DUG_IN_FORTIFYING1
See Also:
Constant Field Values

DUG_IN_FORTIFYING2

public static final int DUG_IN_FORTIFYING2
See Also:
Constant Field Values

INF_PLT_MAX_MEN

public static final int INF_PLT_MAX_MEN
The maximum number of men in an infantry platoon.

See Also:
Constant Field Values

INF_PLT_FOOT_MAX_MEN

public static final int INF_PLT_FOOT_MAX_MEN
The maximum number of men in an infantry platoon.

See Also:
Constant Field Values

INF_PLT_JUMP_MAX_MEN

public static final int INF_PLT_JUMP_MAX_MEN
The maximum number of men in an infantry platoon.

See Also:
Constant Field Values

INF_PLT_CLAN_MAX_MEN

public static final int INF_PLT_CLAN_MAX_MEN
The maximum number of men in an infantry platoon.

See Also:
Constant Field Values

LEG_ATTACK

public static final java.lang.String LEG_ATTACK
The internal names of the anti-Mek attacks.

See Also:
Constant Field Values

SWARM_MEK

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

STOP_SWARM

public static final java.lang.String STOP_SWARM
See Also:
Constant Field Values
Constructor Detail

Infantry

public Infantry()
Generate a new, blank, infantry platoon. Hopefully, we'll be loaded from somewhere.

Method Detail

getLocationAbbrs

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

getLocationNames

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

locations

public int locations()
Returns the number of locations in this platoon

Specified by:
locations in class Entity

canChangeSecondaryFacing

public boolean canChangeSecondaryFacing()
Infantry can face freely (except when dug in)

Specified by:
canChangeSecondaryFacing in class Entity

isValidSecondaryFacing

public boolean isValidSecondaryFacing(int dir)
Infantry can face freely

Specified by:
isValidSecondaryFacing in class Entity

clipSecondaryFacing

public int clipSecondaryFacing(int dir)
Infantry can face freely

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

getWalkMP

public int getWalkMP(boolean gravity,
                     boolean ignoreheat)
return this infantry's walk mp, adjusted for planetary conditions

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

getRunMP

public int getRunMP(boolean gravity,
                    boolean ignoreheat)
Return this Infantry's run MP, which is identical to its walk MP

Overrides:
getRunMP in class Entity

getRunMPwithoutMASC

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

Specified by:
getRunMPwithoutMASC in class Entity

getJumpMP

public int getJumpMP(boolean gravity)
Description copied from class: Entity
return this entity's current jump MP, possibly affected by gravity

Overrides:
getJumpMP in class Entity
Returns:

isHexProhibited

public boolean isHexProhibited(IHex hex)
Infantry can not enter water unless they have UMU mp or hover.

Overrides:
isHexProhibited in class Entity

getMovementString

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

Specified by:
getMovementString in class Entity

getMovementAbbr

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

Specified by:
getMovementAbbr in class Entity

rollHitLocation

public HitData rollHitLocation(int table,
                               int side,
                               int aimedLocation,
                               int aimingMode)
Infantry only have one hit location.

Specified by:
rollHitLocation in class Entity

rollHitLocation

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

Specified by:
rollHitLocation in class Entity

getTransferLocation

public HitData getTransferLocation(HitData hit)
Infantry only have one hit location.

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

hasRearArmor

public boolean hasRearArmor(int loc)
Infantry have no rear armor.

Specified by:
hasRearArmor in class Entity

isPlatoon

protected boolean isPlatoon()
Infantry platoons do wierd and wacky things with armor and internals, but not all Infantry objects are platoons.

See Also:
BattleArmor.isPlatoon()

getInternal

public int getInternal(int loc)
Returns the number of men left in the platoon, or IArmorState.ARMOR_DESTROYED.

Overrides:
getInternal in class Entity

getOInternal

public int getOInternal(int loc)
Returns the number of men originally the platoon.

Overrides:
getOInternal in class Entity

setInternal

public void setInternal(int val,
                        int loc)
Sets the amount of men remaining in the platoon.

Overrides:
setInternal in class Entity

getInternalRemainingPercent

public double getInternalRemainingPercent()
Returns the percent of the men remaining in the platoon.

Overrides:
getInternalRemainingPercent in class Entity

initializeInternal

public void initializeInternal(int val,
                               int loc)
Initializes the number of men in the platoon. Sets the original and starting point of the platoon to the same number.

Overrides:
initializeInternal in class Entity

autoSetInternal

public void autoSetInternal()
Set the men in the platoon based on squad size and number

Specified by:
autoSetInternal in class Entity

getWeaponArc

public int getWeaponArc(int wn)
Infantry can fire all around themselves. But field guns are set up to a vehicular turret facing

Specified by:
getWeaponArc in class Entity

isSecondaryArcWeapon

public boolean isSecondaryArcWeapon(int wn)
Infantry can fire all around themselves. But field guns act like turret mounted on a tank

Specified by:
isSecondaryArcWeapon in class Entity

getHeatCapacity

public int getHeatCapacity()
Infantry build no heat.

Specified by:
getHeatCapacity in class Entity

getHeatCapacityWithWater

public int getHeatCapacityWithWater()
Infantry build no heat.

Specified by:
getHeatCapacityWithWater in class Entity

getEngineCritHeat

public int getEngineCritHeat()
Infantry build no heat.

Specified by:
getEngineCritHeat in class Entity

getNoOfSlots

protected int[] getNoOfSlots()
Infantry have no critical slots.

Specified by:
getNoOfSlots in class Entity

hasHittableCriticals

public boolean hasHittableCriticals(int loc)
Infantry criticals can't be hit.


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 platoon.

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

addEntityBonuses

public PilotingRollData addEntityBonuses(PilotingRollData prd)
Infantry don't need piloting rolls.

Specified by:
addEntityBonuses in class Entity

getMaxElevationChange

public int getMaxElevationChange()
Infantry can only change 1 elevation level at a time.

Specified by:
getMaxElevationChange in class Entity

applyDamage

public void applyDamage()
Update the platoon to reflect damages taken in this phase.

Overrides:
applyDamage in class Entity

getShootingStrength

public int getShootingStrength()
Get the number of men in the platoon (before damage is applied).


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

checkBogDown

public PilotingRollData checkBogDown(MoveStep step,
                                     IHex curHex,
                                     Coords lastPos,
                                     Coords curPos,
                                     boolean isPavementStep)
Checks if the entity is moving into a swamp. If so, returns the target roll for the piloting skill check. now includes the level 3 terains which can bog down


getCost

public double getCost(boolean ignoreAmmo)
Specified by:
getCost in class Entity
Returns:
The cost in C-Bills of the Infantry 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

canAssaultDrop

public boolean canAssaultDrop()
Overrides:
canAssaultDrop in class Entity

isEligibleFor

public boolean isEligibleFor(IGame.Phase phase)
Description copied from class: Entity
Determines if an entity is eligible for a phase.

Overrides:
isEligibleFor in class Entity

isEligibleForFiring

public boolean isEligibleForFiring()
Description copied from class: Entity
An entity is eligible if its to-hit number is anything but impossible. This is only really an issue if friendly fire is turned off.

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

loadWeapon

public boolean loadWeapon(Mounted mounted,
                          Mounted mountedAmmo)
Description copied from class: Entity
Tries to load the specified weapon with the specified ammo. Returns true if successful, false otherwise.

Overrides:
loadWeapon in class Entity

loadWeaponWithSameAmmo

public boolean loadWeaponWithSameAmmo(Mounted mounted,
                                      Mounted mountedAmmo)
Description copied from class: Entity
Tries to load the specified weapon with the specified ammo. Returns true if successful, false otherwise.

Overrides:
loadWeaponWithSameAmmo in class Entity

setDugIn

public void setDugIn(int i)

getDugIn

public int getDugIn()

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.

setTransportID

public void setTransportID(int transportID)
This function is called when loading a unit into a transport. This is overridden to ensure infantry are no longer considered dug in when they are being transported.

Parameters:
transportID -

setAntiMek

public void setAntiMek(boolean b)

isAntiMek

public boolean isAntiMek()

isMechanized

public boolean isMechanized()

getTotalCommGearTons

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

getDamageDivisor

public double getDamageDivisor()

setDamageDivisor

public void setDamageDivisor(double d)

isArmorEncumbering

public boolean isArmorEncumbering()

setArmorEncumbering

public void setArmorEncumbering(boolean b)

hasSpaceSuit

public boolean hasSpaceSuit()

setSpaceSuit

public void setSpaceSuit(boolean b)

hasDEST

public boolean hasDEST()

setDEST

public void setDEST(boolean b)

hasSneakCamo

public boolean hasSneakCamo()

setSneakCamo

public void setSneakCamo(boolean b)

hasSneakIR

public boolean hasSneakIR()

setSneakIR

public void setSneakIR(boolean b)

hasSneakECM

public boolean hasSneakECM()

setSneakECM

public void setSneakECM(boolean b)

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 - - the entity making the attack.
Returns:
a TargetRoll value that contains the stealth modifier for the given range.

setPrimaryWeapon

public void setPrimaryWeapon(InfantryWeapon w)

getPrimaryWeapon

public InfantryWeapon getPrimaryWeapon()

setSecondaryWeapon

public void setSecondaryWeapon(InfantryWeapon w)

getSecondaryWeapon

public InfantryWeapon getSecondaryWeapon()

setSquadSize

public void setSquadSize(int size)

getSquadSize

public int getSquadSize()

setSquadN

public void setSquadN(int n)

getSquadN

public int getSquadN()

setSecondaryN

public void setSecondaryN(int n)

getSecondaryN

public int getSecondaryN()

getDamagePerTrooper

public double getDamagePerTrooper()

isSquad

public boolean isSquad()

setMovementMode

public void setMovementMode(EntityMovementMode movementMode)
Set the movement type of the entity

Overrides:
setMovementMode in class Entity

canAttackMeks

public boolean canAttackMeks()

getWeight

public float getWeight()
Overrides:
getWeight in class Entity

getArmorDesc

public java.lang.String getArmorDesc()

restore

public void restore()
Restores the entity after serialization

Overrides:
restore in class Entity

hasActiveFieldArtillery

public boolean hasActiveFieldArtillery()