コード例 #1
0
    private Deck GetDeckFromType(DeckType type)
    {
        switch (type)
        {
        case DeckType.Battlefield:
            return(owner.battlefield);

        case DeckType.Hand:
            return(owner.myHand);

        case DeckType.Grimoire:
            return(owner.activeGrimoire.GetComponent <Deck>());

        case DeckType.SoulCrypt:
            return(owner.activeCrypt.GetComponent <Deck>());

        case DeckType.Void:
            return(owner.theVoid);

        case DeckType.None:
            return(null);

        default:
            return(null);
        }
    }
コード例 #2
0
    public static List <CardVisual> FindAllCardsOfType(CardType type, DeckType zone = DeckType.None)
    {
        List <CardVisual> cardsToSearch = new List <CardVisual>();

        if (zone == DeckType.None)
        {
            cardsToSearch = Deck._allCards.activeCards;
        }
        else
        {
            cardsToSearch = FindAllCardsInZone(zone);
        }

        List <CardVisual> sortedcards = new List <CardVisual>();

        for (int i = 0; i < cardsToSearch.Count; i++)
        {
            if (cardsToSearch[i].primaryCardType == type)
            {
                sortedcards.Add(cardsToSearch[i]);
            }
        }

        return(sortedcards);
    }
コード例 #3
0
    protected Deck GetDeckFromType(DeckType type, CardVisual card)
    {
        switch (type)
        {
        case DeckType.Battlefield:
            return(card.owner.battlefield);

        case DeckType.Hand:
            return(card.owner.myHand);

        case DeckType.Grimoire:
            return(card.owner.activeGrimoire.GetComponent <Deck>());

        case DeckType.SoulCrypt:
            return(card.owner.activeCrypt.GetComponent <Deck>());

        case DeckType.Void:
            return(card.owner.theVoid);

        case DeckType.NotInGame:
            return(card.owner.notInGame);

        case DeckType.None:
            return(null);

        default:
            return(null);
        }
    }
コード例 #4
0
    public static List <CardVisual> FindAllCardsInZone(DeckType zone, Keywords keyWord, OwnerConstraints ownerConstraints, CardType cardType)
    {
        List <CardVisual> cards = FindAllCardsInZone(zone, keyWord, ownerConstraints);

        List <CardVisual> sortedCards = FindAllCardsOfType(cards, cardType);

        return(sortedCards);
    }
コード例 #5
0
    public static List <CardVisual> FindAllCardsInZone(DeckType zone, Keywords keyWord)
    {
        List <CardVisual> cards = FindAllCardsInZone(zone);

        List <CardVisual> sortedCards = FindAllCardsWithKeyword(keyWord, cards);

        return(sortedCards);
    }
コード例 #6
0
    public static List <CardVisual> FindAllCardsInZone(DeckType zone, OwnerConstraints ownerConstraints)
    {
        List <CardVisual> cards = FindAllCardsInZone(zone);

        List <CardVisual> sortedCards = SortCardsByOwner(cards, ownerConstraints);

        return(sortedCards);
    }
コード例 #7
0
    public static List <CardVisual> FindAllCardsOfType(CardType type, DeckType zone, OwnerConstraints ownerConstraints)
    {
        List <CardVisual> cards = FindAllCardsOfType(type, zone);

        List <CardVisual> sortedcards = SortCardsByOwner(cards, ownerConstraints);

        return(sortedcards);
    }
コード例 #8
0
    public static List <CardVisual> FindAllCardsInZone(DeckType zone, Keywords keyWord, OwnerConstraints ownerConstraints)
    {
        List <CardVisual> cards = FindAllCardsInZone(zone);

        List <CardVisual> sortedCards1 = FindAllCardsWithKeyword(keyWord, cards);
        List <CardVisual> sortedCards2 = SortCardsByOwner(sortedCards1, ownerConstraints);

        return(sortedCards2);
    }
コード例 #9
0
    public static List <CardVisual> FindAllCardsInZone(DeckType zone)
    {
        List <CardVisual> cards = new List <CardVisual>();

        for (int i = 0; i < Deck._allCards.activeCards.Count; i++)
        {
            if (Deck._allCards.activeCards[i].currentDeck.decktype == zone)
            {
                cards.Add(Deck._allCards.activeCards[i]);
            }
        }

        return(cards);
    }
