void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs) { var args = eventArgs as DiscardCardEventArgs; if (args.Source == null || args.Source == Owner || (args.Reason != DiscardReason.Discard && args.Reason != DiscardReason.Judge)) { return; } int answer = 0; var cardsToProcess = new List<Card>( from c in eventArgs.Cards where c.Suit == SuitType.Club select c); if (cardsToProcess.Count() > 0) { CardsMovement temp = new CardsMovement(); temp.Cards = new List<Card>(cardsToProcess); temp.To = new DeckPlace(null, DeckType.Discard); Game.CurrentGame.NotificationProxy.NotifyCardMovement(new List<CardsMovement>() { temp }); foreach (Card cc in cardsToProcess) { cc.PlaceOverride = new DeckPlace(null, DeckType.Discard); } } foreach (var c in cardsToProcess) { var prompt = new MultipleChoicePrompt("LuoYing", c); if (Owner.AskForMultipleChoice(prompt, Prompt.YesNoChoices, out answer) && answer == 1) { NotifySkillUse(); Game.CurrentGame.HandleCardTransferToHand(null, 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); } } }
void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs) { var args = eventArgs as DiscardCardEventArgs; if (args.Source == null || args.Source == Owner || (args.Reason != DiscardReason.Discard && args.Reason != DiscardReason.Judge)) { return; } int answer = 0; List<Card> cardsToProcess = new List<Card>(eventArgs.Cards); foreach (Card c in cardsToProcess) { if (c.Suit == SuitType.Club) { CardsMovement temp = new CardsMovement(); temp.Cards = new List<Card>(cardsToProcess); temp.To = new DeckPlace(null, DeckType.Discard); Game.CurrentGame.NotificationProxy.NotifyCardMovement(new List<CardsMovement>() { temp }); foreach (Card cc in cardsToProcess) { cc.PlaceOverride = new DeckPlace(null, DeckType.Discard); } break; } } foreach (Card c in cardsToProcess) { var prompt = new MultipleChoicePrompt("LuoYing", c); if (c.Suit == SuitType.Club && Game.CurrentGame.UiProxies[Owner].AskForMultipleChoice(prompt, Prompt.YesNoChoices, out answer) && answer == 0) { ActionLog log = new ActionLog(); log.GameAction = GameAction.None; log.SkillAction = this; log.Source = Owner; log.CardAction = c; Game.CurrentGame.NotificationProxy.NotifySkillUse(log); List<Card> cc = new List<Card>(); cc.Add(c); Game.CurrentGame.HandleCardTransferToHand(null, Owner, cc); eventArgs.Cards.Remove(c); } } }