public MageObjectImpl(final MageObjectImpl object) { objectId = object.objectId; name = object.name; manaCost = object.manaCost.copy(); text = object.text; color = object.color.copy(); frameColor = object.frameColor.copy(); frameStyle = object.frameStyle; power = object.power.copy(); toughness = object.toughness.copy(); abilities = object.abilities.copy(); this.cardType.addAll(object.cardType); this.subtype.addAll(object.subtype); isAllCreatureTypes = object.isAllCreatureTypes; supertype.addAll(object.supertype); this.copy = object.copy; this.copyFrom = (object.copyFrom != null ? object.copyFrom.copy() : null); textParts = new ArrayList<>(); textParts.addAll(object.textParts); }
private void init(Card card, Game game) { power = card.getPower().copy(); toughness = card.getToughness().copy(); copyFromCard(card, game); // if temporary added abilities to the spell/card exist, you need to add it to the permanent derived from that card Abilities<Ability> otherAbilities = game.getState().getAllOtherAbilities(card.getId()); if (otherAbilities != null) { abilities.addAll(otherAbilities); } /*if (card.getCardType().contains(CardType.PLANESWALKER)) { this.loyalty = new MageInt(card.getLoyalty().getValue()); }*/ if (card instanceof LevelerCard) { maxLevelCounters = ((LevelerCard) card).getMaxLevelCounters(); } if (isTransformable()) { if (game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId()) != null) { game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId(), null); setTransformed(true); TransformAbility.transform(this, getSecondCardFace(), game); } } }