Class Achievement
java.lang.Object
games.stendhal.server.core.rp.achievement.Achievement
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 Summary
Modifier and TypeFieldDescriptionstatic int
base score for easy achievementsstatic int
base score for difficult achievementsstatic int
base score for achievements of medium difficulty -
Constructor Summary
ConstructorDescriptionAchievement(String identifier, String title, Category category, String description, int baseScore, boolean active, ChatCondition condition)
create a new achievement -
Method Summary
Modifier and TypeMethodDescriptionint
getTitle()
boolean
isActive()
boolean
isFulfilled(Player p)
Check if a player has fulfilled this achievementtoString()
-
Field Details
-
EASY_BASE_SCORE
public static final int EASY_BASE_SCOREbase score for easy achievements- See Also:
- Constant Field Values
-
MEDIUM_BASE_SCORE
public static final int MEDIUM_BASE_SCOREbase score for achievements of medium difficulty- See Also:
- Constant Field Values
-
HARD_BASE_SCORE
public static final int HARD_BASE_SCOREbase 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
- Returns:
- the category of this achievement
-
getIdentifier
- Returns:
- the identifying string
-
getTitle
- Returns:
- the title a player gets awarded for this achievement
-
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
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
-