示例#1
0
 public OctoGameReaction(UserAccounts accounts, OctoGameUpdateMess octoGameUpdateMess,
                         Global global,
                         AwaitForUserMessage awaitForUserMessage, GameFramework gameFramework)
 {
     _accounts            = accounts;
     _octoGameUpdateMess  = octoGameUpdateMess;
     _global              = global;
     _awaitForUserMessage = awaitForUserMessage;
     _gameFramework       = gameFramework;
 }
示例#2
0
        public OctoGameCommand(UserAccounts accounts, SpellUserAccounts spellAccounts,
                               AwaitForUserMessage awaitForUserMessage, LoggingSystem loggingSystem,
                               GameFramework gameFramework, DiscordShardedClient client, OctoGameUpdateMess octoGameUpdateMess, Global global)
        {
            _accounts            = accounts;
            _spellAccounts       = spellAccounts;
            _awaitForUserMessage = awaitForUserMessage;


            _loggingSystem      = loggingSystem;
            _gameFramework      = gameFramework;
            _client             = client;
            _octoGameUpdateMess = octoGameUpdateMess;
            _global             = global;
        }
        public async Task BuyPass()
        {
            try
            {
                var account = UserAccounts.GetAccount(Context.User, Context.Guild.Id);
                var cost    = 4000 * (account.OctoPass + 1);

                if (account.Points >= cost)
                {
                    await Context.Channel.SendMessageAsync(
                        $"Are you sure about buying pass #{account.OctoPass + 1} for {cost} Octo Points? Than write **yes**!");

                    var response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 6000);

                    if (response.Content == "yes" || response.Content == "Yes")
                    {
                        account.OctoPass += 1;
                        account.Points   -= cost;
                        UserAccounts.SaveAccounts(Context.Guild.Id);

                        await CommandHandeling.ReplyAsync(Context,
                                                          $"Booole! You've Got Access **#{account.OctoPass}**");
                    }
                    else
                    {
                        await CommandHandeling.ReplyAsync(Context,
                                                          "You should say `yes` или `Yes` in 6s to get the pass.");
                    }
                }
                else
                {
                    await Context.Channel.SendMessageAsync(
                        $"You did not earn enough Octo Points, current amount: **{account.Points}**\nFor pass #{account.OctoPass + 1} you will need **{cost}** Octo Points!");
                }
            }
            catch
            {
                // await ReplyAsync("boo... An error just appear >_< \nTry to use this command properly: **pass**\n Alias: Пасс, Пропуск, Доступ, КупитьПропуск, Купить Пропуск");
            }
        }
示例#4
0
        public GameFramework(UserAccounts accounts,
                             AttackDamageActiveTree attackDamageActiveTree, SpellUserAccounts spellAccounts,
                             AwaitForUserMessage awaitForUserMessage,
                             AttackDamagePassiveTree attackDamagePassiveTree, AllBuffs allDebuffs, DefencePassiveTree defencePassiveTree, DefenceActiveTree defenceActiveTree, AgilityActiveTree agilityActiveTree, AgilityPassiveTree agilityPassiveTree, MagicActiveTree magicActiveTree, MagicPassiveTree magicPassiveTree, DealDmgToEnemy dealDmgToEnemy, UpdateFightPage updateFightPage)
        {
            _accounts = accounts;

            _attackDamageActiveTree = attackDamageActiveTree;
            _spellAccounts          = spellAccounts;

            _awaitForUserMessage     = awaitForUserMessage;
            _attackDamagePassiveTree = attackDamagePassiveTree;
            _allDebuffs         = allDebuffs;
            _defencePassiveTree = defencePassiveTree;
            _defenceActiveTree  = defenceActiveTree;
            _agilityActiveTree  = agilityActiveTree;
            _agilityPassiveTree = agilityPassiveTree;
            _magicActiveTree    = magicActiveTree;
            _magicPassiveTree   = magicPassiveTree;
            _dealDmgToEnemy     = dealDmgToEnemy;
            _updateFightPage    = updateFightPage;
        }
