diff --git a/Mage.Sets/src/mage/sets/alliances/SustainingSpirit.java b/Mage.Sets/src/mage/sets/alliances/SustainingSpirit.java index 880247d478f..08f61d734d6 100644 --- a/Mage.Sets/src/mage/sets/alliances/SustainingSpirit.java +++ b/Mage.Sets/src/mage/sets/alliances/SustainingSpirit.java @@ -78,7 +78,7 @@ class SustainingSpiritReplacementEffect extends ReplacementEffectImpl 0) &&(controller.getLife() - event.getAmount()) < 1 && event.getPlayerId().equals(controller.getId()) ) { event.setAmount(controller.getLife() - 1); + //unsure how to make this comply with + // 10/1/2008: The ability doesn't change how much damage is dealt; + // it just changes how much life that damage makes you lose. + // An effect such as Spirit Link will see the full amount of damage being dealt. } } } diff --git a/Mage.Sets/src/mage/sets/arabiannights/AliFromCairo.java b/Mage.Sets/src/mage/sets/arabiannights/AliFromCairo.java index 277dbeee6c7..b82bba44ee1 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/AliFromCairo.java +++ b/Mage.Sets/src/mage/sets/arabiannights/AliFromCairo.java @@ -72,7 +72,7 @@ class AliFromCairoReplacementEffect extends ReplacementEffectImpl 0) &&(controller.getLife() - event.getAmount()) < 1 && event.getPlayerId().equals(controller.getId()) ) { event.setAmount(controller.getLife() - 1); + //unsure how to make this comply with + // 10/1/2008: The ability doesn't change how much damage is dealt; + // it just changes how much life that damage makes you lose. + // An effect such as Spirit Link will see the full amount of damage being dealt. } } } diff --git a/Mage.Sets/src/mage/sets/arabiannights/KingSuleiman.java b/Mage.Sets/src/mage/sets/arabiannights/KingSuleiman.java index e7912b6bec0..da657499daf 100644 --- a/Mage.Sets/src/mage/sets/arabiannights/KingSuleiman.java +++ b/Mage.Sets/src/mage/sets/arabiannights/KingSuleiman.java @@ -38,6 +38,7 @@ import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPermanent; @@ -47,11 +48,12 @@ import mage.target.TargetPermanent; */ public class KingSuleiman extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("target Djinn or Efreet"); + private static final FilterPermanent filter = new FilterPermanent("Djinn or Efreet"); static { - filter.add(new SubtypePredicate("Djinn")); - filter.add(new SubtypePredicate("Efreet")); + filter.add( Predicates.or( + new SubtypePredicate("Djinn"), + new SubtypePredicate("Efreet"))); } public KingSuleiman(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/fifthedition/BottleOfSuleiman.java b/Mage.Sets/src/mage/sets/fifthedition/BottleOfSuleiman.java index aee2f3bdb26..eb6d2e073e4 100644 --- a/Mage.Sets/src/mage/sets/fifthedition/BottleOfSuleiman.java +++ b/Mage.Sets/src/mage/sets/fifthedition/BottleOfSuleiman.java @@ -94,7 +94,7 @@ class BottleOfSuleimanEffect extends OneShotEffect { if (you != null) { if (you.flipCoin(game)) { DjinnToken token = new DjinnToken(); - token.putOntoBattlefield(1, game, source.getId(), source.getControllerId()); + token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); return true; } else { you.damage(5, source.getSourceId(), game, true, false); diff --git a/Mage.Sets/src/mage/sets/fourthedition/EbonyHorse.java b/Mage.Sets/src/mage/sets/fourthedition/EbonyHorse.java index c0e95c68bdf..c2a490b7913 100644 --- a/Mage.Sets/src/mage/sets/fourthedition/EbonyHorse.java +++ b/Mage.Sets/src/mage/sets/fourthedition/EbonyHorse.java @@ -33,16 +33,13 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.PreventDamageFromTargetEffect; -import mage.abilities.effects.common.PreventDamageTargetEffect; -import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.*; import mage.cards.CardImpl; import mage.constants.*; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AttackingPredicate; import mage.filter.predicate.permanent.ControllerPredicate; -import mage.target.common.TargetAttackingCreature; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.Target; import mage.target.common.TargetCreaturePermanent; /** @@ -64,9 +61,11 @@ public class EbonyHorse extends CardImpl { // {2}, {tap}: Untap target attacking creature you control. 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 GenericManaCost(2)); ability.addCost(new TapSourceCost()); - ability.addEffect(new PreventDamageFromTargetEffect(Duration.EndOfTurn, true)); - ability.addEffect(new PreventDamageTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE)); - ability.addTarget(new TargetCreaturePermanent(filter)); + ability.addEffect(new PreventCombatDamageSourceEffect(Duration.EndOfTurn)); + ability.addEffect(new PreventCombatDamageFromSourceEffect(Duration.EndOfTurn)); + Target target = new TargetCreaturePermanent(filter); + target.setRequired(true); + ability.addTarget(target); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/invasion/Opt.java b/Mage.Sets/src/mage/sets/invasion/Opt.java index 8f00c7ee705..97a7a7e8a7b 100644 --- a/Mage.Sets/src/mage/sets/invasion/Opt.java +++ b/Mage.Sets/src/mage/sets/invasion/Opt.java @@ -29,11 +29,21 @@ package mage.sets.invasion; import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardControllerEffect; -import mage.abilities.effects.common.ScryEffect; +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.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; /** * @@ -48,8 +58,8 @@ public class Opt extends CardImpl { this.color.setBlue(true); // Look at the top card of your library. You may put that card on the bottom of your library. - // This is functionally the same as scry, but is scry appropriate? - this.getSpellAbility().addEffect(new ScryEffect(1)); + // This is functionally the same as scry, copy scry effect, removing "scry", unless theres a simpler way im overlooking? + this.getSpellAbility().addEffect(new OptEffect()); // Draw a card. this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); } @@ -63,3 +73,62 @@ public class Opt extends CardImpl { return new Opt(this); } } +class OptEffect extends OneShotEffect { + + protected static FilterCard filter1 = new FilterCard("card to put on the bottom of your library"); + + public OptEffect() { + super(Outcome.DrawCard); + this.staticText = "Look at the top card of your library. You may put that card on the bottom of your library."; + } + + public OptEffect(final OptEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Cards cards = new CardsImpl(Zone.PICK); + int count = Math.min( 1, player.getLibrary().size()); + if (count == 0) { + return false; + } + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + cards.add(card); + game.setZone(card.getId(), Zone.PICK); + } + TargetCard target1 = new TargetCard(Zone.PICK, filter1); + // move cards to the bottom of the library + while (cards.size() > 0 && player.choose(Outcome.Detriment, cards, target1, game)) { + Card card = cards.get(target1.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + card.moveToZone(Zone.LIBRARY, source.getId(), game, false); + } + target1.clearChosen(); + } + // move cards to the top of the library + int onBottom = 1 - cards.size(); + + if (cards.size() == 1) { + Card card = cards.get(cards.iterator().next(), game); + card.moveToZone(Zone.LIBRARY, source.getId(), game, true); + } + game.informPlayers(new StringBuilder(player.getName()).append(" puts ") + .append(onBottom).append(onBottom == 1 ?" card":" cards") + .append(" on the bottom of his or her library") + .append(1).append(")").toString()); + return true; + } + return false; + } + + @Override + public OptEffect copy() { + return new OptEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/torment/Accelerate.java b/Mage.Sets/src/mage/sets/torment/Accelerate.java index bfe1534e608..c42b0ef8f3a 100644 --- a/Mage.Sets/src/mage/sets/torment/Accelerate.java +++ b/Mage.Sets/src/mage/sets/torment/Accelerate.java @@ -36,6 +36,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; /** * @@ -51,6 +52,7 @@ public class Accelerate extends CardImpl { // Target creature gains haste until end of turn. this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Draw a card. this.getSpellAbility().addEffect(new DrawCardControllerEffect(1)); }