Beispiel #1
0
        public void Update1()
        {
            if (!arePlayersNear)
            {
                return;
            }

            if (!remoteControl.IsControlledByFaction("GCORP"))
            {
                return;                 // No point bothering to remove from the list, it will disappear next time the game reloads
            }

//            var player = DuckUtils.GetNearestPlayerToPosition(position, 300);
            var player = DuckUtils.GetNearestPlayerToPosition(rotorMountedGrid.GetPosition(), 100);

            if (player == null)
            {
                return;
            }

            if (rotorMountedGrid.HasUsableGun())
            {
                TurnToFacePosition(player.GetPosition());
            }
            else
            {
                rotorMountedGrid.AttemptSelfDestruct();
            }
        }
        public void Update1()
        {
            if (!arePlayersNear)
            {
                return;
            }

            // TODO: need a reference to the whole base grid to properly determine ownership
            if (!remoteControl.IsControlledByFaction("GCORP"))
            {
//				return; // No point bothering to remove from the list, it will disappear next time the game reloads
            }

            double useRange = Range * 2;

            useRange = Math.Min(Range, 800);
            var player = DuckUtils.GetNearestPlayerToPosition(rotorMountedGrid.GetPosition(), useRange);

            if (player == null)
            {
                return;
            }

            if (rotorMountedGrid.HasUsableGun())
            {
                TurnToFacePosition(player.GetPosition());
            }
            else
            {
                rotorMountedGrid.AttemptSelfDestruct();
            }
        }