* Some changes to zone object movement and source object handling. Origin source object of ability is now hold in ability to be able to check e.g. zone change counter.

This commit is contained in:
LevelX2 2015-02-11 17:51:41 +01:00
parent 4fe5560222
commit b73f34a52e
32 changed files with 396 additions and 82 deletions

View file

@ -50,8 +50,8 @@ public class Cloudshift extends CardImpl {
// Exile target creature you control, then return that card to the battlefield under your control.
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addEffect(new ExileTargetForSourceEffect("Cloudshift"));
this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect());
this.getSpellAbility().addEffect(new ExileTargetForSourceEffect());
this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true));
}
public Cloudshift(final Cloudshift card) {

View file

@ -48,8 +48,8 @@ public class ConjurersCloset extends CardImpl {
this.expansionSetCode = "AVR";
// At the beginning of your end step, you may exile target creature you control, then return that card to the battlefield under your control.
Ability ability = new BeginningOfYourEndStepTriggeredAbility(new ExileTargetForSourceEffect("Conjurer's Closet Exile"), true);
ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect());
Ability ability = new BeginningOfYourEndStepTriggeredAbility(new ExileTargetForSourceEffect(), true);
ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true));
ability.addTarget(new TargetControlledCreaturePermanent());
this.addAbility(ability);
}

View file

@ -58,9 +58,9 @@ public class NephaliaSmuggler extends CardImpl {
this.toughness = new MageInt(1);
// {3}{U}, {tap}: Exile another target creature you control, then return that card to the battlefield under your control.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect("Exile Nephalia Smuggler"), new ManaCostsImpl("{3}{U}"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new ManaCostsImpl("{3}{U}"));
ability.addCost(new TapSourceCost());
ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect());
ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true));
ability.addTarget(new TargetControlledCreaturePermanent());
this.addAbility(ability);
}

View file

@ -45,7 +45,8 @@ public class EyeOfNowhere extends CardImpl {
super(ownerId, 59, "Eye of Nowhere", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{U}{U}");
this.expansionSetCode = "CHK";
this.subtype.add("Arcane");
this.color.setBlue(true);
// Return target permanent to its owner's hand.
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent());

View file

@ -77,7 +77,7 @@ public class AdarkarValkyrie extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Vigilance
this.addAbility(VigilanceAbility.getInstance());
// {tap}: When target creature other than Adarkar Valkyrie dies this turn, return that card to the battlefield under your control.
// {T}: When target creature other than Adarkar Valkyrie dies this turn, return that card to the battlefield under your control.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AdarkarValkyrieEffect(), new TapSourceCost());
Target target = new TargetCreaturePermanent(filter);
ability.addTarget(target);
@ -98,7 +98,7 @@ class AdarkarValkyrieEffect extends OneShotEffect {
public AdarkarValkyrieEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "When target creature other than Adarkar Valkyrie dies this turn, return that card to the battlefield under your control";
this.staticText = "When target creature other than {this} dies this turn, return that card to the battlefield under your control";
}
public AdarkarValkyrieEffect(final AdarkarValkyrieEffect effect) {

View file

@ -62,12 +62,12 @@ public class Helvault extends CardImpl {
this.supertype.add("Legendary");
// {1}, {tap}: Exile target creature you control.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect("Helvault exile"), new GenericManaCost(1));
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new GenericManaCost(1));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetControlledCreaturePermanent());
this.addAbility(ability);
// {7}, {tap}: Exile target creature you don't control.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect("Helvault exile"), new GenericManaCost(7));
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new GenericManaCost(7));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);

View file

@ -42,8 +42,6 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.target.Target;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
@ -59,7 +57,7 @@ public class IcyPrison extends CardImpl {
this.color.setBlue(true);
// When Icy Prison enters the battlefield, exile target creature.
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(this.getLogName()), false);
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), false);
ability1.addTarget(new TargetCreaturePermanent());
this.addAbility(ability1);

View file

@ -65,7 +65,7 @@ public class FiendHunter extends CardImpl {
this.toughness = new MageInt(3);
// When Fiend Hunter enters the battlefield, you may exile another target creature.
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect("Fiend Hunter Exile"), true);
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), true);
Target target = new TargetPermanent(filter);
ability1.addTarget(target);
this.addAbility(ability1);

View file

@ -68,7 +68,7 @@ public class LeoninRelicWarder extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(2);
Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect("Leonin Relic-Warder exile"), true);
Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), true);
Target target = new TargetPermanent(filter);
ability.addTarget(target);
this.addAbility(ability);

View file

