mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 11:49:56 -08:00
Cleanup SearchLibraryPutOnLibraryEffect
This commit is contained in:
parent
f5cbb2e224
commit
a4616bc7ee
31 changed files with 33 additions and 45 deletions
|
|
@ -18,24 +18,21 @@ import mage.util.CardUtil;
|
|||
public class SearchLibraryPutOnLibraryEffect extends SearchEffect {
|
||||
|
||||
private boolean reveal;
|
||||
private boolean forceShuffle;
|
||||
|
||||
public SearchLibraryPutOnLibraryEffect(TargetCardInLibrary target) {
|
||||
this(target, false, true);
|
||||
this(target, false);
|
||||
setText();
|
||||
}
|
||||
|
||||
public SearchLibraryPutOnLibraryEffect(TargetCardInLibrary target, boolean reveal, boolean forceShuffle) {
|
||||
public SearchLibraryPutOnLibraryEffect(TargetCardInLibrary target, boolean reveal) {
|
||||
super(target, Outcome.DrawCard);
|
||||
this.reveal = reveal;
|
||||
this.forceShuffle = forceShuffle;
|
||||
setText();
|
||||
}
|
||||
|
||||
public SearchLibraryPutOnLibraryEffect(final SearchLibraryPutOnLibraryEffect effect) {
|
||||
super(effect);
|
||||
this.reveal = effect.reveal;
|
||||
this.forceShuffle = effect.forceShuffle;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -55,16 +52,11 @@ public class SearchLibraryPutOnLibraryEffect extends SearchEffect {
|
|||
if (reveal && !foundCards.isEmpty()) {
|
||||
controller.revealCards(sourceObject.getIdName(), foundCards, game);
|
||||
}
|
||||
if (forceShuffle) {
|
||||
controller.shuffleLibrary(source, game);
|
||||
}
|
||||
controller.shuffleLibrary(source, game);
|
||||
controller.putCardsOnTopOfLibrary(foundCards, game, source, reveal);
|
||||
return true;
|
||||
}
|
||||
// shuffle
|
||||
if (forceShuffle) {
|
||||
controller.shuffleLibrary(source, game);
|
||||
}
|
||||
controller.shuffleLibrary(source, game);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue