Class Achievement

java.lang.Object
games.stendhal.server.core.rp.achievement.Achievement

public class Achievement extends Object
An Achievement a player can reach while playing the game. Achievements are given for example for doing a certain number of quests or killing a number of special creatures
Author:
madmetzger
  • Field Details

    • EASY_BASE_SCORE

      public static final int EASY_BASE_SCORE
      base score for easy achievements
      See Also:
      Constant Field Values
    • MEDIUM_BASE_SCORE

      public static final int MEDIUM_BASE_SCORE
      base score for achievements of medium difficulty
      See Also:
      Constant Field Values
    • HARD_BASE_SCORE

      public static final int HARD_BASE_SCORE
      base score for difficult achievements
      See Also:
      Constant Field Values
  • Constructor Details

    • Achievement

      public Achievement(String identifier, String title, Category category, String description, int baseScore, boolean active, ChatCondition condition)
      create a new achievement
      Parameters:
      identifier -
      title -
      category -
      description -
      baseScore -
      active -
      condition -
  • Method Details

    • getCategory

      public Category getCategory()
      Returns:
      the category of this achievement
    • getIdentifier

      public String getIdentifier()
      Returns:
      the identifying string
    • getTitle

      public String getTitle()
      Returns:
      the title a player gets awarded for this achievement
    • getDescription

      public String getDescription()
      Returns:
      the description of what to do to get this achievement
    • getBaseScore

      public int getBaseScore()
      Returns:
      the base score for this achievement
    • isActive

      public boolean isActive()
      Returns:
      true if the achievement is visible, false otherwise
    • isFulfilled

      public boolean isFulfilled(Player p)
      Check if a player has fulfilled this achievement
      Parameters:
      p - the player to check
      Returns:
      true iff this achievement's condition evaluates to true
    • toString

      public String toString()
      Overrides:
      toString in class Object