示例#5
0
        public async Task GuessGame(ulong enter)
        {
            try
            {
                var amount = (int)enter;

                var userAccount  = UserAccounts.GetAccount(Context.User, Context.Guild.Id);
                var octoAcccount = UserAccounts.GetAccount(Context.Guild.CurrentUser, Context.Guild.Id);

                if (amount > userAccount.Points || amount <= 0)
                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      "You do not have enough OktoPoints! Or you just entered something wrong.");

                    return;
                }


                var randSlot = new Random();
                var slots    = randSlot.Next(72);


                await CommandHandeling.ReplyAsync(Context,
                                                  $"Number of slots **{slots}**. What is your choice?");

                var response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 10000);

                var result = int.TryParse(response.Content, out _);
                if (result)
                {
                    var choise = Convert.ToInt32(response.Content);
                    var bank   = Math.Abs(amount * slots / 5);


                    var rand   = new Random();
                    var random = rand.Next(slots);

                    if (choise == random)
                    {
                        userAccount.Points += bank;
                        UserAccounts.SaveAccounts(Context.Guild.Id);

                        await CommandHandeling.ReplyAsync(Context,
                                                          $"You won **{bank}** OctoPoints!\nNow you have **{userAccount.Points}** OctoPoints!");

                        userAccount.Points += bank;
                        UserAccounts.SaveAccounts(Context.Guild.Id);
                    }
                    else
                    {
                        await CommandHandeling.ReplyAsync(Context,
                                                          $"booole. Yuor **{amount}** OctoPoints stayed with us. Btw, number was **{random}**");


                        userAccount.Points  -= amount;
                        octoAcccount.Points += amount;
                        UserAccounts.SaveAccounts(Context.Guild.Id);
                    }
                }
                else


                {
                    await CommandHandeling.ReplyAsync(Context,
                                                      $"The choice should be between 0 and {slots}, answer only with a number.");
                }
            }
            catch
            {
                //    await ReplyAsync(
                //        "boo... An error just appear >_< \nTry to use this command properly: **guess [rate_num]**(like cassino, ty it!)\n" +
                //        "Alias: Рулетка, угадайка");
            }
        }
示例#6
0
 public ReputationAndPointsCommands(UserAccounts accounts, ServerAccounts serverAccounts, AwaitForUserMessage awaitForUserMessage)
 {
     _accounts            = accounts;
     _serverAccounts      = serverAccounts;
     _awaitForUserMessage = awaitForUserMessage;
 }
示例#7
0
        public async Task CreateSkill(ulong skillId)
        {
            var skill = SpellUserAccounts.GetAccount(skillId);

            if (skill.SpellName != null)
            {
                var embed1 = new EmbedBuilder();
                embed1.WithAuthor(Context.User);
                embed1.AddField("Этот скилл иди уже существует",
                                $"{skill.SpellName}\nID: {skill.SpellId}\nTree: {skill.SpellTree}\nRU: {skill.SpellDescriptionRu}\nEN: {skill.SpellDescriptionEn}\nFormula: {skill.SpellFormula}\nCD: {skill.SpellCd}\n" +
                                "Если хочешь полностью его изменить, напиши **да** (1 минута)");
                await ReplyAsync("", false, embed1.Build());

                var res = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 60000);

                if (res.Content == "да")
                {
                    await ReplyAsync($"Ты изхменяешь скилл {skill.SpellName}");
                }
                else
                {
                    await ReplyAsync($"никкаких апдейтов. (ты сказал {res.Content})");

                    return;
                }
            }

            await Context.Channel.SendMessageAsync("Введи Назваие скилла, у тебя 5 минута.");

            var response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000);

            skill.SpellName = response.ToString();

            var embed = new EmbedBuilder();

            embed.AddField("Введи Номер дерева скилла, у тебя 5 минута", "1 - AD\n2 - DEF\n3 - AGI\n4 - AP");

            await CommandHandeling.ReplyAsync(Context, embed);


            response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000);

            skill.SpellTree = Convert.ToInt32(response.ToString());

            await Context.Channel.SendMessageAsync(
                "Введи Русское описание скилла (либо просто **нету**), у тебя 5 минут.");

            response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000);

            skill.SpellDescriptionRu = response.ToString();

            await Context.Channel.SendMessageAsync(
                "Введи Английское описание скилла (либо просто **нету**), у тебя 5 минут.");

            response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000);

            skill.SpellDescriptionEn = response.ToString();

            var embedAc = new EmbedBuilder();

            embedAc.AddField("Введи Активка или Пассивка, у тебя 5 минута", "0 - Пассив\n1 - Актив");
            await Context.Channel.SendMessageAsync("", false, embedAc.Build());

            response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000);

            skill.ActiveOrPassive = Convert.ToInt32(response.ToString());

            /*
             * await Context.Channel.SendMessageAsync("Введи Формулу описание скилла, у тебя 5 минут.");
             * response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000 );
             * skill.SpellFormula = response.ToString();
             */
            var embedCd = new EmbedBuilder();

            embedCd.AddField("Введи КД скилла, у тебя 5 минут",
                             "1)Если есть - в ходах\n2)Если КД = 1 раз в игру, пиши 9999\n3)Если КД нету вообще, пиши 0");
            await Context.Channel.SendMessageAsync("", false, embedCd.Build());

            response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000);

            skill.SpellCd = Convert.ToInt32(response.ToString());

            await Context.Channel.SendMessageAsync("Тип урона (AD or AP), у тебя 5 минут.");

            response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000);

            skill.SpellDmgType = response.ToString();

            /*
             * await Context.Channel.SendMessageAsync("Введи Пойзен (прокает он хит), у тебя 5 минут.");
             * response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000 );
             * skill.Poisen = response.ToString();
             *
             * await Context.Channel.SendMessageAsync("Введи ОнХит, у тебя 5 минут.");
             * response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000 );
             * skill.Onhit = response.ToString();
             *
             * await Context.Channel.SendMessageAsync("Введи Бафф, у тебя 5 минут.");
             * response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000 );
             * skill.Buff = response.ToString();
             *
             * await Context.Channel.SendMessageAsync("Введи ДЕбафф, у тебя 5 минут.");
             * response = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 300000 );
             * skill.DeBuff = response.ToString();
             */
            SpellUserAccounts.SaveAccounts();
            await ReplyAsync("Готово!");
        }
