Added max phoenix spirits to 4

This commit is contained in:
2021-11-16 13:20:56 -05:00
parent 1cbe2c35a5
commit ca9aba9e99
3 changed files with 3 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ namespace TOOHUCardAPI.Data
public static int PointsPerLevelNormal { get; set; }
public static int FirstWinBonusPointsMin { get; set; }
public static int FirstWinBonusPointsMax { get; set; }
public static int MaxPhoenixSpirits { get; set; }
public static int PointsPerKey { get; set; }
public static int MaxKeyPurchaseAmount { get; set; }
public static string StarterDeckGroupKey { get; set; }

View File

@@ -49,7 +49,7 @@ namespace TOOHUCardAPI.Data.Services
public async Task<int> ChangePowerMaxTotal(long steamId, int amt)
{
User user = await _userRepository.GetUser(steamId);
user.PowerMaxTotal = Math.Clamp(user.PowerMaxTotal + amt, 0, int.MaxValue);
user.PowerMaxTotal = Math.Clamp(user.PowerMaxTotal + amt, 0, AppSettings.MaxPhoenixSpirits);
await _userRepository.UpdateUser(user);
_logger.LogInformation("User {SteamId} changed the number of MaxPower items they had by {Amount}", user.SteamId, amt);
return user.PowerMaxTotal;