示例#1
0
 public override void ModifyCardsUponAcquisition(AbstractCard card, AbstractBattleUnit soldierAffected)
 {
     if (Stacks <= 0)
     {
         return;
     }
     Stacks--;
     soldierAffected.AddCardToPersistentDeck(card.CopyCard());
     soldierAffected.AddCardToPersistentDeck(card.CopyCard());
 }
示例#2
0
    public void AddCardToPersistentDeck(AbstractCard protoCard, AbstractBattleUnit unit, QueueingType queueingType = QueueingType.TO_BACK)
    {
        QueuedActions.ImmediateAction("AddCardToPersistentDeck", () =>
        {
            var persistentDeckList = unit.CardsInPersistentDeck;
            if (persistentDeckList.Where(item => item.Id == protoCard.Id).Any())
            {
                throw new Exception("Attempted to add card to deck that already had the same ID as a card in the deck already: " + protoCard.Name);
            }
            unit.AddCardToPersistentDeck(protoCard);
            Debug.Log("Added card to deck: " + protoCard.Name);

            // ServiceLocator.GetCardAnimationManager().RunCreateNewCardAndAddToDiscardPileAnimation(protoCard); //todo
            // Animate: Card created in center of screen, wait for a second, and shrinks while going down to the deck.
        }, queueingType);
    }