[SWS] Fixed some problems.

This commit is contained in:
LevelX2 2016-10-07 17:56:16 +02:00
parent 966e2f686d
commit 4d7e744187
3 changed files with 17 additions and 7 deletions

View file

@ -12,6 +12,7 @@ import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
/**
*
@ -40,11 +41,12 @@ public class ShuffleIntoLibraryTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null) {
if (permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true)) {
Player controller = game.getPlayer(source.getControllerId());
if (permanent != null && controller != null) {
if (controller.moveCards(permanent, Zone.LIBRARY, source, game)) {
game.getPlayer(permanent.getOwnerId()).shuffleLibrary(source, game);
return true;
}
return true;
}
return false;
}