当前位置: 首页>>代码示例>>C#>>正文


C# Player.AskForMultipleChoice方法代码示例

本文整理汇总了C#中Sanguosha.Core.Players.Player.AskForMultipleChoice方法的典型用法代码示例。如果您正苦于以下问题:C# Player.AskForMultipleChoice方法的具体用法?C# Player.AskForMultipleChoice怎么用?C# Player.AskForMultipleChoice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sanguosha.Core.Players.Player的用法示例。


在下文中一共展示了Player.AskForMultipleChoice方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

 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);
         }
     }
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:55,代码来源:YinLi.cs

示例2: Run

 void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     foreach (Card c in eventArgs.Cards)
     {
         if (c.HistoryPlace1.DeckType == DeckType.Equipment && c.HistoryPlace1.Player == Owner)
         {
             if (Owner.LostHealth == 0)
             {
                 if (AskForSkillUse())
                 {
                     Game.CurrentGame.DrawCards(Owner, 2);
                 }
             }
             else
             {
                 int answer;
                 if (Owner.AskForMultipleChoice(new MultipleChoicePrompt("XiaoJi"), new List<OptionPrompt>() { OptionPrompt.NoChoice, new OptionPrompt("MoPai"), new OptionPrompt("HuiFu") }, out answer))
                 {
                     NotifySkillUse(new List<Player>());
                     if (answer == 1)
                     {
                         Game.CurrentGame.DrawCards(Owner, 2);
                     }
                     if (answer == 2)
                     {
                         Game.CurrentGame.RecoverHealth(Owner, Owner, 1);
                     }
                 }
             }
         }
     }
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:32,代码来源:XiaoJi.cs

示例3: Run

 public void Run(Player owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     Trigger tri = new Trigger();
     int answer = 0;
     List<OptionPrompt> JiangChiQuestion = new List<OptionPrompt>();
     JiangChiQuestion.Add(Prompt.NoChoice);
     JiangChiQuestion.Add(new OptionPrompt("JiangChi1"));
     JiangChiQuestion.Add(new OptionPrompt("JiangChi2"));
     owner.AskForMultipleChoice(new MultipleChoicePrompt("JiangChi"), JiangChiQuestion, out answer);
     if (answer == 0)
     {
         return;
     }
     NotifySkillUse(new List<Player>());
     if (answer == 1)
     {
         owner[Player.DealAdjustment]++;
         tri = new JiangChi1(owner);
         Game.CurrentGame.RegisterTrigger(GameEvent.PlayerCanUseCard, tri);
         Game.CurrentGame.RegisterTrigger(GameEvent.PlayerCanPlayCard, tri);
     }
     else
     {
         owner[Sha.AdditionalShaUsable]++;
         owner[Player.DealAdjustment]--;
         tri = new JiangChi2(owner);
         Game.CurrentGame.RegisterTrigger(Sha.PlayerShaTargetValidation, tri);
     }
     Trigger triRemoval = new JiangChiRemoval(owner, tri, answer == 1);
     Game.CurrentGame.RegisterTrigger(GameEvent.PhasePostEnd, triRemoval);
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:31,代码来源:JiangChi.cs

示例4: Run

 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);
         }
     }
 }
开发者ID:pxoylngx,项目名称:sgs,代码行数:34,代码来源:LuoYing.cs