@ -58,7 +58,7 @@ public class ParallaxTide extends CardImpl {
// Fading 5
this.addAbility(new FadingAbility(5, this));
// Remove a fade counter from Parallax Tide: Exile target land.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect("Parallax Tide Exile"), new RemoveCountersSourceCost(CounterType.FADE.createInstance()));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new RemoveCountersSourceCost(CounterType.FADE.createInstance()));
ability.addTarget(new TargetLandPermanent());
this.addAbility(ability);
// When Parallax Tide leaves the battlefield, each player returns to the battlefield all cards he or she owns exiled with Parallax Tide.

View file

@ -0,0 +1,69 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.ravnika;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.ZoneChangeTriggeredAbility;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.DredgeAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
* @author LevelX2
*/
public class GolgariBrownscale extends CardImpl {
public GolgariBrownscale(UUID ownerId) {
super(ownerId, 166, "Golgari Brownscale", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}");
this.expansionSetCode = "RAV";
this.subtype.add("Lizard");
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// When Golgari Brownscale is put into your hand from your graveyard, you gain 2 life.
this.addAbility(new ZoneChangeTriggeredAbility(Zone.ALL, Zone.GRAVEYARD, Zone.HAND, new GainLifeEffect(2),
"When {this} is put into your hand from your graveyard,", false));
// Dredge 2
this.addAbility(new DredgeAbility(2));
}
public GolgariBrownscale(final GolgariBrownscale card) {
super(card);
}
@Override
public GolgariBrownscale copy() {
return new GolgariBrownscale(this);
}
}

View file

@ -61,7 +61,7 @@ public class OblivionRing extends CardImpl {
this.color.setWhite(true);
// When Oblivion Ring enters the battlefield, exile another target nonland permanent.
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect( "Oblivion Ring exile"), false);
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), false);
Target target = new TargetPermanent(anotherNonlandPermanent);
ability1.addTarget(target);
this.addAbility(ability1);

View file

@ -30,7 +30,6 @@ package mage.sets.stronghold;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.ActivatedAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect;
import mage.cards.CardImpl;
@ -41,8 +40,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.game.stack.StackAbility;
import mage.game.stack.StackObject;
import mage.target.targetpointer.FixedTarget;

View file

@ -67,7 +67,7 @@ public class TriadOfFates extends CardImpl {
}
public TriadOfFates(UUID ownerId) {
super(ownerId, 206, "Triad of Fates", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{B}");
super(ownerId, 206, "Triad of Fates", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{B}");
this.expansionSetCode = "THS";
this.supertype.add("Legendary");
this.subtype.add("Human");
@ -85,7 +85,7 @@ public class TriadOfFates extends CardImpl {
ability.addTarget(target);
this.addAbility(ability);
// {W}, {T}: Exile target creature that has a fate counter on it, then return it to the battlefield under its owner's control.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect("Triad of Fates"), new ManaCostsImpl("{W}"));
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new ManaCostsImpl("{W}"));
ability.addCost(new TapSourceCost());
target = new TargetCreaturePermanent(filterCounter);
ability.addTarget(target);

View file

@ -52,8 +52,8 @@ public class MomentaryBlink extends CardImpl {
// Exile target creature you control, then return it to the battlefield under its owner's control.
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addEffect(new ExileTargetForSourceEffect("Momentary Blink"));
this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect());
this.getSpellAbility().addEffect(new ExileTargetForSourceEffect());
this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true));
// Flashback {3}{U}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{U}"), TimingRule.INSTANT));

View file

@ -73,7 +73,7 @@ public class AdmonitionAngel extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Landfall - Whenever a land enters the battlefield under your control, you may exile target nonland permanent other than Admonition Angel.
TriggeredAbility ability = new LandfallAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect("Admonition Angel Exile"), true);
TriggeredAbility ability = new LandfallAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), true);
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);

View file

@ -66,9 +66,9 @@ public class RuinGhost extends CardImpl {
this.toughness = new MageInt(1);
// {W}, {tap}: Exile target land you control, then return it to the battlefield under your control.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect("Exile Ruin Ghost"), new ManaCostsImpl("{W"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetForSourceEffect(), new ManaCostsImpl("{W"));
ability.addCost(new TapSourceCost());
ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect());
ability.addEffect(new ReturnToBattlefieldUnderYourControlTargetEffect(true));
ability.addTarget(new TargetControlledPermanent(filter));
this.addAbility(ability);
}

View file

@ -53,12 +53,16 @@ public class JourneyToNowhere extends CardImpl {
super(ownerId, 14, "Journey to Nowhere", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
this.expansionSetCode = "ZEN";
this.color.setWhite(true);
// When Journey to Nowhere enters the battlefield, exile target creature.
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new AnotherPredicate());
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect("Journey to Nowhere exile"), false);
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), false);
Target target = new TargetPermanent(filter);
ability1.addTarget(target);
this.addAbility(ability1);
// When Journey to Nowhere leaves the battlefield, return the exiled card to the battlefield under its owner's control.
Ability ability2 = new LeavesBattlefieldTriggeredAbility(new ReturnFromExileForSourceEffect(Zone.BATTLEFIELD), false);
this.addAbility(ability2);
}