示例#8
0
        public async Task CreateOctopusFighter()
        {
            var account  = GameUserAccounts.GetAccount(Context.User);
            var response = "бу";


            if (account.OctopusFighterInfo != null)
            {
                await ReplyAsync(
                    "У тебя уже есть осьминожка! Если ты хочешь ПОЛНОСТЬЮ обновить информацию осьминожки напиши **да**");

                var res = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 6000);

                response = res.Content;
            }

            if (account.OctopusFighterInfo == null || response == "да")
            {
                account.OctopusFighterInfo = null;


                await Context.Channel.SendMessageAsync("Введи имя своего осьминожка, у тебя 1 минута.");

                var res = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 60000);

                account.OctopusFighterInfo += res.Content + "|";
                account.OctopusFighterName  = res.Content;

                await Context.Channel.SendMessageAsync("Введи цвет своего осьминожка, у тебя 1 минута.");

                res = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 60000);

                account.OctopusFighterInfo += res.Content + "|";


                await Context.Channel.SendMessageAsync("Введи характер своего осьминожка, у тебя 2 минуты.");

                res = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 120000);

                account.OctopusFighterInfo += res.Content + "|";

                await Context.Channel.SendMessageAsync("Введи Лор своего осьминожка, у тебя 2 минуты.");

                res = await AwaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 120000);

                account.OctopusFighterInfo += res.Content + "|";


                account.OctopusFighterStrength    = 20;
                account.OctopusFighterAd          = 0;
                account.OctopusFighterAp          = 0;
                account.OctopusFighterAgility     = 0;
                account.OctopusFighterCritDmg     = 1.5;
                account.OctopusFighterDodge       = 0;
                account.OctopusFighterArmor       = 1;
                account.OctopusFighterMagicResist = 1;
                account.OctopusFighterHealth      = 100;
                account.OctopusFighterStamina     = 200;
                account.OctopusFighterLvl         = 1;
                account.OctopusFighterArmPen      = 0;
                account.OctopusFighterMagPen      = 0;

                GameUserAccounts.SaveAccounts();
                await Context.Channel.SendMessageAsync("Готово! Ты создал или обновил информацию о своем осьминоге!");
            }
        }
示例#9
0
 public Fun(UserAccounts accounts, ServerAccounts serverAccounts, AwaitForUserMessage awaitForUserMessage)
 {
     _accounts            = accounts;
     _serverAccounts      = serverAccounts;
     _awaitForUserMessage = awaitForUserMessage;
 }