Ejemplo n.º 1
0
    protected IEnumerator StopPowerUp(iPowerUp powerUp)
    {
        if (powerUp.GetPowerUpType() != PowerUpType.Health || powerUp.GetAmountType() != AmountType.Great)
        {
            charStats.DenyPowerUp(powerUp.GetPowerUpType(), powerUp.GetAmount());
            ReInitTakenGun(currentRifleObject.GetComponent <iGun>());
        }
        else
        {
            currentHealth /= powerUp.GetAmount();
        }
        yield return(new WaitForEndOfFrame());// new WaitForSeconds(powerUp.GetPowerUpTimeLength());

        appliedPowerups.Remove(powerUp);
        Debug.Log("Removed Powerup");
    }
Ejemplo n.º 2
0
 public void GotPowerUp(iPowerUp powerUp)
 {
     if (powerUp.GetPowerUpType() != PowerUpType.Health || powerUp.GetAmountType() != AmountType.Great)
     {
         float nAmount = charStats.ApplyPowerUp(powerUp.GetPowerUpType(), powerUp.GetAmount(), powerUp.GetAmountType());
         powerUp.SetNewAmount(nAmount);
         ReInitTakenGun(currentRifleObject.GetComponent <iGun>());
     }
     else
     {
         currentHealth += (charStats.GetMaxHealth() * (powerUp.GetAmount() - 1));
     }
     powerUp.SetStartTime(Time.time);
     appliedPowerups.Add(powerUp);
     Debug.Log("Applied Powerup");
 }