Exemple #1
0
        private void OnTick(EventArgs args)
        {
            foreach (var skillshot in DetectedSkillshots.Where(v => !v.IsValid))
            {
                if (!skillshot.CastComplete)
                {
                    OnSkillshotDeleted?.Invoke(skillshot);

                    OnUpdateSkillshots?.Invoke(skillshot, true, false);
                }

                skillshot.OnDispose();
            }

            DetectedSkillshots.RemoveAll(v => !v.IsValid);

            foreach (var c in DetectedSkillshots)
            {
                if (!c.IsActive && Environment.TickCount >= c.TimeDetected + SkillshotActivationDelay)
                {
                    c.IsActive = true;

                    OnSkillshotActivation?.Invoke(c);
                }
            }

            foreach (var c in DetectedSkillshots)
            {
                c.OnTick();
            }
        }
Exemple #2
0
        public void AddSkillshot(EvadeSkillshot skillshot, bool isProcessSpell = false, bool triggerEvent = true)
        {
            if (LimitDetectionRange && !skillshot.OwnSpellData.IsGlobal &&
                skillshot.GetCurrentPosition().Distance(Player.Instance, true) > (2 * skillshot.OwnSpellData.Range).Pow())
            {
                return;
            }

            if (SkillshotActivationDelay <= 10)
            {
                skillshot.IsActive = true;
            }

            DetectedSkillshots.Add(skillshot);

            if (triggerEvent && EvadeMenu.IsSkillshotEnabled(skillshot))
            {
                OnSkillshotDetected?.Invoke(skillshot, isProcessSpell);

                OnUpdateSkillshots?.Invoke(skillshot, false, isProcessSpell);
            }
        }