* Bojuka Bog - Fixed card movement to exile missing group movement handling (fixes
package mage.abilities.effects.common;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
@@ -31,13 +28,10 @@ public class ExileGraveyardAllTargetPlayerEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
- if (targetPlayer != null) {
- List<UUID> graveyard = new ArrayList<>(targetPlayer.getGraveyard());
- for (UUID cardId : graveyard) {
- game.getCard(cardId).moveToZone(Zone.EXILED, source, game, false);
- }
- return true;
+ if (targetPlayer != null && controller != null) {
+ return targetPlayer.moveCards(targetPlayer.getGraveyard(), Zone.EXILED, source, game);
}
return false;
}
