|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.game.inventory.ItemEffects
public class ItemEffects
This is the base class from which all item effects must be derived.
It provides neutral “no-op” handlers for all mandatory hooks and
fires script events through Quaestor
.
Field Summary | |
---|---|
protected InventoryItem |
item
The inventory item from which these effects are emitted |
Constructor Summary | |
---|---|
ItemEffects(InventoryItem theItem)
|
Method Summary | |
---|---|
int |
alter(UserStat stat)
Get the amount by which the item which bears this effect alters the supplied stat |
boolean |
canSwim()
|
boolean |
conflicts(GenericItemReference itemClass,
InventoryItem anItem)
For the item which bears this effect, determine whether another item conflicts with it. |
boolean |
considerAsVehicle()
|
static ItemEffects |
forItem(InventoryItem item)
Get the ItemEffects subclass responsible for handling effects from a given item type |
DamageTypeRanks |
getDefenseGeometric()
|
DamageTypeRanks |
getDefenseLinear()
|
InventoryItem |
getItem()
|
boolean |
isFloatingVehicle()
|
boolean |
isMountedAnimal()
|
boolean |
isWheeledVehicle()
|
protected void |
notifyEquipment()
Sent equipment notification to the owner: something has changed |
void |
onDeEquip()
Called whenever the item is de-equipped |
void |
onEquip()
Called whenever the item is equipped |
void |
takeDamage(DamageTypeRanks attacks)
WRITEME: Document this method brpocock@star-hope.org |
void |
use(String targetName,
Coord3D targetCoords)
The item is being used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final InventoryItem item
Constructor Detail |
---|
public ItemEffects(InventoryItem theItem)
theItem
- the item from which these effects are emittedMethod Detail |
---|
public static ItemEffects forItem(InventoryItem item) throws NotFoundException
item
- the item for which to get the effects-handler object
NotFoundException
- if the item doesn't exist, doesn't
define an effects type, or the effects type handler
class can't be found or instantiatedpublic int alter(UserStat stat)
stat
- the user stat to be altered
public boolean canSwim()
public boolean conflicts(GenericItemReference itemClass, InventoryItem anItem)
For the item which bears this effect, determine whether another item conflicts with it.
Since this comparison is done against all equipped items, the
GenericItemReference
is provided simply as a convenience.
This method must be called with the correct
GenericItemReference
that would be returned by calling
InventoryItem.getGenericItem()
, simply to save on calling
that routine many times during the comparison of all items.
itemClass
- the GenericItemReference
of this the
item is an instanceanItem
- the InventoryItem
against which this item
is being considered
public boolean considerAsVehicle()
public DamageTypeRanks getDefenseGeometric()
public DamageTypeRanks getDefenseLinear()
public InventoryItem getItem()
public boolean isFloatingVehicle()
public boolean isMountedAnimal()
public boolean isWheeledVehicle()
protected void notifyEquipment()
public void onDeEquip()
public void onEquip()
public void takeDamage(DamageTypeRanks attacks)
attacks
- WRITEMEpublic void use(String targetName, Coord3D targetCoords)
targetName
- a named object in the room against which the
item is to be usedtargetCoords
- the coördinates in the room against which the
item is to be used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |