Пример #1
0
        ICard DecideWhatCardToPlayOutOfYourTurn(SinglePlayerResponseArgs e)
        {
            ICard        cardTriggering = e.CardTriggering;
            List <ICard> miniCardList   = e.MiniCardList;
            ICard        cardFirst      = e.CardFirst;

            List <Func> funcsCanCounter;
            List <Func> funcsCanAnnul;
            ICard       cardResponded = null;

            if (CardJudge.CardCanBeCounteredByAnyPlayer(null, cardFirst, cardTriggering, out funcsCanCounter) != MiniRoundTimingOption.None)
            {
                cardResponded = PlayACard(this.FindASpecificCard(funcsCanCounter), PlayerToKill, false);
            }

            if (cardResponded != null)
            {
                return(cardResponded);
            }

            if (CardJudge.CardCanBeAnnulled(null, cardFirst, cardTriggering, out funcsCanAnnul) != MiniRoundTimingOption.None)
            {
                cardResponded = PlayACard(this.FindASpecificCard(funcsCanAnnul), PlayerToKill, true);
            }

            if (cardResponded != null)
            {
                return(cardResponded);
            }

            return(null); // Make no response
        }
Пример #2
0
 public virtual void OnResponseNeeded(SinglePlayerResponseArgs responseArgs)
 {
     if (ResponseNeeded != null)
     {
         ResponseNeeded(this, responseArgs);
     }
 }
Пример #3
0
        ICard DecideWhatCardToPlayOutOfYourTurn(SinglePlayerResponseArgs e)
        {
            ICard        cardTriggering = e.CardTriggering;
            List <ICard> miniCardList   = e.MiniCardList;
            ICard        cardFirst      = e.CardFirst;

            List <Func> funcsCanCounter;
            List <Func> funcsCanAnnul;
            ICard       cardResponded = null;

            //if (CardJudge.CardCanBeAnnulledByEquippable(null, cardFirst, cardTriggering, out funcsCanAnnul) != MiniRoundTimingOption.None)
            //  cardResponded = PlayACard(this.FindASpecificCard(funcsCanAnnul), PlayerToKill, true);

            // TODO Make the function parameters correct
            if (CardJudge.CanBePossiblyAnnulledByEquippable(cardFirst.PlayerPlaying, cardFirst, out funcsCanAnnul) != MiniRoundTimingOption.None)
            {
                cardResponded = PlayACard(this.FindASpecificCardInEquippable(funcsCanAnnul), PlayerToKill, true, true);
            }

            if (cardResponded != null)
            {
                return(cardResponded);
            }

            // TODO Add the logic about whether I want to intervene
            if (CardJudge.CardCanBeCounteredByAnyPlayer(null, cardFirst, cardTriggering, out funcsCanCounter) != MiniRoundTimingOption.None)
            {
                cardResponded = PlayACard(this.FindASpecificCard(funcsCanCounter), PlayerToKill, false, false);
            }

            if (cardResponded != null)
            {
                return(cardResponded);
            }

            if (CardJudge.CardCanBeAnnulled(null, cardFirst, cardTriggering, out funcsCanAnnul) != MiniRoundTimingOption.None)
            {
                cardResponded = PlayACard(this.FindASpecificCard(funcsCanAnnul), PlayerToKill, true, false);
            }

            if (cardResponded != null)
            {
                return(cardResponded);
            }

            return(null); // Make no response
        }
Пример #4
0
 void Messenger_ResponseNeeded(PlayerMessenger messenger, SinglePlayerResponseArgs e)
 {
     this.CardResponded = DecideWhatCardToPlayOutOfYourTurn(e);
 }