|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.haphazard.character.body.BodyPart
Abstract class that denotes a location on a characters body.
Field Summary | |
protected java.util.Vector |
mClothes
Clothes on this bodypart |
protected int |
mSlots
How large the part is (ie. how easy it is to hit) |
Constructor Summary | |
BodyPart()
Creates a new instance of BodyPart |
|
BodyPart(java.lang.String name)
Creates a bodypart with a specific name |
Method Summary | |
void |
addWound(int severity)
Adds a wound to the location |
boolean |
canWear(Clothes clothes)
Checks if the character can wear the specified clothes |
java.util.Vector |
getAllClothes()
Gets all the clothes the character is wearing |
int |
getArmorValue()
Gets the total armor value of this part |
int |
getCritical()
Gets how critical this part is The higher the more critical the part is |
int |
getLocation()
Gets the location of this part |
java.lang.String |
getName()
Returns the name of this bodypart |
int |
getPenalty()
Gets the wound penalty of this body part |
javax.swing.tree.DefaultMutableTreeNode |
getTreeNode()
Gets a node view over every thing in this bodypart |
int |
getWound()
Gets the maximum type of wound this bodypart has |
void |
heal()
Heals the part one step towards healthy |
boolean |
isHit(int location)
Checks if a location is hit |
boolean |
isPrimary()
Checks if this is a primary bodypart Useful for example hands |
boolean |
isWearing(Clothes clothes)
Checks if the character is wearing the specific clothes |
void |
setName(java.lang.String name)
Sets the name of the part |
void |
setNaturalArmor(int points)
Sets the amount of natural armor this bodypart gives |
int |
setToHit(int start)
Sets the to hit start value of the part |
void |
status()
Prints the status of this part |
java.lang.String |
toString()
Returns a string representation of this object |
java.lang.String |
toXML(int indent)
Transforms this object into an XML-notation |
boolean |
undress(Clothes clothes)
Undresses the specific clothes from this bodypart |
void |
wear(Clothes clothes)
Wears clothes on this bodypart |
int |
wound(int damage)
Gives the part a new wound |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int mSlots
protected java.util.Vector mClothes
Constructor Detail |
public BodyPart()
public BodyPart(java.lang.String name)
name
- The name the part should be known underMethod Detail |
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name of the bodypartpublic boolean isPrimary()
public void wear(Clothes clothes)
clothes
- The clothes to wearpublic boolean undress(Clothes clothes)
clothes
- The clothes to remove
public boolean isWearing(Clothes clothes)
clothes
- The clothes to check against
public boolean canWear(Clothes clothes)
clothes
- The clothes to check against
public java.util.Vector getAllClothes()
public void setNaturalArmor(int points)
points
- The number of armor points this part haspublic int getArmorValue()
public void status()
public int getCritical()
public void addWound(int severity)
severity
- 0 for stun, 1 for ligth wound, 2 for wound, 3 for severe woundpublic int getWound()
public int getPenalty()
public int wound(int damage)
damage
- The damage inflicted
public void heal()
public boolean isHit(int location)
location
- The to hit number
public int setToHit(int start)
start
- Which number the to hit value starts at
public int getLocation()
public javax.swing.tree.DefaultMutableTreeNode getTreeNode()
public java.lang.String toXML(int indent)
indent
- The indentation level to use
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |