LevelSystem

interface LevelSystem(source)

System that provides methods to work with player's level and experience points.

Before implementing run an eye over all default method implementations and override all methods that works not properly for your case.

Properties

Link copied to clipboard

Assigned converter.

Link copied to clipboard
abstract var exp: Double

Player's current level experience points.

Link copied to clipboard

Remaining experience for the player to reach next level.

Link copied to clipboard

Current fractional XP.

Link copied to clipboard
abstract var level: Int

Current level of the player. Level can not be lesser than zero.

Link copied to clipboard
open var totalExp: Double

Player's total experience points.

Link copied to clipboard

Total amount of experience required for the player to reach next level.

Functions

Link copied to clipboard
open fun didReachLevel(requiredLevel: Int): Boolean

Checks player reached required experience level.

Link copied to clipboard
open fun giveExp(expAmount: Double)

Gives player the amount of experience specified.

Link copied to clipboard
open fun giveLevels(lvlAmount: Int)

Increases the player level by a specified amount.

Link copied to clipboard
open fun hasExp(requiredExp: Double): Boolean

Checks player has required experience on current level.

Link copied to clipboard
open fun hasExpTotal(requiredExp: Double): Boolean

Checks player has required total experience.

Link copied to clipboard
open fun takeExp(expAmount: Double)

Takes away player the amount of experience specified.

Link copied to clipboard
open fun takeLevels(lvlAmount: Int)

Decreases the player level by a specified amount.