예제 #1
0
        private void CustomActivity()
        {
            if (IsBeingPlaced == false)
            {
#if DEBUG
                if (DebugVariables.TurretsAimAtMouse)
                {
                    RotateToAimMouse();
                }
#endif

                if (targetEnemy != null && (targetEnemy.IsDead || !RangeCircleInstance.CollideAgainst(targetEnemy.CircleInstance)))
                {
                    targetEnemy = null;
                }

                if (targetEnemy == null && _potentialTargetList.Count > 0)
                {
                    ChooseTarget();
                }

                if (targetEnemy != null)
                {
                    RotateToAim();
                    SetAnimationFromAimRotation();
                    PerformFiringActivity();
                }
            }
        }
예제 #2
0
        private void CustomActivity()
        {
            if (IsBeingPlaced)
            {
                CurrentState = VariableState.InvalidLocation;
            }
            else
            {
#if DEBUG
                if (DebugVariables.TurretsAimAtMouse)
                {
                    RotateToAimMouse();
                }
#endif

                if (targetEnemy != null && (targetEnemy.IsDead || targetEnemy.HasReachedGoal || !RangeCircleInstance.CollideAgainst(targetEnemy.Collision) || MinimumRangeCircleInstance.CollideAgainst(targetEnemy.Collision)))
                {
                    targetEnemy = null;
                }

                if (targetEnemy == null && _potentialTargetList != null && _potentialTargetList.Count > 0)
                {
                    ChooseTarget();
                }

                if (targetEnemy != null)
                {
                    RotateToAim();
                    PerformFiringActivity();
                }
            }
        }