|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--MapObject | +--Monster
Class to define a Monster and its attributes.
FireMon
,
EarthMon
,
WaterMon
,
GasMon
,
ElectricMon
,
Serialized FormField Summary | |
protected java.util.Vector |
attacks
The attacks this knows |
protected int |
attp
The Attack Of this |
protected boolean |
battle
tru iff battling |
protected int |
defp
The Defense Of this |
static int |
EARTH
Earth kind |
static int |
ELECTRIC
Electric kind |
protected int |
exp
The Experience Of this |
static int |
FIRE
Fire kind |
static int |
GAS
Gas kind |
protected int |
hp
The HP Of this |
protected int |
kind
The kind of Monster this is |
protected int |
level
The level of this |
protected int |
maxAtt
The Maximum Attack Of this at this level |
static int |
MAXATTACKS
The Maximum number of attack to have |
protected int |
maxDef
The Maximum Defense Of this at this level |
protected int |
maxExp
The Maximum Experience before a level up |
protected int |
maxHP
The Maximum HP Of this, ie full health |
protected int |
maxLevel
The Maximum level before learning a new attack |
static int |
MAXLEVEL
The Maximum level allowed for Monsters to have |
protected java.lang.String |
name
The name of this |
static int |
WATER
Water kind |
Fields inherited from class MapObject |
BUILDING, enterable, FLOOR, GRASS, MONSTER, PERSON, PLAYER, REDIRECT, ROCK, TRAINER, type, WALL |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Monster()
|
Method Summary | |
abstract void |
addAttack(java.lang.String attack)
Learn the attack specifid by attack |
boolean |
equals(Monster m)
Tests for equality, ie if all the parameters are the same |
boolean |
equals(java.lang.Object o)
Tests for equality |
boolean |
finishFight(Monster m)
Finish the fight with the opposing Monster, ie give this the requisite experience |
abstract java.lang.String |
getA1()
Gets the name of the first Attack |
abstract java.lang.String |
getA2()
Gets the name of the second Attack |
abstract java.lang.String |
getA3()
Gets the name of the third Attack |
abstract java.lang.String |
getA4()
Gets the name of the fourth Attack |
abstract java.lang.String |
getA5()
Gets the name of the fifth Attack |
abstract java.lang.String |
getA6()
Gets the name of the sixth Attack |
int |
getAttack()
Gets the Attack Points of this. |
Attack |
getAttack(int pos)
Gets the Attack known at the specified position |
java.lang.String[] |
getAttacks()
Gets the array of attacks available to this, adds null if less then Monster.MAXATTACKS |
int |
getDefense()
Gers the defense of this |
int |
getExperience()
Gets the Experience of this |
int |
getHP()
Gets the HP of this |
int |
getKind()
Gets the Kind of this |
int |
getLevel()
Gets the level of this |
int |
getMaxAttack()
Gets the Maximum Attack Points of this |
int |
getMaxDefense()
Gets the Maximum Defense |
int |
getMaxExperience()
Gets the Maximum Experience Pointsup |
int |
getMaxHP()
Gets the maximum hp |
int |
getMaxLevel()
Gets the Max level |
java.lang.String |
getName()
Gets the name of this. |
int |
getNumberOfAttacks()
Gets the number of attacks this knows. |
boolean |
isBattling()
Returns true iff battling |
protected void |
levelUp()
Preforms a level up increasing attack, defense, and hp. |
void |
paint(java.awt.Graphics g)
Draws this for the Grid. |
void |
setAttack(int nap)
Sets the Attack points of this |
void |
setBehind(MapObject m)
Sets the MapObject to paint where this is. |
void |
setDefense(int ndp)
Sets the defense of this |
protected boolean |
setExperience(int nep)
Sets the Experience Pints and levels up if needed. |
void |
setHP(int nhp)
Sets the hp |
void |
setLevel(int level)
Sets the level of this. |
protected void |
setMaxAttack(int nmap)
Sets the Maximum Attack Points of this |
protected void |
setMaxDefense(int nmdp)
Sets the Maximum defense of this |
protected void |
setMaxExperience(int nmep)
Sets the maximum Experience of this, the amount required before a level up |
protected void |
setMaxHP(int nmhp)
Sets the maximum hp |
void |
setName(java.lang.String name)
Sets the name of this Monster |
void |
startBattle()
Starts a fight |
void |
stopBattle()
Stop a fight |
abstract boolean |
substituteAttack(Attack removed,
Attack added)
Substitute one Attack for another. |
Methods inherited from class MapObject |
canBeEntered, getClone, getType, setImage |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int ELECTRIC
public static final int EARTH
public static final int FIRE
public static final int WATER
public static final int GAS
public static final int MAXLEVEL
public static final int MAXATTACKS
protected int hp
protected int defp
protected int attp
protected int exp
protected int maxHP
protected int maxDef
protected int maxAtt
protected int maxExp
protected int level
protected int maxLevel
protected int kind
protected java.util.Vector attacks
protected java.lang.String name
protected boolean battle
Constructor Detail |
public Monster()
Method Detail |
public abstract void addAttack(java.lang.String attack)
attack
- The Attack to learnpublic abstract java.lang.String getA1()
public abstract java.lang.String getA2()
public abstract java.lang.String getA3()
public abstract java.lang.String getA4()
public abstract java.lang.String getA5()
public abstract java.lang.String getA6()
public abstract boolean substituteAttack(Attack removed, Attack added)
removed
- the Attack to removeadded
- the Attack to addpublic void setHP(int nhp)
public int getHP()
protected void setMaxHP(int nmhp)
public int getMaxHP()
public void setDefense(int ndp)
ndp
- the new defense of thispublic int getDefense()
protected void setMaxDefense(int nmdp)
nmdp
- the new Maximum Defense of thispublic int getMaxDefense()
public void setAttack(int nap)
nap
- the new Attack Pointspublic int getAttack()
protected void setMaxAttack(int nmap)
nmap
- the new Maximum Attack Points of thispublic int getMaxAttack()
protected boolean setExperience(int nep) throws AttacksFullException
nep
- the new Experience Points of this
AttacksFullException
public int getExperience()
protected void setMaxExperience(int nmep)
nmep
- the New Maximum Experience Pontspublic int getMaxExperience()
public int getLevel()
public int getKind()
public void setLevel(int level)
level
- the level to mak thispublic int getMaxLevel()
public int getNumberOfAttacks()
protected void levelUp() throws AttacksFullException
AttacksFullException
- iff this has more than Monster.MAXATTACKSpublic boolean finishFight(Monster m) throws AttacksFullException
m
- the Opposing Monster
AttacksFullException
- iff this has more than Monster.MAXATTACKS, and is leveling uppublic void setName(java.lang.String name)
setName
in class java.awt.Component
name
- The Name of thispublic java.lang.String getName()
getName
in class java.awt.Component
public java.lang.String[] getAttacks()
public Attack getAttack(int pos)
pos
- the index of the Attack to return
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the Object to compare to
public boolean equals(Monster m)
m
- the Monster to compare to
public boolean isBattling()
public void startBattle()
public void stopBattle()
public void setBehind(MapObject m)
m
- the MapObject to paint where this ispublic void paint(java.awt.Graphics g)
paint
in class java.awt.Component
g
- the Graphics.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |