megamek.common
Class Pilot

java.lang.Object
  extended by megamek.common.Pilot
All Implemented Interfaces:
java.io.Serializable

public class Pilot
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static int DEATH
          The number of hits that a pilot can take before he dies.
static java.lang.String PORTRAIT_NONE
           
static java.lang.String ROOT_PORTRAIT
           
static java.lang.String SPECIAL_BALLISTIC
           
static java.lang.String SPECIAL_LASER
           
static java.lang.String SPECIAL_MISSILE
           
static java.lang.String SPECIAL_NONE
           
 
Constructor Summary
Pilot()
           
Pilot(java.lang.String name, int gunnery, int piloting)
           
Pilot(java.lang.String name, int gunneryL, int gunneryM, int gunneryB, int piloting)
           
 
Method Summary
 void clearOptions()
           
 void clearOptions(java.lang.String grpKey)
           
 int countOptions()
           
 int countOptions(java.lang.String grpKey)
           
 void decreaseEdge()
           
 int getArtillery()
           
 double getBVImplantMultiplier()
           
 double getBVSkillMultiplier()
          Returns the BV multiplier for this pilot's gunnery/piloting
 double getBVSkillMultiplier(boolean usePiloting)
          Returns the BV multiplier for this pilot's gunnery/piloting
static double getBVSkillMultiplier(int gunnery, int piloting)
          Returns the BV multiplyer for a pilots gunnery/piloting.
 int getCommandBonus()
           
 java.lang.String getDesc()
           
 java.util.Vector<Report> getDescVector(boolean gunneryOnly)
           
 int getExternalId()
           
 int getFatigue()
           
 int getGunnery()
           
 int getGunneryB()
           
 int getGunneryL()
           
 int getGunneryM()
           
 java.lang.String getGunneryRPG()
           
 int getHits()
           
 int getInitBonus()
           
 java.lang.String getName()
           
 java.lang.String getNickname()
           
 java.lang.String getOptionList(java.lang.String sep, java.lang.String grpKey)
          Returns a string of all the option "codes" for this pilot, for a given group, using sep as the separator
 PilotOptions getOptions()
           
 java.util.Enumeration<IOption> getOptions(java.lang.String grpKey)
          Returns the options of the given category that this pilot has
 int getPiloting()
           
 java.lang.String getPortraitCategory()
           
 java.lang.String getPortraitFileName()
           
 int getSensorOps()
          for sensor ops, so these might be easily expanded later for rpg
 java.lang.String getStatusDesc()
           
 int getToughness()
           
 boolean hasEdgeRemaining()
           
 boolean isActive()
           
 boolean isCustom()
          Returns whether this pilot has non-standard piloting or gunnery values
 boolean isDead()
           
 boolean isDoomed()
           
 boolean isEjected()
          Determine if this pilot has abandoned her vehicle.
 boolean isGunneryFatigued(int turn)
           
 boolean isKoThisRound()
           
 boolean isPilotingFatigued(int turn)
           
 boolean isUnconscious()
           
 int modifyPhysicalDamagaForMeleeSpecialist()
           
static java.lang.String parseAdvantageName(java.lang.String s)
           
static java.lang.Object parseAdvantageValue(java.lang.String s)
           
 void setArtillery(int artillery)
           
 void setCommandBonus(int bonus)
           
 void setDead(boolean dead)
           
 void setDoomed(boolean b)
           
 void setEjected(boolean abandoned)
          Specify if this pilot has abandoned her vehicle.
 void setExternalId(int i)
           
 void setFatigue(int i)
           
 void setGunnery(int gunnery)
           
 void setGunneryB(int gunnery)
           
 void setGunneryL(int gunnery)
           
 void setGunneryM(int gunnery)
           
 void setHits(int hits)
           
 void setInitBonus(int bonus)
           
 void setKoThisRound(boolean koThisRound)
           
 void setNickname(java.lang.String nick)
           
 void setOptions(PilotOptions options)
           
 void setPiloting(int piloting)
           
 void setPortraitCategory(java.lang.String name)
           
 void setPortraitFileName(java.lang.String name)
           
 void setToughness(int t)
           
 void setUnconscious(boolean unconscious)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_PORTRAIT

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

PORTRAIT_NONE

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

SPECIAL_NONE

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

SPECIAL_LASER

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

SPECIAL_BALLISTIC

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

SPECIAL_MISSILE

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

DEATH

public static final int DEATH
The number of hits that a pilot can take before he dies.

See Also:
Constant Field Values
Constructor Detail

Pilot

public Pilot()

Pilot

public Pilot(java.lang.String name,
             int gunnery,
             int piloting)

Pilot

public Pilot(java.lang.String name,
             int gunneryL,
             int gunneryM,
             int gunneryB,
             int piloting)
Method Detail

getName

public java.lang.String getName()

getNickname

public java.lang.String getNickname()

getGunnery

public int getGunnery()

getGunneryL

public int getGunneryL()

getGunneryM

public int getGunneryM()

getGunneryB

public int getGunneryB()

getArtillery

public int getArtillery()

getPiloting

public int getPiloting()

getHits

public int getHits()

getInitBonus

public int getInitBonus()

getCommandBonus

public int getCommandBonus()

setNickname

public void setNickname(java.lang.String nick)

setGunnery

public void setGunnery(int gunnery)

setGunneryL

public void setGunneryL(int gunnery)

setGunneryM

public void setGunneryM(int gunnery)

setGunneryB

public void setGunneryB(int gunnery)

setArtillery

public void setArtillery(int artillery)

setPiloting

public void setPiloting(int piloting)

setHits

public void setHits(int hits)

setInitBonus

public void setInitBonus(int bonus)

setCommandBonus

public void setCommandBonus(int bonus)

isUnconscious

public boolean isUnconscious()

setUnconscious

public void setUnconscious(boolean unconscious)

isDead

public boolean isDead()

setDead

public void setDead(boolean dead)

isDoomed

public boolean isDoomed()

setDoomed

public void setDoomed(boolean b)

isActive

public boolean isActive()

isKoThisRound

public boolean isKoThisRound()

setKoThisRound

public void setKoThisRound(boolean koThisRound)

setOptions

public void setOptions(PilotOptions options)

getOptions

public PilotOptions getOptions()

clearOptions

public void clearOptions()

clearOptions

public void clearOptions(java.lang.String grpKey)

countOptions

public int countOptions()

countOptions

public int countOptions(java.lang.String grpKey)

getOptions

public java.util.Enumeration<IOption> getOptions(java.lang.String grpKey)
Returns the options of the given category that this pilot has


getOptionList

public java.lang.String getOptionList(java.lang.String sep,
                                      java.lang.String grpKey)
Returns a string of all the option "codes" for this pilot, for a given group, using sep as the separator


parseAdvantageName

public static java.lang.String parseAdvantageName(java.lang.String s)

parseAdvantageValue

public static java.lang.Object parseAdvantageValue(java.lang.String s)

getDesc

public java.lang.String getDesc()

getDescVector

public java.util.Vector<Report> getDescVector(boolean gunneryOnly)

isCustom

public boolean isCustom()
Returns whether this pilot has non-standard piloting or gunnery values


getBVSkillMultiplier

public double getBVSkillMultiplier()
Returns the BV multiplier for this pilot's gunnery/piloting


getBVSkillMultiplier

public double getBVSkillMultiplier(boolean usePiloting)
Returns the BV multiplier for this pilot's gunnery/piloting

Parameters:
usePiloting - whether or not to use the default value non-anti-mech infantry/BA should not use the anti-mech skill

getBVImplantMultiplier

public double getBVImplantMultiplier()

getBVSkillMultiplier

public static double getBVSkillMultiplier(int gunnery,
                                          int piloting)
Returns the BV multiplyer for a pilots gunnery/piloting. This function is static to evaluate the BV of a unit, even when they have not yet been assinged a pilot.

Parameters:
gunnery - the gunnery skill of the pilot
piloting - the piloting skill of the pilot
Returns:
a multiplier to the BV of whatever unit the pilot is piloting.

modifyPhysicalDamagaForMeleeSpecialist

public int modifyPhysicalDamagaForMeleeSpecialist()

hasEdgeRemaining

public boolean hasEdgeRemaining()

decreaseEdge

public void decreaseEdge()

isEjected

public boolean isEjected()
Determine if this pilot has abandoned her vehicle.

Returns:
true if the pilot has abandoned her vehicle, false if the pilot is still in the vehicle.

setEjected

public void setEjected(boolean abandoned)
Specify if this pilot has abandoned her vehicle.

Parameters:
abandoned - the boolean value to set.

getGunneryRPG

public java.lang.String getGunneryRPG()
Returns:
a string description of the gunnery skills when using RPG

getSensorOps

public int getSensorOps()
for sensor ops, so these might be easily expanded later for rpg


isPilotingFatigued

public boolean isPilotingFatigued(int turn)

isGunneryFatigued

public boolean isGunneryFatigued(int turn)

getStatusDesc

public java.lang.String getStatusDesc()

setExternalId

public void setExternalId(int i)

getExternalId

public int getExternalId()

setPortraitCategory

public void setPortraitCategory(java.lang.String name)

getPortraitCategory

public java.lang.String getPortraitCategory()

setPortraitFileName

public void setPortraitFileName(java.lang.String name)

getPortraitFileName

public java.lang.String getPortraitFileName()

getToughness

public int getToughness()

setToughness

public void setToughness(int t)

getFatigue

public int getFatigue()

setFatigue

public void setFatigue(int i)