コード例 #1
0
        public SkillResult(int amount, bool isCritical, bool isHp, bool isHeal, HotDot hotdot, EntityId source,
                           EntityId target, DateTime time,
                           EntityTracker entityRegistry, PlayerTracker playerTracker)
        {
            Time        = time;
            Amount      = isHp ? Math.Abs(amount) : amount;
            IsCritical  = isCritical;
            IsHp        = isHp;
            IsHeal      = isHeal;
            SkillId     = hotdot.Id;
            Abnormality = true;

            Source = entityRegistry.GetOrPlaceholder(source);
            Target = entityRegistry.GetOrPlaceholder(target);
            var userNpc    = UserEntity.ForEntity(Source);
            var sourceUser = userNpc["root_source"] as UserEntity; // Attribute damage dealt by owned entities to the owner
            var targetUser = Target as UserEntity;                 // But don't attribute damage received by owned entities to the owner

            var pclass = PlayerClass.Common;

            if (sourceUser != null)
            {
                SourcePlayer = playerTracker.Get(sourceUser.ServerId, sourceUser.PlayerId);
                pclass       = SourcePlayer.RaceGenderClass.Class;
            }
            Skill = new UserSkill(hotdot.Id, pclass,
                                  hotdot.Name, "DOT", null, hotdot.IconName);

            if (targetUser != null)
            {
                TargetPlayer = playerTracker.Get(targetUser.ServerId, targetUser.PlayerId);
            }
            HitDirection = HitDirection.Dot;
        }
コード例 #2
0
 public bool Equals(HotDot other)
 {
     return(Id == other.Id);
 }