protected void Run(Player owner, GameEvent gameEvent, GameEventArgs eventArgs) { var args = eventArgs as DiscardCardEventArgs; List <Card> cardsToProcess = new List <Card>(eventArgs.Cards); foreach (Card c in cardsToProcess) { var prompt = new MultipleChoicePrompt("ZongXuan", c); int answer = 0; if (Owner.AskForMultipleChoice(prompt, Prompt.YesNoChoices, out answer) && answer == 1) { Game.CurrentGame.InsertBeforeDeal(owner, new List <Card>() { c }); eventArgs.Cards.Remove(c); } } }
void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs) { var args = eventArgs as DiscardCardEventArgs; if (Game.CurrentGame.CurrentPlayer == Owner || args.Source == null || args.Source == Owner || (args.Reason != DiscardReason.Discard)) { return; } var cardsToProcess = new List <Card>( from c in eventArgs.Cards where c.Type.BaseCategory() == CardCategory.Equipment && (c.Place.DeckType == DeckType.Hand || c.Place.DeckType == DeckType.Equipment) select c); if (cardsToProcess.Count() > 0) { CardsMovement temp = new CardsMovement(); temp.Cards = new List <Card>(cardsToProcess); temp.To = new DeckPlace(null, DeckType.Discard); foreach (Card cc in cardsToProcess) { cc.PlaceOverride = new DeckPlace(null, DeckType.Discard); } Game.CurrentGame.NotificationProxy.NotifyCardMovement(new List <CardsMovement>() { temp }); } else { return; } List <OptionPrompt> prompts = new List <OptionPrompt>(); if (cardsToProcess.Count > 1) { prompts.Add(OptionPrompt.NoChoice); prompts.Add(new OptionPrompt("YinLiQuanBu")); prompts.Add(new OptionPrompt("YinLiBuFen")); } else { prompts.AddRange(OptionPrompt.YesNoChoices); } int choiceIndex = 0; Owner.AskForMultipleChoice(new MultipleChoicePrompt(Prompt.SkillUseYewNoPrompt, this), prompts, out choiceIndex); if (choiceIndex == 0) { return; } if (choiceIndex == 1) { NotifySkillUse(); } foreach (var c in cardsToProcess) { var prompt = new MultipleChoicePrompt("YinLi", c); int answer = 0; if (choiceIndex == 1 || Owner.AskForMultipleChoice(prompt, Prompt.YesNoChoices, out answer) && answer == 1) { if (choiceIndex == 2) { NotifySkillUse(); } c.Log = new ActionLog(); c.Log.SkillAction = this; CardsMovement temp = new CardsMovement(); temp.Cards.Add(c); temp.To = new DeckPlace(null, YinLiDeck); c.PlaceOverride = new DeckPlace(null, DeckType.Discard); Game.CurrentGame.NotificationProxy.NotifyCardMovement(new List <CardsMovement>() { temp }); c.Log = new ActionLog(); Game.CurrentGame.HandleCardTransferToHand(c.Owner, Owner, new List <Card>() { c }, new MovementHelper() { IsFakedMove = true, AlwaysShowLog = true }); eventArgs.Cards.Remove(c); } } }