@Override public boolean apply(Game game, Ability source) { if (affectedObjectList.isEmpty()) { this.discard(); return false; } Permanent permanent = affectedObjectList.get(0).getPermanent(game); if (permanent == null) { permanent = (Permanent) game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD, source.getSourceObjectZoneChangeCounter()); // As long as the permanent is still in the LKI continue to copy to get triggered abilities to TriggeredAbilites for dies events. if (permanent == null) { discard(); return false; } } return copyToPermanent(permanent, game, source); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (controller != null && permanent != null) { permanent.removeAllAbilities(source.getSourceId(), game); // Set any previous copy effects to 'discarded' for (Effect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) { if (effect instanceof CopyEffect) { CopyEffect copyEffect = (CopyEffect) effect; if (copyEffect.getSourceId().equals(permanent.getId())) { copyEffect.discard(); } } } permanent.turnFaceDown(game, source.getControllerId()); permanent.setManifested(false); permanent.setMorphed(true); return permanent.isFaceDown(game); } return false; } }
CopyEffect copyEffect = (CopyEffect) effect; if (copyEffect.getSourceId().equals(copyFromPermanent.getId())) { MageObject oldBluePrint = ((CopyEffect) effect).getTarget(); if (oldBluePrint instanceof Permanent) { CopyEffect copyEffect = (CopyEffect) effect; if (copyEffect.getSourceId().equals(copyToPermanentId) && copyEffect.getDuration() == Duration.Custom) { copyEffect.discard();
CopyEffect copyEffect = (CopyEffect) effect; if (copyEffect.getSourceId().equals(permanent.getId())) { MageObject object = ((CopyEffect) effect).getTarget(); if (object instanceof Permanent) {
if (copyFromObject instanceof Permanent) { for (Ability ability : ((Permanent) copyFromObject).getAbilities(game)) { permanent.addAbility(ability, getSourceId(), game, false); // no new Id so consumed replacement effects are known while new continuousEffects.apply happen. permanent.addAbility(ability, getSourceId(), game, false); // no new Id so consumed replacement effects are known while new continuousEffects.apply happen.