Class FireMon

java.lang.Object
  |
  +--java.awt.Component
        |
        +--MapObject
              |
              +--Monster
                    |
                    +--FireMon
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class FireMon
extends Monster

A class to define the Monsters of type Fire handles the leveling up process and naming of attacks.

See Also:
Monster, Serialized Form

Field Summary
protected static java.lang.String A1
          The name of the first attack
protected static java.lang.String A2
          The name of the second attack
protected static java.lang.String A3
          The name of the third attack
protected static java.lang.String A4
          The name of the fourth attack
protected static java.lang.String A5
          The name of the fifth attack
protected static java.lang.String A6
          The name of the sixth attack
protected  int lastAttack
          The last attack learned (2 <= x <= 5)
protected static int MAX_EARN_ATTACK_LEVEL
          The level at which all attacks have been learned
protected static int START
          The number of levels needed before learning a new attack
 
Fields inherited from class Monster
attacks, attp, battle, defp, EARTH, ELECTRIC, exp, FIRE, GAS, hp, kind, level, maxAtt, MAXATTACKS, maxDef, maxExp, maxHP, maxLevel, MAXLEVEL, name, WATER
 
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
FireMon()
          Construct a Fire Monster with the default values: name is Alligatrix level is two.
FireMon(java.lang.String name)
          Constructs a Fire Monster with the name name.
 
Method Summary
 void addAttack(java.lang.String att)
          Adds the attack specified by its name as parameter att to the Monster if it has less than Monster.MAXATTACKS
 java.lang.String getA1()
          Returns the name of Attack A1
 java.lang.String getA2()
          Returns the name of Attack A2
 java.lang.String getA3()
          Returns the name of Attack A3
 java.lang.String getA4()
          Returns the name of Attack A4
 java.lang.String getA5()
          Returns the name of Attack A5
 java.lang.String getA6()
          Returns the name of Attack A6
 MapObject getClone()
          Returns a new Fire Monster with the same name as this.
protected  void levelUp()
          Preforms a level up on the Monster, Adds new Attacks if needed, increases HP, Attack Points, etc.
 void setImage(java.awt.Image[] img)
          Empty implemntation unneeded as Monsters are only displayed in battle
protected  void setMaxLevel(byte nml)
          Sets the max level always is START + previousMaxLevel
 boolean substituteAttack(Attack removed, Attack added)
          Removes an Attack and adds a new Attack to the end.
 
Methods inherited from class Monster
equals, equals, finishFight, getAttack, getAttack, getAttacks, getDefense, getExperience, getHP, getKind, getLevel, getMaxAttack, getMaxDefense, getMaxExperience, getMaxHP, getMaxLevel, getName, getNumberOfAttacks, isBattling, paint, setAttack, setBehind, setDefense, setExperience, setHP, setLevel, setMaxAttack, setMaxDefense, setMaxExperience, setMaxHP, setName, startBattle, stopBattle
 
Methods inherited from class MapObject
canBeEntered, getType
 
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

START

protected static final int START
The number of levels needed before learning a new attack

See Also:
Constant Field Values

MAX_EARN_ATTACK_LEVEL

protected static final int MAX_EARN_ATTACK_LEVEL
The level at which all attacks have been learned

See Also:
Constant Field Values

A1

protected static final java.lang.String A1
The name of the first attack

See Also:
Constant Field Values

A2

protected static final java.lang.String A2
The name of the second attack

See Also:
Constant Field Values

A3

protected static final java.lang.String A3
The name of the third attack

See Also:
Constant Field Values

A4

protected static final java.lang.String A4
The name of the fourth attack

See Also:
Constant Field Values

A5

protected static final java.lang.String A5
The name of the fifth attack

See Also:
Constant Field Values

A6

protected static final java.lang.String A6
The name of the sixth attack

See Also:
Constant Field Values

lastAttack

protected int lastAttack
The last attack learned (2 <= x <= 5)

Constructor Detail

FireMon

public FireMon()
Construct a Fire Monster with the default values: name is Alligatrix level is two.


FireMon

public FireMon(java.lang.String name)
Constructs a Fire Monster with the name name. level is two.

Parameters:
name - the name of the Fire Monster
Method Detail

setImage

public void setImage(java.awt.Image[] img)
Empty implemntation unneeded as Monsters are only displayed in battle

Specified by:
setImage in class MapObject
Parameters:
img - the array of images to use

setMaxLevel

protected void setMaxLevel(byte nml)
Sets the max level always is START + previousMaxLevel

Parameters:
nml - the new Max Level

levelUp

protected void levelUp()
                throws AttacksFullException
Preforms a level up on the Monster, Adds new Attacks if needed, increases HP, Attack Points, etc.

Overrides:
levelUp in class Monster
Throws:
AttacksFullException - if this has Monster.MAXATTACKS Attacks
See Also:
Monster, Attack

addAttack

public void addAttack(java.lang.String att)
Adds the attack specified by its name as parameter att to the Monster if it has less than Monster.MAXATTACKS

Specified by:
addAttack in class Monster
Parameters:
att - the Name of the Attack to add
See Also:
Monster

substituteAttack

public boolean substituteAttack(Attack removed,
                                Attack added)
Removes an Attack and adds a new Attack to the end.

Specified by:
substituteAttack in class Monster
Parameters:
removed - the Attack to remove
added - the Attack to add
Returns:
true if could remove the Attack and add the new one

getA1

public java.lang.String getA1()
Returns the name of Attack A1

Specified by:
getA1 in class Monster
Returns:
A1

getA2

public java.lang.String getA2()
Returns the name of Attack A2

Specified by:
getA2 in class Monster
Returns:
A2

getA3

public java.lang.String getA3()
Returns the name of Attack A3

Specified by:
getA3 in class Monster
Returns:
A3

getA4

public java.lang.String getA4()
Returns the name of Attack A4

Specified by:
getA4 in class Monster
Returns:
A4

getA5

public java.lang.String getA5()
Returns the name of Attack A5

Specified by:
getA5 in class Monster
Returns:
A5

getA6

public java.lang.String getA6()
Returns the name of Attack A6

Specified by:
getA6 in class Monster
Returns:
A6

getClone

public MapObject getClone()
Returns a new Fire Monster with the same name as this.

Specified by:
getClone in class MapObject
Returns:
a clone of this