private void Button_Confirm_Click(object sender, EventArgs e) { int x; if (Owner.Language == Language.Chinese) { switch (Type) { case "抽复数张卡": if (Int32.TryParse(textBox.Text, out x)) { if (x > 0 && x <= Owner.Player.Deck.CardList.Count) { Owner.Player.Draw(x); Owner.msgProcessor.Send("MultipleDraw", "#抽" + x.ToString() + "张卡。"); Owner.Renew(); Close(); } else if (x > Owner.Player.Deck.CardList.Count) { MessageBox.Show("卡组不足。", Text); textBox.Text = ""; } else { MessageBox.Show("请正确输入要抽卡的数量。", Text); textBox.Text = ""; } } else { MessageBox.Show("请正确输入要抽卡的数量。", Text); textBox.Text = ""; } break; case "复数羁绊卡右移": if (Int32.TryParse(textBox.Text, out x)) { if (x > 0 && x <= Owner.Player.Kizuna.CardList.Count) { for (int i = 0; i < x; i++) { Owner.Player.MoveCard(Owner.Player.Kizuna.CardList.Last(), Owner.Player.KizunaUsed); } Owner.msgProcessor.Send("MultipleDraw", "#右移" + x.ToString() + "张羁绊卡。"); Owner.Renew(); Close(); } else if (x > Owner.Player.Kizuna.CardList.Count) { MessageBox.Show("羁绊卡不足。", Text); textBox.Text = ""; } else { MessageBox.Show("请正确输入要移动的数量。", Text); textBox.Text = ""; } } else { MessageBox.Show("请正确输入要移动的数量。", Text); textBox.Text = ""; } break; case "将复数张顶牌置于退避区": if (Int32.TryParse(textBox.Text, out x)) { if (x > 0 && x <= Owner.Player.Deck.CardList.Count) { string temp = "#将卡组顶端的" + x.ToString() + "张牌置于退避区:"; for (int i = 0; i < x; i++) { temp += Environment.NewLine + "[" + Owner.Player.Deck.CardList[0].CardName + "]"; Owner.Player.MoveCard(Owner.Player.Deck, 0, Owner.Player.Grave); } Owner.msgProcessor.Send("MoveDeckTopCardsToGrave", temp); Owner.Renew(); Close(); } else if (x > Owner.Player.Deck.CardList.Count) { MessageBox.Show("卡组不足。", Text); textBox.Text = ""; } else { MessageBox.Show("请正确输入要置于退避区的顶牌数量。", Text); textBox.Text = ""; } } else { MessageBox.Show("请正确输入要置于退避区的顶牌数量。", Text); textBox.Text = ""; } break; case "查看复数张顶牌": if (Int32.TryParse(textBox.Text, out x)) { if (x > 0 && x <= Owner.Player.Deck.CardList.Count) { string temp = "#查看卡组顶端的" + x.ToString() + "张卡。"; Region tempRegion_CheckDeckTopCards = new Region(Owner.Player); Owner.Player.AllRegions.Add(tempRegion_CheckDeckTopCards); for (int i = 0; i < x; i++) { Card card = Owner.Player.Deck.CardList[0]; card.RemoveFromAny(); tempRegion_CheckDeckTopCards.CardList.Add(card); } Owner.msgProcessor.Send("CheckDeckTopCards", temp); Hide(); Owner.Activate(); using (CardSetView CheckDeckTopCards = new CardSetView(tempRegion_CheckDeckTopCards, "CheckDeckTopCards", Owner.Player, Owner)) { CheckDeckTopCards.Location = new Point(0, 0); CheckDeckTopCards.StartPosition = FormStartPosition.CenterParent; CheckDeckTopCards.ShowDialog(); } Owner.Renew(); Close(); } else if (x > Owner.Player.Deck.CardList.Count) { MessageBox.Show("卡组不足。", Text); textBox.Text = ""; } else { MessageBox.Show("请正确输入要查看的顶牌数量。", Text); textBox.Text = ""; } } else { MessageBox.Show("请正确输入要查看的顶牌数量。", Text); textBox.Text = ""; } break; } } else { switch (Type) { case "抽复数张卡": if (Int32.TryParse(textBox.Text, out x)) { if (x > 0 && x <= Owner.Player.Deck.CardList.Count) { Owner.Player.Draw(x); Owner.msgProcessor.Send("MultipleDraw", "#Draw " + x.ToString() + " cards."); Owner.Renew(); Close(); } else if (x > Owner.Player.Deck.CardList.Count) { MessageBox.Show("There are no enough cards in Deck.", Text); textBox.Text = ""; } else { MessageBox.Show("Pleaser enter a correct number.", Text); textBox.Text = ""; } } else { MessageBox.Show("Pleaser enter a correct number.", Text); textBox.Text = ""; } break; case "复数羁绊卡右移": if (Int32.TryParse(textBox.Text, out x)) { if (x > 0 && x <= Owner.Player.Kizuna.CardList.Count) { for (int i = 0; i < x; i++) { Owner.Player.MoveCard(Owner.Player.Kizuna.CardList.Last(), Owner.Player.KizunaUsed); } Owner.msgProcessor.Send("MultipleDraw", "#Count " + x.ToString() + " Bond cards."); Owner.Renew(); Close(); } else if (x > Owner.Player.Kizuna.CardList.Count) { MessageBox.Show("There are no enough Bond cards.", Text); textBox.Text = ""; } else { MessageBox.Show("Pleaser enter a correct number.", Text); textBox.Text = ""; } } else { MessageBox.Show("Pleaser enter a correct number.", Text); textBox.Text = ""; } break; case "将复数张顶牌置于退避区": if (Int32.TryParse(textBox.Text, out x)) { if (x > 0 && x <= Owner.Player.Deck.CardList.Count) { string temp = "#Send " + x.ToString() + " cards from the top of Deck to Retreat:"; for (int i = 0; i < x; i++) { temp += Environment.NewLine + "[" + Owner.Player.Deck.CardList[0].CardName + "]"; Owner.Player.MoveCard(Owner.Player.Deck, 0, Owner.Player.Grave); } Owner.msgProcessor.Send("MoveDeckTopCardsToGrave", temp); Owner.Renew(); Close(); } else if (x > Owner.Player.Deck.CardList.Count) { MessageBox.Show("There are no enough cards in Deck.", Text); textBox.Text = ""; } else { MessageBox.Show("Pleaser enter a correct number.", Text); textBox.Text = ""; } } else { MessageBox.Show("Pleaser enter a correct number.", Text); textBox.Text = ""; } break; case "查看复数张顶牌": if (Int32.TryParse(textBox.Text, out x)) { if (x > 0 && x <= Owner.Player.Deck.CardList.Count) { string temp = "#Check " + x.ToString() + " cards on the top of Deck."; Region tempRegion_CheckDeckTopCards = new Region(Owner.Player); Owner.Player.AllRegions.Add(tempRegion_CheckDeckTopCards); for (int i = 0; i < x; i++) { Card card = Owner.Player.Deck.CardList[0]; card.RemoveFromAny(); tempRegion_CheckDeckTopCards.CardList.Add(card); } Owner.msgProcessor.Send("CheckDeckTopCards", temp); Hide(); Owner.Activate(); using (CardSetView CheckDeckTopCards = new CardSetView(tempRegion_CheckDeckTopCards, "CheckDeckTopCards", Owner.Player, Owner)) { CheckDeckTopCards.Location = new Point(0, 0); CheckDeckTopCards.StartPosition = FormStartPosition.CenterParent; CheckDeckTopCards.ShowDialog(); } Owner.Renew(); Close(); } else if (x > Owner.Player.Deck.CardList.Count) { MessageBox.Show("There are no enough cards in Deck.", Text); textBox.Text = ""; } else { MessageBox.Show("Pleaser enter a correct number.", Text); textBox.Text = ""; } } else { MessageBox.Show("Pleaser enter a correct number.", Text); textBox.Text = ""; } break; } } }
private void 查看手牌ToolStripMenuItem_Click(object sender, EventArgs e) { CardSetView CheckHandRegion = new CardSetView(Player.Hand, "Hand", Player, this); CheckHandRegion.Owner = this; CheckHandRegion.ShowDialog(); CheckHandRegion.Dispose(); }
private void 查看退避区ToolStripMenuItem_Click(object sender, EventArgs e) { CardSetView CheckGraveRegion = new CardSetView(Player.Grave, "Grave", Player, this); CheckGraveRegion.Owner = this; CheckGraveRegion.ShowDialog(); CheckGraveRegion.Dispose(); }
private void 查看卡组ToolStripMenuItem_Click(object sender, EventArgs e) { msgProcessor.Send("CheckDeck", "#查看卡组。"); CardSetView CheckDeckRegion = new CardSetView(Player.Deck, "Deck", Player, this); CheckDeckRegion.Owner = this; CheckDeckRegion.ShowDialog(); CheckDeckRegion.Dispose(); }
private void 查看对手退避区ToolStripMenuItem_Click(object sender, EventArgs e) { if (Rival.Grave.CardList.Count > 0) { CardSetView CheckRivalGraveRegion = new CardSetView(Rival.Grave, "RivalGrave", Rival, this); CheckRivalGraveRegion.Owner = this; CheckRivalGraveRegion.ShowDialog(); CheckRivalGraveRegion.Dispose(); } }
private void 查看羁绊区ToolStripMenuItem_Click(object sender, EventArgs e) { if ((Player.Kizuna.CardList.Count + Player.KizunaUsed.CardList.Count) > 0) { CardSetView CheckKizunaRegion = new CardSetView(Player.Kizuna, "Kizuna", Player, this); CheckKizunaRegion.Owner = this; CheckKizunaRegion.ShowDialog(); CheckKizunaRegion.Dispose(); } else { if (Language == Language.Chinese) { MessageBox.Show("羁绊区为空。", "查看羁绊区"); } else { MessageBox.Show("Bond is empty.", "Check Bond"); } } }
private void 查看退避区ToolStripMenuItem_Click(object sender, EventArgs e) { if (Player.Grave.CardList.Count > 0) { CardSetView CheckGraveRegion = new CardSetView(Player.Grave, "Grave", Player, this); CheckGraveRegion.Owner = this; CheckGraveRegion.ShowDialog(); CheckGraveRegion.Dispose(); } else { if (Language == Language.Chinese) { MessageBox.Show("退避区为空。", "查看退避区"); } else { MessageBox.Show("Retreat is empty.", "Check Retreat"); } } }
private void 查看手牌ToolStripMenuItem_Click(object sender, EventArgs e) { if (Player.Hand.CardList.Count > 0) { CardSetView CheckHandRegion = new CardSetView(Player.Hand, "Hand", Player, this); CheckHandRegion.Owner = this; CheckHandRegion.ShowDialog(); CheckHandRegion.Dispose(); } else { if (Language == Language.Chinese) { MessageBox.Show("手牌为空。", "查看手牌"); } else { MessageBox.Show("There is no card in Hand.", "Check Hand"); } } }
private void 查看对手退避区ToolStripMenuItem_Click(object sender, EventArgs e) { if (Rival.Grave.CardList.Count > 0) { CardSetView CheckRivalGraveRegion = new CardSetView(Rival.Grave, "RivalGrave", Rival, this); CheckRivalGraveRegion.Owner = this; CheckRivalGraveRegion.ShowDialog(); CheckRivalGraveRegion.Dispose(); } else { if (Language == Language.Chinese) { MessageBox.Show("对手退避区为空。", "查看对手退避区"); } else { MessageBox.Show("Opponent's Retreat is empty.", "Check Opponent's Retreat"); } } }
private void 查看对手叠放卡ToolStripMenuItem_Click(object sender, EventArgs e) { if (contextMenuStrip_RivalCard.SourceControl != null) { Card thisCard = ((CardPic)CardPicClicked).thisCard; if (thisCard.OverlayCardNo.Count > 0) { Region tempRegion_Overlay = new Region(Rival); foreach (int CardNum in thisCard.OverlayCardNo) { tempRegion_Overlay.CardList.Add(Rival.SearchCard(CardNum)); } using (CardSetView ViewRivalOverlayCards = new CardSetView(tempRegion_Overlay, "ViewRivalOverlayCards", Rival, this)) { ViewRivalOverlayCards.Location = new Point(0, 0); ViewRivalOverlayCards.StartPosition = FormStartPosition.Manual; ViewRivalOverlayCards.ShowDialog(); } } } }
private void 查看卡组ToolStripMenuItem_Click(object sender, EventArgs e) { if (Player.Deck.CardList.Count > 0) { if (Language == Language.Chinese) { msgProcessor.Send("CheckDeck", "#查看卡组。"); } else { msgProcessor.Send("CheckDeck", "#Check Deck."); } CardSetView CheckDeckRegion = new CardSetView(Player.Deck, "Deck", Player, this); CheckDeckRegion.Owner = this; CheckDeckRegion.ShowDialog(); CheckDeckRegion.Dispose(); } else { if (Language == Language.Chinese) { MessageBox.Show("卡组为空。", "查看卡组"); } else { MessageBox.Show("Deck is empty.", "Check Deck"); } } }
private void buttonGameOn_Click(object sender, EventArgs e) { Reset(); SelectHero(); string HeroSerialNo; buttonGameOn.Visible = false; buttonTurnStart.Visible = true; buttonTurnEnd.Visible = true; buttonUseKizuna.Visible = true; buttonSupport.Visible = true; button_CriticalAttack.Visible = true; button_Miss.Visible = true; buttonGameOn.Enabled = false; 游戏开始ToolStripMenuItem.Enabled = false; 动作ToolStripMenuItem.Enabled = true; 导出场面信息ToolStripMenuItem.Enabled = true; GameOn = true; HeroSerialNo = Player.Deck.CardList[HeroNum].SerialNo; Player.MoveCard(Player.Deck, HeroNum, Player.FrontField); Player.FrontField.CardList[0].FrontShown = false; Player.Deck.Shuffle(); Player.Draw(6); Renew(); if (Language == Language.Chinese) { msgProcessor.Send("GameOn", "#抽取初始手牌。"); } else { msgProcessor.Send("GameOn", "#Draw opening hands."); } Renew(); using (CardSetView StartGameHandCheck = new CardSetView(Player.Hand, "StartGameHandCheck", Player, this)) { StartGameHandCheck.Location = new Point(0, 0); StartGameHandCheck.StartPosition = FormStartPosition.Manual; StartGameHandCheck.ShowDialog(); } for (int i = 0; i < 5; i++) { Player.MoveCard(Player.Deck, 0, Player.Orb); } Player.FrontField.CardList[0].FrontShown = true; if (Language == Language.Chinese) { msgProcessor.Send("GameOn", "#游戏开始。主人公为[" + CardData[HeroSerialNo][4] + "]。"); } else { msgProcessor.Send("GameOn", "#Game starts. Main Character is [" + CardData[HeroSerialNo][4] + "]."); } Renew(); }