Exemplo n.º 1
0
 public void PrepareDeckForPlayerAndGetReadyForSaving()
 {
     if (initialized)
     {
         PlayerAndEnemyDeckHolder.PrepareManuallyBuiltDeckForThePlayerAndGetReadyForSaving(cards);
     }
 }
Exemplo n.º 2
0
 private void NewGame()
 {
     Map.StartOfMatch = true;
     CardsLevel.Clear();
     PlayerAndEnemyDeckHolder.PrepareFirstDeckIfNeededForThePlayerAndGetReadyForSaving(forceToPrepare: true);
     sceneOpener.OpenMapScene();
 }
Exemplo n.º 3
0
    public override void Execute()
    {
        do
        {
            if (cards != null)
            {
                Destroy(cards[0].gameObject);
                Destroy(cards[1].gameObject);
            }

            cards = PlayerAndEnemyDeckHolder.Get2DifferentRandomUnlockedNotMonsterCards(deckSize: 2);
        } while (cards[0].IsAnotherInstanceOf(cards[1]));

        customPopUpOpener.OpenDisplayingCardsToChoose
        (
            title: "Earn a Card",
            warningMessage: "Choose a card to add to your collection, I mean, to become your friend.",
            confirmBtnMessage: "<<< The Leftmost",
            cancelBtnMessage: "The rightmost >>>",
            onConfirm: () => { AddCardClosePopUpClearSpot(0); },
            onCancel: () => { AddCardClosePopUpClearSpot(1); },
            PreMadeAudioRequest.CreateSFX_AND_STOP_BGMAudioRequest(earnCardAudio, audioRequisitor, assignor: gameObject),
            cards
        );
    }
Exemplo n.º 4
0
    private void InitializeCards(int amountOfSlots)
    {
        cards = PlayerAndEnemyDeckHolder.GetPreparedCardsForThePlayerWithTheRandomCards();

        for (int i = 0; i < amountOfSlots; i++)
        {
            PutCardInIndexWithSmoothMovement(cards[i], i);

            ChildMaker.CopySizeDelta(slots[i], cards[i].GetRectTransform());
        }
    }
Exemplo n.º 5
0
    private IEnumerator PopulateDeck()
    {
        yield return(null);

        cards = new List <Card>();

        if (enemysDeck)
        {
            cards.AddRange(PlayerAndEnemyDeckHolder.GetPreparedCardsForTheEnemy());
        }
        else
        {
            cards.AddRange(PlayerAndEnemyDeckHolder.GetPreparedCardsForThePlayerOrGetRandomDeck());
        }

        for (int i = 0; i < cards.Count; i++)
        {
            cards[i].RectTransform.position = transform.position;
            cards[i].RectTransform.SetParent(transform, true);
        }
    }
Exemplo n.º 6
0
    private void PopulateAmountOfEachCard()
    {
        amountOfEachCard = new int[cards.Length];

        int[] cardAmounts = CardsCollection.GetCardsCollectionAmounts();

        Card[] currentDeck = PlayerAndEnemyDeckHolder.GetPreparedCardsForThePlayerWithTheRandomCards();

        // For each card on Deck, subtract 1 from it's amount in the collection.
        for (int i = 0; i < cards.Length; i++)
        {
            int amount = cardAmounts[i];
            for (int k = 0; k < currentDeck.Length; k++)
            {
                if (cards[i].IsAnotherInstanceOf(currentDeck[k]))
                {
                    amount--;
                }
            }

            amountOfEachCard[i] = amount;
        }
    }
Exemplo n.º 7
0
 private void Give3CardsThenSeeMap()
 {
     CardsCollection.SumToCurrentAmount(PlayerAndEnemyDeckHolder.GetPreparedCardsForTheEnemy()[0], 3);
     QuitBattleAndGoToMap();
 }