Example #1
0
    public void CmdPotionSkill(float healPercentage, int skillCost)
    {
        Debug.Log("POTION ACTIVATED");
        int previousHealth = playerHealth.currentHealth;         //For unit testing
        int healAmount     = (int)(playerHealth.startingHealth * (healPercentage / 100));

        playerSkill.decreaseBar(skillCost);
        playerHealth.Heal(healAmount);


        //Check whether we heal correct amount of health
        if (playerHealth.currentHealth == (previousHealth + healAmount))
        {
            IntegrationTest.Pass(gameObject);
        }
        else if (playerHealth.currentHealth != (previousHealth + healAmount))
        {
            IntegrationTest.Fail(gameObject);
        }
    }