mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 11:49:56 -08:00
[BFZ] Added Oblivion Sower and Titan's Presence.
This commit is contained in:
parent
5d51615eab
commit
c7e64ac9fe
6 changed files with 361 additions and 41 deletions
|
|
@ -28,6 +28,8 @@
|
|||
// author jeffwadsworth
|
||||
package mage.abilities.costs.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -44,16 +46,19 @@ public class RevealTargetFromHandCost extends CostImpl {
|
|||
|
||||
public int convertedManaCosts = 0;
|
||||
protected int numberCardsRevealed = 0;
|
||||
protected List<Card> revealedCards;
|
||||
|
||||
public RevealTargetFromHandCost(TargetCardInHand target) {
|
||||
this.addTarget(target);
|
||||
this.text = (target.getNumberOfTargets() == 0 ? "you may " : "") + "reveal " + target.getTargetName();
|
||||
this.revealedCards = new ArrayList<>();
|
||||
}
|
||||
|
||||
public RevealTargetFromHandCost(final RevealTargetFromHandCost cost) {
|
||||
super(cost);
|
||||
this.convertedManaCosts = cost.convertedManaCosts;
|
||||
this.numberCardsRevealed = cost.numberCardsRevealed;
|
||||
this.revealedCards = new ArrayList<>(cost.revealedCards);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -69,6 +74,7 @@ public class RevealTargetFromHandCost extends CostImpl {
|
|||
convertedManaCosts += card.getManaCost().convertedManaCost();
|
||||
numberCardsRevealed++;
|
||||
cards.add(card);
|
||||
revealedCards.add(card);
|
||||
}
|
||||
}
|
||||
if (numberCardsRevealed > 0) {
|
||||
|
|
@ -92,6 +98,10 @@ public class RevealTargetFromHandCost extends CostImpl {
|
|||
return numberCardsRevealed;
|
||||
}
|
||||
|
||||
public List<Card> getRevealedCards() {
|
||||
return revealedCards;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
|
||||
return targets.canChoose(controllerId, game);
|
||||
|
|
|
|||
|
|
@ -0,0 +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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue