BelongedRegion() public method

public BelongedRegion ( ) : Region
return Region
Exemplo n.º 1
0
 public string GetTextOfMovingToRegion(Card card, string toWhere, bool IsCheckingRegion)
 {
     string text;
     if ((new List<string> { "Orb", "DeckShuffle", "DeckTop", "DeckBottom", "Hand" }).Contains(toWhere))
     {
         if (card.BelongedRegion().Equals(Player.Deck))
         {
             if (!IsCheckingRegion)
             {
                 text = "#将卡组顶牌";
             }
             else
             {
                 text = "#将[" + GetRegionNameInString(card.BelongedRegion()) + "][" + card.UnitTitle + " " + card.UnitName + "]";
             }
         }
         else if (card.BelongedRegion().Equals(Player.Orb))
         {
             text = "#将[宝玉区(" + (Player.Orb.CardList.IndexOf(card) + 1).ToString() + ")]";
         }
         else if (card.BelongedRegion().Equals(Player.Hand))
         {
             text = "#将[手卡(" + (Player.Hand.CardList.IndexOf(card) + 1).ToString() + ")]";
         }
         else
         {
             text = "#将[" + GetRegionNameInString(card.BelongedRegion()) + "][" + card.UnitTitle + " " + card.UnitName + "]";
         }
     }
     else
     {
         text = "#将[" + GetRegionNameInString(card.BelongedRegion()) + "][" + card.UnitTitle + " " + card.UnitName + "]";
     }
     switch (toWhere)
     {
         case "Orb":
             text += "置于宝玉区";
             break;
         case "DeckShuffle":
             text += "加入卡组并切洗";
             break;
         case "DeckTop":
             text += "置于卡组顶端";
             break;
         case "DeckBottom":
             text += "置于卡组底端";
             break;
         case "Hand":
             text += "加入手牌";
             break;
         case "Support":
             text += "置于支援区";
             break;
         case "Kizuna":
             text += "置于羁绊区";
             break;
         case "Grave":
             text += "置于退避区";
             break;
     }
     if (card.OverlayCardNo.Count > 0)
     {
         text += "(叠放卡送入退避区)。";
     }
     else
     {
         text += "。";
     }
     return text;
 }
Exemplo n.º 2
0
 public void MoveCard(Card card, Region toWhere, int NumberDes)
 {
     if (toWhere.Equals(this.Deck) || toWhere.Equals(this.Orb))
     {
         card.FrontShown = false;
         card.Visible = false;
     }
     else
     {
         if (!((toWhere.Equals(this.Kizuna) || toWhere.Equals(this.KizunaUsed)) && (card.BelongedRegion().Equals(this.Kizuna) || card.BelongedRegion().Equals(this.KizunaUsed))))
         {
             card.FrontShown = true;
             card.Visible = true;
         }
     }
     Region fromWhere = card.BelongedRegion();
     fromWhere.CardList.Remove(card);
     toWhere.CardList.Insert(NumberDes, card);
 }
Exemplo n.º 3
0
 public void MoveCard(Card card, Region toWhere, int NumberDes)
 {
     Region fromWhere = card.BelongedRegion();
     if (fromWhere.Equals(Overlay))
     {
         List<Card> temp = new List<Card>();
         temp.AddRange(FrontField.CardList);
         temp.AddRange(BackField.CardList);
         foreach (Card parentCard in temp)
         {
             if (parentCard.OverlayCardNo.Contains(card.NumberInDeck))
             {
                 parentCard.OverlayCardNo.Remove(card.NumberInDeck);
                 break;
             }
         }
     }
     if (toWhere.Equals(Deck) || toWhere.Equals(Orb))
     {
         card.FrontShown = false;
         card.Visible = false;
     }
     else
     {
         if (!((toWhere.Equals(Kizuna) || toWhere.Equals(KizunaUsed)) && (card.BelongedRegion().Equals(Kizuna) || card.BelongedRegion().Equals(KizunaUsed))))
         {
             card.FrontShown = true;
             card.Visible = true;
         }
     }
     if (!((toWhere.Equals(FrontField) || toWhere.Equals(BackField)) && (card.BelongedRegion().Equals(FrontField) || card.BelongedRegion().Equals(BackField))))
     {
         card.SolCounter = 0;
         card.LunaCounter = 0;
     }
     fromWhere.CardList.Remove(card);
     toWhere.CardList.Insert(NumberDes, card);
 }
