|
|||||||||
| 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.Protomech
public class Protomech
Protomechs. Level 2 Clan equipment.
| 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 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 java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int NUM_PMECH_LOCATIONS
public static final int LOC_HEAD
public static final int LOC_TORSO
public static final int LOC_RARM
public static final int LOC_LARM
public static final int LOC_LEG
public static final int LOC_MAINGUN
public static final int LOC_NMISS
public static final int SYSTEM_ARMCRIT
public static final int SYSTEM_LEGCRIT
public static final int SYSTEM_HEADCRIT
public static final int SYSTEM_TORSOCRIT
public static final int SYSTEM_TORSO_WEAPON_A
public static final int SYSTEM_TORSO_WEAPON_B
public static final int[] POSSIBLE_PILOT_DAMAGE
public static final java.lang.String[] systemNames
| Constructor Detail |
|---|
public Protomech()
| Method Detail |
|---|
protected int[] getNoOfSlots()
getNoOfSlots in class Entitypublic int getPilotDamageTaken(int loc)
public Mounted getTorsoWeapon(boolean isTorsoA)
isTorsoA - - a boolean that is true if
the weapon in "Torso A" is needed; false if the
weapon in "Torso B" is needed.
Mounted weapon at the needed location. This
value will be null if no weapon is in the
indicated location.
public void setPilotDamageTaken(int loc,
int damage)
public PilotingRollData getBasePilotingRoll()
getBasePilotingRoll in class Entity
public boolean shaded(int loc,
int numHit)
public int getWalkMP(boolean gravity,
boolean ignoreheat)
Entity
getWalkMP in class Entitygravity - Should the movement be factored for gravityignoreheat - Should heat be ignored?public int getCritsHit(int loc)
public static int getInnerLocation(int location)
public PilotingRollData addEntityBonuses(PilotingRollData roll)
addEntityBonuses in class Entitypublic int getNumberOfCriticals(int loc)
getNumberOfCriticals in class Entitypublic void newRound(int roundNumber)
newRound in interface RoundUpdatednewRound in class EntityroundNumber - the int number of the new roundpublic int getJumpMP()
getJumpMP in class Entitypublic int getJumpMPWithTerrain()
getJumpMPWithTerrain in class Entitypublic int getHeatCapacityWithWater()
Entity
getHeatCapacityWithWater in class Entitypublic int getHeatCapacity()
getHeatCapacity in class Entitypublic java.lang.String[] getLocationNames()
getLocationNames in class Entitypublic java.lang.String getMovementString(EntityMovementType mtype)
getMovementString in class Entitypublic java.lang.String getMovementAbbr(EntityMovementType mtype)
getMovementAbbr in class Entitypublic boolean canChangeSecondaryFacing()
Entity
canChangeSecondaryFacing in class Entitypublic int getEngineCritHeat()
Entity
getEngineCritHeat in class Entitypublic boolean isValidSecondaryFacing(int dir)
isValidSecondaryFacing in class Entitypublic int clipSecondaryFacing(int dir)
clipSecondaryFacing in class Entitypublic boolean hasRearArmor(int loc)
Entity
hasRearArmor in class Entity
public int getRunMPwithoutMyomerBooster(boolean gravity,
boolean ignoreheat)
gravity - ignoreheat -
public int getRunMP(boolean gravity,
boolean ignoreheat)
getRunMP in class Entitypublic boolean hasMyomerBooster()
public int getWeaponArc(int wn)
getWeaponArc in class Entitypublic boolean isSecondaryArcWeapon(int weaponId)
isSecondaryArcWeapon in class Entity
public HitData rollHitLocation(int table,
int side)
rollHitLocation in class Entity
public HitData rollHitLocation(int table,
int side,
int aimedLocation,
int aimingMode)
Entity
rollHitLocation in class Entitypublic boolean canTransferCriticals(int loc)
canTransferCriticals in class Entitypublic HitData getTransferLocation(HitData hit)
getTransferLocation in class Entitypublic int getDependentLocation(int loc)
getDependentLocation in class Entity
public void setInternal(int head,
int torso,
int arm,
int legs,
int mainGun)
head - headtorso - center torsoarm - right/left armlegs - right/left legmainGun - main gunpublic void autoSetInternal()
autoSetInternal in class Entity
public Mounted addEquipment(EquipmentType etype,
int loc)
throws LocationFullException
addEquipment in class EntityLocationFullException
public Mounted addEquipment(EquipmentType etype,
int loc,
boolean rearMounted)
throws LocationFullException
Entity
addEquipment in class EntityLocationFullException
public Mounted addEquipment(EquipmentType etype,
int loc,
boolean rearMounted,
int shots)
throws LocationFullException
Entity
addEquipment in class EntityLocationFullException
protected void addEquipment(Mounted mounted,
int loc,
boolean rearMounted,
int shots)
throws LocationFullException
addEquipment in class EntityLocationFullExceptionpublic 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 int getMaxElevationChange()
Entity
getMaxElevationChange in class Entity
public int getArmor(int loc,
boolean rear)
Entity
getArmor in class Entitypublic int getInternal(int loc)
Entity
getInternal in class Entitypublic java.lang.String[] getLocationAbbrs()
getLocationAbbrs in class Entitypublic java.lang.String getLocationAbbr(int loc)
Entity
getLocationAbbr in class Entitypublic boolean hasMainGun()
public void setHasMainGun(boolean b)
public int locations()
locations in class Entitypublic void setCrew(Pilot p)
setCrew in class Entitypublic boolean canCharge()
Entity
canCharge in class Entitypublic boolean canDFA()
Entity
canDFA in class Entitypublic 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 hasActiveEiCockpit()
hasActiveEiCockpit in class Entitypublic boolean canAssaultDrop()
canAssaultDrop in class Entitypublic boolean isHexProhibited(IHex hex)
Entity
isHexProhibited in class Entitypublic boolean isNuclearHardened()
Entity
isNuclearHardened in class Entity
public void setGrappled(int id,
boolean attacker)
setGrappled in class Entitypublic boolean isGrappleAttacker()
isGrappleAttacker in class Entitypublic int getGrappled()
getGrappled in class Entitypublic boolean isEligibleForMovement()
Entity
isEligibleForMovement in class Entitypublic int getTotalCommGearTons()
getTotalCommGearTons in class Entity
public PilotingRollData checkSkid(EntityMovementType moveType,
IHex prevHex,
EntityMovementType overallMoveType,
MoveStep prevStep,
int prevFacing,
int curFacing,
Coords lastPos,
Coords curPos,
boolean isInfantry,
int distance)
Entity
checkSkid in class Entity
public int getRunMPwithoutMASC(boolean gravity,
boolean ignoreheat)
Entity
getRunMPwithoutMASC in class Entitypublic void setEngine(Engine engine)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||