Exemplo n.º 1
0
        protected override INode CreateTree()
        {
            var doNothing           = new DoNothingNode();
            var isMagicShieldActive = new IsAbilityActiveNode(AbilityType.MAGIC_SHIELD);

            var changeDestination = new ChangeDestinationNode();

            var isPlayerClose       = new IsPlayerCloseNode();
            var run                 = new FleeNode();
            var wait                = new Wait(2.0f);
            var activateMagicShield = new ActivateAbilityNode(AbilityType.MAGIC_SHIELD);
            var seqMagicShield      = new Sequence("MagicShieldSequence", wait, activateMagicShield);
            var seqRun              = new Sequence("RunSequence", isPlayerClose, run, new Succeeder(seqMagicShield), changeDestination);

            var checkArrived         = new IsArrivedToDestinationNode();
            var seqChangeDestination = new Sequence("ChangeDestinationSequence", checkArrived, changeDestination);
            var move    = new WalkNode();
            var seqMove = new Sequence("MoveSequence", new Succeeder(seqChangeDestination), move);

            var selector = new Selector("RunMoveSelector", doNothing, isMagicShieldActive, seqRun, seqMove);

            var repeater = new Repeater(selector);

            return(repeater);
        }
Exemplo n.º 2
0
        protected override INode CreateTree()
        {
            var doNothing = new DoNothingNode();
            var isCasting = new IsAbilityActiveNode(AbilityType.THROW);

            var changeDestination = new ChangeDestinationNode();

            var isPlayerClose = new IsPlayerCloseNode();
            var run           = new FleeNode();
            var wait          = new Wait(2.0f);
            var seqRun        = new Sequence("RunSequence", isPlayerClose, run, changeDestination);

            var throwSomething = new ThrowNode();
            var seqThrow       = new Sequence("ThrowSequence", wait, throwSomething);

            var checkArrived         = new IsArrivedToDestinationNode();
            var seqChangeDestination = new Sequence("ChangeDestinationSequence", checkArrived, changeDestination);
            var move    = new WalkNode();
            var seqMove = new Sequence("MoveSequence", new Succeeder(seqChangeDestination), move);

            var selector = new Selector("RunMoveSelector", doNothing, isCasting, seqRun, seqThrow, seqMove);

            var repeater = new Repeater(selector);

            return(repeater);
        }
Exemplo n.º 3
0
        protected override INode CreateTree()
        {
            var doNothing         = new DoNothingNode();
            var isWhirlwindActive = new IsAbilityActiveNode(AbilityType.WHIRLWIND);
            var activateWhirlwind = new ActivateAbilityNode(AbilityType.WHIRLWIND);

            var selector = new Selector("WhirlwindSelector", doNothing, isWhirlwindActive, activateWhirlwind);

            var repeater = new Repeater(selector);

            return(repeater);
        }