Esempio n. 1
0
        public QiuYuan()
        {
            qiuYuanVerifier = new QiuYuanVerifier();
            var trigger = new AutoNotifyUsagePassiveSkillTrigger(
                this,
                (p, e, a) =>
            {
                if (a.ReadonlyCard.Type is Sha)
                {
                    qiuYuanVerifier.ShaSource = a.Source;
                    return(true);
                }
                return(false);
            },
                (p, e, a, cards, players) =>
            {
                ISkill skill;
                List <Card> nCards;
                List <Player> nPlayers;
                Card theCard = null;
                if (!players[0].AskForCardUsage(new CardUsagePrompt("QiuYuanGiveCard", p), new QiuYuanGiveCardVerifier(), out skill, out nCards, out nPlayers))
                {
                    theCard = players[0].HandCards().First();
                    Game.CurrentGame.SyncImmutableCardAll(theCard);
                    nCards.Add(theCard);
                }
                else
                {
                    theCard = nCards.First();
                }
                Game.CurrentGame.HandleCardTransferToHand(players[0], p, nCards);
                if (!(theCard.Type is Shan) && !a.Targets.Contains(players[0]))
                {
                    a.Targets.Add(players[0]);
                    if (Game.CurrentGame.OrderOf(Game.CurrentGame.CurrentPlayer, p) < Game.CurrentGame.OrderOf(Game.CurrentGame.CurrentPlayer, players[0]))
                    {
                        GameEventArgs newArgs = new GameEventArgs();
                        newArgs.Source        = a.Source;
                        newArgs.UiTargets     = players;
                        newArgs.Targets       = players;
                        newArgs.Card          = a.Card;
                        newArgs.ReadonlyCard  = a.ReadonlyCard;
                        newArgs.InResponseTo  = a.InResponseTo;
                        Game.CurrentGame.Emit(GameEvent.CardUsageTargetConfirming, newArgs);
                    }
                }
            },
                TriggerCondition.OwnerIsTarget,
                qiuYuanVerifier
                )
            {
                AskForConfirmation = false
            };

            Triggers.Add(GameEvent.CardUsageTargetConfirming, trigger);
            IsAutoInvoked = null;
        }
Esempio n. 2
0
 public QiuYuan()
 {
     qiuYuanVerifier = new QiuYuanVerifier();
     var trigger = new AutoNotifyUsagePassiveSkillTrigger(
         this,
         (p, e, a) =>
         {
             if (a.ReadonlyCard.Type is Sha)
             {
                 qiuYuanVerifier.ShaSource = a.Source;
                 return true;
             }
             return false;
         },
         (p, e, a, cards, players) =>
         {
             ISkill skill;
             List<Card> nCards;
             List<Player> nPlayers;
             Card theCard = null;
             if (!players[0].AskForCardUsage(new CardUsagePrompt("QiuYuanGiveCard", p), new QiuYuanGiveCardVerifier(), out skill, out nCards, out nPlayers))
             {
                 theCard = players[0].HandCards().First();
                 Game.CurrentGame.SyncImmutableCardAll(theCard);
                 nCards.Add(theCard);
             }
             else
             {
                 theCard = nCards.First();
             }
             Game.CurrentGame.HandleCardTransferToHand(players[0], p, nCards);
             if (!(theCard.Type is Shan) && !a.Targets.Contains(players[0]))
             {
                 a.Targets.Add(players[0]);
                 if (Game.CurrentGame.OrderOf(Game.CurrentGame.CurrentPlayer, p) < Game.CurrentGame.OrderOf(Game.CurrentGame.CurrentPlayer, players[0]))
                 {
                     GameEventArgs newArgs = new GameEventArgs();
                     newArgs.Source = a.Source;
                     newArgs.UiTargets = players;
                     newArgs.Targets = players;
                     newArgs.Card = a.Card;
                     newArgs.ReadonlyCard = a.ReadonlyCard;
                     newArgs.InResponseTo = a.InResponseTo;
                     Game.CurrentGame.Emit(GameEvent.CardUsageTargetConfirming, newArgs);
                 }
             }
         },
         TriggerCondition.OwnerIsTarget,
         qiuYuanVerifier
     ) { AskForConfirmation = false };
     Triggers.Add(GameEvent.CardUsageTargetConfirming, trigger);
     IsAutoInvoked = null;
 }