Class Level

java.lang.Object
games.stendhal.common.Level

public class Level extends Object
Utility class for getting the player level for some given exp. points.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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
    main​(String[] args)
    prints the level table
    static int
    gets the highest level

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Level

      public Level()
  • Method Details

    • main

      public static void main(String[] args)
      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 Experience
      added - 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) and 1.0 (exclusive).