Package games.stendhal.server.entity
Class DressedEntity
- All Implemented Interfaces:
Killer,Cloneable,Iterable<String>,Serializable
Defines an entity whose appearance (outfit) can be changed.
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.game.RPObject
RPObject.ID -
Field Summary
Fields inherited from class games.stendhal.server.entity.RPEntity
atk, ATTR_TITLE, damageReceived, def, HIT_CHANCE_MULTIPLIER, level, lv_cap, ratk, statusAttackers, statusList, totalDamageReceivedFields inherited from class games.stendhal.server.entity.CombatEntity
enemiesThatGiveFightXP, RPCLASS_NAMEFields inherited from class games.stendhal.server.entity.GuidedEntity
baseSpeed, pathnotifierFields inherited from class marauroa.common.game.RPObject
INVALID_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRemoves layer color information.protected abstract voiddropItemsOn(Corpse corpse) static voidRetrieves the entity's original outfit.Gets this entity's outfit.getOutfitColor(String layer) Retrieves color info for a single layer.gets the color mapbooleanisNaked()Checks if the entity is not wearing clothes.abstract voidlogic()Perform cycle logic.voidThis is simply for backwards compatibility to update a user's outfit with the "outfit" attribute.voidvoidMakes this player wear the given outfit.voidSets this entity's outfit.voidMakes this player wear the given outfit.voidMakes this player wear the given outfit.voidSets the entity's outfit using a string code.voidSets the entity's outfit using a string code.voidsetOutfitColor(String part, int color) Set color for single outfit layer.voidsetOutfitColor(String part, Color color) Set color for single outfit layer.voidsetOutfitColor(String part, String color) voidsetOutfitColors(Map<String, Integer> parts) Set colors for the entire outfit.voidsetOutfitWithDetail(Outfit outfit, boolean temporary) protected voidvoidunsetOutfitColor(String part) Unset color of a single layer.Methods inherited from class games.stendhal.server.entity.RPEntity
addAtkXP, addBaseMana, addDefXP, addKarma, addMana, addRatkXP, addStatusAttacker, addXP, applyDistanceAttackModifiers, attack, calculateRiskForCanHit, canDoRangeAttack, canHit, damage, damageDone, damageDone, delayedDamage, describe, drop, drop, drop, dropDroppableItem, dropWithItemdata, dropWithItemdata, entityAsOnlinePlayer, entityAsPet, equip, equipOrPutOnGround, equipToInventoryOnly, getAllEquipped, getAllEquippedWithItemdata, getAllStatusAttackers, getAmmunition, getArmor, getAtk, getAtkXP, getAttackingRPEntities, getAttackRate, getAttackSources, getAttackTarget, getBaseHP, getBaseMana, getBloodClass, getBoots, getCappedAtk, getCappedDef, getCappedRatk, getCloak, getCorpseDeserver, getCorpseHeight, getCorpseName, getCorpseWidth, getDamageType, getDeathSound, getDef, getDefenseItems, getDefXP, getDescriptionName, getDroppables, getEquippedItemClass, getFirstEquipped, getHarmlessCorpseName, getHelmet, getHP, getItemAtk, getItemDef, getItemRatk, getKarma, getLanguage, getLegs, getLevel, getLVCap, getMana, getMaxRangeForArcher, getMissileIfNotHoldingOtherWeapon, getName, getNumberOfEquipped, getRangedDamageType, getRangeWeapon, getRatk, getRatkXP, getRing, getShield, getSlotToEquip, getStatusList, getSusceptibility, getTitle, getTotalNumberOf, getWeapon, getWeapons, getXP, handleLifesteal, handlePortal, hasArmor, hasBoots, hasCloak, hasHelmet, hasLegs, hasLineOfSight, hasRing, hasShield, hasStatus, heal, heal, heal, incAtkXP, incDefXP, incRatkXP, initHP, isAttackable, isAttacked, isAttacking, isEquipped, isEquipped, isEquippedItemClass, isEquippedItemInSlot, isEquippedWithItemdata, isEquippedWithItemdata, isInvisibleToCreatures, makeCorpse, maybeDropDroppables, onAdded, onDamaged, onDead, onDead, onRejectedAttackStart, onRemoved, rememberAttacker, rewardKillerAnimals, rewardKillers, sendPrivateText, sendPrivateText, sendPrivateText, sendPrivateText, setAtk, setAtkInternal, setAtkXP, setBaseHP, setBaseMana, setBlood, setDeathSound, setDef, setDefInternal, setDefXP, setHP, setLevel, setLVCap, setMana, setName, setRatk, setRatkInternal, setRatkXP, setRatkXPInternal, setShadowStyle, setTarget, setTitle, setXP, stopAttack, stopAttacking, subXP, update, updateItemAtkDef, updateLevel, useKarma, useKarma, useKarmaMethods inherited from class games.stendhal.server.entity.CombatEntity
getsAtkXpFrom, getsDefXpFrom, recentlyDamagedByMethods inherited from class games.stendhal.server.entity.GuidedEntity
addSuspend, addSuspend, applyMovement, atMovementRadius, clearPath, followPath, getBaseSpeed, getCollisionAction, getDirectionFromOrigin, getDistanceFromOrigin, getGuide, getPath, getPathPosition, handleObjectCollision, hasPath, isPathLoop, onFinishedPath, onMoved, onNodeReached, onOutsideMovementRadius, removeSuspend, reroute, retracePath, setBaseSpeed, setCollisionAction, setPath, setPath, setPathAndPosition, setPathPosition, setRandomMovementRadius, setRandomMovementRadius, setRetracePath, setUsesRandomPath, stop, updateModifiedAttributes, usesRandomPathMethods inherited from class games.stendhal.server.entity.ActiveEntity
canMoveTo, canMoveTo, faceto, faceToward, getDirection, getDirectionToward, getDirectionToward, getResistance, getSpeed, getStepsTaken, handleLeaveZone, handleSimpleCollision, ignoresCollision, isFacingToward, isGhost, isMoveCompleted, isZoneChangeAllowed, move, setDirection, setIgnoresCollision, setSpeed, stoppedMethods inherited from class games.stendhal.server.entity.Entity
getAdjacentNodes, getArea, getArea, getCursor, getDescription, getEntitySlot, getHeight, getOrigin, getResistance, getWidth, getX, getY, getZone, hasDescription, isInSight, isObstacle, nextTo, nextTo, notifyWorldAboutChanges, setCursor, setDescription, setEntityClass, setEntitySubclass, setMenu, setPosition, setResistance, setSize, setVisibility, slotIterator, slots, squaredDistance, squaredDistanceMethods inherited from class marauroa.common.game.RPObject
addEvent, addLink, addLink, addMap, addSlot, addSlot, applyDifferences, clearEvents, clearVisible, clone, containsKey, equals, events, eventsIterator, fill, get, getBaseContainer, getBoolean, getContainer, getContainerBaseOwner, getContainerOwner, getContainerSlot, getDifferences, getDouble, getFromSlots, getID, getInt, getLink, getLinkedObject, getMap, getSlot, has, hashCode, hasLink, hasMap, hasSlot, hide, isContained, isEmpty, isHidden, isStorable, maps, put, put, put, put, readObject, remove, removeLink, removeMap, removeSlot, resetAddedAndDeleted, resetAddedAndDeletedMaps, resetAddedAndDeletedRPLink, resetAddedAndDeletedRPSlot, setAddedMaps, setAddedRPSlot, setContainer, setDeletedMaps, setDeletedRPSlot, setID, size, slots, slotsIterator, store, toString, unhide, unstore, writeObject, writeObject, writeToJsonMethods inherited from class marauroa.common.game.SlotOwner
deserializeRPSlots, fill, serializeRPSlotsMethods inherited from class marauroa.common.game.Attributes
add, applyDifferences, get, getBool, getDouble, getInt, getList, getLong, getRPClass, has, instanceOf, iterator, put, put, put, put, readFromMap, remove, resetAddedAndDeletedAttributes, setAddedAttributes, setDeletedAttributes, setRPClass, setRPClass, toAttributeStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DressedEntity
public DressedEntity() -
DressedEntity
-
-
Method Details
-
generateRPClass
public static void generateRPClass() -
put
This is simply for backwards compatibility to update a user's outfit with the "outfit" attribute.- Overrides:
putin classAttributes- Parameters:
attr- the attribute to be set.value- the value we want to set.
-
getOutfit
Gets this entity's outfit. Note: some entities (e.g. sheep, many NPC's, all monsters) don't use the outfit system.- Returns:
- The outfit, or null if this RPEntity is represented as a single sprite rather than an outfit combination.
-
getOriginalOutfit
Retrieves the entity's original outfit.- Returns:
- Original outfit if entity is currently wearing a temporary one.
-
getOutfitColors
gets the color map- Returns:
- color map
-
getOutfitColor
Retrieves color info for a single layer.- Parameters:
layer- Layer name.
-
clearColors
protected void clearColors()Removes layer color information. -
setOutfit
Sets this entity's outfit. Note: some entities (e.g. sheep, many NPC's, all monsters) don't use the outfit system.- Parameters:
outfit- The new outfit.
-
setOutfit
Makes this player wear the given outfit. If the given outfit contains null parts, the current outfit will be kept for these parts. If the outfit change includes any colors, they should be changed after calling this.- Parameters:
outfit- The new outfit.temporary- If true, the original outfit will be stored so that it can be restored later.
-
setOutfit
Makes this player wear the given outfit. If the given outfit contains null parts, the current outfit will be kept for these parts. If the outfit change includes any colors, they should be changed after calling this. Currently supported layers should be in this order: body, dress, head, mouth, eyes, mask, hair, hat, detail- Parameters:
layers- Integer indexes of each outfit layer or null.
-
setOutfit
Makes this player wear the given outfit. If the given outfit contains null parts, the current outfit will be kept for these parts. If the outfit change includes any colors, they should be changed after calling this. Currently supported layers should be in this order: body, dress, head, mouth, eyes, mask, hair, hat, detail- Parameters:
temporary- If true, the original outfit will be stored so that it can be restored later.layers- Integer indexes of each outfit layer or null.
-
setOutfit
Sets the entity's outfit using a string code. E.g.: body=1,hair=5,dress=13- Parameters:
strcode-
-
setOutfit
Sets the entity's outfit using a string code. E.g.: body=1,hair=5,dress=13- Parameters:
strcode- String code representing outfit.temporary- If true, the original outfit will be stored so that it can be restored later.
-
setOutfitWithDetail
-
setOutfitColor
Set color for single outfit layer.- Parameters:
part- Layer to be colored.color-Integervalue color to use.
-
setOutfitColor
Set color for single outfit layer.- Parameters:
part- Layer to be colored.color-Colorvalue color to use.
-
setOutfitColor
-
setOutfitColors
Set colors for the entire outfit.- Parameters:
parts-Mapof layers & colors (Integer).
-
isNaked
public boolean isNaked()Checks if the entity is not wearing clothes. -
unsetOutfitColor
Unset color of a single layer.- Parameters:
part- Layer to be unset.
-
getColorableLayers
-
storeOriginalOutfit
protected void storeOriginalOutfit() -
restoreOriginalOutfit
public void restoreOriginalOutfit() -
dropItemsOn
- Specified by:
dropItemsOnin classRPEntity
-
logic
public abstract void logic()Description copied from class:RPEntityPerform cycle logic.
-