private void LoadRuneChangeInfo(Pox.Rune prev_rune, Pox.Rune curr_rune)
        {
            LoadDataElementChangeInfo(prev_rune, curr_rune);

            int prev_changes = PanelChangeList.Controls.Count;

            if (prev_rune.Rarity != curr_rune.Rarity)
            {
                PushChangeInfo(string.Format("Rarity changed from {0} to {1}", prev_rune.Rarity, curr_rune.Rarity));
            }
            foreach (string f in prev_rune.Faction)
            {
                if (!(curr_rune.Faction.Contains(f)))
                {
                    PushChangeInfo(string.Format("Faction removed: {0}", f));
                }
            }
            foreach (string f in curr_rune.Faction)
            {
                if (!(prev_rune.Faction.Contains(f)))
                {
                    PushChangeInfo(string.Format("Faction added: {0}", f));
                }
            }
            if (prev_rune.ForSale != curr_rune.ForSale)
            {
                PushChangeInfo(prev_rune.ForSale ? "No longer for sale" : "Now for sale");
            }
            if (prev_rune.Tradeable != curr_rune.Tradeable)
            {
                PushChangeInfo(prev_rune.Tradeable ? "No longer tradeable" : "Now tradeable");
            }
            if (prev_rune.AllowRanked != curr_rune.AllowRanked)
            {
                PushChangeInfo(prev_rune.AllowRanked ? "Now banned from ranked play" : "No longer banned from ranked play");
            }
            if (prev_rune.DeckLimit != curr_rune.DeckLimit)
            {
                PushChangeInfo(string.Format("Deck limit changed from {0} to {1}", prev_rune.DeckLimit, curr_rune.DeckLimit));
            }
            if (prev_rune.Cooldown != curr_rune.Cooldown)
            {
                PushChangeInfo(string.Format("Cooldown changed from {0} to {1}", prev_rune.Cooldown, curr_rune.Cooldown));
            }

            if (prev_changes != PanelChangeList.Controls.Count)
            {
                PushChangeInfo("");
            }
        }
Пример #2
0
            private bool VerifyCard(Pox.Rune rune, List <string> factions, CardRandomizerFlags flags)
            {
                // limited cards not allowed
                if (rune.Rarity == "LIMITED")
                {
                    return(false);
                }

                // check if its a split card
                if ((rune.Faction.Count > 1) && (!flags.AllowSplitCards))
                {
                    return(false);
                }

                // check if its banned card
                if ((!rune.AllowRanked) && (!flags.AllowBannedCards))
                {
                    return(false);
                }

                // check if its forgeable
                if ((rune.Expansion == "Planar Disturbances") && (!flags.AllowUnforgeableCards))
                {
                    return(false);
                }

                // check if factions match
                bool faction_match = false;

                foreach (string f in factions)
                {
                    if (rune.Faction.Contains(f))
                    {
                        faction_match = true;
                        break;
                    }
                }

                if (!faction_match)
                {
                    return(false);
                }

                return(true);
            }