Exemple #1
0
        public void Update(SAbnormalityRefresh message)
        {
            if (!_abnormalities.ContainsKey(message.TargetId))
            {
                return;
            }
            var abnormalityUser = _abnormalities[message.TargetId];

            foreach (var abnormality in abnormalityUser)
            {
                if (abnormality.HotDot.Id != message.AbnormalityId)
                {
                    continue;
                }
                abnormality.Refresh(message.StackCounter, message.Duration, message.Time.Ticks);
                AbnormalityAdded?.Invoke(abnormality, abnormality.Stack >= message.StackCounter);
                return;
            }
        }
Exemple #2
0
        public void AddAbnormality(EntityId target, EntityId source, long duration, int stack, int abnormalityId,
                                   long ticks)
        {
            if (!_abnormalities.ContainsKey(target))
            {
                _abnormalities.Add(target, new List <Abnormality.Abnormality>());
            }
            var hotdot = HotDotDatabase.Get(abnormalityId);

            if (hotdot == null || hotdot.IsShow == false)
            {
                return;
            }

            if (_abnormalities[target].Count(x => x.HotDot.Id == abnormalityId) == 0)
            {
                var ab = new Abnormality.Abnormality(hotdot, source, target, duration, stack, ticks, this);
                //dont add existing abnormalities since we don't delete them all, that may cause many untrackable issues.
                _abnormalities[target].Add(ab);
                AbnormalityAdded?.Invoke(ab, true);
            }
        }