* Split Second - Fixed a bug that if more than one split second card was in the game, the zone of the owning card ould not be retrieved correctly.

This commit is contained in:
LevelX2 2014-04-02 20:54:09 +02:00
parent fd51fc8216
commit d22153362f
14 changed files with 35 additions and 40 deletions

View file

@ -65,7 +65,7 @@ public class CelestialCrusader extends CardImpl<CelestialCrusader> {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
this.addAbility(FlashAbility.getInstance()); this.addAbility(FlashAbility.getInstance());
this.addAbility(SplitSecondAbility.getInstance()); this.addAbility(new SplitSecondAbility());
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true)));
} }

View file

@ -28,11 +28,11 @@
package mage.sets.elspethvstezzeret; package mage.sets.elspethvstezzeret;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.constants.Rarity;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.keyword.AffinityForArtifactsAbility; import mage.abilities.keyword.AffinityForArtifactsAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/** /**
* *
@ -49,7 +49,7 @@ public class Thoughtcast extends CardImpl<Thoughtcast> {
// Affinity for artifacts // Affinity for artifacts
this.addAbility(new AffinityForArtifactsAbility()); this.addAbility(new AffinityForArtifactsAbility());
// Draw two cards. // Draw two cards.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(2)); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(2));
} }
public Thoughtcast(final Thoughtcast card) { public Thoughtcast(final Thoughtcast card) {

View file

@ -86,7 +86,7 @@ public class MoltenDisaster extends CardImpl<MoltenDisaster> {
class MoltenDisasterTriggeredAbility extends TriggeredAbilityImpl<MoltenDisasterTriggeredAbility> { class MoltenDisasterTriggeredAbility extends TriggeredAbilityImpl<MoltenDisasterTriggeredAbility> {
public MoltenDisasterTriggeredAbility() { public MoltenDisasterTriggeredAbility() {
super(Zone.HAND, new GainAbilitySourceEffect(SplitSecondAbility.getInstance(), Duration.WhileOnStack), false); super(Zone.HAND, new GainAbilitySourceEffect(new SplitSecondAbility(), Duration.WhileOnStack), false);
} }
public MoltenDisasterTriggeredAbility(final MoltenDisasterTriggeredAbility ability) { public MoltenDisasterTriggeredAbility(final MoltenDisasterTriggeredAbility ability) {

View file

@ -56,7 +56,7 @@ public class TakePossession extends CardImpl<TakePossession> {
this.color.setBlue(true); this.color.setBlue(true);
// Split second // Split second
this.addAbility(SplitSecondAbility.getInstance()); this.addAbility(new SplitSecondAbility());
// Enchant permanent // Enchant permanent
TargetPermanent auraTarget = new TargetPermanent(); TargetPermanent auraTarget = new TargetPermanent();
this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addTarget(auraTarget);

View file

@ -29,10 +29,6 @@ package mage.sets.planarchaos;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.SplitSecondAbility; import mage.abilities.keyword.SplitSecondAbility;
@ -40,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.filter.FilterCard; import mage.filter.FilterCard;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.NamePredicate; import mage.filter.predicate.mageobject.NamePredicate;
@ -69,7 +69,7 @@ public class Extirpate extends CardImpl<Extirpate> {
this.color.setBlack(true); this.color.setBlack(true);
// Split second // Split second
this.addAbility(SplitSecondAbility.getInstance()); this.addAbility(new SplitSecondAbility());
// Choose target card in a graveyard other than a basic land card. Search its owner's graveyard, hand, and library for all cards with the same name as that card and exile them. Then that player shuffles his or her library. // Choose target card in a graveyard other than a basic land card. Search its owner's graveyard, hand, and library for all cards with the same name as that card and exile them. Then that player shuffles his or her library.
this.getSpellAbility().addEffect(new ExtirpateEffect()); this.getSpellAbility().addEffect(new ExtirpateEffect());
this.getSpellAbility().addTarget(new TargetCardInGraveyard(filter)); this.getSpellAbility().addTarget(new TargetCardInGraveyard(filter));
@ -125,8 +125,7 @@ class ExtirpateEffect extends OneShotEffect<ExtirpateEffect> {
for (UUID targetId : targets) { for (UUID targetId : targets) {
Card targetCard = targetPlayer.getGraveyard().get(targetId, game); Card targetCard = targetPlayer.getGraveyard().get(targetId, game);
if (targetCard != null) { if (targetCard != null) {
targetPlayer.getGraveyard().remove(targetCard); player.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.GRAVEYARD);
targetCard.moveToZone(Zone.EXILED, source.getId(), game, false);
} }
} }
} }
@ -142,8 +141,7 @@ class ExtirpateEffect extends OneShotEffect<ExtirpateEffect> {
for (UUID targetId : targets) { for (UUID targetId : targets) {
Card targetCard = targetPlayer.getHand().get(targetId, game); Card targetCard = targetPlayer.getHand().get(targetId, game);
if (targetCard != null) { if (targetCard != null) {
targetPlayer.getHand().remove(targetCard); player.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.HAND);
targetCard.moveToZone(Zone.EXILED, source.getId(), game, false);
} }
} }
} }
@ -161,18 +159,16 @@ class ExtirpateEffect extends OneShotEffect<ExtirpateEffect> {
for (UUID targetId : targets) { for (UUID targetId : targets) {
Card targetCard = targetPlayer.getLibrary().remove(targetId, game); Card targetCard = targetPlayer.getLibrary().remove(targetId, game);
if (targetCard != null) { if (targetCard != null) {
targetCard.moveToZone(Zone.EXILED, source.getId(), game, false); player.moveCardToExileWithInfo(card, null, null, source.getSourceId(), game, Zone.LIBRARY);
} }
} }
} }
} else { } else {
player.lookAtCards(targetPlayer.getName() + " library", cardsInLibrary, game); player.lookAtCards(targetPlayer.getName() + " library", cardsInLibrary, game);
} }
targetPlayer.shuffleLibrary(game);
return true;
} }
targetPlayer.shuffleLibrary(game);
return true;
} }
return false; return false;

View file

@ -65,7 +65,7 @@ public class SulfurElemental extends CardImpl<SulfurElemental> {
// Flash // Flash
this.addAbility(FlashAbility.getInstance()); this.addAbility(FlashAbility.getInstance());
// Split second // Split second
this.addAbility(SplitSecondAbility.getInstance()); this.addAbility(new SplitSecondAbility());
// White creatures get +1/-1. // White creatures get +1/-1.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1,-1, Duration.WhileOnBattlefield, filter, false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1,-1, Duration.WhileOnBattlefield, filter, false)));
} }

View file

@ -54,7 +54,7 @@ public class AngelsGrace extends CardImpl<AngelsGrace> {
this.color.setWhite(true); this.color.setWhite(true);
// Split second // Split second
this.addAbility(SplitSecondAbility.getInstance()); this.addAbility(new SplitSecondAbility());
// You can't lose the game this turn and your opponents can't win the game this turn. Until end of turn, damage that would reduce your life total to less than 1 reduces it to 1 instead. // You can't lose the game this turn and your opponents can't win the game this turn. Until end of turn, damage that would reduce your life total to less than 1 reduces it to 1 instead.
this.getSpellAbility().addEffect(new AngelsGraceEffect()); this.getSpellAbility().addEffect(new AngelsGraceEffect());

View file

@ -59,7 +59,7 @@ public class KrosanGrip extends CardImpl<KrosanGrip> {
this.color.setGreen(true); this.color.setGreen(true);
// Split second // Split second
this.addAbility(SplitSecondAbility.getInstance()); this.addAbility(new SplitSecondAbility());
// Destroy target artifact or enchantment. // Destroy target artifact or enchantment.
this.getSpellAbility().addTarget(new TargetPermanent(filter)); this.getSpellAbility().addTarget(new TargetPermanent(filter));
this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addEffect(new DestroyTargetEffect());

View file

@ -48,7 +48,7 @@ public class SuddenShock extends CardImpl<SuddenShock> {
this.color.setRed(true); this.color.setRed(true);
// Split second // Split second
this.addAbility(SplitSecondAbility.getInstance()); this.addAbility(new SplitSecondAbility());
// Sudden Shock deals 2 damage to target creature or player. // Sudden Shock deals 2 damage to target creature or player.
this.getSpellAbility().addEffect(new DamageTargetEffect(2, true)); this.getSpellAbility().addEffect(new DamageTargetEffect(2, true));
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true));

View file

@ -58,7 +58,7 @@ public class SuddenSpoiling extends CardImpl<SuddenSpoiling> {
this.color.setBlack(true); this.color.setBlack(true);
// Split second // Split second
this.addAbility(SplitSecondAbility.getInstance()); this.addAbility(new SplitSecondAbility());
// Creatures target player controls become 0/2 and lose all abilities until end of turn. // Creatures target player controls become 0/2 and lose all abilities until end of turn.
this.getSpellAbility().addEffect(new SuddenSpoilingEffect(Duration.EndOfTurn)); this.getSpellAbility().addEffect(new SuddenSpoilingEffect(Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());

View file

@ -56,7 +56,7 @@ public class Trickbind extends CardImpl<Trickbind> {
this.color.setBlue(true); this.color.setBlue(true);
// Split second // Split second
this.addAbility(SplitSecondAbility.getInstance()); this.addAbility(new SplitSecondAbility());
// Counter target activated or triggered ability. If a permanent's ability is countered this way, activated abilities of that permanent can't be activated this turn. // Counter target activated or triggered ability. If a permanent's ability is countered this way, activated abilities of that permanent can't be activated this turn.
this.getSpellAbility().addEffect(new TrickbindCounterEffect()); this.getSpellAbility().addEffect(new TrickbindCounterEffect());

View file

@ -28,11 +28,11 @@
package mage.sets.timespiral; package mage.sets.timespiral;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.SplitSecondAbility; import mage.abilities.keyword.SplitSecondAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
/** /**
@ -48,7 +48,7 @@ public class WipeAway extends CardImpl<WipeAway> {
this.color.setBlue(true); this.color.setBlue(true);
// Split second // Split second
this.addAbility(SplitSecondAbility.getInstance()); this.addAbility(new SplitSecondAbility());
// Return target permanent to its owner's hand. // Return target permanent to its owner's hand.
this.getSpellAbility().addTarget(new TargetPermanent()); this.getSpellAbility().addTarget(new TargetPermanent());
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());

View file

@ -78,9 +78,9 @@ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect<PutLibraryInt
// putting cards to grave shouldn't end the game, so getting minimun available // putting cards to grave shouldn't end the game, so getting minimun available
int cardsCount = Math.min(amount.calculate(game, source), player.getLibrary().size()); int cardsCount = Math.min(amount.calculate(game, source), player.getLibrary().size());
for (int i = 0; i < cardsCount; i++) { for (int i = 0; i < cardsCount; i++) {
Card card = player.getLibrary().removeFromTop(game); Card card = player.getLibrary().getFromTop(game);
if (card != null) { if (card != null) {
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false); player.moveCardToGraveyardWithInfo(card, source.getId(), game, Zone.LIBRARY);
} }
else { else {
break; break;

View file

@ -17,14 +17,9 @@ import mage.game.events.GameEvent;
* As long as this spell is on the stack, players can't cast other spells or activate abilities that aren't mana abilities. * As long as this spell is on the stack, players can't cast other spells or activate abilities that aren't mana abilities.
*/ */
public class SplitSecondAbility extends SimpleStaticAbility implements MageSingleton { public class SplitSecondAbility extends SimpleStaticAbility {
private static final SplitSecondAbility ability = new SplitSecondAbility();
public static SplitSecondAbility getInstance() { public SplitSecondAbility() {
return ability;
}
private SplitSecondAbility() {
super(Zone.STACK, new SplitSecondEffect()); super(Zone.STACK, new SplitSecondEffect());
this.setRuleAtTheTop(true); this.setRuleAtTheTop(true);
} }
@ -34,9 +29,13 @@ public class SplitSecondAbility extends SimpleStaticAbility implements MageSingl
return "Split second <i>(As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.)</i>"; return "Split second <i>(As long as this spell is on the stack, players can't cast spells or activate abilities that aren't mana abilities.)</i>";
} }
public SplitSecondAbility(SplitSecondAbility ability) {
super(ability);
}
@Override @Override
public SimpleStaticAbility copy() { public SimpleStaticAbility copy() {
return ability; return new SplitSecondAbility(this);
} }
} }