@Override
 public boolean apply(Game game, Ability source) {
   Spell spell = game.getStack().getSpell(targetPointer.getFirst(game, source));
   if (spell == null) {
     spell =
         (Spell) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.STACK);
   }
   if (spell != null) {
     Spell copy = spell.copySpell();
     copy.setControllerId(source.getControllerId());
     copy.setCopiedSpell(true);
     game.getStack().push(copy);
     copy.chooseNewTargets(game, source.getControllerId());
     Player player = game.getPlayer(source.getControllerId());
     String activateMessage = copy.getActivatedMessage(game);
     if (activateMessage.startsWith(" casts ")) {
       activateMessage = activateMessage.substring(6);
     }
     if (!game.isSimulation()) {
       game.informPlayers(player.getLogName() + activateMessage);
     }
     return true;
   }
   return false;
 }
Example #2
0
 @Override
 public void setCopy(boolean isCopy) {
   setCopiedSpell(isCopy);
 }