예제 #1
0
파일: Blob.cs 프로젝트: siquel/BeatEmUp
        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
파일: Crawler.cs 프로젝트: siquel/BeatEmUp
        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();
            }
        }