private void ShuffleCards() { for (int i = 0; i < cards.Count; i++) { Card2D temp = cards[i]; int randomIndex = Random.Range(i, cards.Count); cards[i] = cards[randomIndex]; cards[randomIndex] = temp; } }
public void StartGame() { // Fill the list with all the selected cards // Shuffle the cards if needed ShuffleCards(); // Setup the first card currentCardIndex = 0; currentCard = cards[currentCardIndex]; cardDisplay.card = currentCard; // Get the screen up for the main game EnableScreen(screens[1]); }
public void NextCard() { currentCardIndex++; if (currentCardIndex > cards.Count - 1) { currentCardIndex = 0; } currentCard = cards[currentCardIndex]; cardDisplay.card = currentCard; cardDisplay.UpdateCard(); }
public override bool IsCardAllowed(Card2D cardToVerify) { bool bToRet = true; CardIdentifier id = cardToVerify._CardInfo.cardID; if(id == CardIdentifier.DRAGONIC_OVERLORD || id == CardIdentifier.DRAGONIC_OVERLORD_BREAK_RIDE) { if(CountByID(CardIdentifier.DRAGONIC_OVERLORD) + CountByID(CardIdentifier.DRAGONIC_OVERLORD_BREAK_RIDE) >= 4) { bToRet = false; } } return bToRet; }
public virtual bool IsCardAllowed(Card2D cardToVerify) { return true; }
public void AddCard(Card2D card) { _DeckList.Add(card); card.Scale(0.65f); card.bInDeck = true; }
public bool IsCardAllowed(Card2D cardToVerify) { return restrictedList.IsCardAllowed(cardToVerify); }
// Update is called once per frame void Update() { _DeckSearcher.Update(); _DeckWatcher.Update(); _DeckInformation.Update(); bool bInsideDeckWatcher = false; if(_DeckWatcher.MouseOn()) { bInsideDeckWatcher = true; } if(Input.GetMouseButtonUp(0)) { if(_DraggedCard != null) { if(bInsideDeckWatcher && _DeckInformation.numCards < 50 && _DeckInformation.IsCardAllowed(_DraggedCard)) { _DeckWatcher.AddCard(_DraggedCard); _DeckInformation.numCards++; if(_DraggedCard._CardInfo.grade == 0) _DeckInformation.numGrade0++; else if(_DraggedCard._CardInfo.grade == 1) _DeckInformation.numGrade1++; else if(_DraggedCard._CardInfo.grade == 2) _DeckInformation.numGrade2++; else if(_DraggedCard._CardInfo.grade == 3) _DeckInformation.numGrade3++; _DeckInformation.CardList[(int)_DraggedCard._CardInfo.cardID]++; if(_DraggedCard._CardInfo.trigger != TriggerIcon.NONE) { _DeckInformation.numTriggers++; } if(_DraggedCard._CardInfo.trigger == TriggerIcon.HEAL) { _DeckInformation.numHealTriggers++; } if(_DraggedCard._CardInfo.bSentinel) { _DeckInformation.numSentinels++; } } _DraggedCard = null; bCardDragged = false; } } }