Merge pull request #1180 from LoneFox78/master

Fixes, clean-ups, and Didgeridoo!
This commit is contained in:
LevelX2 2015-08-05 11:44:02 +02:00
commit 0a3e4d534f
41 changed files with 526 additions and 673 deletions

View file

@ -29,7 +29,7 @@ package mage.sets.alarareborn;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;

View file

@ -32,7 +32,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.PutCreatureOnBattlefieldEffect;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
@ -58,7 +58,7 @@ public class DragonArch extends CardImpl {
this.expansionSetCode = "APC";
// {2}, {T}: You may put a multicolored creature card from your hand onto the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutCreatureOnBattlefieldEffect(filter),
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutPermanentOnBattlefieldEffect(filter),
new ManaCostsImpl("{2}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);

View file

@ -30,8 +30,8 @@ package mage.sets.apocalypse;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.keyword.TrampleAbility;

View file

@ -56,7 +56,7 @@ public class MaskOfIntolerance extends CardImpl {
// At the beginning of each player's upkeep, if there are four or more basic land types among lands that player controls, Mask of Intolerance deals 3 damage to him or her.
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), TargetController.ANY, false);
this.addAbility(new ConditionalTriggeredAbility(ability, new MaskOfIntoleranceCondition(),
"At the beginning of each player's upkeep, if there are four or more basic land types among lands that player controls, Mask of Intolerance deals 3 damage to him or her."));
"At the beginning of each player's upkeep, if there are four or more basic land types among lands that player controls, {this} deals 3 damage to him or her."));
}
public MaskOfIntolerance(final MaskOfIntolerance card) {

View file

@ -30,8 +30,8 @@ package mage.sets.avacynrestored;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.GainAbilityPairedEffect;
import mage.abilities.keyword.SoulbondAbility;

View file

@ -31,8 +31,8 @@ import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;

View file

@ -29,7 +29,7 @@ package mage.sets.commander2013;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.HorsemanshipAbility;
import mage.cards.CardImpl;

View file

@ -28,14 +28,14 @@
package mage.sets.conflux;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.common.TargetCardInYourGraveyard;
/**

View file

@ -28,25 +28,19 @@
package mage.sets.conflux;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ReturnToHandTargetPermanentCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterArtifactCard;
import mage.filter.common.FilterControlledArtifactPermanent;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetControlledPermanent;
/**
@ -65,7 +59,7 @@ public class MasterTransmuter extends CardImpl {
this.toughness = new MageInt(2);
// {U}, {tap}, Return an artifact you control to its owner's hand: You may put an artifact card from your hand onto the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MasterTransmuterEffect(), new ManaCostsImpl("{U}"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutPermanentOnBattlefieldEffect(new FilterArtifactCard("an artifact card")), new ManaCostsImpl("{U}"));
ability.addCost(new TapSourceCost());
ability.addCost(new ReturnToHandTargetPermanentCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact"))));
this.addAbility(ability);
@ -81,38 +75,3 @@ public class MasterTransmuter extends CardImpl {
return new MasterTransmuter(this);
}
}
class MasterTransmuterEffect extends OneShotEffect {
public MasterTransmuterEffect() {
super(Outcome.Benefit);
this.staticText = "You may put an artifact card from your hand onto the battlefield";
}
public MasterTransmuterEffect(final MasterTransmuterEffect effect) {
super(effect);
}
@Override
public MasterTransmuterEffect copy() {
return new MasterTransmuterEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Target target = new TargetCardInHand(new FilterArtifactCard("an artifact card from your hand"));
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
&& controller.chooseUse(outcome, "Put an artifact from your hand to battlefield?", source, game)
&& controller.chooseTarget(outcome, target, source, game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
}
}
}
return false;
}
}

View file

@ -30,17 +30,14 @@ package mage.sets.eventide;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
@ -49,9 +46,6 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
/**
*
@ -62,12 +56,14 @@ public class MindwrackLiege extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blue creatures you control");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("red creatures you control");
private static final FilterCreatureCard filter3 = new FilterCreatureCard("a blue or red creature card");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
filter.add(new ControllerPredicate(TargetController.YOU));
filter2.add(new ColorPredicate(ObjectColor.RED));
filter2.add(new ControllerPredicate(TargetController.YOU));
filter3.add(Predicates.or(new ColorPredicate(ObjectColor.BLUE), new ColorPredicate(ObjectColor.RED)));
}
public MindwrackLiege(UUID ownerId) {
@ -85,8 +81,7 @@ public class MindwrackLiege extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter2, true)));
// {UR}{UR}{UR}{UR}: You may put a blue or red creature card from your hand onto the battlefield.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new MindwrackLiegeEffect(), new ManaCostsImpl("{U/R}{U/R}{U/R}{U/R}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutPermanentOnBattlefieldEffect(filter3), new ManaCostsImpl("{U/R}{U/R}{U/R}{U/R}")));
}
public MindwrackLiege(final MindwrackLiege card) {
@ -98,48 +93,3 @@ public class MindwrackLiege extends CardImpl {
return new MindwrackLiege(this);
}
}
class MindwrackLiegeEffect extends OneShotEffect {
private static final String choiceText = "Put a blue or red creature card from your hand onto the battlefield?";
private static final FilterCreatureCard filter = new FilterCreatureCard("a blue or red creature card");
static {
filter.add(Predicates.or(
new ColorPredicate(ObjectColor.BLUE),
new ColorPredicate(ObjectColor.RED)));
}
public MindwrackLiegeEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "You may put a blue or red creature card from your hand onto the battlefield";
}
public MindwrackLiegeEffect(final MindwrackLiegeEffect effect) {
super(effect);
}
@Override
public MindwrackLiegeEffect copy() {
return new MindwrackLiegeEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) {
return false;
}
TargetCardInHand target = new TargetCardInHand(filter);
if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
return true;
}
}
return false;
}
}

View file

@ -30,7 +30,7 @@ package mage.sets.fatereforged;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;

View file

@ -0,0 +1,81 @@
/*
* 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.homelands;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author LoneFox
*/
public class AnabaAncestor extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Another target Minotaur creature");
static {
filter.add(new SubtypePredicate("Minotaur"));
filter.add(new AnotherPredicate());
}
public AnabaAncestor(UUID ownerId) {
super(ownerId, 81, "Anaba Ancestor", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.expansionSetCode = "HML";
this.subtype.add("Minotaur");
this.subtype.add("Spirit");
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {T}: Another target Minotaur creature gets +1/+1 until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, 1, Duration.EndOfTurn), new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
}
public AnabaAncestor(final AnabaAncestor card) {
super(card);
}
@Override
public AnabaAncestor copy() {
return new AnabaAncestor(this);
}
}

