Exemplo n.º 1
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;
            }
        }
Exemplo n.º 2
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();
            }
        }
Exemplo n.º 3
0
        protected override void OnInitialize()
        {
            MonsterBuilder builder = new BlobBuilder();

            builder.Build(Owner);

            Tree tree = CreateTree();

            tree.Initialize();

            Owner.AddComponent(tree);

            spriterComponent = new SpriterComponent <Texture2D>(Owner, @"Animations\Boss\Boss");
            spriterComponent.Initialize();
            spriterComponent.ChangeAnimation("Walk");
            spriterComponent.Scale = 0.75f;

            Owner.AddComponent(spriterComponent);

            steeringComponent = Owner.FirstComponentOfType <SteeringComponent>();

            SteeringBehavior seek = new SeekBehavior()
            {
                DesiredVelocity = new Vector2(1.25f),
                MaxSpeed        = 1.25f
            };

            steeringComponent.AddBehavior(seek);

            steeringComponent.ChangeActiveBehavior(typeof(SeekBehavior));

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

            BossHealthComponent c = new BossHealthComponent(Owner);

            c.Initialize();
            Owner.AddComponent(c);

            rotation.Enable();
        }