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


C# Games.CardsMovement类代码示例

本文整理汇总了C#中Sanguosha.Core.Games.CardsMovement的典型用法代码示例。如果您正苦于以下问题:C# CardsMovement类的具体用法?C# CardsMovement怎么用?C# CardsMovement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CardsMovement类属于Sanguosha.Core.Games命名空间,在下文中一共展示了CardsMovement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

 void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     ISkill skill;
     List<Card> cards;
     List<Player> players;
     List<Card> originalCards = new List<Card>(Game.CurrentGame.Decks[Owner, QiXing.QiXingDeck]);
     int qxCount = Game.CurrentGame.Decks[Owner, QiXing.QiXingDeck].Count;
     // hack the cards to owner's hand. do not trigger anything
     CardsMovement move = new CardsMovement();
     move.Cards = new List<Card>(Game.CurrentGame.Decks[Owner, QiXing.QiXingDeck]);
     move.To = new DeckPlace(Owner, DeckType.Hand);
     move.Helper.IsFakedMove = true;
     Game.CurrentGame.MoveCards(move);
     if (Game.CurrentGame.UiProxies[Owner].AskForCardUsage(new CardUsagePrompt("KuangFeng"), new KuangFengVerifier(originalCards), out skill, out cards, out players))
     {
         NotifySkillUse(players);
         kuangfengTarget = players[0];
         kuangfengTarget[KuangFengMark] = 1;
         originalCards.Remove(cards[0]);
         Game.CurrentGame.HandleCardDiscard(null, cards);
     }
     move.Cards = new List<Card>(originalCards);
     move.To = new DeckPlace(Owner, QiXing.QiXingDeck);
     Game.CurrentGame.MoveCards(move);
 }
开发者ID:pxoylngx,项目名称:sgs,代码行数:25,代码来源:KuangFeng.cs

示例2: BuQu

 public BuQu()
 {
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             DeckType bq = new PrivateDeckType("BuQu", true);
             if (p.Health > 0 && Game.CurrentGame.Decks[Owner, bq].Count > 0)
             {
                 int toDraw = Game.CurrentGame.Decks[Owner, bq].Count - Math.Max(0, -Owner.Health);
                 while (toDraw-- > 0)
                 {
                     Card c1 = Game.CurrentGame.Decks[Owner, bq][Game.CurrentGame.Decks[Owner, bq].Count - 1];
                     CardsMovement move = new CardsMovement();
                     move.Cards = new List<Card>() { c1 };
                     move.To = new DeckPlace(Owner, bq);
                     Game.CurrentGame.MoveCards(move);
                 }
             }
             return p.Health <= 0;
         },
         Run,
         TriggerCondition.OwnerIsTarget
     ) { Type = TriggerType.Skill };
     Triggers.Add(GameEvent.AfterHealthChanged, trigger);
     IsAutoInvoked = null;
 }
开发者ID:maplegh,项目名称:sgs,代码行数:27,代码来源:BuQu.cs

示例3: Activate

 public override void Activate(Player p, Card c)
 {
     while (true)
     {
         GameEventArgs args = new GameEventArgs();
         args.Source = null;
         args.Targets = new List<Player>() { p };
         args.Card = c;
         args.ReadonlyCard = new ReadOnlyCard(c);
         try
         {
             Game.CurrentGame.Emit(GameEvent.CardUsageBeforeEffected, args);
         }
         catch (TriggerResultException e)
         {
             Trace.Assert(e.Status == TriggerResult.End);
             break;
         }
         ReadOnlyCard result = Game.CurrentGame.Judge(p, null, c, (judgeResultCard) => { return judgeResultCard.Suit != SuitType.Heart; });
         if (result.Suit != SuitType.Heart)
         {
             var theTrigger = new LeBuSiShuTrigger() { Priority = int.MaxValue };
             theTrigger.Owner = p;
             Game.CurrentGame.RegisterTrigger(GameEvent.PhaseOutEvents[TurnPhase.Draw], theTrigger);
         }
         break;
     }
     CardsMovement move = new CardsMovement();
     move.Cards = new List<Card>();
     move.Cards.Add(c);
     move.To = new DeckPlace(null, DeckType.Discard);
     Game.CurrentGame.MoveCards(move);
 }
