@Override public void setCopySourceCard(Card copySourceCard) { if (copySourceCard != null) { this.copySourceCard = copySourceCard.copy(); } }
public PermanentCard(final PermanentCard permanent) { super(permanent); this.card = permanent.card.copy(); this.maxLevelCounters = permanent.maxLevelCounters; this.zoneChangeCounter = permanent.zoneChangeCounter; }
public ExileFromHandCost(final ExileFromHandCost cost) { super(cost); for (Card card : cost.cards) { this.cards.add(card.copy()); } this.setXFromCMC = cost.setXFromCMC; }
/** * Return a random basic land of the chosen color. * * @param color the color the basic land should produce. * @param basicLands list of information about basic lands from the * database. * @return a single basic land that produces the color needed. */ private static Card getBasicLand(ColoredManaSymbol color, Map<String, List<CardInfo>> basicLands) { String landName = DeckGeneratorPool.getBasicLandName(color.toString()); List<CardInfo> basicLandsInfo = basicLands.get(landName); return basicLandsInfo.get(RandomUtil.nextInt(basicLandsInfo.size())).getMockCard().copy(); } }
public SplitCard(SplitCard card) { super(card); this.leftHalfCard = card.getLeftHalfCard().copy(); ((SplitCardHalf) leftHalfCard).setParentCard(this); this.rightHalfCard = card.rightHalfCard.copy(); ((SplitCardHalf) rightHalfCard).setParentCard(this); }
public Card copyCard(Card cardToCopy, Ability source, Game game) { Card copiedCard = cardToCopy.copy(); copiedCard.assignNewId(); copiedCard.setOwnerId(source.getControllerId()); copiedCard.setCopy(true, cardToCopy); copiedCards.put(copiedCard.getId(), copiedCard); addCard(copiedCard); if (copiedCard.isSplitCard()) { Card leftCard = ((SplitCard) copiedCard).getLeftHalfCard(); copiedCards.put(leftCard.getId(), leftCard); addCard(leftCard); Card rightCard = ((SplitCard) copiedCard).getRightHalfCard(); copiedCards.put(rightCard.getId(), rightCard); addCard(rightCard); } return copiedCard; }
Card card = landCards.get(RandomUtil.nextInt(allCount)); if (genPool.isValidLandCard(card)) { Card addedCard = card.copy(); deckLands.add(addedCard); genPool.addCard(addedCard);
if (currentAmount > 0) { deckCMC.setAmount(currentAmount - 1); genPool.addCard(card.copy()); count++;
private static Card takeAttributesFromSpell(Card card, ZoneChangeEvent event, Game game) { card = card.copy(); if (Zone.STACK == event.getFromZone()) { Spell spell = game.getStack().getSpell(event.getTargetId()); if (spell != null && !spell.isFaceDown(game)) { if (!card.getColor(game).equals(spell.getColor(game))) { // the card that is referenced to in the permanent is copied and the spell attributes are set to this copied card card.getColor(game).setColor(spell.getColor(game)); } } } return card; }
Card sourceCard = game.getCard(source.getSourceId()); if (sourceCard != null) { sourceCard = sourceCard.copy(); sourceCard.setFaceDown(true, game); shellGamePile.add(sourceCard); Card card = game.getCard(cardId); if (card != null) { card = card.copy(); card.setFaceDown(true, game); shellGamePile.add(card);