示例5: Run

 void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     Owner[FenYong.FenYongStatus] = 0;
     int answer = 0;
     Player current = Game.CurrentGame.CurrentPlayer;
     int choiceCount = Owner.LostHealth;
     int currentPlayerCardsCount = current.HandCards().Count + current.Equipments().Count();
     List<Player> shaCheck = Game.CurrentGame.AlivePlayers;
     shaCheck.Remove(Owner);
     bool canUseSha = Game.CurrentGame.PlayerCanBeTargeted(Owner, shaCheck, new Card() { Place = new DeckPlace(Owner, DeckType.None), Type = new Sha() });
     if (canUseSha)
     {
         List<OptionPrompt> prompts = new List<OptionPrompt>();
         prompts.Add(new OptionPrompt("XueHenQiPai", current, choiceCount));
         prompts.Add(new OptionPrompt("XueHenSha"));
         Owner.AskForMultipleChoice(new MultipleChoicePrompt("XueHen"), prompts, out answer);
     }
     if (answer == 0)
     {
         XueHenEffect = 0;
         NotifySkillUse();
         if (currentPlayerCardsCount == 0) return;
         List<Card> toDiscard = new List<Card>();
         if (currentPlayerCardsCount <= choiceCount)
         {
             toDiscard.AddRange(current.HandCards());
             toDiscard.AddRange(current.Equipments());
         }
         else
         {
             List<List<Card>> choiceAnswer;
             List<DeckPlace> sourcePlace = new List<DeckPlace>();
             sourcePlace.Add(new DeckPlace(current, DeckType.Hand));
             sourcePlace.Add(new DeckPlace(current, DeckType.Equipment));
             if (!Owner.AskForCardChoice(new CardChoicePrompt("XueHen", current, Owner),
                 sourcePlace,
                 new List<string>() { "QiPaiDui" },
                 new List<int>() { choiceCount },
                 new RequireCardsChoiceVerifier(choiceCount),
                 out choiceAnswer,
                 null,
                 CardChoiceCallback.GenericCardChoiceCallback))
             {
                 choiceAnswer = new List<List<Card>>();
                 choiceAnswer.Add(Game.CurrentGame.PickDefaultCardsFrom(new List<DeckPlace>() { new DeckPlace(current, DeckType.Hand), new DeckPlace(current, DeckType.Equipment) }, choiceCount));
             }
             toDiscard = choiceAnswer[0];
         }
         Game.CurrentGame.HandleCardDiscard(current, toDiscard);
     }
     else
     {
         XueHenEffect = 1;
         NotifySkillUse();
         Owner[Sha.NumberOfShaUsed]--;
         Sha.UseDummyShaTo(Owner, null, new RegularSha(), new CardUsagePrompt("XueHen"), XueHenSha);
     }
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:58,代码来源:XueHen.cs

示例6: OnJudgeBegin

 void OnJudgeBegin(Player player, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     Card c = Game.CurrentGame.Decks[eventArgs.Source, DeckType.JudgeResult].Last();
     int answer = 0;
     player.AskForMultipleChoice(new MultipleChoicePrompt("ZhenLie", c.Suit, c.Rank), OptionPrompt.YesNoChoices, out answer);
     if (answer == 1)
     {
         NotifySkillUse(new List<Player>());
         Game.CurrentGame.SyncImmutableCardAll(Game.CurrentGame.PeekCard(0));
         Card c1 = Game.CurrentGame.DrawCard();
         new GuiCai().ReplaceJudgementCard(player, eventArgs.Source, c1, this);
     }
 }
开发者ID:kingling,项目名称:sgs,代码行数:13,代码来源:ZhenLie.cs

示例7: Run

        void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
        {
            foreach (Card c in eventArgs.Cards)
            {
                if (c.HistoryPlace1.DeckType == DeckType.Equipment && c.HistoryPlace1.Player == Owner)
                {
                    if (AskForSkillUse())
                    {
                        NotifySkillUse(new List<Player>());
                        int answer = 0;
                        Owner.AskForMultipleChoice(new MultipleChoicePrompt("XuanFeng"), new List<OptionPrompt>() { new OptionPrompt("XuanFengChuSha"), new OptionPrompt("XuanFengShangHai") }, out answer);
                        if (answer == 0)
                        {
                            ISkill skill;
                            List<Card> cards;
                            List<Player> players;
                            if (Owner.AskForCardUsage(new CardUsagePrompt("XuanFeng1"), new XuanFeng1Verifier(),
                                out skill, out cards, out players))
                            {
                                try
                                {
                                    GameEventArgs args = new GameEventArgs();
                                    Owner[Sha.NumberOfShaUsed]--;
                                    args.Source = Owner;
                                    args.Targets = new List<Player>(players);
                                    args.Skill = new XuanFengShaComposerSkill();
                                    args.Cards = cards;
                                    Game.CurrentGame.Emit(GameEvent.CommitActionToTargets, args);
                                }
                                catch (TriggerResultException e)
                                {
                                    Trace.Assert(e.Status == TriggerResult.Retry);
                                    continue;
                                }
                            }
                        }
                        else
                        {
                            ISkill skill;
                            List<Card> cards;
                            List<Player> players;
                            if (Owner.AskForCardUsage(new CardUsagePrompt("XuanFeng2"), new XuanFeng2Verifier(), out skill, out cards, out players))
                            {
                                Game.CurrentGame.DoDamage(Owner, players[0], 1, DamageElement.None, null, null);
                            }

                        }
                    }
                }
            }
        }
