Beeg fixpack

This commit is contained in:
2026-02-16 03:30:45 -08:00
parent f09d6ac8e8
commit 366ed9f5e6
52 changed files with 2876 additions and 451 deletions

View File

@@ -48,20 +48,17 @@ public class ExperiencePointsComponent : IExperiencePointsComponent
public void Gain(int baseExpGain)
{
var modifiedExpGain = baseExpGain * _expGainRate.Value;
var newCurrentExpTotal = modifiedExpGain + _currentExp.Value;
while (modifiedExpGain + _currentExp.Value >= _expToNextLevel.Value)
_currentExp.OnNext(Mathf.RoundToInt(modifiedExpGain + _currentExp.Value));
while (_currentExp.Value >= _expToNextLevel.Value)
LevelUp();
var cappedAmount = Math.Min(baseExpGain + _currentExp.Value, _expToNextLevel.Value);
_currentExp.OnNext(cappedAmount);
}
public void GainUnmodified(int flatRateExp)
{
var newCurrentExpTotal = flatRateExp + _currentExp.Value;
while (flatRateExp + _currentExp.Value >= _expToNextLevel.Value)
_currentExp.OnNext(newCurrentExpTotal);
while (_currentExp.Value >= _expToNextLevel.Value)
LevelUp();
var cappedAmount = Math.Min(flatRateExp + _currentExp.Value, _expToNextLevel.Value);
_currentExp.OnNext(cappedAmount);
}
public void ModifyExpGainRate(double newRate) => _expGainRate.OnNext(newRate);