示例#1
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;
 }
示例#2
0
 public static void gainCardRemodel(Player p, StatusObject o)
 {
     p.setGain(true);
     p.setGainsLeft(p.getGainsLeft() + 1);
     p.setCurrencyForGainBonus(2);
     o.setTrashForGain(true);
 }