コード例 #1
0
        public async Task SeeSkill(ulong skillId)
        {
            try
            {
                var skill = SpellUserAccounts.GetAccount(skillId);

                var embed = new EmbedBuilder();
                embed.WithAuthor(Context.User);
                embed.AddField($"{skill.SpellName}",
                               $"ID: {skill.SpellId}\nTree: {skill.SpellTree}\nRU: {skill.SpellDescriptionRu}\nEN: {skill.SpellDescriptionEn}\nFormula: {skill.SpellFormula}\nCD: {skill.SpellCd}");

                await ReplyAsync("", false, embed.Build());
            }
            catch
            {
                //   await ReplyAsync("Такого скила нету. Наши скиллы начинаються с ид **1000**");
            }
        }
コード例 #2
0
        public async Task GetSkillDependingOnMoveList(AccountSettings account, AccountSettings enemy,
                                                      SocketReaction reaction, int i)
        {
            var skills = GetSkillListFromTree(account);
            var ski    = Convert.ToUInt64(skills[GetSkillNum(reaction) - 1]);
            var skill  = _spellAccounts.GetAccount(ski);

            if (account.SkillCooldowns.Any(x => x.skillId == skill.SpellId))
            {
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                _awaitForUserMessage.ReplyAndDeleteOvertime("this skill is on cooldown, use another one", 6,
                                                            reaction);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                return;
            }

            Console.WriteLine($"{skill.SpellNameEn} + {skill.SpellId}");

            double dmg = 0;
            switch (account.MoveListPage)
            {
            case 1:
                dmg = _attackDamageActiveTree.AttackDamageActiveSkills(skill.SpellId, account, enemy, false);
                break;

            case 2:
                dmg = _defenceActiveTree.DefSkills(skill.SpellId, account, enemy, false);
                break;

            case 3:
                dmg = _agilityActiveTree.AgiActiveSkills(skill.SpellId, account, enemy, false);
                break;

            case 4:
                dmg = _magicActiveTree.ApSkills(skill.SpellId, account, enemy, false);
                break;
            }



            await _dealDmgToEnemy.DmgHealthHandeling(skill.WhereDmg, dmg, skill.SpellDmgType, account, enemy);
            await UpdateTurn(account, enemy);
        }
コード例 #3
0
        public string GetSkillString(AccountSettings account, AccountSettings enemy)
        {
            string[] skills;
            // var tree = "";
            double dmg;
            var    skillString = "404";


            if (account.MoveListPage == 1 && account.Attack_Tree != null)
            {
                skillString = null;
                skills      = account.Attack_Tree.Split(new[] { '|' },
                                                        StringSplitOptions.RemoveEmptyEntries);
                //  tree = "AD";

                for (var i = 0; i < skills.Length; i++)
                {
                    var ski   = Convert.ToUInt64(skills[i]);
                    var skill = _spellAccounts.GetAccount(ski);

                    dmg          = _attackDamageActiveTree.AttackDamageActiveSkills(skill.SpellId, account, enemy, true);
                    skillString += ReturnSkillString(i, dmg, skill, account);
                }
            }
            else if (account.MoveListPage == 2 && account.Defensive_Tree != null)
            {
                skillString = null;
                skills      = account.Defensive_Tree.Split(new[] { '|' },
                                                           StringSplitOptions.RemoveEmptyEntries);
                //tree = "DEF";
                for (var i = 0; i < skills.Length; i++)
                {
                    var ski   = Convert.ToUInt64(skills[i]);
                    var skill = _spellAccounts.GetAccount(ski);

                    dmg          = _defenceActiveTree.DefSkills(skill.SpellId, account, enemy, true);
                    skillString += ReturnSkillString(i, dmg, skill, account);
                }
            }
            else if (account.MoveListPage == 3 && account.Agility_Tree != null)
            {
                skillString = null;
                skills      = account.Agility_Tree.Split(new[] { '|' },
                                                         StringSplitOptions.RemoveEmptyEntries);
                // tree = "AGI";
                for (var i = 0; i < skills.Length; i++)
                {
                    var ski   = Convert.ToUInt64(skills[i]);
                    var skill = _spellAccounts.GetAccount(ski);

                    dmg          = _agilityActiveTree.AgiActiveSkills(skill.SpellId, account, enemy, true);
                    skillString += ReturnSkillString(i, dmg, skill, account);
                }
            }
            else if (account.MoveListPage == 4 && account.Magic_Tree != null)
            {
                skillString = null;
                skills      = account.Magic_Tree.Split(new[] { '|' },
                                                       StringSplitOptions.RemoveEmptyEntries);
                //tree = "AP";

                for (var i = 0; i < skills.Length; i++)
                {
                    var ski   = Convert.ToUInt64(skills[i]);
                    var skill = _spellAccounts.GetAccount(ski);

                    dmg = _magicActiveTree.ApSkills(skill.SpellId, account, enemy, true);

                    skillString += ReturnSkillString(i, dmg, skill, account);
                }
            }
            else if (account.MoveListPage == 5 && account.AllPassives != null)
            {
                skillString = null;
                skills      = account.AllPassives.Split(new[] { '|' },
                                                        StringSplitOptions.RemoveEmptyEntries);
                //tree = "PASS";

                for (var i = 0; i < skills.Length; i++)
                {
                    var ski   = Convert.ToUInt64(skills[i]);
                    var skill = _spellAccounts.GetAccount(ski);

                    skillString += ReturnSkillString(i, 0, skill, account);
                }
            }

            return(skillString);
        }
