mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
parent
a06cacb462
commit
fe0557127b
2 changed files with 36 additions and 23 deletions
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -6,7 +5,7 @@ import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleEvasionAbility;
|
import mage.abilities.common.SimpleEvasionAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
|
import mage.abilities.effects.PreventionEffectImpl;
|
||||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
|
@ -37,9 +36,13 @@ public final class ArgothianPixies extends CardImpl {
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
// Argothian Pixies can't be blocked by artifact creatures.
|
// Argothian Pixies can't be blocked by artifact creatures.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventDamageToSourceByCardTypeEffect2(CardType.ARTIFACT)));
|
this.addAbility(new SimpleEvasionAbility(
|
||||||
|
new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)));
|
||||||
|
|
||||||
// Prevent all damage that would be dealt to Argothian Pixies by artifact creatures.
|
// Prevent all damage that would be dealt to Argothian Pixies by artifact creatures.
|
||||||
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
||||||
|
new ArgothianPixiesPreventDamageFromArtifactsEffect(Duration.WhileOnBattlefield)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArgothianPixies(final ArgothianPixies card) {
|
public ArgothianPixies(final ArgothianPixies card) {
|
||||||
|
@ -52,26 +55,27 @@ public final class ArgothianPixies extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PreventDamageToSourceByCardTypeEffect2 extends PreventAllDamageToSourceEffect {
|
class ArgothianPixiesPreventDamageFromArtifactsEffect extends PreventionEffectImpl {
|
||||||
|
|
||||||
private CardType cardType;
|
public ArgothianPixiesPreventDamageFromArtifactsEffect(Duration duration) {
|
||||||
|
super(duration);
|
||||||
public PreventDamageToSourceByCardTypeEffect2() {
|
staticText = "Prevent all combat damage that would be dealt to {this} by artifact creatures";
|
||||||
this(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PreventDamageToSourceByCardTypeEffect2(CardType cardT) {
|
public ArgothianPixiesPreventDamageFromArtifactsEffect(final ArgothianPixiesPreventDamageFromArtifactsEffect effect) {
|
||||||
super(Duration.WhileOnBattlefield);
|
super(effect);
|
||||||
cardType = cardT;
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArgothianPixiesPreventDamageFromArtifactsEffect copy() {
|
||||||
|
return new ArgothianPixiesPreventDamageFromArtifactsEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (super.applies(event, source, game)) {
|
if (super.applies(event, source, game)) {
|
||||||
if (game.getObject(event.getSourceId()).getCardType().contains(cardType)) {
|
if (game.getObject(event.getSourceId()).getCardType().contains(CardType.ARTIFACT)) {
|
||||||
if (event.getTargetId().equals(source.getSourceId())) {
|
return (event.getTargetId().equals(source.getSourceId()));
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -16,7 +15,6 @@ import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
import mage.target.common.TargetCardInHand;
|
|
||||||
import mage.target.targetpointer.FixedTarget;
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,11 +26,18 @@ public final class CreamOfTheCrop extends CardImpl {
|
||||||
public CreamOfTheCrop(UUID ownerId, CardSetInfo setInfo) {
|
public CreamOfTheCrop(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
|
||||||
|
|
||||||
// Whenever a creature enters the battlefield under your control, you may look at the top X cards of your library, where X is that creature's power. If you do, put one of those cards on top of your library and the rest on the bottom of your library in any order.
|
// Whenever a creature enters the battlefield under your control,
|
||||||
|
// you may look at the top X cards of your library, where X is that
|
||||||
|
// creature's power. If you do, put one of those cards on top of your
|
||||||
|
// library and the rest on the bottom of your library in any order.
|
||||||
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
|
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(
|
||||||
Zone.BATTLEFIELD, new CreamOfTheCropEffect(),
|
Zone.BATTLEFIELD, new CreamOfTheCropEffect(),
|
||||||
StaticFilters.FILTER_PERMANENT_CREATURE, true, SetTargetPointer.PERMANENT,
|
StaticFilters.FILTER_PERMANENT_CREATURE, true, SetTargetPointer.PERMANENT,
|
||||||
"Whenever a creature enters the battlefield under your control, you may look at the top X cards of your library, where X is that creature's power. If you do, put one of those cards on top of your library and the rest on the bottom of your library in any order"));
|
"Whenever a creature enters the battlefield under your control, "
|
||||||
|
+ "you may look at the top X cards of your library, where X "
|
||||||
|
+ "is that creature's power. If you do, put one of those cards "
|
||||||
|
+ "on top of your library and the rest on the bottom of "
|
||||||
|
+ "your library in any order"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public CreamOfTheCrop(final CreamOfTheCrop card) {
|
public CreamOfTheCrop(final CreamOfTheCrop card) {
|
||||||
|
@ -49,7 +54,10 @@ class CreamOfTheCropEffect extends OneShotEffect {
|
||||||
|
|
||||||
CreamOfTheCropEffect() {
|
CreamOfTheCropEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "look at the top X cards of your library, where X is that creature's power. If you do, put one of those cards on top of your library and the rest on the bottom of your library in any order";
|
this.staticText = "look at the top X cards of your library, "
|
||||||
|
+ "where X is that creature's power. If you do, put "
|
||||||
|
+ "one of those cards on top of your library and the "
|
||||||
|
+ "rest on the bottom of your library in any order";
|
||||||
}
|
}
|
||||||
|
|
||||||
CreamOfTheCropEffect(final CreamOfTheCropEffect effect) {
|
CreamOfTheCropEffect(final CreamOfTheCropEffect effect) {
|
||||||
|
@ -68,8 +76,9 @@ class CreamOfTheCropEffect extends OneShotEffect {
|
||||||
if (controller != null && permanent != null) {
|
if (controller != null && permanent != null) {
|
||||||
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, permanent.getPower().getValue()));
|
Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, permanent.getPower().getValue()));
|
||||||
if (!cards.isEmpty()) {
|
if (!cards.isEmpty()) {
|
||||||
TargetCard target = new TargetCardInHand(new FilterCard("card to put on top of your library"));
|
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put on top of your library"));
|
||||||
controller.choose(Outcome.Benefit, cards, target, game);
|
target.setNotTarget(true);
|
||||||
|
controller.chooseTarget(Outcome.Benefit, cards, target, source, game);
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
Card card = cards.get(target.getFirstTarget(), game);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
cards.remove(card);
|
cards.remove(card);
|
||||||
|
|
Loading…
Reference in a new issue