Module:Experience/doc: Difference between revisions

From Brighter Shores Wiki
Jump to navigation Jump to search
Content added Content deleted
(Created page with "{{Documentation}} See also: {{T|XP/Total}}, {{T|XP/Between}}, {{T|XP/To next}}, {{T|XP/Level for}} {{Helper module |name = Experience |fname1 = _total_xp(level) |ftype1 = number |fuse1 = Returns the total experience needed to reach a level (from 0). |fname2 = _between(level_low, level_high) |ftype2 = number, number |fuse2 = Given a level_low and a level_high, return how much experience is needed, starting at level_low, to reach level_high. This is assuming you start...")
 
mNo edit summary
 
Line 1:
{{Documentation}}
{{See also|Template: {{T|XP/Total}}, {{T|Template:XP/Between}}, {{T|Template:XP/To next}}, {{T|Template:XP/Level for}}
 
See also: {{T|XP/Total}}, {{T|XP/Between}}, {{T|XP/To next}}, {{T|XP/Level for}}
 
{{Helper module

Latest revision as of 10:42, 19 December 2024

This is a documentation subpage for Module:Experience.
It contains usage information, categories, and other content that is not part of the original module page.
Module:Experience's function between is invoked by Template:XP/Between.
Module:Experience's function level_at is invoked by Template:XP/Level for.
Module:Experience's function to_next is invoked by Template:XP/To next.
Module:Experience's function total_xp is invoked by Template:XP/Total.
Module:Experience requires strict.
Module:Experience loads data from Module:Experience/data.
Module:Experience is required by Module:Skill calc.

This module is a helper module to be used by other modules; it may not designed to be invoked directly. See Brighter Shores:Lua/Helper modules for a full list and more information.

FunctionTypeUse
_total_xp(level)numberReturns the total experience needed to reach a level (from 0).
_between(level_low, level_high)number, numberGiven a level_low and a level_high, return how much experience is needed, starting at level_low, to reach level_high. This is assuming you start at exactly level_low and end as soon as you reach level_high, with no extra experience.
_to_next(level)numberGiven a level, return the experience needed to get to the next level. Returns nil for level 500
_level_at(xp)numberReturns the level you would be at if you had xp experience. When the result is < 500, _total_xp(result) <= xp and xp < _total_xp(result+1)