@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent lazavTheMultifarious = game.getPermanent(source.getSourceId()); Permanent newBluePrint = null; if (controller != null && lazavTheMultifarious != null) { Card copyFromCard = game.getCard(source.getFirstTarget()); if (copyFromCard != null) { newBluePrint = new PermanentCard(copyFromCard, source.getControllerId(), game); newBluePrint.assignNewId(); ApplyToPermanent applier = new LazavTheMultifariousApplier(); applier.apply(game, newBluePrint, source, lazavTheMultifarious.getId()); CopyEffect copyEffect = new CopyEffect(Duration.Custom, newBluePrint, lazavTheMultifarious.getId()); copyEffect.newId(); copyEffect.setApplier(applier); Ability newAbility = source.copy(); copyEffect.init(newAbility, game); game.addEffect(copyEffect, newAbility); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent lazavDimirMastermind = game.getPermanent(source.getSourceId()); Permanent newBluePrint = null; if (controller != null && lazavDimirMastermind != null) { Card copyFromCard = game.getCard(((FixedTarget) getTargetPointer()).getTarget()); if (copyFromCard != null) { newBluePrint = new PermanentCard(copyFromCard, source.getControllerId(), game); newBluePrint.assignNewId(); ApplyToPermanent applier = new LazavDimirMastermindApplier(); applier.apply(game, newBluePrint, source, lazavDimirMastermind.getId()); CopyEffect copyEffect = new CopyEffect(Duration.Custom, newBluePrint, lazavDimirMastermind.getId()); copyEffect.newId(); copyEffect.setApplier(applier); Ability newAbility = source.copy(); copyEffect.init(newAbility, game); game.addEffect(copyEffect, newAbility); } return true; } return false; } }
newEffect.setApplier(applier); Ability newAbility = source.copy(); newEffect.init(newAbility, this);
copyEffect.newId(); Ability newAbility = source.copy(); copyEffect.init(newAbility, game); game.addEffect(copyEffect, newAbility);
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent dimirDoppelganger = game.getPermanent(source.getSourceId()); Permanent newBluePrint = null; if (controller != null && dimirDoppelganger != null) { Card copyFromCard = game.getCard(source.getFirstTarget()); if (copyFromCard != null) { Cards cardsToExile = new CardsImpl(); cardsToExile.add(copyFromCard); controller.moveCards(cardsToExile, Zone.EXILED, source, game); newBluePrint = new PermanentCard(copyFromCard, source.getControllerId(), game); newBluePrint.assignNewId(); ApplyToPermanent applier = new DimirDoppelgangerApplier(); applier.apply(game, newBluePrint, source, dimirDoppelganger.getId()); CopyEffect copyEffect = new CopyEffect(Duration.Custom, newBluePrint, dimirDoppelganger.getId()); copyEffect.newId(); copyEffect.setApplier(applier); Ability newAbility = source.copy(); copyEffect.init(newAbility, game); game.addEffect(copyEffect, newAbility); } return true; } return false; } }