sidequest_common.leveling ========================= .. py:module:: sidequest_common.leveling .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: sidequest_common.leveling.LevelProgress Functions --------- .. autoapisummary:: sidequest_common.leveling.level_for_xp sidequest_common.leveling.level_progress sidequest_common.leveling.total_xp_for_level sidequest_common.leveling.xp_to_next_level Module Contents --------------- .. py:class:: LevelProgress Bases: :py:obj:`NamedTuple` Where a running XP total sits on the curve. .. py:attribute:: level :type: int .. py:attribute:: xp_for_next_level :type: int .. py:attribute:: xp_into_level :type: int .. py:function:: level_for_xp(xp: int) -> int Level reached with ``xp`` total. .. py:function:: level_progress(xp: int) -> LevelProgress Level reached with ``xp`` total, plus progress toward the next one. .. py:function:: total_xp_for_level(level: int) -> int Total XP needed to reach ``level`` from zero. .. py:function:: xp_to_next_level(level: int) -> int XP needed to go from ``level`` to ``level + 1``.