コード例 #1
0
    //..

    private void PlayerAttacksFirst()
    {
        Debug.Log("Player is attacking first!");
        //apply damage to enemy if there is any and check to make sure the enemy is alive still
        player_DoMove();
        //then heal the player
        healPlayer();

        //then apply damage effects to the player
        damage_Player_Effects();

        //apply damage to player and check if the player is still alive
        if (enemyStats.curHp > 0)   //checks to see that the enemy is still alive before the enemy attacks
        {
            enemy_DoMove();

            gui.updatePlayerHealth();

            //then heal the enemy
            healEnemy();

            //then damage effects on the enemy
            damage_Enemy_Effects();
        }
        else
        {
            //the enemy died with tthis turn's attack
        }

        if (playerStats.curHp <= 0)
        {
            //the player died with this turn's attack
        }
    }