private void RegisterBuff(long ticks) { if (!HotDot.Buff) { return; } var userEntity = _abnormalityTracker.EntityTracker.GetOrNull(Target); var user = userEntity as UserEntity; if (user == null) { return; } var player = _abnormalityTracker.PlayerTracker.GetOrUpdate(user); if (!_abnormalityTracker.AbnormalityStorage.AbnormalityTime(player).ContainsKey(HotDot)) { var npcEntity = _abnormalityTracker.EntityTracker.GetOrPlaceholder(Source); PlayerClass playerClass; if (!(npcEntity is UserEntity)) { playerClass = PlayerClass.Common; } else { playerClass = ((UserEntity)npcEntity).RaceGenderClass.Class; } var abnormalityInitDuration = new AbnormalityDuration(playerClass, ticks, Stack); _abnormalityTracker.AbnormalityStorage.AbnormalityTime(player).Add(HotDot, abnormalityInitDuration); _buffRegistered = true; return; } _abnormalityTracker.AbnormalityStorage.AbnormalityTime(player)[HotDot].Start(ticks, Stack); _buffRegistered = true; }
private void RegisterEnduranceDebuff(long ticks) { if (!HotDot.Debuff) { return; } var entityGame = _abnormalityTracker.EntityTracker.GetOrPlaceholder(Target); var game = entityGame as NpcEntity; if (game == null) { return; } if (!_abnormalityTracker.AbnormalityStorage.AbnormalityTime(game).ContainsKey(HotDot)) { var userEntity = _abnormalityTracker.EntityTracker.GetOrPlaceholder(Source); var user = userEntity as UserEntity; if (user == null) { return; } var abnormalityInitDuration = new AbnormalityDuration(user.RaceGenderClass.Class, ticks, Stack); _abnormalityTracker.AbnormalityStorage.AbnormalityTime(game).Add(HotDot, abnormalityInitDuration); _enduranceDebuffRegistered = true; return; } _abnormalityTracker.AbnormalityStorage.AbnormalityTime(game)[HotDot].Start(ticks, Stack); _enduranceDebuffRegistered = true; }
public void Start(long begin) { if (_death == null) { _death = new AbnormalityDuration(PlayerClass.Common, begin, 0); return; } _death.Start(begin, 0); }
public object Clone() { var newListDuration = _listDuration.Select(duration => (Duration)duration.Clone()).ToList(); var abnormalityDuration = new AbnormalityDuration(InitialPlayerClass) { _listDuration = newListDuration }; return(abnormalityDuration); }
public AbnormalityDuration Clone(long begin, long end) { if (begin == 0 || end == 0) { return((AbnormalityDuration)Clone()); } var newListDuration = _listDuration.Where(x => x.Begin <end && x.End> begin) .Select(duration => duration.Clone(begin, end)) .ToList(); var abnormalityDuration = new AbnormalityDuration(InitialPlayerClass) { _listDuration = newListDuration }; return(abnormalityDuration); }
public Death(AbnormalityDuration death) { _death = death; }