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