Example #1
0
        private void EstimateWeapons(ParsedEvtcLog log)
        {
            if (Prof == "Sword")
            {
                _weaponsArray = new string[]
                {
                    "Sword",
                    "2Hand",
                    null,
                    null,
                    null,
                    null,
                    null,
                    null
                };
                return;
            }
            string[] weapons = new string[8];//first 2 for first set next 2 for second set, second sets of 4 for underwater
            IReadOnlyList <AbstractCastEvent> casting = GetCastEvents(log, 0, log.FightData.FightEnd);
            int  swapped     = -1;
            long swappedTime = 0;
            var  swaps       = casting.OfType <WeaponSwapEvent>().Select(x =>
            {
                return(x.SwappedTo);
            }).ToList();

            foreach (AbstractCastEvent cl in casting)
            {
                if (cl.ActualDuration == 0 && cl.SkillId != SkillItem.WeaponSwapId)
                {
                    continue;
                }
                SkillItem skill = cl.Skill;
                // first iteration
                if (swapped == -1)
                {
                    swapped = skill.FindWeaponSlot(swaps);
                }
                if (!skill.EstimateWeapons(weapons, swapped, cl.Time > swappedTime + ParserHelper.WeaponSwapDelayConstant) && cl is WeaponSwapEvent swe)
                {
                    //wepswap
                    swapped     = swe.SwappedTo;
                    swappedTime = swe.Time;
                }
            }
            _weaponsArray = weapons;
        }