Exemplo n.º 4
0
 public void DeOverlayCardToGrave(Card card, Card newtop)
 {
     bool isHorizontal = card.IsHorizontal;
     int pos = card.BelongedRegion().CardList.IndexOf(card);
     Region DesRegion = card.BelongedRegion();
     MoveCard(card, Grave);
     MoveCard(newtop, DesRegion, pos);
     foreach(int overlaycardnum in card.OverlayCardNo)
     {
         if(overlaycardnum != newtop.NumberInDeck)
         {
             newtop.OverlayCardNo.Add(overlaycardnum);
         }
     }
     card.OverlayCardNo.Clear();
     newtop.IsHorizontal = isHorizontal;
 }
Exemplo n.º 5
0
 public string GetTextOfMovingToRegion(Card card, string toWhere, bool IsCheckingRegion)
 {
     string text;
     if (Language == Language.Chinese)
     {
         if ((new List<string> { "Orb", "DeckShuffle", "DeckTop", "DeckBottom", "Hand" }).Contains(toWhere))
         {
             if (card.BelongedRegion().Equals(Player.Deck))
             {
                 if (!IsCheckingRegion)
                 {
                     text = "#将卡组顶牌";
                 }
                 else
                 {
                     text = "#将[卡组(" + (Player.Deck.CardList.IndexOf(card) + 1).ToString() + ")][" + card.CardName + "]";
                 }
             }
             else if (card.BelongedRegion().Equals(Player.Orb))
             {
                 text = "#将[宝玉区(" + (Player.Orb.CardList.IndexOf(card) + 1).ToString() + ")]";
             }
             else if (card.BelongedRegion().Equals(Player.Hand))
             {
                 text = "#将[手牌(" + (Player.Hand.CardList.IndexOf(card) + 1).ToString() + ")]";
             }
             else if (card.BelongedRegion().Equals(Player.FrontField) || card.BelongedRegion().Equals(Player.BackField) || card.BelongedRegion().Equals(Player.Grave) || card.BelongedRegion().Equals(Player.Kizuna) || card.BelongedRegion().Equals(Player.KizunaUsed) || card.BelongedRegion().Equals(Player.Support) || card.BelongedRegion().Equals(Player.Overlay))
             {
                 text = "#将[" + GetRegionNameInString(card.BelongedRegion()) + "][" + card.CardName + "]";
             }
             else
             {
                 text = "#将一张卡";
             }
         }
         else if (card.BelongedRegion().Equals(Player.Deck) || card.BelongedRegion().Equals(Player.Orb) || card.BelongedRegion().Equals(Player.Hand) || card.BelongedRegion().Equals(Player.FrontField) || card.BelongedRegion().Equals(Player.BackField) || card.BelongedRegion().Equals(Player.Grave) || card.BelongedRegion().Equals(Player.Kizuna) || card.BelongedRegion().Equals(Player.KizunaUsed) || card.BelongedRegion().Equals(Player.Support) || card.BelongedRegion().Equals(Player.Overlay))
         {
             text = "#将[" + GetRegionNameInString(card.BelongedRegion()) + "][" + card.CardName + "]";
         }
         else
         {
             text = "#将[" + card.CardName + "]";
         }
         switch (toWhere)
         {
             case "Orb":
                 text += "置于宝玉区";
                 break;
             case "DeckShuffle":
                 text += "加入卡组并切洗";
                 break;
             case "DeckTop":
                 text += "置于卡组顶端";
                 break;
             case "DeckBottom":
                 text += "置于卡组底端";
                 break;
             case "Hand":
                 text += "加入手牌";
                 break;
             case "Support":
                 text += "置于支援区";
                 break;
             case "Kizuna":
                 text += "置于羁绊区";
                 break;
             case "Grave":
                 text += "置于退避区";
                 break;
         }
         if (card.OverlayCardNo.Count > 0)
         {
             text += "(叠放卡送入退避区)。";
         }
         else
         {
             text += "。";
         }
     }
     else
     {
         if ((new List<string> { "Orb", "DeckShuffle", "DeckTop", "DeckBottom", "Hand" }).Contains(toWhere))
         {
             if (card.BelongedRegion().Equals(Player.Deck))
             {
                 if (!IsCheckingRegion)
                 {
                     text = "#Place the top card of Deck";
                 }
                 else
                 {
                     text = "#Place [Deck(" + (Player.Deck.CardList.IndexOf(card) + 1).ToString() + ")][" + card.CardName + "]";
                 }
             }
             else if (card.BelongedRegion().Equals(Player.Orb))
             {
                 text = "#Place [Orb(" + (Player.Orb.CardList.IndexOf(card) + 1).ToString() + ")]";
             }
             else if (card.BelongedRegion().Equals(Player.Hand))
             {
                 text = "#Place [Hand(" + (Player.Hand.CardList.IndexOf(card) + 1).ToString() + ")]";
             }
             else if (card.BelongedRegion().Equals(Player.FrontField) || card.BelongedRegion().Equals(Player.BackField) || card.BelongedRegion().Equals(Player.Grave) || card.BelongedRegion().Equals(Player.Kizuna) || card.BelongedRegion().Equals(Player.KizunaUsed) || card.BelongedRegion().Equals(Player.Support) || card.BelongedRegion().Equals(Player.Overlay))
             {
                 text = "#Place [" + GetRegionNameInString(card.BelongedRegion()) + "][" + card.CardName + "]";
             }
             else
             {
                 text = "#Place a card";
             }
         }
         else if (card.BelongedRegion().Equals(Player.Deck) || card.BelongedRegion().Equals(Player.Orb) || card.BelongedRegion().Equals(Player.Hand) || card.BelongedRegion().Equals(Player.FrontField) || card.BelongedRegion().Equals(Player.BackField) || card.BelongedRegion().Equals(Player.Grave) || card.BelongedRegion().Equals(Player.Kizuna) || card.BelongedRegion().Equals(Player.KizunaUsed) || card.BelongedRegion().Equals(Player.Support) || card.BelongedRegion().Equals(Player.Overlay))
         {
             text = "#Place [" + GetRegionNameInString(card.BelongedRegion()) + "][" + card.CardName + "]";
         }
         else
         {
             text = "#Place [" + card.CardName + "]";
         }
         switch (toWhere)
         {
             case "Orb":
                 text += " in Orb";
                 break;
             case "DeckShuffle":
                 text += " to Deck and shuffle";
                 break;
             case "DeckTop":
                 text += " on the Top of Deck";
                 break;
             case "DeckBottom":
                 text += " at the Bottom of Deck";
                 break;
             case "Hand":
                 text = text.Replace("Place", "Add");
                 text += " to Hand";
                 break;
             case "Support":
                 text += " in Support";
                 break;
             case "Kizuna":
                 text += " in Bond";
                 break;
             case "Grave":
                 text += " in Retreat";
                 break;
         }
         if (card.OverlayCardNo.Count > 0)
         {
             text += "(the other cards in the stack will be sent to Retreat).";
         }
         else
         {
             text += ".";
         }
     }
     return text;
 }
