Exemplo n.º 1
0
        public Decoy(RealmManager manager, Player player, int duration, float tps, int random, int explode)
            : base(manager, 0x0715, duration, true, true, true)
        {
            this.explode  = explode;
            this.player   = player;
            this.duration = duration;
            speed         = tps;

            Position?history = player.TryGetHistory(100);

            if (history == null)
            {
                direction = GetRandDirection();
            }
            if (random == 1)
            {
                direction = GetRandDirection();
            }
            else
            {
                direction = new Vector2(player.X - history.Value.X, player.Y - history.Value.Y);
                if (direction.LengthSquared() == 0)
                {
                    direction = GetRandDirection();
                }
                else
                {
                    direction.Normalize();
                }
            }
        }
Exemplo n.º 2
0
        public Decoy(Player player, int duration, float tps)
            : base(player.Manager, 0x0715, duration, true, true, true)
        {
            this.player   = player;
            this.duration = duration;
            speed         = tps;

            var history = player.TryGetHistory(100);

            if (history == null)
            {
                direction = GetRandDirection();
            }
            else
            {
                direction = new Vector2(player.X - history.Value.X, player.Y - history.Value.Y);
                if (direction.LengthSquared() == 0)
                {
                    direction = GetRandDirection();
                }
                else
                {
                    direction.Normalize();
                }
            }
        }
Exemplo n.º 3
0
        public Decoy(Player player, int duration, float tps)
            : base(0x0715, duration, true, true, true)
        {
            this.player = player;
            this.duration = duration;
            this.speed = tps;

            var history = player.TryGetHistory(100);
            if (history == null)
                direction = GetRandDirection();
            else
            {
                direction = new Vector2(player.X - history.Value.X, player.Y - history.Value.Y);
                if (direction.LengthSquared() == 0)
                    direction = GetRandDirection();
                else
                    direction.Normalize();
            }
        }