Fix sort bug, add to max hp on level up
This commit is contained in:
@@ -357,6 +357,10 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
|
||||
|
||||
public void LevelUp()
|
||||
{
|
||||
var rng = new RandomNumberGenerator();
|
||||
rng.Randomize();
|
||||
var hpIncrease = rng.RandiRange(3, 6);
|
||||
Stats.SetMaximumHP(Stats.MaximumHP.Value + hpIncrease);
|
||||
var nextLevel = Stats.CurrentLevel.Value + 1;
|
||||
var expToNextLevel = _expToNextLevel[nextLevel];
|
||||
var newCurrentExp = Mathf.Max(Stats.CurrentExp.Value - Stats.ExpToNextLevel.Value, 0);
|
||||
|
||||
Reference in New Issue
Block a user