Пример #1
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);
        }
Пример #2
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);
        }