mirror of
https://github.com/correl/mage.git
synced 2025-04-11 09:11:12 -09:00
- Fixed #6838
This commit is contained in:
parent
bd9738f128
commit
bfb7a1a24d
14 changed files with 107 additions and 76 deletions
Mage.Sets/src/mage/cards
a
b
d
i
m
r
s
Mage/src/main/java/mage/abilities
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -13,6 +12,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.counters.CounterType;
|
import mage.counters.CounterType;
|
||||||
|
@ -26,7 +26,9 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
*/
|
*/
|
||||||
public final class AquastrandSpider extends CardImpl {
|
public final class AquastrandSpider extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with a +1/+1 counter on it");
|
private static final FilterCreaturePermanent filter
|
||||||
|
= new FilterCreaturePermanent("creature with a +1/+1 counter on it");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(new CounterPredicate(CounterType.P1P1));
|
filter.add(new CounterPredicate(CounterType.P1P1));
|
||||||
}
|
}
|
||||||
|
@ -42,9 +44,11 @@ public final class AquastrandSpider extends CardImpl {
|
||||||
this.addAbility(new GraftAbility(this, 2));
|
this.addAbility(new GraftAbility(this, 2));
|
||||||
|
|
||||||
// {G}: Target creature with a +1/+1 counter on it gains reach until end of turn.
|
// {G}: Target creature with a +1/+1 counter on it gains reach until end of turn.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(ReachAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||||
|
new GainAbilityTargetEffect(ReachAbility.getInstance(),
|
||||||
|
Duration.EndOfTurn), new ManaCostsImpl("{G}"));
|
||||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability.addCustomOutcome(Outcome.Benefit));
|
||||||
}
|
}
|
||||||
|
|
||||||
public AquastrandSpider(final AquastrandSpider card) {
|
public AquastrandSpider(final AquastrandSpider card) {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.a;
|
package mage.cards.a;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -22,8 +21,12 @@ public final class AuraShards extends CardImpl {
|
||||||
public AuraShards(UUID ownerId, CardSetInfo setInfo) {
|
public AuraShards(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{W}");
|
||||||
|
|
||||||
// Whenever a creature enters the battlefield under your control, you may destroy target artifact or enchantment.
|
// Whenever a creature enters the battlefield under your control,
|
||||||
Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), StaticFilters.FILTER_PERMANENT_CREATURE, true, "Whenever a creature enters the battlefield under your control, you may destroy target artifact or enchantment");
|
// you may destroy target artifact or enchantment.
|
||||||
|
Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD,
|
||||||
|
new DestroyTargetEffect(), StaticFilters.FILTER_PERMANENT_CREATURE, true,
|
||||||
|
"Whenever a creature enters the battlefield under your control, "
|
||||||
|
+ "you may destroy target artifact or enchantment");
|
||||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT));
|
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ public final class BeastWithin extends CardImpl {
|
||||||
class BeastWithinEffect extends OneShotEffect {
|
class BeastWithinEffect extends OneShotEffect {
|
||||||
|
|
||||||
public BeastWithinEffect() {
|
public BeastWithinEffect() {
|
||||||
super(Outcome.PutCreatureInPlay);
|
super(Outcome.Detriment);
|
||||||
staticText = "Its controller creates a 3/3 green Beast creature token";
|
staticText = "Its controller creates a 3/3 green Beast creature token";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
|
|
||||||
package mage.cards.d;
|
package mage.cards.d;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterAttackingCreature;
|
import mage.filter.common.FilterAttackingCreature;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
@ -26,9 +27,13 @@ public final class DuelistsHeritage extends CardImpl {
|
||||||
public DuelistsHeritage(UUID ownerId, CardSetInfo setInfo) {
|
public DuelistsHeritage(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||||
|
|
||||||
|
// Whenever one or more creatures attack, you may have target attacking
|
||||||
// Whenever one or more creatures attack, you may have target attacking creature gain double strike until end of turn.
|
// creature gain double strike until end of turn.
|
||||||
Ability ability = new DuelistsHeritageTriggeredAbility();
|
Effect effect = new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(),
|
||||||
|
Duration.EndOfTurn);
|
||||||
|
effect.setOutcome(Outcome.Benefit);
|
||||||
|
Ability ability = new DuelistsHeritageTriggeredAbility(
|
||||||
|
Zone.BATTLEFIELD, effect);
|
||||||
ability.addTarget(new TargetCreaturePermanent(new FilterAttackingCreature()));
|
ability.addTarget(new TargetCreaturePermanent(new FilterAttackingCreature()));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
@ -45,8 +50,8 @@ public final class DuelistsHeritage extends CardImpl {
|
||||||
|
|
||||||
class DuelistsHeritageTriggeredAbility extends TriggeredAbilityImpl {
|
class DuelistsHeritageTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
public DuelistsHeritageTriggeredAbility() {
|
public DuelistsHeritageTriggeredAbility(Zone zone, Effect effect) {
|
||||||
super(Zone.BATTLEFIELD, new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn), true);
|
super(zone, effect, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DuelistsHeritageTriggeredAbility(final DuelistsHeritageTriggeredAbility ability) {
|
public DuelistsHeritageTriggeredAbility(final DuelistsHeritageTriggeredAbility ability) {
|
||||||
|
|
|
@ -30,14 +30,14 @@ public final class InevitableEnd extends CardImpl {
|
||||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||||
this.getSpellAbility().addTarget(auraTarget);
|
this.getSpellAbility().addTarget(auraTarget);
|
||||||
this.getSpellAbility().addEffect(
|
this.getSpellAbility().addEffect(
|
||||||
new AttachEffect(Outcome.BoostCreature));
|
new AttachEffect(Outcome.Detriment));
|
||||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// Enchanted creature has "At the beginning of your upkeep, sacrifice a
|
// Enchanted creature has "At the beginning of your upkeep, sacrifice a
|
||||||
// creature."
|
// creature."
|
||||||
BeginningOfUpkeepTriggeredAbility triggeredAbility =
|
BeginningOfUpkeepTriggeredAbility triggeredAbility
|
||||||
new BeginningOfUpkeepTriggeredAbility(
|
= new BeginningOfUpkeepTriggeredAbility(
|
||||||
new SacrificeControllerEffect(
|
new SacrificeControllerEffect(
|
||||||
StaticFilters.FILTER_PERMANENT_CREATURE, 1, null),
|
StaticFilters.FILTER_PERMANENT_CREATURE, 1, null),
|
||||||
TargetController.YOU, false);
|
TargetController.YOU, false);
|
||||||
|
@ -46,7 +46,9 @@ public final class InevitableEnd extends CardImpl {
|
||||||
"Enchanted creature has \"" + triggeredAbility.getRule() + "\"")));
|
"Enchanted creature has \"" + triggeredAbility.getRule() + "\"")));
|
||||||
}
|
}
|
||||||
|
|
||||||
private InevitableEnd(final InevitableEnd card) { super(card); }
|
private InevitableEnd(final InevitableEnd card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InevitableEnd copy() {
|
public InevitableEnd copy() {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.m;
|
package mage.cards.m;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -13,6 +12,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.target.common.TargetAttackingCreature;
|
import mage.target.common.TargetAttackingCreature;
|
||||||
|
|
||||||
|
@ -25,13 +25,16 @@ public final class MazeOfIth extends CardImpl {
|
||||||
public MazeOfIth(UUID ownerId, CardSetInfo setInfo) {
|
public MazeOfIth(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||||
|
|
||||||
// {tap}: Untap target attacking creature. Prevent all combat damage that would be dealt to and dealt by that creature this turn.
|
// {T}: Untap target attacking creature. Prevent all combat damage that
|
||||||
|
// would be dealt to and dealt by that creature this turn.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost());
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new TapSourceCost());
|
||||||
Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true);
|
Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true);
|
||||||
effect.setText("Prevent all combat damage that would be dealt to");
|
effect.setText("Prevent all combat damage that would be dealt to");
|
||||||
|
effect.setOutcome(Outcome.Detriment);
|
||||||
ability.addEffect(effect);
|
ability.addEffect(effect);
|
||||||
effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE, true);
|
effect = new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE, true);
|
||||||
effect.setText("and dealt by that creature this turn");
|
effect.setText("and dealt by that creature this turn");
|
||||||
|
effect.setOutcome(Outcome.Detriment);
|
||||||
ability.addEffect(effect);
|
ability.addEffect(effect);
|
||||||
ability.addTarget(new TargetAttackingCreature());
|
ability.addTarget(new TargetAttackingCreature());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package mage.cards.r;
|
package mage.cards.r;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -14,6 +13,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Outcome;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,17 +25,20 @@ public final class RetreatToHagra extends CardImpl {
|
||||||
public RetreatToHagra(UUID ownerId, CardSetInfo setInfo) {
|
public RetreatToHagra(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
|
||||||
|
|
||||||
// <i>Landfall</i>- Whenever a land enters the battlefield under your control, choose one - Target creature gets +1/+0 and gains deathtouch until end of turn;
|
// <i>Landfall</i>- Whenever a land enters the battlefield under your control,
|
||||||
|
// choose one - Target creature gets +1/+0 and gains deathtouch until end of turn;
|
||||||
LandfallAbility ability = new LandfallAbility(new BoostTargetEffect(1, 0, Duration.EndOfTurn), false);
|
LandfallAbility ability = new LandfallAbility(new BoostTargetEffect(1, 0, Duration.EndOfTurn), false);
|
||||||
ability.addEffect(new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn));
|
Effect effect = new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn);
|
||||||
|
effect.setOutcome(Outcome.Benefit);
|
||||||
|
ability.addEffect(effect);
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
|
|
||||||
// or Each opponent loses 1 life and you gain 1 life.
|
// or Each opponent loses 1 life and you gain 1 life.
|
||||||
Mode mode = new Mode();
|
Mode mode = new Mode();
|
||||||
mode.addEffect(new LoseLifeOpponentsEffect(1));
|
mode.addEffect(new LoseLifeOpponentsEffect(1));
|
||||||
Effect effect = new GainLifeEffect(1);
|
Effect gainLife = new GainLifeEffect(1);
|
||||||
effect.setText("and you gain 1 life");
|
gainLife.setText("and you gain 1 life");
|
||||||
mode.addEffect(effect);
|
mode.addEffect(gainLife);
|
||||||
ability.addMode(mode);
|
ability.addMode(mode);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ public final class SaskiaTheUnyielding extends CardImpl {
|
||||||
class SaskiaTheUnyieldingEffect extends OneShotEffect {
|
class SaskiaTheUnyieldingEffect extends OneShotEffect {
|
||||||
|
|
||||||
public SaskiaTheUnyieldingEffect() {
|
public SaskiaTheUnyieldingEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Detriment);
|
||||||
this.staticText = "it deals that much damage to the chosen player";
|
this.staticText = "it deals that much damage to the chosen player";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,13 +39,15 @@ public final class ShieldedByFaith extends CardImpl {
|
||||||
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
|
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
|
||||||
|
|
||||||
// Enchanted creature has indestructible.
|
// Enchanted creature has indestructible.
|
||||||
Effect effect = new GainAbilityAttachedEffect(IndestructibleAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield);
|
Effect effect = new GainAbilityAttachedEffect(IndestructibleAbility.getInstance(),
|
||||||
|
AttachmentType.AURA, Duration.WhileOnBattlefield);
|
||||||
effect.setText("Enchanted creature has indestructible");
|
effect.setText("Enchanted creature has indestructible");
|
||||||
|
effect.setOutcome(Outcome.Benefit);
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||||
|
|
||||||
// Whenever a creature enters the battlefield, you may attach Shielded by Faith to that creature.
|
// Whenever a creature enters the battlefield, you may attach Shielded by Faith to that creature.
|
||||||
this.addAbility(new EntersBattlefieldAllTriggeredAbility(
|
this.addAbility(new EntersBattlefieldAllTriggeredAbility(
|
||||||
Zone.BATTLEFIELD, new AttachEffect(Outcome.Neutral, "attach {source} to that creature"),
|
Zone.BATTLEFIELD, new AttachEffect(Outcome.Benefit, "attach {source} to that creature"),
|
||||||
new FilterCreaturePermanent("a creature"), true, SetTargetPointer.PERMANENT, null, false));
|
new FilterCreaturePermanent("a creature"), true, SetTargetPointer.PERMANENT, null, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public final class SongOfTheDryads extends CardImpl {
|
||||||
// Enchant permanent
|
// Enchant permanent
|
||||||
TargetPermanent auraTarget = new TargetPermanent();
|
TargetPermanent auraTarget = new TargetPermanent();
|
||||||
this.getSpellAbility().addTarget(auraTarget);
|
this.getSpellAbility().addTarget(auraTarget);
|
||||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit));
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
|
||||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
|
@ -108,6 +108,8 @@ class BecomesColorlessForestLandEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasLayer(Layer layer) {
|
public boolean hasLayer(Layer layer) {
|
||||||
return layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4;
|
return layer == Layer.AbilityAddingRemovingEffects_6
|
||||||
|
|| layer == Layer.ColorChangingEffects_5
|
||||||
|
|| layer == Layer.TypeChangingEffects_4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,8 +56,10 @@ public final class SurgicalExtraction extends CardImpl {
|
||||||
class SurgicalExtractionEffect extends OneShotEffect {
|
class SurgicalExtractionEffect extends OneShotEffect {
|
||||||
|
|
||||||
public SurgicalExtractionEffect() {
|
public SurgicalExtractionEffect() {
|
||||||
super(Outcome.Exile);
|
super(Outcome.Detriment);
|
||||||
this.staticText = "Choose target card in a graveyard other than a basic land card. Search its owner's graveyard, hand, and library for any number of cards with the same name as that card and exile them. Then that player shuffles their library";
|
this.staticText = "Choose target card in a graveyard other than a basic land card. "
|
||||||
|
+ "Search its owner's graveyard, hand, and library for any number of cards "
|
||||||
|
+ "with the same name as that card and exile them. Then that player shuffles their library";
|
||||||
}
|
}
|
||||||
|
|
||||||
public SurgicalExtractionEffect(final SurgicalExtractionEffect effect) {
|
public SurgicalExtractionEffect(final SurgicalExtractionEffect effect) {
|
||||||
|
@ -80,21 +82,24 @@ class SurgicalExtractionEffect extends OneShotEffect {
|
||||||
if (chosenCard != null && controller != null) {
|
if (chosenCard != null && controller != null) {
|
||||||
Player owner = game.getPlayer(chosenCard.getOwnerId());
|
Player owner = game.getPlayer(chosenCard.getOwnerId());
|
||||||
if (owner != null) {
|
if (owner != null) {
|
||||||
String nameToSearch = chosenCard.isSplitCard() ? ((SplitCard) chosenCard).getLeftHalfCard().getName() : chosenCard.getName();
|
String nameToSearch = chosenCard.isSplitCard()
|
||||||
|
? ((SplitCard) chosenCard).getLeftHalfCard().getName() : chosenCard.getName();
|
||||||
FilterCard filterNamedCard = new FilterCard("card named " + nameToSearch);
|
FilterCard filterNamedCard = new FilterCard("card named " + nameToSearch);
|
||||||
filterNamedCard.add(new NamePredicate(nameToSearch));
|
filterNamedCard.add(new NamePredicate(nameToSearch));
|
||||||
|
|
||||||
// cards in Graveyard
|
// cards in Graveyard
|
||||||
int cardsCount = owner.getGraveyard().count(filterNamedCard, game);
|
int cardsCount = owner.getGraveyard().count(filterNamedCard, game);
|
||||||
if (cardsCount > 0) {
|
if (cardsCount > 0) {
|
||||||
filterNamedCard.setMessage("card named " + nameToSearch + " in the graveyard of " + owner.getName());
|
filterNamedCard.setMessage("card named " + nameToSearch
|
||||||
|
+ " in the graveyard of " + owner.getName());
|
||||||
TargetCardInGraveyard target = new TargetCardInGraveyard(0, cardsCount, filterNamedCard);
|
TargetCardInGraveyard target = new TargetCardInGraveyard(0, cardsCount, filterNamedCard);
|
||||||
if (controller.chooseTarget(Outcome.Exile, owner.getGraveyard(), target, source, game)) {
|
if (controller.chooseTarget(Outcome.Exile, owner.getGraveyard(), target, source, game)) {
|
||||||
List<UUID> targets = target.getTargets();
|
List<UUID> targets = target.getTargets();
|
||||||
for (UUID targetId : targets) {
|
for (UUID targetId : targets) {
|
||||||
Card targetCard = owner.getGraveyard().get(targetId, game);
|
Card targetCard = owner.getGraveyard().get(targetId, game);
|
||||||
if (targetCard != null) {
|
if (targetCard != null) {
|
||||||
controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true);
|
controller.moveCardToExileWithInfo(targetCard, null,
|
||||||
|
"", source.getSourceId(), game, Zone.GRAVEYARD, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
package mage.cards.s;
|
package mage.cards.s;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -38,11 +36,13 @@ public final class SwordOfFireAndIce extends CardImpl {
|
||||||
|
|
||||||
// Equipped creature gets +2/+2 and has protection from red and from blue.
|
// Equipped creature gets +2/+2 and has protection from red and from blue.
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)));
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(ProtectionAbility.from(ObjectColor.RED, ObjectColor.BLUE), AttachmentType.EQUIPMENT)));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(
|
||||||
// Whenever equipped creature deals combat damage to a player, Sword of Fire and Ice deals 2 damage to any target and you draw a card.
|
ProtectionAbility.from(ObjectColor.RED, ObjectColor.BLUE), AttachmentType.EQUIPMENT)));
|
||||||
|
// Whenever equipped creature deals combat damage to a player, Sword of Fire
|
||||||
|
// and Ice deals 2 damage to any target and you draw a card.
|
||||||
this.addAbility(new SwordOfFireAndIceAbility());
|
this.addAbility(new SwordOfFireAndIceAbility());
|
||||||
// Equip
|
// Equip
|
||||||
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2)));
|
this.addAbility(new EquipAbility(Outcome.Benefit, new GenericManaCost(2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public SwordOfFireAndIce(final SwordOfFireAndIce card) {
|
public SwordOfFireAndIce(final SwordOfFireAndIce card) {
|
||||||
|
@ -82,11 +82,14 @@ class SwordOfFireAndIceAbility extends TriggeredAbilityImpl {
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
|
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
|
||||||
Permanent p = game.getPermanent(event.getSourceId());
|
Permanent p = game.getPermanent(event.getSourceId());
|
||||||
return damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId());
|
return damageEvent.isCombatDamage()
|
||||||
|
&& p != null
|
||||||
|
&& p.getAttachments().contains(this.getSourceId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return "Whenever equipped creature deals combat damage to a player, {this} deals 2 damage to any target and you draw a card.";
|
return "Whenever equipped creature deals combat damage to a player, "
|
||||||
|
+ "{this} deals 2 damage to any target and you draw a card.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import mage.constants.AbilityType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
import mage.game.events.GameEvent.EventType;
|
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class DestroyTargetEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DestroyTargetEffect(boolean noRegen, boolean multitargetHandling) {
|
public DestroyTargetEffect(boolean noRegen, boolean multitargetHandling) {
|
||||||
super(Outcome.DestroyPermanent);
|
super(Outcome.Detriment);
|
||||||
this.noRegen = noRegen;
|
this.noRegen = noRegen;
|
||||||
this.multitargetHandling = multitargetHandling;
|
this.multitargetHandling = multitargetHandling;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue