Esempio n. 1
0
    void BuildTree()
    {
        var rootRepeat       = new NaiveRepeater("rootRepeat", bt);
        var rootSel          = new SelectorNode("rootSel", bt);
        var parry            = new ActionNode("parry", Parry, bt);
        var counter          = new ActionNode("counter", Counter, bt);
        var defendSeq        = new SequenceNode("defendSeq", bt);
        var attackAndRecover = new ActionNode("attackAndRecover", AttackAndRecover, bt);
        var attacked         = new ActionNode("attacked", Attacked, bt);
        var dashSel          = new SelectorNode("dashSel", bt);
        var back             = new ActionNode("back", Back, bt);
        var attackSeq        = new SequenceNode("attackSeq", bt);

        rootRepeat.Build(
            rootSel.Build(
                defendSeq.Build(
                    parry,
                    counter
                    ),
                attackSeq.Build(
                    dashSel.Build(
                        attackAndRecover,
                        attacked
                        ),
                    back
                    )
                )
            );

        bt.Build(rootRepeat);
    }
Esempio n. 2
0
    void BuildTree()
    {
        var rootRepeat = new NaiveRepeater("rootRepeat", bt);
        //var riskSwitch = new ConditionNode("riskSwitch", RiskBranch, bt);
        //var approachAttack = new SequenceNode("approachAttack", bt);
        //var pathFinding = new SelectorNode("pathFinding", bt);
        //var repeatTillFail = new SuccessRepeater("repeatTillFail", bt);
        //var approachSeq = new SequenceNode("repeatSq", bt);
        //var findPath = new ActionNode("findPath", FindPath, bt);
        //var pathApproach = new ActionNode("pathApproach", PathApproach, bt);
        //var closeToTarget = new ActionNode("checkDistance", CloseToTarget, bt);
        var tryMeleeAttack    = new SequenceNode("tryMeleeAttack", bt);
        var getInRange        = new ActionNode("getInRange", GetInRange, bt);
        var meleeAttackAction = new ActionNode("meleeAttackAction", MeleeAttackAction, bt);
        var idleAction        = new ActionNode("idleAction", IdleAction, bt);

        rootRepeat.Build(
            tryMeleeAttack.Build(
                getInRange,
                meleeAttackAction
                )
            );
        bt.Build(rootRepeat);

        //rootRepeat.Build(
        //    approachAttack.Build(
        //         pathFinding.Build(
        //             repeatTillFail.Build(
        //                 approachSeq.Build(
        //                     findPath,
        //                     pathApproach
        //                 )
        //             ),
        //             closeToTarget
        //        ),
        //        tryMeleeAttack.Build(
        //            getInRange,
        //            meleeAttackAction
        //        )
        //    )
        //);
    }