Exemplo n.º 6
0
        public void CardInfoRenew(Card thisCard)
        {
            try
            {
                pictureBoxCardInfo.Image = Image.FromFile(@"img/(" + CardData[thisCard.SerialNo][1] + ")" + CardData[thisCard.SerialNo][2] + ".jpg");
            }
            catch
            {
                try
                {
                    pictureBoxCardInfo.Image = Image.FromFile(@"img/back.jpg");
                }
                catch { }
            }
            string[] CardDataInfo = CardData[thisCard.SerialNo];
            string str = "";
            if (Language == Language.Chinese)
            {
                if (AppConfig.GetValue("CardInfoBrief") == "False")
                {
                    str += "日文卡名:" + CardDataInfo[3] + Environment.NewLine;
                    str += "中文卡名:" + CardDataInfo[4] + Environment.NewLine;
                    str += "阶级/兵种:" + CardDataInfo[7] + "/" + CardDataInfo[8] + Environment.NewLine;
                    str += "战斗力/支援力/射程:" + CardDataInfo[13] + "/" + CardDataInfo[14] + "/" + CardDataInfo[15] + Environment.NewLine;
                    if (CardDataInfo[6] != "" && CardDataInfo[6] != "-")
                    {
                        str += "出击/转职费用:" + CardDataInfo[5] + "/" + CardDataInfo[6] + Environment.NewLine;
                    }
                    else
                    {
                        str += "出击/转职费用:" + CardDataInfo[5] + "/-" + Environment.NewLine;
                    }
                    str += "势力:" + CardDataInfo[9] + Environment.NewLine;
                    str += "性别/武器/属性:" + CardDataInfo[10] + "/" + CardDataInfo[11] + "/";

                    if (CardDataInfo[12] == "")
                    {
                        str += "-" + Environment.NewLine;
                    }
                    else
                    {
                        str += CardDataInfo[12] + Environment.NewLine;
                    }
                    str += Environment.NewLine;
                    str += "能力:" + Environment.NewLine;
                }
                str += CardDataInfo[16].Replace("$$", Environment.NewLine) + Environment.NewLine;
                if (CardDataInfo[17] != "" && CardDataInfo[17] != "-")
                {
                    if (AppConfig.GetValue("CardInfoBrief") == "False")
                    {
                        str += "支援能力:" + Environment.NewLine;
                    }
                    str += CardDataInfo[17].Replace("$$", Environment.NewLine) + Environment.NewLine;
                }
                if (thisCard.OverlayCardNo.Count != 0)
                {
                    str += Environment.NewLine;
                    foreach (int CardNo in thisCard.OverlayCardNo)
                    {
                        Card OverlayedCard = thisCard.BelongedRegion().Controller.Overlay.SearchCard(CardNo);
                        if (OverlayedCard != null)
                        {
                            str += "叠放:" + OverlayedCard.CardName + Environment.NewLine;
                        }
                    }
                }
            }
            else
            {
                if (AppConfig.GetValue("CardInfoBrief") == "False")
                {
                    str += "Japanese cardname: " + CardDataInfo[3] + Environment.NewLine;
                    str += "English cardname: " + CardDataInfo[4] + Environment.NewLine;
                    str += "Class: " + CardDataInfo[7] + "/" + CardDataInfo[8] + Environment.NewLine;
                    str += "Attack/Support/Range: " + CardDataInfo[13] + "/" + CardDataInfo[14] + "/" + CardDataInfo[15] + Environment.NewLine;
                    if (CardDataInfo[6] != "" && CardDataInfo[6] != "-")
                    {
                        str += "Deploy/Promote Cost: " + CardDataInfo[5] + "/" + CardDataInfo[6] + Environment.NewLine;
                    }
                    else
                    {
                        str += "Deploy/Promote Cost: " + CardDataInfo[5] + "/-" + Environment.NewLine;
                    }
                    str += "Symbol: " + CardDataInfo[9] + Environment.NewLine;
                    str += "Gender/Weapon/Type: " + CardDataInfo[10] + "/" + CardDataInfo[11] + "/";

                    if (CardDataInfo[12] == "")
                    {
                        str += "-" + Environment.NewLine;
                    }
                    else
                    {
                        str += CardDataInfo[12] + Environment.NewLine;
                    }
                    str += Environment.NewLine;
                    str += "Skill: " + Environment.NewLine;
                }
                str += CardDataInfo[16].Replace("$$", Environment.NewLine) + Environment.NewLine;
                if (CardDataInfo[17] != "" && CardDataInfo[17] != "-")
                {
                    if (AppConfig.GetValue("CardInfoBrief") == "False")
                    {
                        str += "Support Skill: " + Environment.NewLine;
                    }
                    str += CardDataInfo[17].Replace("$$", Environment.NewLine) + Environment.NewLine;
                }
                if (thisCard.OverlayCardNo.Count != 0)
                {
                    str += Environment.NewLine;
                    foreach (int CardNo in thisCard.OverlayCardNo)
                    {
                        Card OverlayedCard = thisCard.BelongedRegion().Controller.Overlay.SearchCard(CardNo);
                        if (OverlayedCard != null)
                        {
                            str += "Stack: " + OverlayedCard.CardName + Environment.NewLine;
                        }
                    }
                }
            }

            //if (thisCard.Comments != "")
            //{
            //    str += Environment.NewLine;
            //    str += "实际战斗力:" + (thisCard.Power + thisCard.Comments).ToString() + Environment.NewLine;
            //}
            textBoxCardInfo.Text = str;
        }
