Beispiel #1
0
        private void OnPlayCardStage(Player player, JToken data)
        {
            QuestCard quest = this.matches[player].CurrentStory as QuestCard;
            QuestArea area  = quest.StageBuilder;

            List <string>     cardNames = Jsonify.ArrayToList <string>(data["cards"]);
            List <FoeCard>    foe       = player.Hand.GetCards <FoeCard>(cardNames);
            List <WeaponCard> weapons   = player.Hand.GetCards <WeaponCard>(cardNames);
            List <TestCard>   test      = player.Hand.GetCards <TestCard>(cardNames);

            player.Hand.Transfer(area, test.Cast <Card>().ToList());
            player.Hand.Transfer(area, foe.Cast <Card>().ToList());
            player.Hand.Transfer(area, weapons.Cast <Card>().ToList());

            this.UpdateHand(player);
            this.UpdateOtherArea(player, area.Cards);
            this.UpdatePlayerArea(player);
        }
Beispiel #2
0
        private void OnConfirmStage(Player player, JToken data)
        {
            QuestCard quest = this.matches[player].CurrentStory as QuestCard;
            QuestArea area  = quest.StageBuilder;

            if (player.Hand.Count > 12)
            {
                this.UpdateHand(player);
                this.Message(this.GetMatch(player), "You have too many cards (" + (player.Hand.Cards.Count) + "), please discard");
                this.matches[player].Log("Rejected play by " + player.Username + " too many cards in hand(" + (player.Hand.Cards.Count) + ")");
                return;
            }

            if (area.MainCard != null && quest.Stages.Count < quest.StageCount)
            {
                quest.AddStage(area);
                quest.StageResponse();
            }

            this.UpdateOtherArea(player, new List <Card>());
        }
Beispiel #3
0
 public virtual void Transfer(CardArea target, Card card)
 {
     if (target != null && this.cards.Contains(card))
     {
         if (target is QuestArea)
         {
             QuestArea qatarget = target as QuestArea;
             qatarget.Add(card);
             if (qatarget.cards.Contains(card))
             {
                 this.Remove(card);
             }
         }
         else
         {
             target.Add(card);
             if (target.cards.Contains(card))
             {
                 this.Remove(card);
             }
         }
     }
 }