@Override public StackObject createCopyOnStack(Game game, Ability source, UUID newControllerId, boolean chooseNewTargets) { Spell copy = this.copySpell(newControllerId); game.getState().setZone(copy.getId(), Zone.STACK); // required for targeting ex: Nivmagus Elemental game.getStack().push(copy); if (chooseNewTargets) { copy.chooseNewTargets(game, newControllerId); } game.fireEvent(new GameEvent(EventType.COPIED_STACKOBJECT, copy.getId(), this.getId(), newControllerId)); return copy; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source)); if (spell != null && controller != null) { Spell copy = spell.copySpell(source.getControllerId()); copy.getColor(game).setRed(true); game.getStack().push(copy); copy.chooseNewTargets(game, controller.getId()); game.fireEvent(new GameEvent(GameEvent.EventType.COPIED_STACKOBJECT, copy.getId(), spell.getId(), source.getControllerId())); return true; } return false; }
Spell copy = spell.copySpell(source.getControllerId()); game.getStack().push(copy); setTarget:
return false; Spell copy = spell.copySpell(source.getControllerId()); game.getStack().push(copy); setTarget:
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { StackObject stackObject = game.getStack().getStackObject(source.getId()); Spell spell = (Spell) stackObject; if (spell == null) { return false; } spell = spell.copySpell(source.getControllerId()); // Remove Epic effect from the spell Effect epicEffect = null; for (Effect effect : spell.getSpellAbility().getEffects()) { if (effect instanceof EpicEffect) { epicEffect = effect; break; } } spell.getSpellAbility().getEffects().remove(epicEffect); DelayedTriggeredAbility ability = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(new EpicPushEffect(spell, rule), Duration.EndOfGame, false); game.addDelayedTriggeredAbility(ability, source); game.addEffect(new EpicReplacementEffect(), source); return true; } return false; }