Class DefaultItem
java.lang.Object
games.stendhal.server.core.rule.defaultruleset.DefaultItem
All default items which can be reduced to stuff that increase the attack
point and stuff that increase the defense points.
- Author:
- Matthias Totz, chad3f
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractCreator<Item>
buildCreator(Class<?> implementation)
Build a creator for the class.Class<?>
getItem()
Returns an item-instance.int
int
getValue()
double
void
initializeActiveSlotsList(String slots)
Add slots to list where SlotActivatedItem can be activated when equipped.void
Set the types of status attacks that this StatusResistantItem can resist.void
setAttributes(Map<String,String> attributes)
void
setBehavior(UseBehavior behavior)
Set the use behavior.void
setDamageType(String type)
void
setDescription(String text)
void
setEquipableSlots(List<String> slots)
void
setImplementation(Class<?> implementation)
void
setItemClass(String val)
void
setItemName(String val)
void
setItemSubclass(String val)
void
setSusceptibilities(Map<String,Double> sus)
Set the susceptibilities.void
setTileId(int val)
void
setValue(int val)
void
setWeight(double weight)
toXML()
-
Constructor Details
-
DefaultItem
-
-
Method Details
-
setWeight
public void setWeight(double weight) -
getWeight
public double getWeight() -
getAttributes
-
setAttributes
-
setEquipableSlots
-
getEquipableSlots
-
setDescription
-
getDescription
-
setDamageType
-
setSusceptibilities
Set the susceptibilities. The key of each map entry should be a string corresponding to a damage type. The value is the susceptibility value of that damage type. The content of the mapping is copied, so it can be safely modified afterwards.- Parameters:
sus
- susceptibility mapping
-
initializeActiveSlotsList
Add slots to list where SlotActivatedItem can be activated when equipped.- Parameters:
slots
- String list of slots separated by semicolon
-
initializeStatusResistancesList
Set the types of status attacks that this StatusResistantItem can resist.- Parameters:
res
- The status type and the resistance value
-
setImplementation
-
setBehavior
Set the use behavior.- Parameters:
behavior
- new behavior
-
getImplementation
-
buildCreator
Build a creator for the class. It uses the following constructor search order:
- Class(name, clazz, subclazz, attributes)
- Class(attributes)
- Class()
- Parameters:
implementation
- The implementation class.- Returns:
- A creator, or
null
if none found.
-
getItem
Returns an item-instance.- Returns:
- An item, or
null
on error.
-
getTileId
public int getTileId()- Returns:
- the tile id .
-
setTileId
public void setTileId(int val) -
setValue
public void setValue(int val) -
getValue
public int getValue() -
getItemClass
- Returns:
- the class.
-
setItemClass
-
getItemSubclass
- Returns:
- the subclass.
-
setItemSubclass
-
getItemName
-
setItemName
-
toXML
-