Exemplo n.º 1
0
            public combo(string s)
            {
                int i = 0;
                this.neededMana = 0;
                requiredWeapon = CardDB.cardName.unknown;
                this.type = combotype.combo;
                this.twoTurnCombo = false;
                bool fixmana = false;
                if (s.Contains("nxttrn")) this.twoTurnCombo = true;
                if (s.Contains("mana:")) fixmana = true;

                /*foreach (string ding in s.Split(':'))
                {
                    if (i == 0)
                    {
                        if (ding == "c") this.type = combotype.combo;
                        if (ding == "t") this.type = combotype.target;
                        if (ding == "w") this.type = combotype.weaponuse;
                    }
                    if (ding == "" || ding == string.Empty) continue;

                    if (i == 1 && type == combotype.combo)
                    {
                        int m = Convert.ToInt32(ding);
                        neededMana = -1;
                        if (m >= 1) neededMana = m;
                    }
                */
                if (type == combotype.combo)
                {
                    this.combolength = 0;
                    this.combot0len = 0;
                    this.combot1len = 0;
                    this.combot0lenAll = 0;
                    int manat0 = 0;
                    int manat1 = -1;
                    bool t1 = false;
                    foreach (string crdl in s.Split(';')) //ding.Split
                    {
                        if (crdl == "" || crdl == string.Empty) continue;
                        if (crdl == "nxttrn")
                        {
                            t1 = true;
                            continue;
                        }
                        if (crdl.StartsWith("mana:"))
                        {
                            this.neededMana = Convert.ToInt32(crdl.Replace("mana:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("hero:"))
                        {
                            this.oHero = Hrtprozis.Instance.heroNametoEnum(crdl.Replace("hero:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonus:"))
                        {
                            this.bonusForPlaying = Convert.ToInt32(crdl.Replace("bonus:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonusfirst:"))
                        {
                            this.bonusForPlayingT0 = Convert.ToInt32(crdl.Replace("bonusfirst:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonussecond:"))
                        {
                            this.bonusForPlayingT1 = Convert.ToInt32(crdl.Replace("bonussecond:", ""));
                            continue;
                        }
                        string crd = crdl.Split(',')[0];
                        if (t1)
                        {
                            manat1 += CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(crd)).cost;
                        }
                        else
                        {
                            manat0 += CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(crd)).cost;
                        }
                        this.combolength++;

                        if (combocards.ContainsKey(CardDB.Instance.cardIdstringToEnum(crd)))
                        {
                            combocards[CardDB.Instance.cardIdstringToEnum(crd)]++;
                        }
                        else
                        {
                            combocards.Add(CardDB.Instance.cardIdstringToEnum(crd), 1);
                            cardspen.Add(CardDB.Instance.cardIdstringToEnum(crd), Convert.ToInt32(crdl.Split(',')[1]));
                        }

                        if (this.twoTurnCombo)
                        {

                            if (t1)
                            {
                                if (this.combocardsTurn1.ContainsKey(CardDB.Instance.cardIdstringToEnum(crd)))
                                {
                                    combocardsTurn1[CardDB.Instance.cardIdstringToEnum(crd)]++;
                                }
                                else
                                {
                                    combocardsTurn1.Add(CardDB.Instance.cardIdstringToEnum(crd), 1);
                                }
                                this.combot1len++;
                            }
                            else
                            {
                                CardDB.Card lolcrd = CardDB.Instance.getCardDataFromID(CardDB.Instance.cardIdstringToEnum(crd));
                                if (lolcrd.type == CardDB.cardtype.MOB)
                                {
                                    if (this.combocardsTurn0Mobs.ContainsKey(CardDB.Instance.cardIdstringToEnum(crd)))
                                    {
                                        combocardsTurn0Mobs[CardDB.Instance.cardIdstringToEnum(crd)]++;
                                    }
                                    else
                                    {
                                        combocardsTurn0Mobs.Add(CardDB.Instance.cardIdstringToEnum(crd), 1);
                                    }
                                    this.combot0len++;
                                }
                                if (lolcrd.type == CardDB.cardtype.WEAPON)
                                {
                                    this.requiredWeapon = lolcrd.name;
                                }
                                if (this.combocardsTurn0All.ContainsKey(CardDB.Instance.cardIdstringToEnum(crd)))
                                {
                                    combocardsTurn0All[CardDB.Instance.cardIdstringToEnum(crd)]++;
                                }
                                else
                                {
                                    combocardsTurn0All.Add(CardDB.Instance.cardIdstringToEnum(crd), 1);
                                }
                                this.combot0lenAll++;
                            }
                        }


                    }
                    if (!fixmana)
                    {
                        this.neededMana = Math.Max(manat1, manat0);
                    }
                }

                /*if (i == 2 && type == combotype.combo)
                {
                    int m = Convert.ToInt32(ding);
                    penality = 0;
                    if (m >= 1) penality = m;
                }

                i++;
            }*/
            }
Exemplo n.º 2
0
            public combo(string s)
            {
                int i = 0;

                this.neededMana   = 0;
                requiredWeapon    = CardDB.cardName.unknown;
                this.type         = combotype.combo;
                this.twoTurnCombo = false;
                bool fixmana = false;

                if (s.Contains("nxttrn"))
                {
                    this.twoTurnCombo = true;
                }
                if (s.Contains("mana:"))
                {
                    fixmana = true;
                }

                /*foreach (string ding in s.Split(':'))
                 * {
                 *  if (i == 0)
                 *  {
                 *      if (ding == "c") this.type = combotype.combo;
                 *      if (ding == "t") this.type = combotype.target;
                 *      if (ding == "w") this.type = combotype.weaponuse;
                 *  }
                 *  if (ding == "" || ding == string.Empty) continue;
                 *
                 *  if (i == 1 && type == combotype.combo)
                 *  {
                 *      int m = Convert.ToInt32(ding);
                 *      neededMana = -1;
                 *      if (m >= 1) neededMana = m;
                 *  }
                 */
                if (type == combotype.combo)
                {
                    this.combolength   = 0;
                    this.combot0len    = 0;
                    this.combot1len    = 0;
                    this.combot0lenAll = 0;
                    int  manat0 = 0;
                    int  manat1 = -1;
                    bool t1     = false;
                    foreach (string crdl in s.Split(';')) //ding.Split
                    {
                        if (crdl == "" || crdl == string.Empty)
                        {
                            continue;
                        }
                        if (crdl == "nxttrn")
                        {
                            t1 = true;
                            continue;
                        }
                        if (crdl.StartsWith("mana:"))
                        {
                            this.neededMana = Convert.ToInt32(crdl.Replace("mana:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("hero:"))
                        {
                            this.oHero = Hrtprozis.Instance.heroNametoEnum(crdl.Replace("hero:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonus:"))
                        {
                            this.bonusForPlaying = Convert.ToInt32(crdl.Replace("bonus:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonusfirst:"))
                        {
                            this.bonusForPlayingT0 = Convert.ToInt32(crdl.Replace("bonusfirst:", ""));
                            continue;
                        }
                        if (crdl.StartsWith("bonussecond:"))
                        {
                            this.bonusForPlayingT1 = Convert.ToInt32(crdl.Replace("bonussecond:", ""));
                            continue;
                        }
                        string crd = crdl.Split(',')[0];
                        if (t1)
                        {
                            manat1 += cb.cdb.getCardDataFromID(cb.cdb.cardIdstringToEnum(crd)).cost;
                        }
                        else
                        {
                            manat0 += cb.cdb.getCardDataFromID(cb.cdb.cardIdstringToEnum(crd)).cost;
                        }
                        this.combolength++;

                        if (combocards.ContainsKey(cb.cdb.cardIdstringToEnum(crd)))
                        {
                            combocards[cb.cdb.cardIdstringToEnum(crd)]++;
                        }
                        else
                        {
                            combocards.Add(cb.cdb.cardIdstringToEnum(crd), 1);
                            cardspen.Add(cb.cdb.cardIdstringToEnum(crd), Convert.ToInt32(crdl.Split(',')[1]));
                        }

                        if (this.twoTurnCombo)
                        {
                            if (t1)
                            {
                                if (this.combocardsTurn1.ContainsKey(cb.cdb.cardIdstringToEnum(crd)))
                                {
                                    combocardsTurn1[cb.cdb.cardIdstringToEnum(crd)]++;
                                }
                                else
                                {
                                    combocardsTurn1.Add(cb.cdb.cardIdstringToEnum(crd), 1);
                                }
                                this.combot1len++;
                            }
                            else
                            {
                                CardDB.Card lolcrd = cb.cdb.getCardDataFromID(cb.cdb.cardIdstringToEnum(crd));
                                if (lolcrd.type == CardDB.cardtype.MOB)
                                {
                                    if (this.combocardsTurn0Mobs.ContainsKey(cb.cdb.cardIdstringToEnum(crd)))
                                    {
                                        combocardsTurn0Mobs[cb.cdb.cardIdstringToEnum(crd)]++;
                                    }
                                    else
                                    {
                                        combocardsTurn0Mobs.Add(cb.cdb.cardIdstringToEnum(crd), 1);
                                    }
                                    this.combot0len++;
                                }
                                if (lolcrd.type == CardDB.cardtype.WEAPON)
                                {
                                    this.requiredWeapon = lolcrd.name;
                                }
                                if (this.combocardsTurn0All.ContainsKey(cb.cdb.cardIdstringToEnum(crd)))
                                {
                                    combocardsTurn0All[cb.cdb.cardIdstringToEnum(crd)]++;
                                }
                                else
                                {
                                    combocardsTurn0All.Add(cb.cdb.cardIdstringToEnum(crd), 1);
                                }
                                this.combot0lenAll++;
                            }
                        }
                    }
                    if (!fixmana)
                    {
                        this.neededMana = Math.Max(manat1, manat0);
                    }
                }

                /*if (i == 2 && type == combotype.combo)
                 * {
                 *  int m = Convert.ToInt32(ding);
                 *  penality = 0;
                 *  if (m >= 1) penality = m;
                 * }
                 *
                 * i++;
                 * }*/
                this.bonusForPlaying   = Math.Max(bonusForPlaying, 1);
                this.bonusForPlayingT0 = Math.Max(bonusForPlayingT0, 1);
                this.bonusForPlayingT1 = Math.Max(bonusForPlayingT1, 1);
            }
Exemplo n.º 3
0
            public combo(string s)
            {
                var i = 0;

                this.neededMana     = 0;
                this.requiredWeapon = SimCard.None;
                this.type           = combotype.combo;
                this.twoTurnCombo   = false;
                var fixmana = false;

                if (s.Contains("nxttrn"))
                {
                    this.twoTurnCombo = true;
                }

                if (s.Contains("mana:"))
                {
                    fixmana = true;
                }

                /*foreach (string ding in s.Split(':'))
                 * {
                 *  if (i == 0)
                 *  {
                 *      if (ding == "c") this.type = combotype.combo;
                 *      if (ding == "t") this.type = combotype.target;
                 *      if (ding == "w") this.type = combotype.weaponuse;
                 *  }
                 *  if (ding == "" || ding == string.Empty) continue;
                 *
                 *  if (i == 1 && type == combotype.combo)
                 *  {
                 *      int m = Convert.ToInt32(ding);
                 *      neededMana = -1;
                 *      if (m >= 1) neededMana = m;
                 *  }
                 */
                if (this.type == combotype.combo)
                {
                    this.combolength   = 0;
                    this.combot0len    = 0;
                    this.combot1len    = 0;
                    this.combot0lenAll = 0;
                    var manat0 = 0;
                    var manat1 = -1;
                    var t1     = false;
                    foreach (var crdl in s.Split(';')) //ding.Split
                    {
                        if (crdl == "" || crdl == string.Empty)
                        {
                            continue;
                        }

                        if (crdl == "nxttrn")
                        {
                            t1 = true;
                            continue;
                        }

                        if (crdl.StartsWith("mana:"))
                        {
                            this.neededMana = Convert.ToInt32(crdl.Replace("mana:", ""));
                            continue;
                        }

                        if (crdl.StartsWith("hero:"))
                        {
                            this.oHero = SimCard.FromName(crdl.Replace("hero:", "")).CardDef.Class;
                            continue;
                        }

                        if (crdl.StartsWith("bonus:"))
                        {
                            this.bonusForPlaying = Convert.ToInt32(crdl.Replace("bonus:", ""));
                            continue;
                        }

                        if (crdl.StartsWith("bonusfirst:"))
                        {
                            this.bonusForPlayingT0 = Convert.ToInt32(crdl.Replace("bonusfirst:", ""));
                            continue;
                        }

                        if (crdl.StartsWith("bonussecond:"))
                        {
                            this.bonusForPlayingT1 = Convert.ToInt32(crdl.Replace("bonussecond:", ""));
                            continue;
                        }

                        var crd = crdl.Split(',')[0];
                        if (t1)
                        {
                            manat1 += SimCard.FromName(crd).Cost;
                        }
                        else
                        {
                            manat0 += SimCard.FromName(crd).Cost;
                        }

                        this.combolength++;

                        if (this.combocards.ContainsKey(crd))
                        {
                            this.combocards[crd]++;
                        }
                        else
                        {
                            this.combocards.Add(crd, 1);
                            this.cardspen.Add(crd, Convert.ToInt32(crdl.Split(',')[1]));
                        }

                        if (this.twoTurnCombo)
                        {
                            if (t1)
                            {
                                if (this.combocardsTurn1.ContainsKey(crd))
                                {
                                    this.combocardsTurn1[crd]++;
                                }
                                else
                                {
                                    this.combocardsTurn1.Add(crd, 1);
                                }

                                this.combot1len++;
                            }
                            else
                            {
                                SimCard lolcrd = crd;
                                if (lolcrd.Type == CardType.MINION)
                                {
                                    if (this.combocardsTurn0Mobs.ContainsKey(crd))
                                    {
                                        this.combocardsTurn0Mobs[crd]++;
                                    }
                                    else
                                    {
                                        this.combocardsTurn0Mobs.Add(crd, 1);
                                    }

                                    this.combot0len++;
                                }

                                if (lolcrd.Type == CardType.WEAPON)
                                {
                                    this.requiredWeapon = lolcrd.CardId;
                                }

                                if (this.combocardsTurn0All.ContainsKey(crd))
                                {
                                    this.combocardsTurn0All[crd]++;
                                }
                                else
                                {
                                    this.combocardsTurn0All.Add(crd, 1);
                                }

                                this.combot0lenAll++;
                            }
                        }
                    }

                    if (!fixmana)
                    {
                        this.neededMana = Math.Max(manat1, manat0);
                    }
                }

                /*if (i == 2 && type == combotype.combo)
                 * {
                 *  int m = Convert.ToInt32(ding);
                 *  penality = 0;
                 *  if (m >= 1) penality = m;
                 * }
                 *
                 * i++;
                 * }*/
                this.bonusForPlaying   = Math.Max(this.bonusForPlaying, 1);
                this.bonusForPlayingT0 = Math.Max(this.bonusForPlayingT0, 1);
                this.bonusForPlayingT1 = Math.Max(this.bonusForPlayingT1, 1);
            }