开发者ID:maplegh,项目名称:sgs,代码行数:33,代码来源:LeBuSiShu.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: Draw

 protected void Draw(Player player, GameEvent gameEvent, GameEventArgs eventArgs, List<Card> cards, List<Player> players)
 {
     Game.CurrentGame.SortByOrderOfComputation(Game.CurrentGame.CurrentPlayer, players);
     StagingDeckType QiaoBianDeck = new StagingDeckType("QiaoBian");
     CardsMovement move = new CardsMovement();
     move.Helper.IsFakedMove = true;
     foreach (Player p in players)
     {
         if (p.HandCards().Count == 0) continue;
         List<List<Card>> answer;
         var places = new List<DeckPlace>() { new DeckPlace(p, DeckType.Hand) };
         if (!Game.CurrentGame.UiProxies[Owner].AskForCardChoice(new CardChoicePrompt("QiaoBian", Owner), places,
             new List<string>() { "QiaoBian" }, new List<int>() { 1 }, new RequireOneCardChoiceVerifier(true), out answer))
         {
             answer = new List<List<Card>>();
             answer.Add(Game.CurrentGame.PickDefaultCardsFrom(places));
         }
         move.Cards = answer[0];
         move.To = new DeckPlace(p, QiaoBianDeck);
         Game.CurrentGame.MoveCards(move, false, Core.Utils.GameDelayTypes.None);
         Game.CurrentGame.PlayerLostCard(p, answer[0]);
     }
     move.Cards.Clear();
     move.Helper.IsFakedMove = false;
     move.To = new DeckPlace(Owner, DeckType.Hand);
     foreach (Player p in players)
     {
         move.Cards.AddRange(Game.CurrentGame.Decks[p, QiaoBianDeck]);
     }
     cards = new List<Card>(move.Cards);
     Game.CurrentGame.MoveCards(move);
     Game.CurrentGame.PlayerAcquiredCard(Owner, cards);
     Game.CurrentGame.NotificationProxy.NotifyActionComplete();
 }
开发者ID:kingling,项目名称:sgs,代码行数:34,代码来源:QiaoBian.cs

示例6: Process

 public override void Process(Player source, List<Player> dests, ICard card, ReadOnlyCard readonlyCard)
 {
     DeckType wuguDeck = new DeckType("WuGu");
     DeckType wuguFakeDeck = new DeckType("WuGuFake");
     CardsMovement move = new CardsMovement();
     move.Cards = new List<Card>();
     for (int i = 0; i < dests.Count; i++)
     {
         Game.CurrentGame.SyncImmutableCardAll(Game.CurrentGame.PeekCard(0));
         Card c = Game.CurrentGame.DrawCard();
         move.Cards.Add(c);
     }
     move.To = new DeckPlace(null, wuguDeck);
     Game.CurrentGame.MoveCards(move);
     fakeMapping = new Dictionary<Card, Card>();
     Game.CurrentGame.Decks[null, wuguFakeDeck].Clear();
     foreach (var c in Game.CurrentGame.Decks[null, wuguDeck])
     {
         var faked = new Card(c);
         faked.Place = new DeckPlace(null, wuguFakeDeck);
         Game.CurrentGame.Decks[null, wuguFakeDeck].Add(faked);
         fakeMapping.Add(faked, c);
     }
     Game.CurrentGame.NotificationProxy.NotifyWuGuStart(new DeckPlace(null, wuguFakeDeck));
     base.Process(source, dests, card, readonlyCard);
     Game.CurrentGame.NotificationProxy.NotifyWuGuEnd();
     Game.CurrentGame.Decks[null, wuguFakeDeck].Clear();
     if (Game.CurrentGame.Decks[null, wuguDeck].Count > 0)
     {
         move = new CardsMovement();
         move.Cards = new List<Card>(Game.CurrentGame.Decks[null, wuguDeck]);
         move.To = new DeckPlace(null, DeckType.Discard);
         Game.CurrentGame.MoveCards(move);
     }
 }
开发者ID:pxoylngx,项目名称:sgs,代码行数:35,代码来源:WuGuFengDeng.cs

示例7: Activate

 public override void Activate(Player p, Card c)
 {
     while (true)
     {
         GameEventArgs args = new GameEventArgs();
         args.Source = null;
         args.Targets = new List<Player>() { p };
         args.Card = c;
         args.ReadonlyCard = new ReadOnlyCard(c);
         try
         {
             Game.CurrentGame.Emit(GameEvent.CardUsageBeforeEffected, args);
         }
         catch (TriggerResultException e)
         {
             Trace.Assert(e.Status == TriggerResult.End);
             break;
         }
         ReadOnlyCard result = Game.CurrentGame.Judge(p, null, c, (judgeResultCard) => { return judgeResultCard.Suit != SuitType.Heart; });
         if (result.Suit != SuitType.Heart)
         {
             Game.CurrentGame.PhasesSkipped.Add(TurnPhase.Play);
         }
         break;
     }
     CardsMovement move = new CardsMovement();
     move.Cards = new List<Card>();
     move.Cards.Add(c);
     move.To = new DeckPlace(null, DeckType.Discard);
     move.Helper.IsFakedMove = true;
     Game.CurrentGame.MoveCards(move, false, Core.Utils.GameDelays.None);
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:32,代码来源:LeBuSiShu.cs

示例8: Run

        void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
        {
            DeckType HuoShouDeck = DeckType.Register("HuoShou");

            CardsMovement move = new CardsMovement();
            move.Cards = new List<Card>();
            int toDraw = Owner.LostHealth;
            for (int i = 0; i < toDraw; i++)
            {
                Game.CurrentGame.SyncImmutableCardAll(Game.CurrentGame.PeekCard(0));
                Card c = Game.CurrentGame.DrawCard();
                move.Cards.Add(c);
            }
            move.To = new DeckPlace(null, HuoShouDeck);
            Game.CurrentGame.MoveCards(move);
            List<Card> toDiscard = new List<Card>();
            foreach (var c in move.Cards)
            {
                if (c.Suit == SuitType.Heart)
                {
                    toDiscard.Add(c);
                    Game.CurrentGame.RecoverHealth(Owner, Owner, 1);
                }
            }
            Game.CurrentGame.HandleCardDiscard(null, toDiscard);
            Game.CurrentGame.HandleCardTransferToHand(null, Owner, Game.CurrentGame.Decks[null, HuoShouDeck]);
            Game.CurrentGame.CurrentPhaseEventIndex++;
            throw new TriggerResultException(TriggerResult.End);
        }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:29,代码来源:ZaiQi.cs

示例9: Run

 void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     var card = Game.CurrentGame.Judge(Owner, this, null, (judgeResultCard) => { return judgeResultCard.SuitColor == SuitColorType.Black; });
     if (card.SuitColor == SuitColorType.Black)
     {
         ISkill skill;
         List<Card> cards;
         List<Player> players;
         int toDraw = Owner.LostHealth;
         List<Card> remainingCards = new List<Card>();
         CardsMovement move = new CardsMovement();
         for (int i = 0; i < toDraw; i++)
         {
             Game.CurrentGame.SyncImmutableCard(Owner, Game.CurrentGame.PeekCard(0));
             Card c = Game.CurrentGame.DrawCard();
             move.Cards.Add(c);
             remainingCards.Add(c);
         }
         move.To = new DeckPlace(Owner, DeckType.Hand);
         move.Helper.IsFakedMove = true;
         Game.CurrentGame.MoveCards(move);
         if (!Owner.AskForCardUsage(new CardUsagePrompt("MiJi"), new MiJiVerifier(), out skill, out cards, out players))
         {
             players = new List<Player>() { Owner };
         }
         Game.CurrentGame.InsertBeforeDeal(null, remainingCards, new MovementHelper() { IsFakedMove = true });
         Game.CurrentGame.DrawCards(players[0], toDraw);
     }
 }
开发者ID:h1398123,项目名称:sgs,代码行数:29,代码来源:MiJi.cs

