예제 #1
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player controller = game.getPlayer(source.getControllerId());
   if (controller != null) {
     for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
       if (!playerId.equals(this.getTargetPointer().getFirst(game, source))) {
         Token token = new DragonToken2();
         token.putOntoBattlefield(1, game, source.getSourceId(), playerId);
       }
     }
     return true;
   }
   return false;
 }
예제 #2
0
 @Override
 public void setExpansionSetCodeForImage(String code) {
   super.setExpansionSetCodeForImage(code);
   if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("KLD")) {
     this.setTokenType(RandomUtil.nextInt(3) + 1);
   }
 }
예제 #3
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player you = game.getPlayer(source.getControllerId());
   ManaCosts cost = new ManaCostsImpl("{X}");
   if (you != null && you.chooseUse(Outcome.Neutral, "Do you want to to pay {X}?", game)) {
     int costX =
         you.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
     cost.add(new GenericManaCost(costX));
     if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
       Token token = new GoblinSoldierToken();
       return token.putOntoBattlefield(
           costX, game, source.getSourceId(), source.getControllerId());
     }
   }
   return false;
 }
 @Override
 public boolean apply(Game game, Ability source) {
   String tokenType =
       game.getState()
           .getValue(source.getSourceId().toString() + "_SarpadianEmpiresVolVii")
           .toString();
   Token token;
   if (tokenType.equals("White Citizen")) {
     token = new CitizenToken();
   } else if (tokenType.equals("Blue Camarid")) {
     token = new CamaridToken();
   } else if (tokenType.equals("Black Thrull")) {
     token = new ThrullToken();
   } else if (tokenType.equals("Red Goblin")) {
     token = new GoblinToken();
   } else {
     token = new SaprolingToken();
   }
   token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
   return true;
 }
예제 #5
0
  @Override
  public Token apply(Card source) {
    if (target == null) {
      throw new IllegalArgumentException("Target can't be null");
    }
    // A copy contains only the attributes of the basic card or basic Token that's the base of the
    // permanent
    // else gained abililies would be copied too.

    MageObject sourceObj = source;
    if (source instanceof PermanentToken) {
      sourceObj = ((PermanentToken) source).getToken();
      // to show the source image, the original values have to be used
      target.setOriginalExpansionSetCode(((Token) sourceObj).getOriginalExpansionSetCode());
      target.setOriginalCardNumber(((Token) sourceObj).getOriginalCardNumber());
      target.setCopySourceCard(((PermanentToken) source).getToken().getCopySourceCard());
    } else if (source instanceof PermanentCard) {
      if (((PermanentCard) source).isMorphed() || ((PermanentCard) source).isManifested()) {
        MorphAbility.setPermanentToFaceDownCreature(target);
        return target;
      } else {
        if (((PermanentCard) source).isTransformed() && source.getSecondCardFace() != null) {
          sourceObj = ((PermanentCard) source).getSecondCardFace();
        } else {
          sourceObj = ((PermanentCard) source).getCard();
        }

        target.setOriginalExpansionSetCode(source.getExpansionSetCode());
        target.setOriginalCardNumber(source.getCardNumber());
        target.setCopySourceCard((Card) sourceObj);
      }
    } else {
      target.setOriginalExpansionSetCode(source.getExpansionSetCode());
      target.setOriginalCardNumber(source.getCardNumber());
      if (source instanceof Card) {
        target.setCopySourceCard(source);
      }
    }

    target.setName(sourceObj.getName());
    target.getColor(null).setColor(sourceObj.getColor(null));
    target.getManaCost().clear();
    target.getManaCost().add(sourceObj.getManaCost());
    target.getCardType().clear();
    for (CardType type : sourceObj.getCardType()) {
      target.getCardType().add(type);
    }
    target.getSubtype().clear();
    for (String type : sourceObj.getSubtype()) {
      target.getSubtype().add(type);
    }
    target.getSupertype().clear();
    for (String type : sourceObj.getSupertype()) {
      target.getSupertype().add(type);
    }

    target.getAbilities().clear();

    for (Ability ability0 : sourceObj.getAbilities()) {
      Ability ability = ability0.copy();
      ability.newId();
      ability.setSourceId(target.getId());
      target.addAbility(ability);
    }

    target.getPower().modifyBaseValue(sourceObj.getPower().getBaseValueModified());
    target.getToughness().modifyBaseValue(sourceObj.getToughness().getBaseValueModified());

    return target;
  }