Пример #1
0
        private void ChaseAndAttack(ref NodeStatus status)
        {
            rotation.Enable();

            if (targetingComponent.HasTarget)
            {
                Owner.Body.Velocity = Vector2.Zero;

                steeringComponent.Disable();

                Console.WriteLine("Has target and at target...");
            }
            else
            {
                steeringComponent.Enable();

                steeringComponent.Current.TargetX = currentTarget.Position.X;
                steeringComponent.Current.TargetY = currentTarget.Position.Y;

                spriterComponent.FlipX = Owner.Body.Velocity.X > 0f;
            }

            resting = elapsed > TARGET_SWAP_TIME;

            if (resting)
            {
                status = NodeStatus.Success;

                rotation.Disable();

                return;
            }

            status = NodeStatus.Running;
        }
Пример #2
0
        private void Attack(ref NodeStatus status)
        {
            NeedsTarget(ref status);

            SkillRotation rotation = Owner.FirstComponentOfType <SkillRotation>();

            if (status == NodeStatus.Success)
            {
                rotation.Enable();
            }
            else
            {
                rotation.Disable();

                status = NodeStatus.Failed;
            }
        }
Пример #3
0
        private void Attack(ref NodeStatus status)
        {
            TargetingComponent targetingComponent = Owner.FirstComponentOfType <TargetingComponent>();
            SkillRotation      rotation           = Owner.FirstComponentOfType <SkillRotation>();

            if (targetingComponent.HasTarget && targetingComponent.Target.Name.StartsWith("Player"))
            {
                status = NodeStatus.Running;

                rotation.Enable();
            }
            else
            {
                status = NodeStatus.Failed;

                rotation.Disable();
            }
        }