示例10: Install

        /// <summary>
        /// 给某个玩家穿装备
        /// </summary>
        /// <param name="p"></param>
        /// <param name="card"></param>
        public void Install(Player p, Card card)
        {
            ParentCard = card;
            CardsMovement attachMove = new CardsMovement();
            attachMove.Cards = new List<Card>();
            attachMove.Cards.Add(card);
            attachMove.To = new DeckPlace(p, DeckType.Equipment);
            foreach (Card c in Game.CurrentGame.Decks[p, DeckType.Equipment])
            {
                if (CardCategoryManager.IsCardCategory(c.Type.Category, this.Category))
                {
                    Equipment e = (Equipment)c.Type;
                    Trace.Assert(e != null);
                    Game.CurrentGame.EnterAtomicContext();
                    Game.CurrentGame.PlayerLostCard(p, new List<Card>() { card });
                    Game.CurrentGame.HandleCardDiscard(p, new List<Card> () {c});
                    Game.CurrentGame.MoveCards(attachMove);
                    Game.CurrentGame.ExitAtomicContext();
                    return;
                }
            }

            Game.CurrentGame.MoveCards(attachMove);
            Game.CurrentGame.PlayerLostCard(p, new List<Card>() {card});
            return;
        }
开发者ID:h1398123,项目名称:sgs,代码行数:31,代码来源:Equipment.cs

示例11: OnJudgeBegin

 public void OnJudgeBegin(Player player, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     if (player.HandCards().Count == 0 && !player.Equipments().Any(card => card.SuitColor == SuitColorType.Black))
     {
         return;
     }
     ISkill skill;
     List<Card> cards;
     List<Player> players;
     Card c = Game.CurrentGame.Decks[eventArgs.Source, DeckType.JudgeResult].Last();
     if (Game.CurrentGame.UiProxies[player].AskForCardUsage(new CardUsagePrompt("GuiDao", eventArgs.Source, c.Suit, c.Rank), new GuiDaoVerifier(), out skill, out cards, out players))
     {
         NotifySkillUse();
         Card theCard = cards[0];
         theCard.Log = new ActionLog();
         theCard.Log.Source = player;
         theCard.Log.SkillAction = this;
         theCard.Log.GameAction = GameAction.ReplaceJudge;
         Game.CurrentGame.EnterAtomicContext();
         List<Card> toDiscard = new List<Card>() {Game.CurrentGame.Decks[eventArgs.Source, DeckType.JudgeResult].Last()};
         CardsMovement move = new CardsMovement();
         move.Cards = new List<Card>();
         move.Cards.AddRange(cards);
         move.To = new DeckPlace(eventArgs.Source, DeckType.JudgeResult);
         Game.CurrentGame.MoveCards(move);
         Game.CurrentGame.PlayerLostCard(player, cards);
         Game.CurrentGame.HandleCardTransferToHand(null, player, toDiscard);
         Game.CurrentGame.ExitAtomicContext();
     }
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:30,代码来源:GuiDao.cs

示例12: Run

        void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
        {
            Owner[FenXinUsed] = 1;
            Player target = eventArgs.Targets[0];

            Card role1 = Game.CurrentGame.Decks[Owner, RoleGame.RoleDeckType][0];
            Card role2 = Game.CurrentGame.Decks[target, RoleGame.RoleDeckType][0];
            Game.CurrentGame.SyncCard(target, ref role1);
            Game.CurrentGame.SyncCard(Owner, ref role2);

            List<CardsMovement> moves = new List<CardsMovement>();
            CardsMovement move1 = new CardsMovement();
            move1.Cards = new List<Card>() { role1 };
            move1.To = new DeckPlace(target, RoleGame.RoleDeckType);
            moves.Add(move1);

            CardsMovement move2 = new CardsMovement();
            move2.Cards = new List<Card>() { role2 };
            move2.To = new DeckPlace(Owner, RoleGame.RoleDeckType);
            moves.Add(move2);

            Game.CurrentGame.MoveCards(moves);

            var role = role2.Type as RoleCardHandler;
            if (role != null)
            {
                Owner.Role = role.Role;
            }
            role = role1.Type as RoleCardHandler;
            if (role != null)
            {
                target.Role = role.Role;
            }
            GameDelays.Delay(GameDelays.RoleDistribute);
        }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:35,代码来源:FenXin.cs

示例13: BuQu

 public BuQu()
 {
     var trigger = new AutoNotifyPassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             if (p.Health > 0 && Game.CurrentGame.Decks[Owner, bq].Count > 0)
             {
                 int toDraw = Game.CurrentGame.Decks[Owner, bq].Count;
                 while (toDraw-- > 0)
                 {
                     Card c1 = Game.CurrentGame.Decks[Owner, bq][Game.CurrentGame.Decks[Owner, bq].Count - 1];
                     CardsMovement move = new CardsMovement();
                     move.Cards = new List<Card>() { c1 };
                     move.To = new DeckPlace(null, DeckType.Discard);
                     Game.CurrentGame.MoveCards(move);
                 }
             }
             return p.Health <= 0;
         },
         Run,
         TriggerCondition.OwnerIsTarget
     ) { Type = TriggerType.Skill };
     Triggers.Add(GameEvent.AfterHealthChanged, trigger);
     ExtraCardsDeck = bq;
     IsAutoInvoked = true;
 }
