Package games.stendhal.common
Class Level
java.lang.Object
games.stendhal.common.Level
Utility class for getting the player level for some given exp. points.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
changeLevel(int exp, int added)
Calculates how many levels to add when a certain amount of experience is added.static int
getLevel(int exp)
calculates the level according to the experience.static double
getWisdom(int level)
Get an entity's wisdom factor based on their level.static int
getXP(int level)
Calculates the experienced needed for a level.static void
prints the level tablestatic int
maxLevel()
gets the highest level
-
Field Details
-
LEVELS
public static final int LEVELS- See Also:
- Constant Field Values
-
-
Constructor Details
-
Level
public Level()
-
-
Method Details
-
main
prints the level table- Parameters:
args
- ignored
-
maxLevel
public static int maxLevel()gets the highest level- Returns:
- highest level
-
getLevel
public static int getLevel(int exp)calculates the level according to the experience.- Parameters:
exp
- experience needed- Returns:
- level
-
getXP
public static int getXP(int level)Calculates the experienced needed for a level.- Parameters:
level
- level- Returns:
- experience needed
-
changeLevel
public static int changeLevel(int exp, int added)Calculates how many levels to add when a certain amount of experience is added.- Parameters:
exp
- the current Experienceadded
- the added Experience- Returns:
- difference of levels
-
getWisdom
public static double getWisdom(int level)Get an entity's wisdom factor based on their level. As no one really has 100% (i.e. 1.0) wisdom, it should be scaled as needed.- Parameters:
level
- A player level.- Returns:
- A value between
0.0
(inclusive) and1.0
(exclusive).
-