Additional tools for Admin portal, and huge NameSpace Revamp

This commit is contained in:
dingo
2025-12-26 09:10:43 -05:00
parent ba747d1891
commit 244635ca3f
133 changed files with 2153 additions and 4776 deletions
+3 -33
View File
@@ -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;
}
}