sidequest_common.leveling#

MEE6-compatible leveling curve.

Going from level n to n + 1 costs 5n^2 + 50n + 100 XP; XP is stored as a running total.

Classes#

LevelProgress

Where a running XP total sits on the curve.

Functions#

level_for_xp(→ int)

Level reached with xp total.

level_progress(→ LevelProgress)

Level reached with xp total, plus progress toward the next one.

total_xp_for_level(→ int)

Total XP needed to reach level from zero.

xp_to_next_level(→ int)

XP needed to go from level to level + 1.

Module Contents#

class sidequest_common.leveling.LevelProgress#

Bases: NamedTuple

Where a running XP total sits on the curve.

level: int#
xp_for_next_level: int#
xp_into_level: int#
sidequest_common.leveling.level_for_xp(xp: int) → int#

Level reached with xp total.

sidequest_common.leveling.level_progress(xp: int) → LevelProgress#

Level reached with xp total, plus progress toward the next one.

sidequest_common.leveling.total_xp_for_level(level: int) → int#

Total XP needed to reach level from zero.

sidequest_common.leveling.xp_to_next_level(level: int) → int#

XP needed to go from level to level + 1.