mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Merge pull request #1180 from LoneFox78/master
Fixes, clean-ups, and Didgeridoo!
This commit is contained in:
commit
0a3e4d534f
41 changed files with 526 additions and 673 deletions
|
@ -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;
|
||||
|
@ -54,7 +54,7 @@ public class VedalkenHeretic extends CardImpl {
|
|||
|
||||
// Whenever Vedalken Heretic deals damage to an opponent, you may draw a card.
|
||||
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), true));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public VedalkenHeretic(final VedalkenHeretic card) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -59,15 +53,17 @@ import mage.target.common.TargetCardInHand;
|
|||
|
||||
*/
|
||||
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) {
|
||||
|
@ -80,13 +76,12 @@ public class MindwrackLiege extends CardImpl {
|
|||
|
||||
// Other blue creatures you control get +1/+1.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, true)));
|
||||
|
||||
|
||||
// Other red creatures you control get +1/+1.
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
@ -53,7 +53,7 @@ public class MindscourDragon extends CardImpl {
|
|||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
|
||||
// Whenever Mindscour Dragon deals combat damage to an opponent, target player puts the top four cards of his or her library into his or her graveyard.
|
||||
Ability ability = new DealsDamageToOpponentTriggeredAbility(new PutLibraryIntoGraveTargetEffect(4), false, true);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
|
|
81
Mage.Sets/src/mage/sets/homelands/AnabaAncestor.java
Normal file
81
Mage.Sets/src/mage/sets/homelands/AnabaAncestor.java
Normal 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);
|
||||
}
|
||||
}
|
74
Mage.Sets/src/mage/sets/homelands/AnabaSpiritCrafter.java
Normal file
74
Mage.Sets/src/mage/sets/homelands/AnabaSpiritCrafter.java
Normal 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);
|
||||
}
|
||||
}
|
69
Mage.Sets/src/mage/sets/homelands/Didgeridoo.java
Normal file
69
Mage.Sets/src/mage/sets/homelands/Didgeridoo.java
Normal 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);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
@ -60,7 +60,7 @@ public class NicolBolas extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
// At the beginning of your upkeep, sacrifice Nicol Bolas unless you pay {U}{B}{R}.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{U}{B}{R}")), TargetController.YOU, false));
|
||||
|
||||
|
||||
// Whenever Nicol Bolas deals damage to an opponent, that player discards his or her hand.
|
||||
this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardHandTargetEffect("that player"), false));
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -65,4 +65,4 @@ public class HypnoticSpecter extends CardImpl {
|
|||
public HypnoticSpecter copy() {
|
||||
return new HypnoticSpecter(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
54
Mage.Sets/src/mage/sets/masterseditioniii/AnabaAncestor.java
Normal file
54
Mage.Sets/src/mage/sets/masterseditioniii/AnabaAncestor.java
Normal 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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
54
Mage.Sets/src/mage/sets/masterseditioniii/Didgeridoo.java
Normal file
54
Mage.Sets/src/mage/sets/masterseditioniii/Didgeridoo.java
Normal 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);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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,21 +75,21 @@ 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(
|
||||
new GainAbilitySourceEffect(TrampleAbility.getInstance()),
|
||||
new CardsInControllerGraveCondition(7),
|
||||
" has trample,"));
|
||||
|
||||
|
||||
Ability gainedAbility = new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(new FilterControlledCreaturePermanent(), 1, ""), TargetController.YOU, false);
|
||||
|
||||
|
||||
ability.addEffect(new ConditionalContinuousEffect(
|
||||
new GainAbilitySourceEffect(gainedAbility),
|
||||
new CardsInControllerGraveCondition(7),
|
||||
" and has \"At the beginning of your upkeep, sacrifice a creature.\" "));
|
||||
|
||||
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -61,17 +61,17 @@ public class SnakeUmbra extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// Enchanted creature gets +1/+1
|
||||
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
|
||||
|
||||
|
||||
// and has "Whenever this creature deals damage to an opponent, you may draw a card."
|
||||
Ability gainedAbility = new DealsDamageToOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), true);
|
||||
Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA);
|
||||
effect.setText("and has \"Whenever this creature deals damage to an opponent, you may draw a card.\"");
|
||||
ability.addEffect(effect);
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// Totem armor
|
||||
this.addAbility(new TotemArmorAbility());
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* 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
|
||||
|
@ -20,7 +20,7 @@
|
|||
* 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.
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -46,7 +46,7 @@ public class DealsDamageToOpponentTriggeredAbility extends TriggeredAbilityImpl
|
|||
public DealsDamageToOpponentTriggeredAbility(Effect effect) {
|
||||
this(effect, false, false);
|
||||
}
|
||||
|
||||
|
||||
public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(effect, optional, false);
|
||||
}
|
|
@ -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();
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue