mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Another simplification for ExileFromTopOfLibraryCost
This commit is contained in:
parent
15e229ab23
commit
3598f07caa
1 changed files with 1 additions and 9 deletions
|
@ -31,11 +31,8 @@ package mage.abilities.costs.common;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.costs.CostImpl;
|
import mage.abilities.costs.CostImpl;
|
||||||
import mage.cards.Cards;
|
|
||||||
import mage.cards.CardsImpl;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Library;
|
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
|
@ -71,12 +68,7 @@ public class ExileFromTopOfLibraryCost extends CostImpl {
|
||||||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
|
||||||
Player controller = game.getPlayer(controllerId);
|
Player controller = game.getPlayer(controllerId);
|
||||||
if(controller != null) {
|
if(controller != null) {
|
||||||
Library library = controller.getLibrary();
|
controller.moveCards(controller.getLibrary().getTopCards(game, amount), Zone.LIBRARY, Zone.EXILED, ability, game);
|
||||||
Cards cards = new CardsImpl();
|
|
||||||
for(int i = 0; i < amount; i++) {
|
|
||||||
cards.add(library.removeFromTop(game));
|
|
||||||
}
|
|
||||||
controller.moveCards(cards, Zone.LIBRARY, Zone.EXILED, ability, game);
|
|
||||||
paid = true;
|
paid = true;
|
||||||
}
|
}
|
||||||
return paid;
|
return paid;
|
||||||
|
|
Loading…
Reference in a new issue