View file

@ -0,0 +1,74 @@
/*
* 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.homelands;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author LoneFox
*/
public class AnabaSpiritCrafter extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Minotaur creatures");
static {
filter.add(new SubtypePredicate("Minotaur"));
}
public AnabaSpiritCrafter(UUID ownerId) {
super(ownerId, 86, "Anaba Spirit Crafter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.expansionSetCode = "HML";
this.subtype.add("Minotaur");
this.subtype.add("Shaman");
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// Minotaur creatures get +1/+0.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 0, Duration.WhileOnBattlefield, filter, false)));
}
public AnabaSpiritCrafter(final AnabaSpiritCrafter card) {
super(card);
}
@Override
public AnabaSpiritCrafter copy() {
return new AnabaSpiritCrafter(this);
}
}

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.homelands;
import java.util.UUID;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
* @author LoneFox
*/
public class Didgeridoo extends CardImpl {
private static final FilterPermanentCard filter = new FilterPermanentCard("a Minotaur permanent card");
static {
filter.add(new SubtypePredicate("Minotaur"));
}
public Didgeridoo(UUID ownerId) {
super(ownerId, 130, "Didgeridoo", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}");
this.expansionSetCode = "HML";
// {3}: You may put a Minotaur permanent card from your hand onto the battlefield.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutPermanentOnBattlefieldEffect(filter), new ManaCostsImpl("{3}")));
}
public Didgeridoo(final Didgeridoo card) {
super(card);
}
@Override
public Didgeridoo copy() {
return new Didgeridoo(this);
}
}

View file

@ -30,8 +30,8 @@ package mage.sets.legends;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.abilities.effects.common.discard.DiscardHandTargetEffect;
import mage.abilities.keyword.FlyingAbility;

View file

@ -27,17 +27,18 @@
*/
package mage.sets.magic2010;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.effects.common.PutCreatureOnBattlefieldEffect;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.cards.CardImpl;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
/**
*
@ -56,7 +57,7 @@ public class ElvishPiper extends CardImpl {
// {G}, {tap}: You may put a creature card from your hand onto the battlefield.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new PutCreatureOnBattlefieldEffect(),
new PutPermanentOnBattlefieldEffect(new FilterCreatureCard("a creature card")),
new ManaCostsImpl("{G}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);

View file

@ -27,13 +27,13 @@
*/
package mage.sets.magic2010;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import java.util.UUID;

View file

@ -30,11 +30,12 @@ package mage.sets.magic2012;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.effects.common.PutCreatureOnBattlefieldEffect;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreatureCard;
import java.util.UUID;
@ -50,7 +51,7 @@ public class QuicksilverAmulet extends CardImpl {
// {4}, {tap}: You may put a creature card from your hand onto the battlefield.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new PutCreatureOnBattlefieldEffect(),
new PutPermanentOnBattlefieldEffect(new FilterCreatureCard("a creature card")),
new ManaCostsImpl("{4}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);

View file

@ -34,12 +34,11 @@ import mage.abilities.LoyaltyAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -50,11 +49,7 @@ import mage.filter.FilterSpell;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.command.Emblem;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCardInLibrary;
/**
@ -63,7 +58,8 @@ import mage.target.common.TargetCardInLibrary;
*/
public class GarrukCallerOfBeasts extends CardImpl {
private static final FilterCreatureCard filterGreenCreature = new FilterCreatureCard("a green creature card from your hand");
private static final FilterCreatureCard filterGreenCreature = new FilterCreatureCard("a green creature card");
static {
filterGreenCreature.add(new ColorPredicate(ObjectColor.GREEN));
}
@ -80,7 +76,7 @@ public class GarrukCallerOfBeasts extends CardImpl {
this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect(5, new FilterCreatureCard("all creature cards"),true), 1));
// -3: You may put a green creature card from your hand onto the battlefield.
this.addAbility(new LoyaltyAbility(new GarrukCallerOfBeastsPutOntoBattlefieldEffect(), -3));
this.addAbility(new LoyaltyAbility(new PutPermanentOnBattlefieldEffect(filterGreenCreature), -3));
// -7: You get an emblem with "Whenever you cast a creature spell, you may search your library for a creature card, put it onto the battlefield, then shuffle your library.");
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new GarrukCallerOfBeastsEmblem()), -7));
@ -96,6 +92,7 @@ public class GarrukCallerOfBeasts extends CardImpl {
return new GarrukCallerOfBeasts(this);
}
}
/**
* Emblem: "Whenever you cast a creature spell, you may search your library for a creature card, put it onto the battlefield, then shuffle your library."
*/
@ -113,48 +110,3 @@ class GarrukCallerOfBeastsEmblem extends Emblem {
this.getAbilities().add(ability);
}
}
class GarrukCallerOfBeastsPutOntoBattlefieldEffect extends OneShotEffect {
private static final FilterCreatureCard filterGreenCreature = new FilterCreatureCard("a green creature card from your hand");
static {
filterGreenCreature.add(new ColorPredicate(ObjectColor.GREEN));
}
public GarrukCallerOfBeastsPutOntoBattlefieldEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "You may put a green creature card from your hand onto the battlefield";
}
public GarrukCallerOfBeastsPutOntoBattlefieldEffect(final GarrukCallerOfBeastsPutOntoBattlefieldEffect effect) {
super(effect);
}
@Override
public GarrukCallerOfBeastsPutOntoBattlefieldEffect copy() {
return new GarrukCallerOfBeastsPutOntoBattlefieldEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (controller.getHand().count(filterGreenCreature, game) > 0) {
if (controller.chooseUse(Outcome.PutCreatureInPlay,
"Put a green creature card onto the battlefield?", source, game)) {
Target target = new TargetCardInHand(filterGreenCreature);
if (controller.chooseTarget(outcome, target, source, game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
}
}
}
}
return true;
}
return false;
}
}

View file

@ -0,0 +1,54 @@
/*
* 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.masterseditioniii;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class AnabaAncestor extends mage.sets.homelands.AnabaAncestor {
public AnabaAncestor(UUID ownerId) {
super(ownerId);
this.cardNumber = 86;
this.expansionSetCode = "ME3";
this.rarity = Rarity.COMMON;
}
public AnabaAncestor(final AnabaAncestor card) {
super(card);
}
@Override
public AnabaAncestor copy() {
return new AnabaAncestor(this);
}
}

View file

@ -0,0 +1,54 @@
/*
* 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.masterseditioniii;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class AnabaSpiritCrafter extends mage.sets.homelands.AnabaSpiritCrafter {
public AnabaSpiritCrafter(UUID ownerId) {
super(ownerId);
this.cardNumber = 87;
this.expansionSetCode = "ME3";
this.rarity = Rarity.COMMON;
}
public AnabaSpiritCrafter(final AnabaSpiritCrafter card) {
super(card);
}
@Override
public AnabaSpiritCrafter copy() {
return new AnabaSpiritCrafter(this);
}
}

View file

@ -0,0 +1,54 @@
/*
* 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.masterseditioniii;
import java.util.UUID;
import mage.constants.Rarity;
/**
*
* @author LoneFox
*/
public class Didgeridoo extends mage.sets.homelands.Didgeridoo {
public Didgeridoo(UUID ownerId) {
super(ownerId);
this.cardNumber = 194;
this.expansionSetCode = "ME3";
this.rarity = Rarity.UNCOMMON;
}
public Didgeridoo(final Didgeridoo card) {
super(card);
}
@Override
public Didgeridoo copy() {
return new Didgeridoo(this);
}
}

View file

@ -34,24 +34,15 @@ import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.abilities.effects.common.PutCreatureOnBattlefieldEffect;
import mage.cards.Card;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.cards.CardImpl;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.*;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
import mage.filter.predicate.mageobject.ChosenSubtypePredicate;
/**
*
@ -66,8 +57,10 @@ public class BelbesPortal extends CardImpl {
// As Belbe's Portal enters the battlefield, choose a creature type.
this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.PutCreatureInPlay)));
// {3}, {tap}: You may put a creature card of the chosen type from your hand onto the battlefield.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new BelbesPortalPutCreatureOnBattlefieldEffect(),
FilterCreatureCard filter = new FilterCreatureCard("a creature card of the chosen type");
filter.add(new ChosenSubtypePredicate(this.getId()));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new PutPermanentOnBattlefieldEffect(filter),
new ManaCostsImpl("{3}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
@ -82,48 +75,3 @@ public class BelbesPortal extends CardImpl {
return new BelbesPortal(this);
}
}
class BelbesPortalPutCreatureOnBattlefieldEffect extends OneShotEffect {
BelbesPortalPutCreatureOnBattlefieldEffect() {
super(Outcome.PutCreatureInPlay);
staticText = "You may put a creature card of the chosen type from your hand onto the battlefield";
}
BelbesPortalPutCreatureOnBattlefieldEffect(final BelbesPortalPutCreatureOnBattlefieldEffect effect) {
super(effect);
}
@Override
public BelbesPortalPutCreatureOnBattlefieldEffect copy() {
return new BelbesPortalPutCreatureOnBattlefieldEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
String subtype = (String) game.getState().getValue(permanent.getId() + "_type");
if (subtype != null) {
Player player = game.getPlayer(source.getControllerId());
String choiceText = "Put a " + subtype.toLowerCase() + " creature card from your hand onto the battlefield?";
if (player != null) {
if (player.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) {
FilterCreatureCard creatureTypeFilter = new FilterCreatureCard();
creatureTypeFilter.add(new SubtypePredicate(subtype));
TargetCardInHand target = new TargetCardInHand(creatureTypeFilter);
if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
}
}
}
return true;
}
}
}
return false;
}
}

View file

@ -28,13 +28,13 @@
package mage.sets.ninthedition;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*

View file

@ -38,8 +38,8 @@ import mage.abilities.condition.common.CardsInControllerGraveCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.continuous.BecomesColorSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.SetCardColorSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
@ -77,7 +77,7 @@ public class RepentantVampire extends CardImpl {
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
// Threshold - As long as seven or more cards are in your graveyard, Repentant Vampire is white and has "{tap}: Destroy target black creature."
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect(
new SetCardColorSourceEffect(ObjectColor.WHITE, Duration.WhileOnBattlefield),
new BecomesColorSourceEffect(ObjectColor.WHITE, Duration.WhileOnBattlefield),
new CardsInControllerGraveCondition(7),
"<i>Threshold</i> - As long as seven or more cards are in your graveyard, {this} is white"));
Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost());

View file

@ -36,9 +36,9 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.CardsInControllerGraveCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.SacrificeControllerEffect;
import mage.abilities.effects.common.continuous.BecomesColorSourceEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.SetCardColorSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.keyword.VigilanceAbility;
@ -75,7 +75,7 @@ public class WaywardAngel extends CardImpl {
new CardsInControllerGraveCondition(7),
"<i>Threshold</i> - As long as seven or more cards are in your graveyard, {this} gets +3/+3,"));
ability.addEffect(new ConditionalContinuousEffect(
new SetCardColorSourceEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield),
new BecomesColorSourceEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield),
new CardsInControllerGraveCondition(7),
" is black,"));
ability.addEffect(new ConditionalContinuousEffect(

View file

@ -67,9 +67,6 @@ public class MaliciousAdvice extends CardImpl {
effect.setText("Tap X target artifacts, creatures, and/or lands");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addEffect(new LoseLifeSourceControllerEffect(new ManacostVariableValue()));
// Correct number of targets will be set in adjustTargets
// I'm not sure if/why this needs to be here, but other such cards do have it...
this.getSpellAbility().addTarget(new TargetPermanent(filter));
}
@Override

View file

@ -29,18 +29,18 @@ package mage.sets.riseoftheeldrazi;
import java.util.UUID;
import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.TotemArmorAbility;
import mage.cards.CardImpl;
import mage.constants.*;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;

View file

@ -29,20 +29,12 @@ package mage.sets.shadowmoor;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInHand;
/**
*
@ -50,13 +42,18 @@ import mage.target.common.TargetCardInHand;
*/
public class DramaticEntrance extends CardImpl {
private static final FilterCreatureCard filter = new FilterCreatureCard("a green creature card");
static {
filter.add(new ColorPredicate(ObjectColor.GREEN));
}
public DramaticEntrance(UUID ownerId) {
super(ownerId, 111, "Dramatic Entrance", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{G}{G}");
this.expansionSetCode = "SHM";
// You may put a green creature card from your hand onto the battlefield.
this.getSpellAbility().addEffect(new DramaticEntranceEffect());
this.getSpellAbility().addEffect(new PutPermanentOnBattlefieldEffect(filter));
}
@ -69,47 +66,3 @@ public class DramaticEntrance extends CardImpl {
return new DramaticEntrance(this);
}
}
class DramaticEntranceEffect extends OneShotEffect {
private static final FilterCreatureCard filter = new FilterCreatureCard("a green creature card from your hand");
static {
filter.add(new ColorPredicate(ObjectColor.GREEN));
}
public DramaticEntranceEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "You may put a green creature card from your hand onto the battlefield";
}
public DramaticEntranceEffect(final DramaticEntranceEffect effect) {
super(effect);
}
@Override
public DramaticEntranceEffect copy() {
return new DramaticEntranceEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
if (controller.getHand().count(filter, game) > 0) {
if (controller.chooseUse(Outcome.PutCreatureInPlay,
"Put a green creature card onto the battlefield?", source, game)) {
Target target = new TargetCardInHand(filter);
if (controller.chooseTarget(outcome, target, source, game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
}
}
}
}
return true;
}
return false;
}
}

View file

@ -31,9 +31,9 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedByCreatureTriggeredAbility;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.WitherAbility;
import mage.cards.CardImpl;

View file

@ -29,16 +29,16 @@ package mage.sets.timespiral;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.SetCardColorSourceEffect;
import mage.abilities.effects.common.continuous.BecomesColorSourceEffect;
import mage.abilities.keyword.FlankingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
@ -59,7 +59,7 @@ public class BlazingBladeAskari extends CardImpl {
// Flanking
this.addAbility(new FlankingAbility());
// {2}: Blazing Blade Askari becomes colorless until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SetCardColorSourceEffect(new ObjectColor(""), Duration.EndOfTurn), new ManaCostsImpl("{2}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesColorSourceEffect(new ObjectColor(), Duration.EndOfTurn), new ManaCostsImpl("{2}")));
}
public BlazingBladeAskari(final BlazingBladeAskari card) {

View file

@ -28,13 +28,13 @@
package mage.sets.timespiral;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.effects.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.keyword.ShadowAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
/**
*

View file

@ -29,22 +29,13 @@ package mage.sets.urzassaga;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.abilities.common.DealsDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
/**
*
@ -52,6 +43,12 @@ import mage.target.common.TargetCardInHand;
*/
public class GoblinLackey extends CardImpl {
private static final FilterPermanentCard filter = new FilterPermanentCard("a Goblin permanent card");
static {
filter.add(new SubtypePredicate("Goblin"));
}
public GoblinLackey(UUID ownerId) {
super(ownerId, 190, "Goblin Lackey", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "USG";
@ -61,7 +58,7 @@ public class GoblinLackey extends CardImpl {
this.toughness = new MageInt(1);
// Whenever Goblin Lackey deals damage to a player, you may put a Goblin permanent card from your hand onto the battlefield.
this.addAbility(new GoblinLackeyTriggeredAbility());
this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new PutPermanentOnBattlefieldEffect(filter), false));
}
public GoblinLackey(final GoblinLackey card) {
@ -73,72 +70,3 @@ public class GoblinLackey extends CardImpl {
return new GoblinLackey(this);
}
}
class GoblinLackeyTriggeredAbility extends TriggeredAbilityImpl {
public GoblinLackeyTriggeredAbility() {
super(Zone.BATTLEFIELD, new GoblinLackeyEffect(), true);
}
public GoblinLackeyTriggeredAbility(final GoblinLackeyTriggeredAbility ability) {
super(ability);
}
@Override
public GoblinLackeyTriggeredAbility copy() {
return new GoblinLackeyTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getSourceId().equals(this.sourceId)
&& game.getOpponents(this.getControllerId()).contains(event.getTargetId());
}
@Override
public String getRule() {
return "Whenever {this} deals damage to an opponent, you may put a Goblin permanent card from your hand onto the battlefield.";
}
}
class GoblinLackeyEffect extends OneShotEffect {
public GoblinLackeyEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "you may put a Goblin permanent card from your hand onto the battlefield";
}
public GoblinLackeyEffect(final GoblinLackeyEffect effect) {
super(effect);
}
@Override
public GoblinLackeyEffect copy() {
return new GoblinLackeyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller == null) {
return false;
}
FilterPermanentCard filter = new FilterPermanentCard("Goblin permanent card from your hand");
filter.add(new SubtypePredicate("Goblin"));
TargetCardInHand target = new TargetCardInHand(filter);
if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
} else {
return false;
}
}
return true;
}
}

View file

@ -95,7 +95,7 @@ class AddleEffect extends OneShotEffect {
controller.choose(outcome, choice, game);
ObjectColor color = choice.getColor();
if(color != null) {
game.informPlayers(new StringBuilder(controller.getLogName()).append(" chooses ").append(color).toString());
game.informPlayers(controller.getLogName() + " chooses " + color + ".");
FilterCard filter = new FilterCard();
filter.add(new ColorPredicate(color));
Effect effect = new DiscardCardYouChooseTargetEffect(filter);

View file

@ -35,26 +35,16 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterArtifactCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCardInLibrary;
/**
*
* @author BetaSteward_at_googlemail.com
@ -64,7 +54,6 @@ public class StoneforgeMystic extends CardImpl {
private static final FilterCard filter = new FilterCard("an Equipment card");
static {
filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.add(new SubtypePredicate("Equipment"));
}
@ -82,7 +71,7 @@ public class StoneforgeMystic extends CardImpl {
this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true));
// {1}{W}, {T}: You may put an Equipment card from your hand onto the battlefield.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new StoneforgeMysticEffect(), new ManaCostsImpl("{1}{W}"));
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutPermanentOnBattlefieldEffect(filter), new ManaCostsImpl("{1}{W}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
@ -97,44 +86,3 @@ public class StoneforgeMystic extends CardImpl {
}
}
class StoneforgeMysticEffect extends OneShotEffect {
private static final FilterArtifactCard filter = new FilterArtifactCard("an Equipment card from your hand");
static {
filter.add(new SubtypePredicate("Equipment"));
}
public StoneforgeMysticEffect() {
super(Outcome.Benefit);
this.staticText = "You may put an Equipment card from your hand onto the battlefield";
}
public StoneforgeMysticEffect(final StoneforgeMysticEffect effect) {
super(effect);
}
@Override
public StoneforgeMysticEffect copy() {
return new StoneforgeMysticEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Target target = new TargetCardInHand(filter);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
&& controller.chooseUse(outcome, "Put an Equipment from your hand to battlefield?", source, game)
&& controller.chooseTarget(outcome, target, source, game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
}
}
return true;
}
return false;
}
}

View file

@ -29,23 +29,14 @@ package mage.sets.zendikar;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.common.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.PutPermanentOnBattlefieldEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
/**
*
@ -53,6 +44,12 @@ import mage.target.common.TargetCardInHand;
*/
public class WarrenInstigator extends CardImpl {
private static final FilterCreatureCard filter = new FilterCreatureCard("a Goblin creature card");
static {
filter.add(new SubtypePredicate("Goblin"));
}
public WarrenInstigator(UUID ownerId) {
super(ownerId, 154, "Warren Instigator", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{R}{R}");
this.expansionSetCode = "ZEN";
@ -63,7 +60,9 @@ public class WarrenInstigator extends CardImpl {
this.toughness = new MageInt(1);
this.addAbility(DoubleStrikeAbility.getInstance());
this.addAbility(new WarrenInstigatorTriggeredAbility());
// Whenever Warren Instigator deals damage to an opponent, you may put a Goblin creature card from your hand onto the battlefield.
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new PutPermanentOnBattlefieldEffect(filter), false));
}
public WarrenInstigator(final WarrenInstigator card) {
@ -75,72 +74,3 @@ public class WarrenInstigator extends CardImpl {
return new WarrenInstigator(this);
}
}
class WarrenInstigatorTriggeredAbility extends TriggeredAbilityImpl {
public WarrenInstigatorTriggeredAbility() {
super(Zone.BATTLEFIELD, new WarrenInstigatorEffect(), true);
}
public WarrenInstigatorTriggeredAbility(final WarrenInstigatorTriggeredAbility ability) {
super(ability);
}
@Override
public WarrenInstigatorTriggeredAbility copy() {
return new WarrenInstigatorTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getSourceId().equals(this.sourceId)
&& game.getOpponents(this.getControllerId()).contains(event.getTargetId());
}
@Override
public String getRule() {
return "Whenever {this} deals damage to an opponent, you may put a Goblin creature card from your hand onto the battlefield.";
}
}
class WarrenInstigatorEffect extends OneShotEffect {
public WarrenInstigatorEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "you may put a Goblin creature card from your hand onto the battlefield";
}
public WarrenInstigatorEffect(final WarrenInstigatorEffect effect) {
super(effect);
}
@Override
public WarrenInstigatorEffect copy() {
return new WarrenInstigatorEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
FilterCreatureCard filter = new FilterCreatureCard("Goblin creature card from your hand");
filter.add(new SubtypePredicate("Goblin"));
TargetCardInHand target = new TargetCardInHand(filter);
if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
Card card = game.getCard(target.getFirstTarget());
if (card != null) {
card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
return true;
}
}
return false;
}
}

View file

@ -25,7 +25,7 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
package mage.abilities.common;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;

View file

@ -15,7 +15,7 @@ public class DomainValue implements DynamicValue {
private Integer amount;
private boolean countTargetPlayer;
private UUID player;
private UUID playerId;
public DomainValue() {
this(1);
@ -34,15 +34,15 @@ public class DomainValue implements DynamicValue {
this.countTargetPlayer = countTargetPlayer;
}
public DomainValue(Integer amount, UUID player) {
public DomainValue(Integer amount, UUID playerId) {
this(amount, false);
this.player = player;
this.playerId = playerId;
}
public DomainValue(final DomainValue dynamicValue) {
this.amount = dynamicValue.amount;
this.countTargetPlayer = dynamicValue.countTargetPlayer;
this.player = dynamicValue.player;
this.playerId = dynamicValue.playerId;
}
@Override
@ -53,8 +53,8 @@ public class DomainValue implements DynamicValue {
int haveSwamps = 0;
int haveForests = 0;
UUID targetPlayer;
if(player != null) {
targetPlayer = player;
if(playerId != null) {
targetPlayer = playerId;
}
else if(countTargetPlayer) {
targetPlayer = sourceAbility.getTargets().getFirstTarget();

View file

@ -82,7 +82,7 @@ public class DamageAttachedControllerEffect extends OneShotEffect {
if (staticText != null && !staticText.isEmpty()) {
return staticText;
}
return "{this} deals " + amount + " to that creature's controller";
return "{this} deals " + amount + " damage to that creature's controller";
}
}

View file

@ -6,7 +6,8 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.FilterCard;
import mage.filter.common.FilterPermanentCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
@ -14,34 +15,34 @@ import mage.target.common.TargetCardInHand;
/**
* @author magenoxx_at_gmail.com
*/
public class PutCreatureOnBattlefieldEffect extends OneShotEffect {
public class PutPermanentOnBattlefieldEffect extends OneShotEffect {
private final FilterCreatureCard filter;
private final FilterCard filter;
public PutCreatureOnBattlefieldEffect() {
this(new FilterCreatureCard("a creature card"));
public PutPermanentOnBattlefieldEffect() {
this(new FilterPermanentCard("a permanent card"));
}
public PutCreatureOnBattlefieldEffect(FilterCreatureCard filter) {
super(Outcome.PutCreatureInPlay);
public PutPermanentOnBattlefieldEffect(FilterCard filter) {
super(Outcome.PutCardInPlay);
this.filter = filter;
}
public PutCreatureOnBattlefieldEffect(final PutCreatureOnBattlefieldEffect effect) {
public PutPermanentOnBattlefieldEffect(final PutPermanentOnBattlefieldEffect effect) {
super(effect);
this.filter = effect.filter.copy();
}
@Override
public PutCreatureOnBattlefieldEffect copy() {
return new PutCreatureOnBattlefieldEffect(this);
public PutPermanentOnBattlefieldEffect copy() {
return new PutPermanentOnBattlefieldEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
String choiceText = "Put " + filter.getMessage() + " from your hand onto the battlefield?";
if (player == null || !player.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) {
if (player == null || !player.chooseUse(Outcome.PutCardInPlay, choiceText, source, game)) {
return false;
}
@ -62,6 +63,6 @@ public class PutCreatureOnBattlefieldEffect extends OneShotEffect {
return staticText;
}
return "You may put " + filter.getMessage() + " from your hand onto the battlefield";
return "you may put " + filter.getMessage() + " from your hand onto the battlefield";
}
}

View file

@ -1,101 +0,0 @@
/*
*
* 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.abilities.effects.common.continuous;
import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.stack.StackObject;
/**
*
* @author nicolas.perrenou
*/
public class SetCardColorSourceEffect extends ContinuousEffectImpl {
private ObjectColor setColor;
public SetCardColorSourceEffect(ObjectColor setColor, Duration duration, String text) {
super(duration, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Benefit);
this.setColor = setColor;
staticText = text;
}
public SetCardColorSourceEffect(ObjectColor setColor, Duration duration) {
super(duration, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Benefit);
this.setColor = setColor;
}
public SetCardColorSourceEffect(final SetCardColorSourceEffect effect) {
super(effect);
this.setColor = effect.setColor;
}
@Override
public boolean apply(Game game, Ability source) {
MageObject o = game.getObject(source.getSourceId());
if (o != null) {
if (o instanceof Permanent || o instanceof StackObject) {
o.getColor(game).setColor(setColor);
}
}
return false;
}
@Override
public SetCardColorSourceEffect copy() {
return new SetCardColorSourceEffect(this);
}
@Override
public String getText(Mode mode) {
StringBuilder sb = new StringBuilder();
sb.append("{this} ");
if (mode.getTargets().size() > 0) {
sb.append(mode.getTargets().get(0).getTargetName());
}
sb.append(" becomes ").append(setColor.getDescription());
sb.append(" ").append(duration.toString());
return sb.toString();
}
}