public class Weapon extends Equippable
Modifier and Type | Field and Description |
---|---|
static int |
AXE |
static int |
BOW |
static int |
DAGGER |
static int |
FIST |
static int |
MACE |
static int |
SPEAR |
static int |
SWORD |
Constructor and Description |
---|
Weapon(java.lang.String id,
long serial,
WeaponType type,
ItemMaterial material,
int value,
int minDmg,
int maxDmg,
Modifiers bonuses,
java.util.List<java.lang.String> equipEffects,
java.util.List<java.lang.String> hitEffects,
int reqLevel,
java.lang.String picName,
org.newdawn.slick.GameContainer gc)
Weapon constructor (with saved serial number and default spritesheet)
|
Weapon(java.lang.String id,
long serial,
WeaponType type,
ItemMaterial material,
int value,
int minDmg,
int maxDmg,
Modifiers bonuses,
java.util.List<java.lang.String> equipEffects,
java.util.List<java.lang.String> hitEffects,
int reqLevel,
java.lang.String picName,
java.lang.String spriteName,
org.newdawn.slick.GameContainer gc)
Weapon constructor (with saved serial number)
|
Weapon(java.lang.String id,
WeaponType type,
ItemMaterial material,
int value,
int minDmg,
int maxDmg,
Modifiers bonuses,
java.util.List<java.lang.String> equipEffects,
java.util.List<java.lang.String> hitEffects,
int reqLevel,
java.lang.String picName,
org.newdawn.slick.GameContainer gc)
Weapon constructor (with default spritesheet)
|
Weapon(java.lang.String id,
WeaponType type,
ItemMaterial material,
int value,
int minDmg,
int maxDmg,
Modifiers bonuses,
java.util.List<java.lang.String> equipEffects,
java.util.List<java.lang.String> hitEffects,
int reqLevel,
java.lang.String picName,
java.lang.String spriteName,
org.newdawn.slick.GameContainer gc)
Weapon constructor
|
Modifier and Type | Method and Description |
---|---|
int[] |
getDamage()
Returns weapon maximal and minimal damage
|
Effect |
getHitEffect(java.lang.String effectId)
Returns 'on-hit' effects with specified ID
|
java.util.Collection<Effect> |
getHitEffects()
Returns all 'on-hit' effects
|
java.util.List<java.lang.String> |
getHitEffectsIds()
Returns all IDs of all 'on-hit' effects
|
Targetable |
getOwner()
Return effect source owner
|
AnimObject |
getSpriteFor(Gender sex)
Returns sprite for specified gender
|
int |
getType()
Return weapon type
|
boolean |
use(Targetable user,
Targetable target)
Activates object on-use action
|
getEffect, getEffects, getEffectsIds, reset, type
draw, getActionType, getId, getMaxStack, getNumber, getSerialId, getTile, getValue, setOwner, setTile, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, getSerialId
public static final int DAGGER
public static final int SWORD
public static final int AXE
public static final int MACE
public static final int SPEAR
public static final int BOW
public static final int FIST
public Weapon(java.lang.String id, WeaponType type, ItemMaterial material, int value, int minDmg, int maxDmg, Modifiers bonuses, java.util.List<java.lang.String> equipEffects, java.util.List<java.lang.String> hitEffects, int reqLevel, java.lang.String picName, java.lang.String spriteName, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
id
- Weapon IDname
- Weapon nameinfo
- Informations about weapontype
- Weapon type (0-5)material
- Weapon material (0-2)value
- Weapon valuemaxDmg
- Max weapon damageminDmg
- Min weapon damagebonuses
- Weapon bonusesequippEffects
- List with IDs of all equip effectshitEffects
- List with IDs of all hit effectsreqLevel
- Required levelpicName
- Weapon icon image file namegc
- Slick game containerorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public Weapon(java.lang.String id, long serial, WeaponType type, ItemMaterial material, int value, int minDmg, int maxDmg, Modifiers bonuses, java.util.List<java.lang.String> equipEffects, java.util.List<java.lang.String> hitEffects, int reqLevel, java.lang.String picName, java.lang.String spriteName, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
id
- Weapon IDserial
- Saved serial numbername
- Weapon nameinfo
- Informations about weapontype
- Weapon type (0-5)material
- Weapon material (0-2)value
- Weapon valuemaxDmg
- Max weapon damageminDmg
- Min weapon damagebonuses
- Weapon bonusesequippEffects
- List with IDs of all equip effectshitEffects
- List with IDs of all hit effectsreqLevel
- Required levelpicName
- Weapon icon image file namegc
- Slick game containerorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public Weapon(java.lang.String id, WeaponType type, ItemMaterial material, int value, int minDmg, int maxDmg, Modifiers bonuses, java.util.List<java.lang.String> equipEffects, java.util.List<java.lang.String> hitEffects, int reqLevel, java.lang.String picName, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
id
- Weapon IDname
- Weapon nameinfo
- Informations about weapontype
- Weapon type (0-5)material
- Weapon material (0-2)value
- Weapon valuemaxDmg
- Max weapon damageminDmg
- Min weapon damagebonuses
- Weapon bonusesequippEffects
- List with IDs of all equip effectshitEffects
- List with IDs of all hit effectsreqLevel
- Required levelpicName
- Weapon icon image file namegc
- Slick game containerorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public Weapon(java.lang.String id, long serial, WeaponType type, ItemMaterial material, int value, int minDmg, int maxDmg, Modifiers bonuses, java.util.List<java.lang.String> equipEffects, java.util.List<java.lang.String> hitEffects, int reqLevel, java.lang.String picName, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
id
- Weapon IDserial
- Saved serial numbername
- Weapon nameinfo
- Informations about weapontype
- Weapon type (0-5)material
- Weapon material (0-2)value
- Weapon valuemaxDmg
- Max weapon damageminDmg
- Min weapon damagebonuses
- Weapon bonusesequippEffects
- List with IDs of all equip effectshitEffects
- List with IDs of all hit effectsreqLevel
- Required levelpicName
- Weapon icon image file namegc
- Slick game containerorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public int[] getDamage()
public int getType()
public boolean use(Targetable user, Targetable target)
Usable
user
- Object usertarget
- Object user targetpublic AnimObject getSpriteFor(Gender sex)
Equippable
getSpriteFor
in class Equippable
sex
- Game character genderpublic Targetable getOwner()
EffectSource
getOwner
in interface EffectSource
getOwner
in class Equippable
public java.util.Collection<Effect> getHitEffects()
public Effect getHitEffect(java.lang.String effectId)
effectId
- Effects IDpublic java.util.List<java.lang.String> getHitEffectsIds()