开发者ID:h1398123,项目名称:sgs,代码行数:27,代码来源:BuQu.cs

示例14: Run

 void Run(Player Owner, GameEvent gameEvent, GameEventArgs eventArgs)
 {
     ISkill skill;
     List<Card> cards;
     List<Player> players;
     List<Card> originalCards = new List<Card>(Game.CurrentGame.Decks[Owner, QiXing.QiXingDeck]);
     int qxCount = Game.CurrentGame.Decks[Owner, QiXing.QiXingDeck].Count;
     // hack the cards to owner's hand. do not trigger anything
     CardsMovement move = new CardsMovement();
     move.Cards = new List<Card>(Game.CurrentGame.Decks[Owner, QiXing.QiXingDeck]);
     move.To = new DeckPlace(Owner, DeckType.Hand);
     move.Helper.IsFakedMove = true;
     Game.CurrentGame.MoveCards(move);
     if (Game.CurrentGame.UiProxies[Owner].AskForCardUsage(new CardUsagePrompt("DaWu"), new DaWuVerifier(originalCards), out skill, out cards, out players))
     {
         NotifySkillUse(players);
         foreach (var mark in players)
         {
             mark[DaWuMark] = 1;
         }
         dawuTargets = players;
         foreach (Card cc in cards) originalCards.Remove(cc);
         Game.CurrentGame.HandleCardDiscard(null, cards);
     }
     move.Cards = new List<Card>(originalCards);
     move.To = new DeckPlace(Owner, QiXing.QiXingDeck);
     Game.CurrentGame.MoveCards(move);
 }
开发者ID:pxoylngx,项目名称:sgs,代码行数:28,代码来源:DaWu.cs

示例15: Activate

 public override void Activate(Player p, Card c)
 {
     while (true)
     {
         GameEventArgs args = new GameEventArgs();
         args.Source = null;
         args.Targets = new List<Player>() { p };
         args.Card = c;
         args.ReadonlyCard = new ReadOnlyCard(c);
         try
         {
             Game.CurrentGame.Emit(GameEvent.CardUsageBeforeEffected, args);
         }
         catch (TriggerResultException e)
         {
             Trace.Assert(e.Status == TriggerResult.End);
             break;
         }
         ReadOnlyCard result = Game.CurrentGame.Judge(p, null, c, (judgeResultCard) => { return judgeResultCard.Suit == SuitType.Spade && judgeResultCard.Rank >= 2 && judgeResultCard.Rank <= 9; });
         if (result.Suit == SuitType.Spade && result.Rank >= 2 && result.Rank <= 9)
         {
             var roc = new ReadOnlyCard(c);
             CardsMovement move = new CardsMovement();
             move.Cards = new List<Card>();
             move.Cards.Add(c);
             move.To = new DeckPlace(null, DeckType.Discard);
             Game.CurrentGame.MoveCards(move);
             Game.CurrentGame.DoDamage(null, p, 3, DamageElement.Lightning, c, roc);
             return;
         }
         break;
     }
     RecursiveShanDianDriver(p, p, c);
 }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:34,代码来源:ShanDian.cs


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