コード例 #4
0
        public async Task CreateSkill(ulong skillId)
        {
            var skill = _spellAccounts.GetAccount(skillId);

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

                await SendMessAsync(embed1);

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

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

                    return;
                }
            }

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

            var response = await _awaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 3000000);

            skill.SpellNameEn = response.ToString();

            var embed = new EmbedBuilder();

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

            await SendMessAsync(embed);


            response = await _awaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 3000000);

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

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

            response = await _awaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 3000000);

            skill.SpellDescriptionRu = response.ToString();

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

            response = await _awaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 3000000);

            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, 3000000);

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

            /*
             * await Context.Channel.SendMessageAsync("Введи Формулу описание скилла, у тебя 5 минут.");
             * response = await AwaitForUserMessage.AwaitMessage(Context.User.DiscordId, Context.Channel.DiscordId, 3000000 );
             * 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, 3000000);

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

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

            await _awaitForUserMessage.AwaitMessage(Context.User.Id, Context.Channel.Id, 3000000);

            // skill.SpellDmgType = response.ToString();

            /*
             * await Context.Channel.SendMessageAsync("Введи Пойзен (прокает он хит), у тебя 5 минут.");
             * response = await AwaitForUserMessage.AwaitMessage(Context.User.DiscordId, Context.Channel.DiscordId, 3000000 );
             * skill.Poison = response.ToString();
             *
             * await Context.Channel.SendMessageAsync("Введи ОнХит, у тебя 5 минут.");
             * response = await AwaitForUserMessage.AwaitMessage(Context.User.DiscordId, Context.Channel.DiscordId, 3000000 );
             * skill.Onhit = response.ToString();
             *
             * await Context.Channel.SendMessageAsync("Введи Бафф, у тебя 5 минут.");
             * response = await AwaitForUserMessage.AwaitMessage(Context.User.DiscordId, Context.Channel.DiscordId, 3000000 );
             * skill.InstantBuff = response.ToString();
             *
             * await Context.Channel.SendMessageAsync("Введи ДЕбафф, у тебя 5 минут.");
             * response = await AwaitForUserMessage.AwaitMessage(Context.User.DiscordId, Context.Channel.DiscordId, 3000000 );
             * skill.DeBuff = response.ToString();
             */
            _spellAccounts.SaveAccounts();
            await SendMessAsync("Готово!");
        }
