[minor] fixes to handling of auras going to battlefield from library or graveyard.

This commit is contained in:
LevelX2 2013-05-27 12:55:11 +02:00
parent 908b9194c3
commit 40d1ea8da1
4 changed files with 10 additions and 0 deletions

View file

@ -118,6 +118,7 @@ class CurseOfMisfortunesEffect extends OneShotEffect<CurseOfMisfortunesEffect> {
Card card = game.getCard(targetCard.getFirstTarget()); Card card = game.getCard(targetCard.getFirstTarget());
if (card != null) { if (card != null) {
this.setTargetPointer(new FixedTarget(targetPlayer.getId())); this.setTargetPointer(new FixedTarget(targetPlayer.getId()));
game.getState().setValue("attachTo:" + card.getId(), targetPlayer.getId());
player.shuffleLibrary(game); player.shuffleLibrary(game);
return card.putOntoBattlefield(game, Constants.Zone.LIBRARY, source.getId(), source.getControllerId()); return card.putOntoBattlefield(game, Constants.Zone.LIBRARY, source.getId(), source.getControllerId());
} }

View file

@ -109,6 +109,7 @@ class BitterheartWitchEffect extends OneShotEffect<BitterheartWitchEffect> {
if (player.searchLibrary(targetCard, game)) { if (player.searchLibrary(targetCard, game)) {
Card card = game.getCard(targetCard.getFirstTarget()); Card card = game.getCard(targetCard.getFirstTarget());
if (card != null) { if (card != null) {
game.getState().setValue("attachTo:" + card.getId(), targetPlayer.getId());
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId()); card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
targetPlayer.addAttachment(card.getId(), game); targetPlayer.addAttachment(card.getId(), game);
} }

View file

@ -76,7 +76,9 @@ public class ArachnusSpinner extends CardImpl<ArachnusSpinner> {
this.power = new MageInt(5); this.power = new MageInt(5);
this.toughness = new MageInt(7); this.toughness = new MageInt(7);
// Reach (This creature can block creatures with flying.)
this.addAbility(ReachAbility.getInstance()); this.addAbility(ReachAbility.getInstance());
// Tap an untapped Spider you control: Search your graveyard and/or library for a card named Arachnus Web and put it onto the battlefield attached to target creature. If you search your library this way, shuffle it.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new ArachnusSpinnerEffect(), new ArachnusSpinnerEffect(),
new TapTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false))); new TapTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false)));
@ -144,6 +146,7 @@ class ArachnusSpinnerEffect extends OneShotEffect<ArachnusSpinnerEffect> {
if (card != null) { if (card != null) {
Permanent permanent = game.getPermanent(source.getFirstTarget()); Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) { if (permanent != null) {
game.getState().setValue("attachTo:" + card.getId(), permanent.getId());
card.putOntoBattlefield(game, zone, source.getSourceId(), source.getControllerId()); card.putOntoBattlefield(game, zone, source.getSourceId(), source.getControllerId());
return permanent.addAttachment(card.getId(), game); return permanent.addAttachment(card.getId(), game);
} }

View file

@ -46,6 +46,11 @@ import mage.target.Target;
import java.util.UUID; import java.util.UUID;
/** /**
* Cards with the Aura subtype don't change the zone they are in, if there is no
* valid target on the battlefield. Also, when entering the Battlefield and it
* was not cast, this effect gets the target to witch to attach it.
*
* This effect is automatically added to ContinuousEffects at the start of a game
* *
* @author North * @author North
*/ */