Class DressedEntity

All Implemented Interfaces:
Killer, Cloneable, Iterable<String>, Serializable
Direct Known Subclasses:
NPC, Player

public abstract class DressedEntity extends RPEntity
Defines an entity whose appearance (outfit) can be changed.
  • Constructor Details

    • DressedEntity

      public DressedEntity()
    • DressedEntity

      public DressedEntity(RPObject object)
  • Method Details

    • generateRPClass

      public static void generateRPClass()
    • put

      public void put(String attr, String value)
      This is simply for backwards compatibility to update a user's outfit with the "outfit" attribute.
      Overrides:
      put in class Attributes
      Parameters:
      attr - the attribute to be set.
      value - the value we want to set.
    • getOutfit

      public Outfit 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

      public Outfit getOriginalOutfit()
    • getOutfitColors

      public Map<String,​String> getOutfitColors()
      gets the color map
      Returns:
      color map
    • setOutfit

      public void setOutfit(Outfit outfit)
      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

      public void setOutfit(Outfit outfit, boolean temporary)
      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

      public void setOutfit(Integer... layers)
      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

      public void setOutfit(boolean temporary, Integer... layers)
      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

      public void setOutfit(String strcode)
      Sets the entity's outfit using a string code. E.g.: body=1,hair=5,dress=13
      Parameters:
      strcode -
    • setOutfit

      public void setOutfit(String strcode, boolean temporary)
      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

      public void setOutfitWithDetail(Outfit outfit, boolean temporary)
    • setOutfitColor

      public void setOutfitColor(String part, int color)
      Set color for single outfit layer.
      Parameters:
      part - Layer to be colored.
      color - Integer value color to use.
    • setOutfitColor

      public void setOutfitColor(String part, Color color)
      Set color for single outfit layer.
      Parameters:
      part - Layer to be colored.
      color - Color value color to use.
    • setOutfitColor

      public void setOutfitColor(String part, String color)
    • setOutfitColors

      public void setOutfitColors(Map<String,​Integer> parts)
      Set colors for the entire outfit.
      Parameters:
      parts - Map of layers & colors (Integer).
    • isNaked

      public boolean isNaked()
      Checks if the entity is not wearing clothes.
    • unsetOutfitColor

      public void unsetOutfitColor(String part)
      Unset color of a single layer.
      Parameters:
      part - Layer to be unset.
    • restoreOriginalOutfit

      public void restoreOriginalOutfit()
    • dropItemsOn

      protected abstract void dropItemsOn(Corpse corpse)
      Specified by:
      dropItemsOn in class RPEntity
    • logic

      public abstract void logic()
      Description copied from class: RPEntity
      Perform cycle logic.
      Specified by:
      logic in class RPEntity