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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractCreator<Item>buildCreator(Class<?> implementation) Build a creator for the class.Class<?>getItem()Returns an item-instance.getSlots()String[]intintgetValue()doublevoidinitializeActiveSlotsList(String slots) Add slots to list where SlotActivatedItem can be activated when equipped.voidSet the types of status attacks that this StatusResistantItem can resist.booleanvoidsetAttributes(Map<String, String> attributes) voidsetBehavior(UseBehavior behavior) Set the use behavior.voidsetDamageType(String type) voidsetDescription(String text) voidsetEquipableSlots(List<String> slots) voidsetImplementation(Class<?> implementation) voidsetItemClass(String val) voidsetItemName(String val) voidsetItemSubclass(String val) voidsetStatusAttacks(String statusAttacks) voidsetSusceptibilities(Map<String, Double> sus) Set the susceptibilities.voidsetTileId(int val) voidsetUnattainable(boolean unattainable) voidsetValue(int val) voidsetWeight(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
-
setStatusAttacks
-
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
nullif none found.
-
getItem
Returns an item-instance.- Returns:
- An item, or
nullon 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
-
getCreator
-
getSlots
-
getDamageType
-
getSusceptibilities
-
getResistances
-
getStatusAttacks
-
getActiveSlotsList
-
getUseBehavior
-
isUnattainable
public boolean isUnattainable() -
setUnattainable
public void setUnattainable(boolean unattainable) -
toXML
-