forked from External/mage
refactored mill effect names
This commit is contained in:
parent
fe1281decb
commit
7008392a49
109 changed files with 237 additions and 237 deletions
|
|
@ -1,59 +0,0 @@
|
|||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PutTopCardOfLibraryIntoGraveTargetEffect extends OneShotEffect {
|
||||
|
||||
private DynamicValue numberCards;
|
||||
|
||||
public PutTopCardOfLibraryIntoGraveTargetEffect(int numberCards) {
|
||||
this(StaticValue.get(numberCards));
|
||||
}
|
||||
|
||||
public PutTopCardOfLibraryIntoGraveTargetEffect(DynamicValue numberCards) {
|
||||
super(Outcome.Discard);
|
||||
this.numberCards = numberCards;
|
||||
this.staticText = setText();
|
||||
}
|
||||
|
||||
public PutTopCardOfLibraryIntoGraveTargetEffect(final PutTopCardOfLibraryIntoGraveTargetEffect effect) {
|
||||
super(effect);
|
||||
this.numberCards = effect.numberCards;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PutTopCardOfLibraryIntoGraveTargetEffect copy() {
|
||||
return new PutTopCardOfLibraryIntoGraveTargetEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
player.millCards(numberCards.calculate(game, source, this), source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String setText() {
|
||||
StringBuilder sb = new StringBuilder("target player mills ");
|
||||
if (numberCards.toString().equals("1")) {
|
||||
sb.append("a card");
|
||||
} else {
|
||||
sb.append(CardUtil.numberToText(numberCards.toString()));
|
||||
sb.append(" cards");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue