mirror of
https://github.com/correl/mage.git
synced 2025-04-10 17:00:08 -09:00
* Lurking Predators - Some minor rework.
This commit is contained in:
parent
9856c48688
commit
c06e86cd2f
2 changed files with 17 additions and 17 deletions
Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human
Mage.Sets/src/mage/sets/magic2010
|
@ -799,6 +799,7 @@ public class HumanPlayer extends PlayerImpl {
|
|||
if (unpaid instanceof ManaCostsImpl) {
|
||||
specialManaAction(unpaid, game);
|
||||
// TODO: delve or convoke cards with PhyrexianManaCost won't work together (this combinaton does not exist yet)
|
||||
@SuppressWarnings("unchecked")
|
||||
ManaCostsImpl<ManaCost> costs = (ManaCostsImpl<ManaCost>) unpaid;
|
||||
for (ManaCost cost : costs.getUnpaid()) {
|
||||
if (cost instanceof PhyrexianManaCost) {
|
||||
|
|
|
@ -28,10 +28,7 @@
|
|||
package mage.sets.magic2010;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SpellCastOpponentTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
@ -39,6 +36,10 @@ import mage.cards.Card;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
@ -52,7 +53,6 @@ public class LurkingPredators extends CardImpl {
|
|||
super(ownerId, 190, "Lurking Predators", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}{G}");
|
||||
this.expansionSetCode = "M10";
|
||||
|
||||
|
||||
// Whenever an opponent casts a spell, reveal the top card of your library. If it's a creature card, put it onto the battlefield. Otherwise, you may put that card on the bottom of your library.
|
||||
this.addAbility(new SpellCastOpponentTriggeredAbility(new LurkingPredatorsEffect(), false));
|
||||
}
|
||||
|
@ -85,26 +85,25 @@ class LurkingPredatorsEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (controller == null || sourceObject == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (player.getLibrary().size() > 0) {
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
player.revealCards("Lurking Predators", cards, game);
|
||||
if (controller.getLibrary().size() > 0) {
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
Cards cards = new CardsImpl(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
|
||||
if (card != null) {
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
card = player.getLibrary().removeFromTop(game);
|
||||
card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
|
||||
} else if (player.chooseUse(Outcome.Neutral, "Put " + card.getName() + " on the bottom of your library?", source, game)) {
|
||||
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
} else if (controller.chooseUse(Outcome.Neutral, "Put " + card.getIdName() + " on the bottom of your library?", source, game)) {
|
||||
controller.putCardsOnBottomOfLibrary(cards, game, source, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue