|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.game.inventory.ItemEffects
org.starhope.appius.game.inventory.effects.Shovel
public class Shovel
The stock item of many games: The Shovel. It's possible that someone might want to override this, but unlike the Simple* classes in this package, it's actually fairly reasonable to assign this effect directly to an item.
Here's how it works: the Shovel will look at the event spaces defined for the room. If there's are $earth/* spaces defined (spaces whose names begin with “evt_$earth/”), it will permit digging in those areas. The player can then attempt to dig a hole. There are settings for the digging Action, whether the digging Action requires specific facings, and what sort of particle is dropped to represent a hole, as well as that particle's lifetime (so holes can auto-refill over time). Digging where there is already a hole will refill and remove it.
To bury an item, a room variable is set named “evt_$earth/item” with the InventoryItem slot# of the buried item. Note that the inventory item will be owned by User ID #1 when buried. If a player digs at the given spot, they will pick up the item and receive the usual “earning” message identifying it. The room variable will also be removed, so only one user can retrieve the item.
An option to actually bury an item as an user has not been designed yet.
Field Summary | |
---|---|
private String |
digAction
WRITEME: Document this brpocock@star-hope.org |
private Set<String> |
digFacings
WRITEME: Document this brpocock@star-hope.org |
private String |
fillAction
WRITEME: Document this brpocock@star-hope.org |
private String |
getItemAction
WRITEME: Document this brpocock@star-hope.org |
Fields inherited from class org.starhope.appius.game.inventory.ItemEffects |
---|
item |
Constructor Summary | |
---|---|
Shovel(InventoryItem theItem)
|
Method Summary | |
---|---|
void |
addDigFacing(String facing)
|
String |
getDigAction()
|
Set<String> |
getDigFacings()
|
String |
getFillAction()
|
String |
getGetItemAction()
|
void |
removeDigFacing(String facing)
|
void |
setDigAction(String newDigAction)
|
void |
setFillAction(String newFillAction)
|
void |
setGetItemAction(String newGetItemAction)
|
void |
use(String targetName,
Coord3D targetCoords)
The item is being used. |
Methods inherited from class org.starhope.appius.game.inventory.ItemEffects |
---|
alter, canSwim, conflicts, considerAsVehicle, forItem, getDefenseGeometric, getDefenseLinear, getItem, isFloatingVehicle, isMountedAnimal, isWheeledVehicle, notifyEquipment, onDeEquip, onEquip, takeDamage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Set<String> digFacings
private String digAction
private String fillAction
private String getItemAction
Constructor Detail |
---|
public Shovel(InventoryItem theItem)
theItem
- the item to be a shovelMethod Detail |
---|
public void addDigFacing(String facing)
facing
- the facing to be allowed when diggingpublic String getDigAction()
public Set<String> getDigFacings()
public String getFillAction()
public String getGetItemAction()
public void removeDigFacing(String facing)
facing
- the facing to be removed from diggingpublic void setDigAction(String newDigAction)
newDigAction
- the digAction to setpublic void setFillAction(String newFillAction)
newFillAction
- the fillAction to setpublic void setGetItemAction(String newGetItemAction)
newGetItemAction
- the getItemAction to setpublic void use(String targetName, Coord3D targetCoords)
ItemEffects
use
in class ItemEffects
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.ItemEffects.use(java.lang.String,
org.starhope.appius.geometry.Coord3D)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |