Example #1
0
    public int getPowerUpPrice(PowerupBase.EType powerUptype)
    {
        switch (powerUptype)
        {
        case PowerupBase.EType.HINT_WORD:
            return(5);

        case PowerupBase.EType.BLOCK:
            return(5);

        case PowerupBase.EType.BOMB:
            return(10);

        case PowerupBase.EType.DESTROY:
            return(25);

        case PowerupBase.EType.ROTATE:
            return(15);

        case PowerupBase.EType.WILDCARD:
            return(50);
        }

        return(0);
    }
Example #2
0
    public bool hasStockThisPowerup(PowerupBase.EType powerupType)
    {
        if (getPowerupByType(powerupType).stock > 0)
        {
            return(true);
        }

        return(false);
    }
Example #3
0
    public PowerupBase getPowerupByType(PowerupBase.EType type)
    {
        foreach (PowerupBase powerup in powerups)
        {
            if (powerup != null)
            {
                if (powerup.type == type)
                {
                    return(powerup);
                }
            }
        }

        return(null);
    }
Example #4
0
    public void activatePowerUp(PowerupBase.EType wichOne, bool canUse)
    {
        if (allowPowerUps)
        {
            powerup = getPowerupByType(wichOne);

            if (powerup == null)
            {
                cancelPowerup();
            }
            else
            {
                powerup.activate(canUse);
            }
        }
    }
Example #5
0
 public void consumePowerupStock(PowerupBase.EType type)
 {
     getPowerupByType(type).updateStock(-1);
 }
Example #6
0
 public void addPowerupStock(PowerupBase.EType type, int amount)
 {
     getPowerupByType(type).updateStock(amount);
 }