Exemple #1
0
    public void BuyCard(int offerSlotId)
    {
        int aCardId = offerSlots[offerSlotId].offerCardId;

        if (EnoughResources(aCardId))
        {
            cm.CardAS(aCardId, 1);
            if (offerSlotId == 0)
            {
                NewRandomOffer(offerSlotId, new int[] { 0, 1 });
            }
            else
            {
                NewRandomOffer(offerSlotId, new int[] { 2, 3, 4 });
            }
            rm.ResourceAS("Wood", -cm.cards[aCardId].costWood);
            rm.ResourceAS("Stone", -cm.cards[aCardId].costStone);
            rm.ResourceAS("Food", -cm.cards[aCardId].costFood);
            rm.ResourceAS("Soul", -cm.cards[aCardId].costSoul);
        }
    }