forked from External/mage
Change all line endings to LF
This commit is contained in:
parent
13d9a56b7a
commit
430ae503c7
17069 changed files with 1263498 additions and 1263497 deletions
|
|
@ -1,60 +1,60 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ExileCardsFromTopOfLibraryTargetEffect extends OneShotEffect {
|
||||
|
||||
int amount;
|
||||
String targetName;
|
||||
|
||||
public ExileCardsFromTopOfLibraryTargetEffect(int amount) {
|
||||
this(amount, null);
|
||||
}
|
||||
|
||||
public ExileCardsFromTopOfLibraryTargetEffect(int amount, String targetName) {
|
||||
super(Outcome.Exile);
|
||||
this.amount = amount;
|
||||
this.staticText = (targetName == null ? "that player" : targetName) + " exiles the top "
|
||||
+ CardUtil.numberToText(amount, "")
|
||||
+ (amount == 1 ? "card" : " cards") + " of his or her library";
|
||||
}
|
||||
|
||||
public ExileCardsFromTopOfLibraryTargetEffect(final ExileCardsFromTopOfLibraryTargetEffect effect) {
|
||||
super(effect);
|
||||
this.amount = effect.amount;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExileCardsFromTopOfLibraryTargetEffect copy() {
|
||||
return new ExileCardsFromTopOfLibraryTargetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (targetPlayer != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
cards.addAll(targetPlayer.getLibrary().getTopCards(game, amount));
|
||||
return targetPlayer.moveCards(cards, null, Zone.EXILED, source, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ExileCardsFromTopOfLibraryTargetEffect extends OneShotEffect {
|
||||
|
||||
int amount;
|
||||
String targetName;
|
||||
|
||||
public ExileCardsFromTopOfLibraryTargetEffect(int amount) {
|
||||
this(amount, null);
|
||||
}
|
||||
|
||||
public ExileCardsFromTopOfLibraryTargetEffect(int amount, String targetName) {
|
||||
super(Outcome.Exile);
|
||||
this.amount = amount;
|
||||
this.staticText = (targetName == null ? "that player" : targetName) + " exiles the top "
|
||||
+ CardUtil.numberToText(amount, "")
|
||||
+ (amount == 1 ? "card" : " cards") + " of his or her library";
|
||||
}
|
||||
|
||||
public ExileCardsFromTopOfLibraryTargetEffect(final ExileCardsFromTopOfLibraryTargetEffect effect) {
|
||||
super(effect);
|
||||
this.amount = effect.amount;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExileCardsFromTopOfLibraryTargetEffect copy() {
|
||||
return new ExileCardsFromTopOfLibraryTargetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (targetPlayer != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
cards.addAll(targetPlayer.getLibrary().getTopCards(game, amount));
|
||||
return targetPlayer.moveCards(cards, null, Zone.EXILED, source, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue