예제 #1
0
    //The initialisation of the boss' behaviour tree.
    protected void InitialiseBehaviourTree()
    {
        MoveToPlayerNode moveToPlayerNode = new MoveToPlayerNode(Player, this);
        MeleeAttackNode  meleeAttackNode  = new MeleeAttackNode(Player, this);
        SequenceNode     meleeSequence    = new SequenceNode(new BehaviourNode[2] {
            moveToPlayerNode, meleeAttackNode
        });

        AOEAttackNode aoeAttackNode = new AOEAttackNode(Player, this);
        PlayerInRangeDecoratorNode playerInRangeDecoratorNode = new PlayerInRangeDecoratorNode(aoeAttackNode, this);
        SelectorNode attackTypeSelector = new SelectorNode(new BehaviourNode[2] {
            meleeSequence, playerInRangeDecoratorNode
        });

        WanderNode wanderNode = new WanderNode(Player, this);

        RootNode = new SelectorNode(new BehaviourNode[2] {
            attackTypeSelector, wanderNode
        });

        //currentNode = null;
    }
 //The parameters are the AOE attack node and the boss.
 public PlayerInRangeDecoratorNode(AOEAttackNode aoeAttackNode, BossWhole boss)
 {
     this.aoeAttackNode = aoeAttackNode;
     this.boss          = boss;
 }