开发者ID:pxoylngx,项目名称:sgs,代码行数:51,代码来源:XuanFeng.cs

示例8: Run

 void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     int answer;
     if (Owner.AskForMultipleChoice(new MultipleChoicePrompt("ManYi"), OptionPrompt.YesNoChoices, out answer) && answer == 1)
     {
         NotifySkillUse();
         GameEventArgs args = new GameEventArgs();
         args.Source = Owner;
         args.Targets = new List<Player>();
         args.Skill = new CardWrapper(Owner, new NanManRuQin(), false);
         args.Cards = new List<Card>();
         Game.CurrentGame.Emit(GameEvent.CommitActionToTargets, args);
     }
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:14,代码来源:ManYi.cs

示例9: En

 public void En(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     foreach (Player source in enSources)
     {
         int answer = 0;
         Owner.AskForMultipleChoice(new MultipleChoicePrompt("EnYuan", source), OptionPrompt.YesNoChoices, out answer);
         if (answer == 1)
         {
             Owner[EnYuanEffect] = 0;
             NotifySkillUse();
             Game.CurrentGame.DrawCards(source, 1);
         }
     }
 }
开发者ID:h1398123,项目名称:sgs,代码行数:14,代码来源:EnYuan.cs

示例10: Process

        protected override void Process(Player source, Player dest, ICard card, ReadOnlyCard readonlyCard, GameEventArgs inResponseTo)
        {
            if (source.IsDead) return;
            if (dest.HandCards().Count + dest.Equipments().Count == 0) return; // ShunChai -> WuXie(from target) -> WuXie(soemone else) -> target has no card
            List<string> resultDeckPlace = new List<string>();
            resultDeckPlace.Add("GuoHeChaiQiao");
            List<int> resultDeckMax = new List<int>();
            resultDeckMax.Add(1);
            List<List<Card>> answer;
            bool doHandCard = true;
            if (dest.Equipments().Count != 0)
            {
                int result = 0;
                source.AskForMultipleChoice(new MultipleChoicePrompt("GuoHeChaiQiao2"), new List<OptionPrompt>() { new OptionPrompt("ShouPai"), new OptionPrompt("ZhuangBeiPai") }, out result);
                if (result == 1) doHandCard = false;
            }
            if (doHandCard)
            {
                Game.CurrentGame.SyncImmutableCards(source, Game.CurrentGame.Decks[dest, DeckType.Hand]);
                Game.CurrentGame.HandCardVisibility[source].Add(dest);
                var places = new List<DeckPlace>() { new DeckPlace(dest, DeckType.Hand) };
                if (!source.AskForCardChoice(new CardChoicePrompt("GuoHeChaiQiao2"), places, resultDeckPlace, resultDeckMax, new RequireOneCardChoiceVerifier(true), out answer))
                {
                    Trace.TraceInformation("Player {0} Invalid answer", source.Id);
                    answer = new List<List<Card>>();
                    answer.Add(Game.CurrentGame.PickDefaultCardsFrom(places));
                }
                foreach (Card c in dest.HandCards()) Game.CurrentGame.HideHandCard(c);
                Game.CurrentGame.HandCardVisibility[source].Remove(dest);
                Game.CurrentGame.HandleCardDiscard(dest, answer[0]);
            }
            else
            {
                var places = new List<DeckPlace>() { new DeckPlace(dest, DeckType.Equipment) };
                if (!source.AskForCardChoice(new CardChoicePrompt("GuoHeChaiQiao2"), places, resultDeckPlace, resultDeckMax, new RequireOneCardChoiceVerifier(true), out answer))
                {
                    Trace.TraceInformation("Player {0} Invalid answer", source.Id);
                    answer = new List<List<Card>>();
                    answer.Add(Game.CurrentGame.PickDefaultCardsFrom(places));
                }
                Game.CurrentGame.HandleCardDiscard(dest, answer[0]);

            }
        }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:44,代码来源:GuoHeChaiQiao2.cs

