Example #1
0
 /**
  * Handles the setting of non mana X costs
  *
  * @param controller
  * @param game
  * @return announce message
  */
 protected String handleOtherXCosts(Game game, Player controller) {
   String announceString = null;
   for (VariableCost variableCost : this.costs.getVariableCosts()) {
     if (!(variableCost instanceof VariableManaCost)) {
       int xValue = variableCost.announceXValue(this, game);
       costs.add(variableCost.getFixedCostsFromAnnouncedValue(xValue));
       // set the xcosts to paid
       variableCost.setAmount(xValue);
       ((Cost) variableCost).setPaid();
       String message =
           controller.getLogName()
               + " announces a value of "
               + xValue
               + " ("
               + variableCost.getActionText()
               + ")";
       if (announceString == null) {
         announceString = message;
       } else {
         announceString = announceString + " " + message;
       }
     }
   }
   return announceString;
 }
Example #2
0
 /**
  * As we have ability in the stack, we need to update optional costs in original card. This
  * information will be used later by effects, e.g. to determine whether card was kicked or not.
  * E.g. Desolation Angel
  */
 private void updateOptionalCosts(int index) {
   Ability abilityOrig =
       spellCards.get(index).getAbilities().get(spellAbilities.get(index).getId());
   if (abilityOrig != null) {
     for (Object object : spellAbilities.get(index).getOptionalCosts()) {
       Cost cost = (Cost) object;
       for (Cost costOrig : abilityOrig.getOptionalCosts()) {
         if (cost.getId().equals(costOrig.getId())) {
           if (cost.isPaid()) {
             costOrig.setPaid();
           } else {
             costOrig.clearPaid();
           }
           break;
         }
       }
     }
   }
 }