public void Apply(ArcadeUser user) { if (Money > 0) { user.Give(Money); } ulong oldExp = user.Exp; if (Exp > 0) { user.Exp += Exp; } if (user.Config.Notifier.HasFlag(NotifyAllow.Level)) { int oldLevel = ExpConvert.AsLevel(oldExp, user.Ascent); int level = user.Level; if (level > oldLevel) { user.Notifier.Append($"Level up! ({LevelViewer.GetLevel(oldLevel, user.Ascent)} to {LevelViewer.GetLevel(level, user.Ascent)})"); } } if (!Check.NotNullOrEmpty(ItemIds)) { return; } foreach ((string itemId, int amount) in ItemIds) { ItemHelper.GiveItem(user, itemId, amount); } }
public async Task ViewLevelAsync() { await Context.Channel.SendMessageAsync(LevelViewer.View(Context.Account)); }
public static string View(ArcadeUser user, ArcadeContext ctx) { var details = new StringBuilder(); details.AppendLine($"> **{user.Username}**"); details.AppendLine($"> Joined: **{Format.Date(user.CreatedAt, '.')}**"); details.AppendLine("\n> **Level**"); details.AppendLine($"> {LevelViewer.GetLevel(user.Level, user.Ascent)}"); if (user.Balance > 0 || user.Debt > 0 || user.ChipBalance > 0) { details.AppendLine("\n> **Wallet**"); if (user.Balance > 0 || user.Debt > 0) { string icon = user.Balance > 0 ? Icons.Balance : Icons.Debt; long value = user.Balance > 0 ? user.Balance : user.Debt; string id = user.Balance > 0 ? Vars.Balance : Vars.Debt; int position = Leaderboard.GetPosition(ctx.Data.Users.Values.Values, user, id); string pos = ""; if (position < 4) { pos = $" (#**{position:##,0}** global)"; } details.AppendLine($"> {icon} **{value:##,0}**{pos}"); } if (user.ChipBalance > 0) { int position = Leaderboard.GetPosition(ctx.Data.Users.Values.Values, user, Vars.Chips); string pos = ""; if (position < 4) { pos = $" (#**{position:##,0}** global)"; } details.AppendLine($"> {Icons.Chips} **{user.ChipBalance:##,0}**{pos}"); } } if (user.Items.Count > 0) { details.AppendLine($"\n> **Inventory**"); details.AppendLine($"> **{user.Items.Count}** used {Format.TryPluralize("slot", user.Items.Count)}"); } List <string> randomStats = GetRandomStats(user, 3); if (Check.NotNullOrEmpty(randomStats)) { return(details.ToString()); } details.AppendLine($"\n> **Random Statistics**"); foreach (string stat in randomStats) { details.AppendLine($"> **{Var.WriteName(stat)}**: {Var.WriteValue(user, stat)}"); } return(details.ToString()); }
public void LoadManagers() { pickupManager = new Managers.PickupManager(); players = new Managers.PlayerPair(); LevelView = new LevelViewer(); }