Пример #1
0
    private static CardDescriptions GetDescription(CardName cName)
    {
        switch ((CardName)UnityEngine.Random.Range(0, GlobalConstants.numCards))
        {
        case CardName.Coin:
            return(CardDescriptions.coin);

        case CardName.CoinStack:
            return(CardDescriptions.coinStack);

        case CardName.RustySword:
            return(CardDescriptions.rustySword);

        case CardName.SmallRock:
            return(CardDescriptions.smallRock);

        case CardName.SmallBag:
            return(CardDescriptions.smallBag);

        case CardName.Rock:
            return(CardDescriptions.rock);

        case CardName.Backpack:
            return(CardDescriptions.backpack);

        case CardName.DullAxe:
            return(CardDescriptions.dullAxe);

        case CardName.Blink:
            return(CardDescriptions.blink);

        case CardName.ShinySword:
            return(CardDescriptions.shinySword);

        case CardName.LavaLamp:
            return(CardDescriptions.lavaLamp);

        case CardName.SmallSling:
            return(CardDescriptions.smallSling);

        case CardName.HeavySling:
            return(CardDescriptions.heavySling);

        case CardName.Punch:
            return(CardDescriptions.punch);

        default:
            return(null);
        }
    }
Пример #2
0
    public void InitCard(int w, int a, int v, int u, int c, int tel, CardType t, CardName n, CardEffect e = CardEffect.None)
    {
        weight   = w;
        attack   = a;
        value    = v;
        uses     = u;
        capacity = c;
        teleport = tel;
        type     = t;
        name     = n;

        actionEnum = e;
        switch (e)
        {
        case CardEffect.ChangeCapacity:
            action = ChangeCapacity;
            break;

        case CardEffect.AttackCard:
            action = AttackCard;
            break;

        case CardEffect.Transport:
            action = Transport;
            break;

        case CardEffect.Struggle:
            action = Struggle;
            break;

        default:
            break;
        }

        BuildCardVisuals(this);
    }