|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.TurnOrdered
megamek.common.Entity
megamek.common.Infantry
public class Infantry
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.
| 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 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 java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int squadn
public static final int LOC_INFANTRY
public static final int LOC_FIELD_GUNS
public int turnsLayingExplosives
public static final int DUG_IN_NONE
public static final int DUG_IN_WORKING
public static final int DUG_IN_COMPLETE
public static final int DUG_IN_FORTIFYING1
public static final int DUG_IN_FORTIFYING2
public static final int INF_PLT_MAX_MEN
public static final int INF_PLT_FOOT_MAX_MEN
public static final int INF_PLT_JUMP_MAX_MEN
public static final int INF_PLT_CLAN_MAX_MEN
public static final java.lang.String LEG_ATTACK
public static final java.lang.String SWARM_MEK
public static final java.lang.String STOP_SWARM
| Constructor Detail |
|---|
public Infantry()
| Method Detail |
|---|
public java.lang.String[] getLocationAbbrs()
getLocationAbbrs in class Entitypublic java.lang.String[] getLocationNames()
getLocationNames in class Entitypublic int locations()
locations in class Entitypublic boolean canChangeSecondaryFacing()
canChangeSecondaryFacing in class Entitypublic boolean isValidSecondaryFacing(int dir)
isValidSecondaryFacing in class Entitypublic int clipSecondaryFacing(int dir)
clipSecondaryFacing in class Entity
public int getWalkMP(boolean gravity,
boolean ignoreheat)
getWalkMP in class Entitygravity - Should the movement be factored for gravityignoreheat - Should heat be ignored?
public int getRunMP(boolean gravity,
boolean ignoreheat)
getRunMP in class Entity
public int getRunMPwithoutMASC(boolean gravity,
boolean ignoreheat)
getRunMPwithoutMASC in class Entitypublic int getJumpMP(boolean gravity)
Entity
getJumpMP in class Entitypublic boolean isHexProhibited(IHex hex)
isHexProhibited in class Entitypublic java.lang.String getMovementString(EntityMovementType mtype)
getMovementString in class Entitypublic java.lang.String getMovementAbbr(EntityMovementType mtype)
getMovementAbbr in class Entity
public HitData rollHitLocation(int table,
int side,
int aimedLocation,
int aimingMode)
rollHitLocation in class Entity
public HitData rollHitLocation(int table,
int side)
Entity
rollHitLocation in class Entitypublic HitData getTransferLocation(HitData hit)
getTransferLocation in class Entitypublic int getDependentLocation(int loc)
getDependentLocation in class Entitypublic boolean hasRearArmor(int loc)
hasRearArmor in class Entityprotected boolean isPlatoon()
BattleArmor.isPlatoon()public int getInternal(int loc)
getInternal in class Entitypublic int getOInternal(int loc)
getOInternal in class Entity
public void setInternal(int val,
int loc)
setInternal in class Entitypublic double getInternalRemainingPercent()
getInternalRemainingPercent in class Entity
public void initializeInternal(int val,
int loc)
initializeInternal in class Entitypublic void autoSetInternal()
autoSetInternal in class Entitypublic int getWeaponArc(int wn)
getWeaponArc in class Entitypublic boolean isSecondaryArcWeapon(int wn)
isSecondaryArcWeapon in class Entitypublic int getHeatCapacity()
getHeatCapacity in class Entitypublic int getHeatCapacityWithWater()
getHeatCapacityWithWater in class Entitypublic int getEngineCritHeat()
getEngineCritHeat in class Entityprotected int[] getNoOfSlots()
getNoOfSlots in class Entitypublic boolean hasHittableCriticals(int loc)
public int calculateBattleValue()
Entity
calculateBattleValue in class Entity
public int calculateBattleValue(boolean ignoreC3,
boolean ignorePilot)
calculateBattleValue in class EntityignoreC3 - 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 bvpublic java.util.Vector<Report> victoryReport()
Entity
victoryReport in class Entitypublic PilotingRollData addEntityBonuses(PilotingRollData prd)
addEntityBonuses in class Entitypublic int getMaxElevationChange()
getMaxElevationChange in class Entitypublic void applyDamage()
applyDamage in class Entitypublic int getShootingStrength()
public boolean canCharge()
Entity
canCharge in class Entitypublic boolean canDFA()
Entity
canDFA in class Entity
public PilotingRollData checkBogDown(MoveStep step,
IHex curHex,
Coords lastPos,
Coords curPos,
boolean isPavementStep)
public double getCost(boolean ignoreAmmo)
getCost in class Entitypublic boolean doomedInVacuum()
doomedInVacuum in class Entitypublic boolean doomedOnGround()
doomedOnGround in class Entitypublic boolean doomedInAtmosphere()
doomedInAtmosphere in class Entitypublic boolean doomedInSpace()
doomedInSpace in class Entitypublic boolean canAssaultDrop()
canAssaultDrop in class Entitypublic boolean isEligibleFor(IGame.Phase phase)
Entity
isEligibleFor in class Entitypublic boolean isEligibleForFiring()
Entity
isEligibleForFiring in class Entitypublic void newRound(int roundNumber)
Entity
newRound in interface RoundUpdatednewRound in class EntityroundNumber - the int number of the new round
public boolean loadWeapon(Mounted mounted,
Mounted mountedAmmo)
Entity
loadWeapon in class Entity
public boolean loadWeaponWithSameAmmo(Mounted mounted,
Mounted mountedAmmo)
Entity
loadWeaponWithSameAmmo in class Entitypublic void setDugIn(int i)
public int getDugIn()
public boolean isNuclearHardened()
Entity
isNuclearHardened in class Entitypublic void setTransportID(int transportID)
transportID - public void setAntiMek(boolean b)
public boolean isAntiMek()
public boolean isMechanized()
public int getTotalCommGearTons()
getTotalCommGearTons in class Entitypublic double getDamageDivisor()
public void setDamageDivisor(double d)
public boolean isArmorEncumbering()
public void setArmorEncumbering(boolean b)
public boolean hasSpaceSuit()
public void setSpaceSuit(boolean b)
public boolean hasDEST()
public void setDEST(boolean b)
public boolean hasSneakCamo()
public void setSneakCamo(boolean b)
public boolean hasSneakIR()
public void setSneakIR(boolean b)
public boolean hasSneakECM()
public void setSneakECM(boolean b)
public TargetRoll getStealthModifier(int range,
Entity ae)
range is not one of the
Entity class range constants, an
IllegalArgumentException will be thrown. Sub-classes
are encouraged to override this method.
getStealthModifier in class Entityrange - - an int value that must match one of the
Compute class range constants.ae - - the entity making the attack.
TargetRoll value that contains the stealth
modifier for the given range.public void setPrimaryWeapon(InfantryWeapon w)
public InfantryWeapon getPrimaryWeapon()
public void setSecondaryWeapon(InfantryWeapon w)
public InfantryWeapon getSecondaryWeapon()
public void setSquadSize(int size)
public int getSquadSize()
public void setSquadN(int n)
public int getSquadN()
public void setSecondaryN(int n)
public int getSecondaryN()
public double getDamagePerTrooper()
public boolean isSquad()
public void setMovementMode(EntityMovementMode movementMode)
setMovementMode in class Entitypublic boolean canAttackMeks()
public float getWeight()
getWeight in class Entitypublic java.lang.String getArmorDesc()
public void restore()
restore in class Entitypublic boolean hasActiveFieldArtillery()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||