Exemplo n.º 7
0
        public void SetCardToField(Card card, Region region)
        {
            int CardNoWithSameName = -1;
            card.FrontShown = true;
            card.IsHorizontal = false;
            Card specard = SpecialLevelUp(card);
            if (specard != null)
            {
                CardNoWithSameName = specard.NumberInDeck;
            }
            else
            {
                if (Player.SearchCardsOnField(card.UnitName).Count > 1)
                {
                    if (Language == Language.Chinese)
                    {
                        MessageBox.Show("战场上存在多张同名卡,请选择需要升级/转职的对象。", "存在同名卡", MessageBoxButtons.OK);
                    }
                    else
                    {
                        MessageBox.Show("There are several cards with same unitnames on field, please choose one to Lv Up/CC on.", "Same-name cards", MessageBoxButtons.OK);
                    }
                    SelectTargetCard selecttargetcard = new SelectTargetCard(Player, this, Player.SearchCardsOnField(card.UnitName));
                    if(DialogResult.OK==selecttargetcard.ShowDialog())
                    {
                        CardNoWithSameName = selecttargetcard.Target.NumberInDeck;
                    }
                }
                else if (Player.SearchCardsOnField(card.UnitName).Count == 1)
                {
                    CardNoWithSameName = Player.SearchCardsOnField(card.UnitName)[0].NumberInDeck;
                }
                else
                {
                    CardNoWithSameName = -1;
                }
            }
            if (Language == Language.Chinese)
            {
                if (CardNoWithSameName != -1)
                {
                    OverlayQues overlayques = new OverlayQues(this);
                    DialogResult Overlay = overlayques.ShowDialog();

                    if (Overlay == DialogResult.Yes)
                    {
                        Card OverlayedCard = Player.SearchCard(CardNoWithSameName);
                        msgProcessor.Send("Overlay", "#从[" + GetRegionNameInString(card.BelongedRegion()) + "]将[" + GetRegionNameInString(OverlayedCard.BelongedRegion()) + "][" + OverlayedCard.CardName + "]升级/转职为[" + card.CardName + "](Lv" + (OverlayedCard.OverlayCardNo.Count + 2).ToString() + ")。");
                        Player.OverlayCard(card, CardNoWithSameName);
                    }
                    else if (Overlay == DialogResult.No)
                    {
                        Card GrownCard = Player.SearchCard(CardNoWithSameName);
                        msgProcessor.Send("Grow", "#用[" + GetRegionNameInString(card.BelongedRegion()) + "][" + card.CardName + "]使[" + GetRegionNameInString(GrownCard.BelongedRegion()) + "][" + GrownCard.CardName + "]成长为Lv" + (GrownCard.OverlayCardNo.Count + 2).ToString() + "。");
                        Player.GrowCard(card, CardNoWithSameName);
                    }
                    else
                    {
                        msgProcessor.Send("Summon", "#从[" + GetRegionNameInString(card.BelongedRegion()) + "]将[" + card.CardName + "]出击到" + GetRegionNameInString(region) + "(已存在同角色名的单位)。");
                        Player.MoveCard(card, region);
                    }
                }
                else
                {
                    msgProcessor.Send("Summon", "#从[" + GetRegionNameInString(card.BelongedRegion()) + "]将[" + card.CardName + "]出击到" + GetRegionNameInString(region) + "。");
                    Player.MoveCard(card, region);
                }
            }
            else
            {
                if (CardNoWithSameName != -1)
                {
                    OverlayQues overlayques = new OverlayQues(this);
                    DialogResult Overlay = overlayques.ShowDialog();

                    if (Overlay == DialogResult.Yes)
                    {
                        Card OverlayedCard = Player.SearchCard(CardNoWithSameName);
                        msgProcessor.Send("Overlay", "#From [" + GetRegionNameInString(card.BelongedRegion()) + "] Level up / Class Change [" + GetRegionNameInString(OverlayedCard.BelongedRegion()) + "][" + OverlayedCard.CardName + "] to [" + card.CardName + "](Lv" + (OverlayedCard.OverlayCardNo.Count + 2).ToString() + ").");
                        Player.OverlayCard(card, CardNoWithSameName);
                    }
                    else if (Overlay == DialogResult.No)
                    {
                        Card GrownCard = Player.SearchCard(CardNoWithSameName);
                        msgProcessor.Send("Grow", "#Using [" + GetRegionNameInString(card.BelongedRegion()) + "][" + card.CardName + "] grow [" + GetRegionNameInString(GrownCard.BelongedRegion()) + "][" + GrownCard.CardName + "] to Lv" + (GrownCard.OverlayCardNo.Count + 2).ToString() + ".");
                        Player.GrowCard(card, CardNoWithSameName);
                    }
                    else
                    {
                        msgProcessor.Send("Summon", "#From [" + GetRegionNameInString(card.BelongedRegion()) + "]  deploy [" + card.CardName + "] to " + GetRegionNameInString(region) + "(unit with same name exists).");
                        Player.MoveCard(card, region);
                    }
                }
                else
                {
                    msgProcessor.Send("Summon", "#From [" + GetRegionNameInString(card.BelongedRegion()) + "] deploy [" + card.CardName + "] to " + GetRegionNameInString(region) + ".");
                    Player.MoveCard(card, region);
                }
            }
            msgProcessor.Send("Update", "");
            Renew();
        }