示例11: Run

 void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     Owner[FenYong.FenYongStatus] = 0;
     int answer = 0;
     Player current = Game.CurrentGame.CurrentPlayer;
     int choiceCount = Owner.LostHealth;
     int currentPlayerCardsCount = current.HandCards().Count + current.Equipments().Count();
     List<OptionPrompt> prompts = new List<OptionPrompt>();
     prompts.Add(new OptionPrompt("XueHenQiPai", current, choiceCount));
     prompts.Add(new OptionPrompt("XueHenSha"));
     Owner.AskForMultipleChoice(new MultipleChoicePrompt("XueHen"), prompts, out answer);
     if (answer == 0)
     {
         Owner[XueHenEffect] = 0;
         NotifySkillUse();
         if (currentPlayerCardsCount <= choiceCount)
         {
             List<Card> cards = new List<Card>();
             cards.AddRange(current.HandCards());
             cards.AddRange(current.Equipments());
             Game.CurrentGame.HandleCardDiscard(current, cards);
             return;
         }
         List<List<Card>> choiceAnswer;
         List<DeckPlace> sourcePlace = new List<DeckPlace>();
         sourcePlace.Add(new DeckPlace(current, DeckType.Hand));
         sourcePlace.Add(new DeckPlace(current, DeckType.Equipment));
         if (!Owner.AskForCardChoice(new CardChoicePrompt("XueHen", current, Owner),
             sourcePlace,
             new List<string>() { "QiPaiDui" },
             new List<int>() { choiceCount },
             new RequireCardsChoiceVerifier(choiceCount),
             out choiceAnswer,
             null,
             CardChoiceCallback.GenericCardChoiceCallback))
         {
             choiceAnswer = new List<List<Card>>();
             choiceAnswer.Add(Game.CurrentGame.PickDefaultCardsFrom(new List<DeckPlace>() { new DeckPlace(current, DeckType.Hand), new DeckPlace(current, DeckType.Equipment) }, choiceCount));
         }
         Game.CurrentGame.HandleCardDiscard(current, choiceAnswer[0]);
     }
     else
     {
         ISkill skill;
         List<Card> cards;
         List<Player> players;
         if (!Owner.AskForCardUsage(new CardUsagePrompt("XueHen"), new XueHenShaVerifier(), out skill, out cards, out players))
         {
             players = new List<Player>();
             List<Player> nPlayers = Game.CurrentGame.AlivePlayers;
             players.Add(nPlayers[0]);
         }
         Owner[XueHenEffect] = 1;
         NotifySkillUse(players);
         GameEventArgs args = new GameEventArgs();
         Owner[Sha.NumberOfShaUsed]--;
         args.Source = Owner;
         args.Targets = players;
         args.Skill = new CardWrapper(Owner, new RegularSha());
         Game.CurrentGame.Emit(GameEvent.CommitActionToTargets, args);
     }
 }
开发者ID:h1398123,项目名称:sgs,代码行数:62,代码来源:XueHen.cs

示例12: Run1

 void Run1(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     MultipleChoicePrompt prompt;
     List<OptionPrompt> options = new List<OptionPrompt>();
     OptionPrompt option1 = new OptionPrompt("MouKuiMoPai");
     int i = 0;
     foreach (var target in eventArgs.Targets)
     {
         options.Clear();
         options.Add(OptionPrompt.NoChoice);
         options.Add(option1);
         options.Add(new OptionPrompt("MouKuiQiZhi", target));
         bool isNaked = target.HandCards().Count + target.Equipments().Count == 0;
         prompt = isNaked ? new MultipleChoicePrompt("MouKuiDrawCardOnly") : new MultipleChoicePrompt("MouKui");
         int answer = 0;
         Owner.AskForMultipleChoice(prompt, isNaked ? OptionPrompt.YesNoChoices : options, out answer);
         if (answer == 0) { i++; continue; }
         MouKuiEffect = 0;
         NotifySkillUse();
         if (answer == 1)
         {
             Game.CurrentGame.DrawCards(Owner, 1);
         }
         else
         {
             Card theCard = Game.CurrentGame.SelectACardFrom(target, Owner, new CardChoicePrompt("MouKui", target, Owner), "QiPaiDui");
             Game.CurrentGame.HandleCardDiscard(target, new List<Card>() { theCard });
         }
         eventArgs.ReadonlyCard[MouKuiCheck[target]] |= (1 << i);
         i++;
     }
 }
开发者ID:kingling,项目名称:sgs,代码行数:32,代码来源:MouKui.cs


注:本文中的Sanguosha.Core.Players.Player.AskForMultipleChoice方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。