Additional tools for Admin portal, and huge NameSpace Revamp
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Server.Data;
|
||||
namespace DungeonCrawler.Data.Entities;
|
||||
using DataServer.Data;
|
||||
namespace DataServer.Data.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Derived stats calculator - used at runtime
|
||||
@@ -153,34 +153,4 @@ public class Character
|
||||
public virtual ICollection<LearnedSpell> LearnedSpells { get; set; } = new List<LearnedSpell>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Experience required per level (exponential curve)
|
||||
/// </summary>
|
||||
public static class LevelSystem
|
||||
{
|
||||
public static long GetXpForLevel(int level)
|
||||
{
|
||||
// Base 100 XP for level 2, scaling exponentially
|
||||
return (long)(100 * Math.Pow(1.15, level - 1));
|
||||
}
|
||||
|
||||
public static long GetTotalXpForLevel(int level)
|
||||
{
|
||||
long total = 0;
|
||||
for (int i = 1; i < level; i++)
|
||||
total += GetXpForLevel(i);
|
||||
return total;
|
||||
}
|
||||
|
||||
public static int GetLevelForXp(long totalXp)
|
||||
{
|
||||
int level = 1;
|
||||
long xpNeeded = 0;
|
||||
while (xpNeeded <= totalXp)
|
||||
{
|
||||
xpNeeded += GetXpForLevel(level);
|
||||
if (xpNeeded <= totalXp) level++;
|
||||
}
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user