Exemplo n.º 1
0
    private void SetupChooseTargetSequence(Script_Sequence p_chooseTargetSequence)
    {
        Script_Action_SetFlag setEnemies = new Script_Action_SetFlag(_behaviourTree, _manager.GetEnemies(), _entityListFlag);
        Script_Action_SetEntitiesWithinRange setEnemiesWithinRange = new Script_Action_SetEntitiesWithinRange(_behaviourTree, _grid, _entityListFlag, _entityListFlag, this as Script_IEntity, _engageTargetRange);

        Script_Action_SetNearestEntityFromEntityWithinRange setNearestEnemy = new Script_Action_SetNearestEntityFromEntityWithinRange(_behaviourTree, _grid, _entityListFlag, _engageTargetRange, this as Script_IEntity, _targetEntityFlag);
        Script_Action_SetEnemyAttackingTarget setEnemyAttackingDps          = new Script_Action_SetEnemyAttackingTarget(_behaviourTree, _entityListFlag, _manager.GetDps() as Script_IEntity, _targetEntityFlag);
        Script_Action_SetEnemyAttackingTarget setEnemyAttackingHealer       = new Script_Action_SetEnemyAttackingTarget(_behaviourTree, _entityListFlag, _manager.GetHealer() as Script_IEntity, _targetEntityFlag);

        Script_Selector chooseTargetToAidSelector = new Script_Selector(_behaviourTree);

        Script_LeafTask setEnemiesLeaf            = new Script_LeafTask(_behaviourTree, setEnemies);
        Script_LeafTask setEnemiesWithinRangeLeaf = new Script_LeafTask(_behaviourTree, setEnemiesWithinRange);
        Script_LeafTask setNearestEnemyLeaf       = new Script_LeafTask(_behaviourTree, setNearestEnemy);

        Script_LeafTask setEnemyAttackingHealerLeaf = new Script_LeafTask(_behaviourTree, setEnemyAttackingHealer);
        Script_LeafTask setEnemyAttackingDpsLeaf    = new Script_LeafTask(_behaviourTree, setEnemyAttackingDps);

        chooseTargetToAidSelector.AddTask(setEnemyAttackingHealerLeaf);
        chooseTargetToAidSelector.AddTask(setEnemyAttackingDpsLeaf);

        p_chooseTargetSequence.AddTask(setEnemiesLeaf);
        p_chooseTargetSequence.AddTask(setEnemiesWithinRangeLeaf);
        p_chooseTargetSequence.AddTask(setNearestEnemyLeaf);
        p_chooseTargetSequence.AddTask(chooseTargetToAidSelector);
    }
Exemplo n.º 2
0
 private Script_DamageDealer GetDps()
 {
     return(_manager.GetDps());
 }