コード例 #10
0
    public static List <CardVisual> FindCardsWithStatExtreme(CardStats stat, DeckType zone, bool high, OwnerConstraints owner)
    {
        List <CardVisual> results = new List <CardVisual>();

        //Debug.Log("Finding cards in" + zone.ToString());

        Dictionary <int, int> cardsByStat = StatCollector(stat, zone, owner);
        List <int>            sortedStats = cardsByStat.Values.ToList();

        //Debug.Log(sortedStats.Count + " is the number of stats found");

        //for (int i = 0; i < sortedStats.Count; i++) {
        //    Debug.Log(sortedStats[i].ToString() + " is the value of a stat on a soul");
        //}



        int targetStat;

        if (high)
        {
            targetStat = sortedStats.Max();
        }
        else
        {
            targetStat = sortedStats.Min();
        }

        foreach (KeyValuePair <int, int> entry in cardsByStat)
        {
            if (entry.Value == targetStat)
            {
                results.Add(FindCardByID(entry.Key));
            }
        }

        //foreach (CardVisual card in results) {
        //    Debug.Log(card.gameObject.name + " has the least " + stat.ToString());
        //}

        return(results);
    }
コード例 #11
0
ファイル: CombatManager.cs プロジェクト: Alarack/Soulweaver
    private bool ConfirmCardClicked(CardVisual card, DeckType location = DeckType.None, bool mineOnly = false)
    {
        if (card == null)
        {
            //Debug.LogError("Card Clicked was Null");
            return(false);
        }

        if (location != DeckType.None && card.currentDeck.decktype != location)
        {
            //Debug.LogError("Card Clicked was not in " + location.ToString());
            return(false);
        }

        if (mineOnly && !card.photonView.isMine)
        {
            //Debug.LogError("Card Clicked was not mine");
            return(false);
        }


        return(true);
    }
コード例 #12
0
    public void RPCSpawnCardRemote(PhotonTargets targets, CardIDs.CardID dataID, string prefabname, DeckType targetDeck = DeckType.None)
    {
        int cardDataID = (int)dataID;
        int deckTypeEnum;

        if (targetDeck != DeckType.None)
        {
            deckTypeEnum = (int)targetDeck;
        }
        else
        {
            deckTypeEnum = 0;
        }

        photonView.RPC("SpawnCardRemote", targets, cardDataID, deckTypeEnum, prefabname);
    }
コード例 #13
0
    private static Dictionary <int, int> StatCollector(CardStats stat, DeckType zone, OwnerConstraints owner)
    {
        Dictionary <int, int> results = new Dictionary <int, int>();

        List <CardVisual> cardsToSearch = FindAllCardsInZone(zone, owner); //FindAllCardsOfType(CardType.Soul, zone, owner);

        //foreach(CardVisual card in cardsToSearch) {
        //    Debug.Log(card.gameObject.name + " is " + card.cardData.cardName);
        //}

        switch (stat)
        {
        case CardStats.Cost:

            for (int i = 0; i < cardsToSearch.Count; i++)
            {
                results.Add(cardsToSearch[i].photonView.viewID, cardsToSearch[i].essenceCost);
            }
            break;

        case CardStats.Attack:
            for (int i = 0; i < cardsToSearch.Count; i++)
            {
                if (cardsToSearch[i].primaryCardType != CardType.Soul)
                {
                    continue;
                }


                CreatureCardVisual soul = cardsToSearch[i] as CreatureCardVisual;

                results.Add(soul.photonView.viewID, soul.attack);
            }
            break;

        case CardStats.Size:
            for (int i = 0; i < cardsToSearch.Count; i++)
            {
                if (cardsToSearch[i].primaryCardType != CardType.Soul)
                {
                    continue;
                }

                CreatureCardVisual soul = cardsToSearch[i] as CreatureCardVisual;

                results.Add(soul.photonView.viewID, soul.size);
            }
            break;

        case CardStats.Health:
            for (int i = 0; i < cardsToSearch.Count; i++)
            {
                if (cardsToSearch[i].primaryCardType != CardType.Soul)
                {
                    continue;
                }

                CreatureCardVisual soul = cardsToSearch[i] as CreatureCardVisual;

                results.Add(soul.photonView.viewID, soul.health);
            }
            break;
        }

        return(results);
    }