Class Weapon

java.lang.Object
  extended by Weapon

public class Weapon
extends java.lang.Object

This class represents a Weapon within our game. For full details of the Weapon class, see HW J6.


Constructor Summary
Weapon()
          The default constructor, it creates a default weapon.
Weapon(int mod, java.lang.String nm, java.lang.String hit, java.lang.String miss)
          The specific constructor, it creates a weapon according to the passed values.
 
Method Summary
 int getDamageModifier()
          Returns the damage modifier for this weapon
 java.lang.String getFullName()
          Returns the full name (including adjective) for this weapon.
 java.lang.String getHitVerb()
          Returns the hit verb for this weapon (i.e., 'hits', 'whacks', etc.)
 java.lang.String getMissVerb()
          Returns the miss verb for this weapon (i.e., 'misses', 'whiffs', etc.)
 java.lang.String getName()
          Returns the base name for this weapon (i.e., 'katana', 'sai', etc.).
 void setDamageModifier(int dm)
          Sets the damage modifier for this weapon to the passed value
 void setHitVerb(java.lang.String str)
          Sets the hit verb for this weapon to the passed value
 void setMissVerb(java.lang.String str)
          Sets the miss verb for this weapon to the passed value
 void setName(java.lang.String str)
          Sets the name for this weapon to the passed value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Weapon

public Weapon()
The default constructor, it creates a default weapon. It initializes the damage modifier to 0, the name to "bare hands", the hit verb to "strikes" and the miss verb to "misses".


Weapon

public Weapon(int mod,
              java.lang.String nm,
              java.lang.String hit,
              java.lang.String miss)
The specific constructor, it creates a weapon according to the passed values.

Parameters:
mod - The damage modifier of this weapon
nm - The name of this weapon (i.e., 'katana', 'sai', etc.)
hit - The hit verb for this weapon (i.e., 'hits', 'whacks', etc.)
miss - The miss verb for this weapon (i.e., 'misses', 'whiffs', etc.)
Method Detail

getDamageModifier

public int getDamageModifier()
Returns the damage modifier for this weapon

Returns:
The damage modifier for this weapon

getFullName

public java.lang.String getFullName()
Returns the full name (including adjective) for this weapon. The full name includes an adjective and the weapon type. The adjective ('cursed', 'normal', 'shiny', 'high quality', 'elite', or 'magical') corresponds to the damage modifier -- the more damage the weapon does, the better the modifer.

Returns:
The full name (including adjective) for this weapon

getName

public java.lang.String getName()
Returns the base name for this weapon (i.e., 'katana', 'sai', etc.). The base name does not include any adjective; that is done by the getFullName() method.

Returns:
The base name for this weapon

getMissVerb

public java.lang.String getMissVerb()
Returns the miss verb for this weapon (i.e., 'misses', 'whiffs', etc.)

Returns:
The miss verb for this weapon.

getHitVerb

public java.lang.String getHitVerb()
Returns the hit verb for this weapon (i.e., 'hits', 'whacks', etc.)

Returns:
The hit verb for this weapon.

setDamageModifier

public void setDamageModifier(int dm)
Sets the damage modifier for this weapon to the passed value

Parameters:
dm - The new damage modifier

setName

public void setName(java.lang.String str)
Sets the name for this weapon to the passed value

Parameters:
str - The new name

setMissVerb

public void setMissVerb(java.lang.String str)
Sets the miss verb for this weapon to the passed value

Parameters:
str - The new miss verb

setHitVerb

public void setHitVerb(java.lang.String str)
Sets the hit verb for this weapon to the passed value

Parameters:
str - The new hit verb