|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjurpe.items.BasicItem
jurpe.items.Weapon
public class Weapon
Weapon Type Class. Every weapon must have a skill (Skill) to use it. Also, every weapons has Swing and Thrust damage for each type of Attack: Cutting, Impalling, Crushing.
BasicItem,
Serialized Form| Constructor Summary | |
|---|---|
Weapon(java.lang.String name,
jurpe.items.Attack att,
int cost,
int weight,
int maxDamage,
int minStrength,
Skill skl)
Constructor |
|
Weapon(java.lang.String name,
int cost,
int weight,
Skill skl,
int dCUT_SW,
int dCUT_TH,
int dCR_SW,
int dCR_TH,
int dIMP_SW,
int dIMP_TH,
int minStrength,
int maxDamage)
Constructor |
|
| Method Summary | |
|---|---|
static Weapon |
createRandom(ItemValueType value,
RandomNames rn,
MasterShop ms,
Skills sk)
Creates a random generated Weapon |
java.lang.String[] |
getAttacks()
Return an array of String determining a long description for each available Attack |
jurpe.items.Attack |
getAttackTypes()
Return Attack meta object |
int |
getBasicDamage(int characterStrength)
Get Basic Damage for weapon |
int |
getDamageModifier()
Returns modifier of damage based on weapon mode. |
DamageType |
getDamageType()
Returns type of damage based on weapon mode. |
java.lang.String |
getDescription()
Get long description of this weapon |
java.lang.String |
getDescription(java.lang.String divisor)
Get a long description of weapon. |
int |
getIndexAttacks(DamageMode mode)
If getAttacks returns 3 different types of attacks, when you pass the mode for this weapon, ie: Weapon.MODE_IMP, this method returns the position of that mode in that array. |
int |
getMaxDamage()
Get Weapon's max damage. |
int |
getMaxDamage(int characterStrength)
Get Maximum Damage for this weapon. |
int |
getMinimalStrength()
Get Minimal Strength to wear this weapon |
DamageMode |
getMode()
Get Selected Mode for this weapon. |
Skill |
getSkill()
Get Skill required to use this weapon |
java.lang.String |
getStringMode()
Get selected mode for this weapon as a string. |
boolean |
isBalanced()
If this weapon need to get ready (not balanced). |
boolean |
isReady()
If this weapon is balanced, then returns true if it's also ready. |
static void |
main(java.lang.String[] args)
Deprecated. |
void |
setMode(DamageMode mode)
Set mode for this weapon (ie: cutting, crushing, impalling). |
void |
setWeaponReady(boolean isReady)
If current weapon is unbalanced, you may set its status here. |
java.lang.String |
toString()
Name of weapon |
void |
unwear(PCharacter pc)
Unwear BasicItem (polymorphic) |
boolean |
wear(PCharacter pc)
Polymorphic method to wear this BasicItem |
| Methods inherited from class jurpe.items.BasicItem |
|---|
clone, compareTo, getCommonDescription, getCost, getName, getType, getWeight, isItemRandom, isItemUsable, isItemWearable, setRandom, toStringWCost, use, warningMessage |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Weapon(java.lang.String name,
jurpe.items.Attack att,
int cost,
int weight,
int maxDamage,
int minStrength,
Skill skl)
name - Weapon's nameatt - Available Attack types for this weaponcost - Weapon's Costweight - Weapon's Weightskl - Required Skill to use this weaponminStrength - Minimal Strength (ST) to use WeaponmaxDamage - Max Damage this weapon can do, if any
public Weapon(java.lang.String name,
int cost,
int weight,
Skill skl,
int dCUT_SW,
int dCUT_TH,
int dCR_SW,
int dCR_TH,
int dIMP_SW,
int dIMP_TH,
int minStrength,
int maxDamage)
name - Weapon's namecost - Weapon's Costweight - Weapon's Weightskl - Required Skill to use this weapondCUT_SW - Amount of damage made by Cutting/Swing.dCUT_TH - Amount of damage made by Cutting/ThrustdCR_SW - Amount of damage made by Crushing/SwingdCR_TH - Amount of damage made by Crushing/ThrustdIMP_SW - Amount of damage made by Impalling/SwingdIMP_TH - Amount of damage made by Impalling/ThrustminStrength - Minimal Strength (ST) to use WeaponmaxDamage - Max Damage this weapon can do, if any| Method Detail |
|---|
public static Weapon createRandom(ItemValueType value,
RandomNames rn,
MasterShop ms,
Skills sk)
throws JurpeException
value - ItemValueType indicating rarity of Itemrn - Handle to Random Namesms - Handle to MasterShopsk - Handle to Skills for this world
JurpeExceptionpublic void setMode(DamageMode mode)
mode - It can be
public java.lang.String getStringMode()
public DamageMode getMode()
public int getMinimalStrength()
public java.lang.String[] getAttacks()
public int getIndexAttacks(DamageMode mode)
mode - The weapon mode as in Weapon (MODE_CRU, MODE_CUT, MODE_IMP)
public Skill getSkill()
public boolean isBalanced()
public boolean isReady()
public void setWeaponReady(boolean isReady)
isReady - to set for this weaponpublic jurpe.items.Attack getAttackTypes()
public java.lang.String getDescription(java.lang.String divisor)
divisor - Divisor character
public java.lang.String getDescription()
getDescription in class BasicItempublic boolean wear(PCharacter pc)
wear in class BasicItempc - PCharacter that is going to wear this BasicItem
public void unwear(PCharacter pc)
unwear in class BasicItempc - PCharacter that is going to unwear this BasicItempublic DamageType getDamageType()
WeaponDamagepublic int getDamageModifier()
public int getBasicDamage(int characterStrength)
characterStrength - Strength (ST) of character who wears this weapon
public int getMaxDamage()
public int getMaxDamage(int characterStrength)
characterStrength - Strength (ST) of character who wears this weapon
public java.lang.String toString()
toString in class BasicItempublic static void main(java.lang.String[] args)
args -
|
Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||