示例#1
0
文件: Player.cs 项目: postcn/Dominion
 public StatusObject trashForGain(Card c)
 {
     StatusObject o = new StatusObject(false);
     if (this.myHand.getHand().Count == 0)
     {
         o.setTrashedCorrectly(true);
         this.currencyForGainBonus = 0;
         this.gainsLeft = 0;
     }
     if (this.gain)
     {
         //check if card is in hand or if its feast (which has already been played)
         if (this.myHand.contains(c))
         {
             this.myHand.remove(c);//don't put it anywhere so trashed
             this.currencyForGain = c.getCost() + this.currencyForGainBonus;
             if (this.gainsLeft <= 0)
             {
                 this.currencyForGainBonus = 0;
             }
             o.setTrashedCorrectly(true);
         }
     }
     return o;
 }
示例#2
0
文件: Player.cs 项目: postcn/Dominion
        public StatusObject trashCards(List<Card> cards)
        {
            StatusObject retVal = new StatusObject(false);
            //If none then didnt want to discard any
            if (cards.Count == 0)
            {
                retVal.setTrashedCorrectly(true);
                return retVal;
            }

            if (cards.Count > this.possibleTrashes)
            {
                retVal.setMessage(Internationalizer.getMessage("MoreThanFour"));
                return retVal;
            }

            StatusObject returner = allCardsInHand(cards, retVal);
            if (returner != null)
            {
                return returner;
            }

            //Trash cards
            foreach (Card c in cards)
            {
                this.getHand().remove(c);//trash not discard for the chapel
            }

            this.possibleTrashes = 0;
            retVal.setTrashedCorrectly(true);

            return retVal;
        }
示例#3
0
 public static void gainCardFeast(Player p, StatusObject o)
 {
     p.setGain(true);
     p.setGainsLeft(p.getGainsLeft() + 1);
     //You gain a card worth 5 which is 1 more than cost of feast.
     p.setCurrencyForGain(5);
     p.getPlayed().Remove(CardMother.Feast());
     o.setTrashedCorrectly(true);
 }
示例#4
0
文件: Player.cs 项目: postcn/Dominion
 public StatusObject gainCard(CardStack cs)
 {
     StatusObject o = new StatusObject(false);
     if (cs.isEmpty())
     {
         o.setMessage(Internationalizer.getMessage("StackEmpty"));
         return o;
     }
     if (!this.gain)
     {
         o.setMessage(Internationalizer.getMessage("NotGain"));
         return o;
     }
     if (this.gainsLeft <= 0)
     {
         o.setMessage(Internationalizer.getMessage("NoGainsLeft"));
         return o;
     }
     if (this.currencyForGain >= cs.getCard().getCost())
     {
         this.getDeck().discard(cs.buyOne());
         this.gainsLeft--;
         if (this.gainsLeft == 0)
         {
             this.currencyForGain = 0;
             this.gain = false;
         }
         else
         {
             if (this.lastPlayedCard.Equals(CardMother.Remodel()))
             {
                 o.setMessage(Internationalizer.getMessage("WasRemodel"));
                 o.setTrashForGain(true);
             }
             else
             {
                 o.setMessage(Internationalizer.getMessage("GainsLeft"));
                 o.setTrashedCorrectly(true);
             }
         }
         o.setGainedProperly(true);
     }
     else
     {
         o.setMessage(Internationalizer.getMessage("NotEnoughCur") + this.currencyForGain);
     }
     return o;
 }
示例#5
0
 public static void gainCardWorkshop(Player p, StatusObject o)
 {
     p.setGain(true);
     p.setGainsLeft(p.getGainsLeft() + 1);
     //you gain a card worth 4
     p.setCurrencyForGain(4);
     o.setTrashedCorrectly(true);
 }