Ejemplo n.º 1
0
        public async Task NewGamePlusTask()
        {
            var account = EntityConverter.ConvertUser(Context.User);

            await ReplyAsync("So you want to start over? Are you sure?");

            var response = await Context.Channel.AwaitMessage(m => m.Author == Context.User);

            if (!response.Content.Equals("Yes", StringComparison.CurrentCultureIgnoreCase))
            {
                return;
            }

            await ReplyAsync($"You will lose all your progress so far, are you really sure? However, you will get an experience boost from x{account.XpBoost:F} to x{Math.Min(2,account.XpBoost * (1 + 0.1 * (1 - Math.Exp(-(double)account.XP / 120000)))):F}");

            response = await Context.Channel.AwaitMessage(m => m.Author == Context.User);

            if (!response.Content.Equals("Yes", StringComparison.CurrentCultureIgnoreCase))
            {
                return;
            }

            if (ColossoPvE.UserInBattle(EntityConverter.ConvertUser(Context.User)))
            {
                await ReplyAsync($"I find it highly unwise to do such things in the midst of a fight.");

                return;
            }

            await ReplyAsync("Let us reverse the cycle, to a stage where you were just beginning");

            account.NewGame();
            UserAccountProvider.StoreUser(account);
            await Status();
        }
Ejemplo n.º 2
0
        public async Task Repair([Remainder] string item)
        {
            var inv   = UserAccounts.GetAccount(Context.User).Inv;
            var embed = new EmbedBuilder();

            embed.WithColor(Colors.Get("Iodem"));
            if (ColossoPvE.UserInBattle(UserAccounts.GetAccount(Context.User)))
            {
                return;
            }

            if (inv.Repair(item))
            {
                embed.WithDescription($"Item repaired successfully.");
            }
            else
            {
                embed.WithDescription($":x: No such item to repair, or not enough funds.");
            }
            await Context.Channel.SendMessageAsync("", false, embed.Build());
        }
Ejemplo n.º 3
0
        private async Task Client_Ready()
        {
            var channel = (SocketTextChannel)client.GetChannel(535209634408169492) ?? (SocketTextChannel)client.GetChannel(668443234292334612);

            if (channel != null && (DateTime.Now - Global.RunningSince).TotalSeconds < 15)
            {
                await channel.SendMessageAsync($"Hello, I am back up. {Environment.OSVersion}");

                foreach (var guild in client.Guilds)
                {
                    var gs = GuildSettings.GetGuildSettings(guild);
                    if (gs.AutoSetup && gs.ColossoChannel != null)
                    {
                        await ColossoPvE.Setup(guild);

                        Console.WriteLine($"Setup in {gs.Name}");
                    }
                }
            }
            //setup colosso
            await client.SetStatusAsync(UserStatus.Idle);

            Global.UpSince = DateTime.UtcNow;
        }