Beispiel #1
0
    public void EnablePowerUp(PUpTypes type, int id, int power, float amount, Color effectColor)
    {
        DataLogger.LogMessage("Activating pup: type:^" + type.ToString() + " - id: " + id.ToString() + " - power: " + power.ToString() + " - amount: " + amount.ToString());
        if (canActivatePowerUp == false)
        {
            return;
        }

        if (type == PUpTypes.equipment)
        {
            if (id < equipmentPUps.Length)
            {
                if (equipmentPUps[id] != null)
                {
                    equipmentPUps[id].Enable(power, amount, effectColor);
                    activePUp = equipmentPUps[id];
                }
                else
                {
                    DataLogger.LogError("Equipment pup with id " + id.ToString() + " is null!");
                }
            }
            else
            {
                DataLogger.LogError("Equipment pup with id " + id.ToString() + " not enough Equipment pups! length:" + equipmentPUps.Length.ToString());
            }
        }
        else if (type == PUpTypes.potion)
        {
            if (id < potionPUps.Length)
            {
                if (potionPUps[id] != null)
                {
                    CharacterStuffController.s.lastActivatedButton = false;
                    potionPUps[id].Enable(power, amount, effectColor);
                    activePUp = potionPUps[id];
                }
                else
                {
                    DataLogger.LogError("Potion pup with id " + id.ToString() + " is null!");
                }
            }
            else
            {
                DataLogger.LogError("Potion pup with id " + id.ToString() + " not enough potion pups! length:" + potionPUps.Length.ToString());
            }
        }
        else
        {
            DataLogger.LogError("Other pup types arent implemented/does not exist: " + type.ToString());
        }
    }
Beispiel #2
0
    public void ReceiveEnemyPowerUpActions(int player, int x, int y, PUpTypes type, int id, int power, float amount, ActionType action)
    {
        IndividualCard card = null;

        try {
            if (x != -1 && y != -1)
            {
                card = CardHandler.s.allCards[x, y];
            }
        } catch {
            DataLogger.LogError("ReceiveEnemyPowerUpActions couldnt find the card " + x.ToString() + "-" + y.ToString());
        }

        if (type == PUpTypes.equipment)
        {
            equipmentPUps[id].ReceiveAction(player, card, power, amount, action);
        }
        else
        {
            potionPUps[id].ReceiveAction(player, card, power, amount, action);
        }
    }
Beispiel #3
0
 public void SendPowerUpAction(int x, int y, PUpTypes pUpType, int id, int power, float amount, ActionType action)
 {
     DataHandler.s.SendPowerUpAction(x, y, pUpType, id, power, amount, action);
 }