コード例 #5
0
            public static async Task MainPage(SocketReaction reaction, RestUserMessage socketMsg)
            {
                var globalAccount = Global.Client.GetUser(reaction.UserId);
                var account       = GameUserAccounts.GetAccount(globalAccount);


                string[] skills;
                // var tree = "";
                double dmg;
                var    skillString = "You dont have any skills here.";

                if (account.MoveListPage == 1 && account.CurrentOctopusFighterSkillSetAd != null)
                {
                    skillString = null;
                    skills      = account.CurrentOctopusFighterSkillSetAd.Split(new[] { '|' },
                                                                                StringSplitOptions.RemoveEmptyEntries);
                    //  tree = "AD";

                    for (var i = 0; i < skills.Length; i++)
                    {
                        var ski   = Convert.ToUInt64(skills[i]);
                        var skill = SpellUserAccounts.GetAccount(ski);

                        dmg = GameSpellHandeling.AdSkills(skill.SpellId, account);
                        if (skill.SpellDmgType == "PASS")
                        {
                            skillString +=
                                $"{i + 1}. {skill.SpellName} ({skill.SpellDmgType}): {skill.SpellDescriptionRu} **{Math.Ceiling(dmg)}**\n";
                        }
                        else
                        {
                            skillString +=
                                $"{i + 1}. {skill.SpellName} ({skill.SpellDmgType}): **{Math.Ceiling(dmg)}** \n";
                        }
                    }
                }
                else if (account.MoveListPage == 2 && account.CurrentOctopusFighterSkillSetDef != null)
                {
                    skillString = null;
                    skills      = account.CurrentOctopusFighterSkillSetDef.Split(new[] { '|' },
                                                                                 StringSplitOptions.RemoveEmptyEntries);
                    //tree = "DEF";
                    for (var i = 0; i < skills.Length; i++)
                    {
                        var ski   = Convert.ToUInt64(skills[i]);
                        var skill = SpellUserAccounts.GetAccount(ski);

                        dmg = GameSpellHandeling.DefdSkills(skill.SpellId, account);
                        if (skill.SpellDmgType == "PASS")
                        {
                            skillString +=
                                $"{i + 1}. {skill.SpellName} ({skill.SpellDmgType}): {skill.SpellDescriptionRu} **{Math.Ceiling(dmg)}**\n";
                        }
                        else
                        {
                            skillString +=
                                $"{i + 1}. {skill.SpellName} ({skill.SpellDmgType}): **{Math.Ceiling(dmg)}** \n";
                        }
                    }
                }
                else if (account.MoveListPage == 3 && account.CurrentOctopusFighterSkillSetAgi != null)
                {
                    skillString = null;
                    skills      = account.CurrentOctopusFighterSkillSetAgi.Split(new[] { '|' },
                                                                                 StringSplitOptions.RemoveEmptyEntries);
                    // tree = "AGI";
                    for (var i = 0; i < skills.Length; i++)
                    {
                        var ski   = Convert.ToUInt64(skills[i]);
                        var skill = SpellUserAccounts.GetAccount(ski);

                        dmg = GameSpellHandeling.AgiSkills(skill.SpellId, account);
                        if (skill.SpellDmgType == "PASS")
                        {
                            skillString +=
                                $"{i + 1}. {skill.SpellName} ({skill.SpellDmgType}): {skill.SpellDescriptionRu} **{Math.Ceiling(dmg)}**\n";
                        }
                        else
                        {
                            skillString +=
                                $"{i + 1}. {skill.SpellName} ({skill.SpellDmgType}): **{Math.Ceiling(dmg)}** \n";
                        }
                    }
                }
                else if (account.MoveListPage == 4 && account.CurrentOctopusFighterSkillSetAp != null)
                {
                    skillString = null;
                    skills      = account.CurrentOctopusFighterSkillSetAp.Split(new[] { '|' },
                                                                                StringSplitOptions.RemoveEmptyEntries);
                    //tree = "AP";

                    for (var i = 0; i < skills.Length; i++)
                    {
                        var ski   = Convert.ToUInt64(skills[i]);
                        var skill = SpellUserAccounts.GetAccount(ski);

                        dmg = GameSpellHandeling.ApSkills(skill.SpellId, account);
                        if (skill.SpellDmgType == "PASS")
                        {
                            skillString +=
                                $"{i + 1}. {skill.SpellName} ({skill.SpellDmgType}): {skill.SpellDescriptionRu} **{Math.Ceiling(dmg)}**\n";
                        }
                        else
                        {
                            skillString +=
                                $"{i + 1}. {skill.SpellName} ({skill.SpellDmgType}): **{Math.Ceiling(dmg)}** \n";
                        }
                    }
                }


                var mainPage = new EmbedBuilder();

                mainPage.WithAuthor(globalAccount);
                mainPage.WithFooter($"Move List Page {account.MoveListPage} from 4");
                mainPage.WithColor(Color.DarkGreen);
                mainPage.AddField("Enemy:", $"**LVL:** {account.CurrentEnemyLvl}\n" +
                                  $"**Strength:** {account.CurrentEnemyStrength}\n" +
                                  $"**AD:** {account.CurrentEnemyAd + account.CurrentEnemyStrength}  **AP:** {account.CurrentEnemyAp}\n" +
                                  $"**Health:** {account.CurrentEnemyHealth}\n" +
                                  $"**Stamina:** {account.CurrentEnemyStamina}\n" +
                                  $"**Armor:** {account.CurrentEnemyArmor} LVL  **MagRes:** {account.CurrentEnemyMagicResist} LVL\n" +
                                  $"**ArmPen:** {account.CurrentEnemyArmPen} LVL  **MagPen:** {account.CurrentEnemyMagPen}\n" +
                                  $"**Agility:** {account.CurrentEnemyAgility}\n" +
                                  "**________________**");

                mainPage.AddField($"Your octopus:",
                                  $"**LVL:** {account.CurrentOctopusFighterLvl}\n" +
                                  $"**Strength:** {account.CurrentOctopusFighterStrength}\n" +
                                  $"**AD:** {account.CurrentOctopusFighterAd + account.CurrentOctopusFighterStrength}  **AP:** {account.CurrentOctopusFighterAp}\n" +
                                  $"**Health:** {account.CurrentOctopusFighterHealth}\n" +
                                  $"**Stamina:** {account.CurrentOctopusFighterStamina}\n" +
                                  $"**Armor:** {account.CurrentOctopusFighterArmor} LVL  **MagRes:** {account.CurrentOctopusFighterMagicResist} LVL\n" +
                                  $"**ArmPen:** {account.CurrentOctopusFighterArmPen}  **MagPen:** {account.CurrentOctopusFighterMagPen}\n" +
                                  $"**Agility:** {account.CurrentOctopusFighterAgility}\n" +
                                  $"**________________**\n" +
                                  $"{new Emoji("⬅")} - Move List Page Left , {new Emoji("➡")} - Move List Page Right {new Emoji("📖")} - History, {new Emoji("❌")} - **END GAME**");
                mainPage.AddField($"(Move List", $"{skillString}");


                await socketMsg.ModifyAsync(message =>
                {
                    message.Embed = mainPage.Build();
                    // This somehow can't be empty or it won't update the
                    // embed propperly sometimes... I don't know why
                    // message.Content =  Constants.InvisibleString;
                });
            }