This commit is contained in:
2025-03-07 01:52:56 -08:00
parent 65e4af8595
commit e7ef669c29
16 changed files with 15 additions and 41 deletions

View File

@@ -20,7 +20,7 @@ public interface IPlayer : IKillable, IProvide<ISaveChunk<PlayerData>>
public void Knockback(float impulse);
public void GainExp(int expGained);
public void GainExp(double expGained);
public void LevelUp();

View File

@@ -380,7 +380,7 @@ public partial class Player : CharacterBody3D, IPlayer
_knockbackDirection = GlobalBasis.Z.Normalized();
}
public void GainExp(int expGained)
public void GainExp(double expGained)
{
Stats.SetCurrentExp(Stats.CurrentExp.Value + expGained);
}
@@ -571,7 +571,7 @@ public partial class Player : CharacterBody3D, IPlayer
Die();
}
private void CurrentEXP_Sync(int newExp)
private void CurrentEXP_Sync(double newExp)
{
if (Stats.CurrentExp.Value >= Stats.ExpToNextLevel.Value)
LevelUp();

View File

@@ -17,7 +17,7 @@ public partial record PlayerStats
[Save("maximumVT")]
public int MaximumVT { get; init; }
[Save("currentExp")]
public int CurrentExp { get; init; }
public double CurrentExp { get; init; }
[Save("currentLevel")]
public int CurrentLevel { get; init; }
[Save("currentAttack")]
@@ -68,7 +68,7 @@ public class PlayerStatController
public IAutoProp<int> CurrentDefense => _currentDefense;
public IAutoProp<int> MaxDefense => _maxDefense;
public IAutoProp<int> BonusDefense => _bonusDefense;
public IAutoProp<int> CurrentExp => _currentExp;
public IAutoProp<double> CurrentExp => _currentExp;
public IAutoProp<int> ExpToNextLevel => _expToNextLevel;
public IAutoProp<int> CurrentLevel => _currentLevel;
public IAutoProp<double> Luck => _luck;
@@ -91,7 +91,7 @@ public class PlayerStatController
{
_maximumVT.OnNext(newValue);
}
public void SetCurrentExp(int newValue)
public void SetCurrentExp(double newValue)
{
_currentExp.OnNext(newValue);
}
@@ -139,7 +139,7 @@ public class PlayerStatController
private readonly AutoProp<int> _maximumHP = new(-1);
private readonly AutoProp<int> _currentVT = new(-1);
private readonly AutoProp<int> _maximumVT = new(-1);
private readonly AutoProp<int> _currentExp = new(-1);
private readonly AutoProp<double> _currentExp = new(-1);
private readonly AutoProp<int> _currentLevel = new(-1);
private readonly AutoProp<int> _currentAttack = new(-1);
private readonly AutoProp<int> _bonusAttack = new(-1);