示例#1
0
    public void doEnemyTurn()
    {
        Debug.Log("Enemy state: in enemy turn");

        if (enemy.currentHP <= 0)
        {
            enemy.isDead    = true;
            turn.End        = true;
            turn.PlayerTurn = false;
            turn.EnemyTurn  = false;
        }
        else
        {
            enemy.Guard = false;

            if (player.currentHP <= 0)
            {
                player.isDead   = true;
                turn.End        = true;
                turn.PlayerTurn = false;
                turn.EnemyTurn  = false;
            }
        }
        enemy.StaminaCheck = enemy.HasEnoughStamina();
        Debug.Log("Checking stamina level..." + enemy.HasEnoughStamina());
        Debug.Log("Enemy's StaminaCheck is " + enemy.StaminaCheck);
        if (skipTurn == false)
        {
            enemy.tree = enemy.BuildTree();
        }
        if (skipTurn == true)
        {
            skipTurn = false;
        }
        enemy.tree.RunBehaviorTree();
        yieldETurn();
    }