Esempio n. 1
0
        public static void Move(IDescription d)
        {
            LivingEntity le = d as LivingEntity;

            if (le == null)
            {
                return;
            }

            double dir = le.Direction(le.MoveTarget);

            WalkDirection(le, dir);

            double scale = 1;

            Skill skill = le.PreppedSkill ?? le.ActiveSkill;

            if (skill?.Name == "block")
            {
                scale = 0.5;
            }
            else if (skill?.Name == "counter")
            {
                scale = 0;
            }

            le.ChangeCoordsDelta(Math.Cos(dir) * scale, Math.Sin(dir) * scale);
        }
Esempio n. 2
0
        public static void SlideBack(IDescription description)
        {
            LivingEntity le = description as LivingEntity;

            if (le == null)
            {
                return;
            }

            double direction = Math.Atan2(le.Y - le.knockbackFrom.Y, le.X - le.knockbackFrom.X);

            le.ChangeCoordsDelta(Math.Cos(direction) * 4, Math.Sin(direction) * 4);
            le.DrawOffsetX = 0;
            le.DrawOffsetY = 0;
        }