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 lockOn = new LockOnTargetNode();

            var checkDistanceForHold = new IsArrivedToDestinationNode(2f);
            var hold = new HoldNode();
            var seqCheckDistanceHold = new Sequence("MoveSequence", lockOn, checkDistanceForHold, hold);

            var move = new WalkNode();

            var selector = new Selector("NothingMoveSelector", doNothing, seqCheckDistanceHold, move);

            var repeater = new Repeater(selector);

            return(repeater);
        }
Exemplo n.º 4
0
        protected override INode CreateTree()
        {
            var doNothing = new DoNothingNode();

            var changeDestination = new ChangeDestinationNode();

            var isPlayerClose = new IsPlayerCloseNode();
            var run           = new FleeNode();
            var seqRun        = new Sequence("RunSequence", isPlayerClose, run, 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, seqRun, seqMove);

            var repeater = new Repeater(selector);

            return(repeater);
        }