Added support for savemaxpower

This commit is contained in:
2021-10-31 02:57:30 -04:00
parent 05340b5cc8
commit aa68670221
12 changed files with 1080 additions and 11 deletions

View File

@@ -29,6 +29,14 @@ namespace TOOHUCardAPI.Data.Services
_logger.LogInformation($"User with steamid {user.SteamId} was given {points} points. New total: {user.Point}");
}
public async Task<int> ChangePowerMaxTotal(string steamId, int amt)
{
User user = await _userRepository.GetUser(steamId);
user.PowerMaxTotal = Math.Clamp(user.PowerMaxTotal + amt, 0, int.MaxValue);
await _userRepository.UpdateUser(user);
return user.PowerMaxTotal;
}
public async Task<int> LevelUpCard(string steamId, string itemName, int levelIncrease)
{
User user = await _userRepository.GetUser(steamId);