Merge origin/master

This commit is contained in:
LevelX2 2015-10-12 09:12:22 +02:00
commit aa525bf0d2
110 changed files with 1531 additions and 1545 deletions

View file

@ -27,7 +27,8 @@
*/
package mage.sets.avacynrestored;
import mage.constants.*;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -37,6 +38,11 @@ import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
@ -47,8 +53,6 @@ import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.util.functions.EmptyApplyToPermanent;
import java.util.UUID;
/**
*
* @author noxx
@ -60,7 +64,6 @@ public class InfiniteReflection extends CardImpl {
this.expansionSetCode = "AVR";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
@ -109,9 +112,9 @@ class InfiniteReflectionTriggeredEffect extends OneShotEffect {
if (sourcePermanent != null && sourcePermanent.getAttachedTo() != null) {
Permanent toCopyFromPermanent = game.getPermanent(sourcePermanent.getAttachedTo());
if (toCopyFromPermanent != null) {
for (Permanent toCopyToPermanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
for (Permanent toCopyToPermanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (!toCopyToPermanent.equals(toCopyFromPermanent) && !(toCopyToPermanent instanceof PermanentToken)) {
game.copyPermanent(toCopyFromPermanent, toCopyToPermanent, source, new EmptyApplyToPermanent());
game.copyPermanent(toCopyFromPermanent, toCopyToPermanent.getId(), source, new EmptyApplyToPermanent());
}
}
return true;
@ -135,7 +138,7 @@ class InfiniteReflectionEntersBattlefieldEffect extends ReplacementEffectImpl {
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
@ -144,15 +147,14 @@ class InfiniteReflectionEntersBattlefieldEffect extends ReplacementEffectImpl {
&& !(permanent instanceof PermanentToken);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent toCopyToPermanent = game.getPermanent(event.getTargetId());
MageObject toCopyToObject = game.getObject(event.getTargetId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (sourcePermanent != null && toCopyToPermanent != null && sourcePermanent.getAttachedTo() != null) {
if (sourcePermanent != null && toCopyToObject != null && sourcePermanent.getAttachedTo() != null) {
Permanent toCopyFromPermanent = game.getPermanent(sourcePermanent.getAttachedTo());
if (toCopyFromPermanent != null) {
game.copyPermanent(toCopyFromPermanent, toCopyToPermanent, source, new EmptyApplyToPermanent());
game.copyPermanent(toCopyFromPermanent, toCopyToObject.getId(), source, new EmptyApplyToPermanent());
}
}
return false;

View file

@ -30,25 +30,25 @@ package mage.sets.commander2014;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.combat.BlocksIfAbleTargetEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.AttackingPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.SecondTargetPointer;
/**
*
@ -66,7 +66,6 @@ public class DomineeringWill extends CardImpl {
super(ownerId, 13, "Domineering Will", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{3}{U}");
this.expansionSetCode = "C14";
// Target player gains control of up to three target nonattacking creatures until end of turn. Untap those creatures. They block this turn if able.
this.getSpellAbility().addEffect(new DomineeringWillEffect());
this.getSpellAbility().addTarget(new TargetPlayer());
@ -102,14 +101,20 @@ class DomineeringWillEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
if (targetPlayer != null) {
ContinuousEffect effect = new DomineeringWillControlEffect();
ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfTurn, targetPlayer.getId());
effect.setTargetPointer(new SecondTargetPointer());
effect.setText("Target player gains control of up to three target nonattacking creatures until end of turn");
game.addEffect(effect, source);
Effect effect2 = new DomineeringWillUntapTargetEffect();
Effect effect2 = new UntapTargetEffect();
effect2.setTargetPointer(new SecondTargetPointer());
effect2.setText("Untap those creatures");
effect2.apply(game, source);
RequirementEffect effect3 = new DomineeringWillBlocksIfAbleTargetEffect(Duration.EndOfTurn);
RequirementEffect effect3 = new BlocksIfAbleTargetEffect(Duration.EndOfTurn);
effect3.setTargetPointer(new SecondTargetPointer());
effect3.setText("They block this turn if able");
game.addEffect(effect3, source);
return true;
@ -117,109 +122,3 @@ class DomineeringWillEffect extends OneShotEffect {
return false;
}
}
class DomineeringWillControlEffect extends ContinuousEffectImpl {
public DomineeringWillControlEffect() {
super(Duration.EndOfTurn, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl);
}
public DomineeringWillControlEffect(final DomineeringWillControlEffect effect) {
super(effect);
}
@Override
public DomineeringWillControlEffect copy() {
return new DomineeringWillControlEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
if (targetPlayer != null) {
boolean targetStillExists = false;
for (UUID permanentId : source.getTargets().get(1).getTargets()) {
Permanent permanent = game.getPermanent(permanentId);
if (permanent != null) {
targetStillExists = true;
if (targetPlayer != null) {
permanent.changeControllerId(targetPlayer.getId(), game);
permanent.getAbilities().setControllerId(targetPlayer.getId());
} else {
permanent.changeControllerId(source.getControllerId(), game);
permanent.getAbilities().setControllerId(source.getControllerId());
}
}
}
if (!targetStillExists) {
// no valid target exists, effect can be discarded
discard();
}
return true;
}
return false;
}
}
class DomineeringWillUntapTargetEffect extends OneShotEffect {
public DomineeringWillUntapTargetEffect() {
super(Outcome.Untap);
}
public DomineeringWillUntapTargetEffect(final DomineeringWillUntapTargetEffect effect) {
super(effect);
}
@Override
public DomineeringWillUntapTargetEffect copy() {
return new DomineeringWillUntapTargetEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (UUID target : source.getTargets().get(1).getTargets()) {
Permanent permanent = game.getPermanent(target);
if (permanent != null) {
permanent.untap(game);
}
}
return true;
}
}
class DomineeringWillBlocksIfAbleTargetEffect extends RequirementEffect {
public DomineeringWillBlocksIfAbleTargetEffect(Duration duration) {
super(duration);
}
public DomineeringWillBlocksIfAbleTargetEffect(final DomineeringWillBlocksIfAbleTargetEffect effect) {
super(effect);
}
@Override
public DomineeringWillBlocksIfAbleTargetEffect copy() {
return new DomineeringWillBlocksIfAbleTargetEffect(this);
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
return source.getTargets().get(1).getTargets().contains(permanent.getId());
}
@Override
public boolean mustAttack(Game game) {
return false;
}
@Override
public boolean mustBlock(Game game) {
return false;
}
@Override
public boolean mustBlockAny(Game game) {
return true;
}
}

View file

@ -29,20 +29,22 @@ package mage.sets.darksteel;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.SourceTappedCondition;
import mage.abilities.condition.Condition;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author LoneFox
*
*/
public class NimAbomination extends CardImpl {
@ -55,7 +57,7 @@ public class NimAbomination extends CardImpl {
// At the beginning of your end step, if Nim Abomination is untapped, you lose 3 life.
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new LoseLifeSourceControllerEffect(3),
TargetController.YOU, new InvertCondition(new SourceTappedCondition()), false));
TargetController.YOU, new SourceUntappedCondition(), false));
}
public NimAbomination(final NimAbomination card) {
@ -67,3 +69,26 @@ public class NimAbomination extends CardImpl {
return new NimAbomination(this);
}
}
class SourceUntappedCondition implements Condition {
private static final SourceUntappedCondition fInstance = new SourceUntappedCondition();
public static SourceUntappedCondition getInstance() {
return fInstance;
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
if (permanent != null) {
return !permanent.isTapped();
}
return false;
}
@Override
public String toString() {
return "if {this} is untapped";
}
}

View file

@ -157,7 +157,6 @@ class PossibilityStormEffect extends OneShotEffect {
if (exile != null) {
while (exile.size() > 0) {
card = exile.getRandom(game);
exile.remove(card.getId());
spellController.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.EXILED, false, false);
}
}

View file

@ -50,11 +50,11 @@ import mage.target.TargetPlayer;
* @author jeffwadsworth
*/
public class MerrowBonegnawer extends CardImpl {
private UUID exileId = UUID.randomUUID();
private static final FilterSpell filter = new FilterSpell("black spell");
static {
filter.add(new ColorPredicate(ObjectColor.BLACK));
}
@ -69,13 +69,13 @@ public class MerrowBonegnawer extends CardImpl {
this.toughness = new MageInt(1);
// {tap}: Target player exiles a card from his or her graveyard.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileFromZoneTargetEffect(Zone.GRAVEYARD, exileId, "Merrow Bonegnawer", new FilterCard("a card")), new TapSourceCost());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileFromZoneTargetEffect(Zone.GRAVEYARD, exileId, getIdName(), new FilterCard()), new TapSourceCost());
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
// Whenever you cast a black spell, you may untap Merrow Bonegnawer.
this.addAbility(new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), filter, true, false));
}
public MerrowBonegnawer(final MerrowBonegnawer card) {

View file

@ -27,17 +27,19 @@
*/
package mage.sets.exodus;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
@ -51,8 +53,7 @@ public class Manabond extends CardImpl {
super(ownerId, 113, "Manabond", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.expansionSetCode = "EXO";
// At the beginning of your end step, you may reveal your hand and put all land cards from it onto the battlefield. If you do, discard your hand.
// At the beginning of your end step, reveal your hand and put all land cards from it onto the battlefield. If you do, discard your hand.
this.addAbility(new BeginningOfYourEndStepTriggeredAbility(new ManabondEffect(), true));
}
@ -66,12 +67,11 @@ public class Manabond extends CardImpl {
}
}
class ManabondEffect extends OneShotEffect {
public ManabondEffect() {
super(Outcome.PutCardInPlay);
staticText = "reveal your hand and put all land cards from it onto the battlefield. If you do, discard your hand";
staticText = "you may reveal your hand and put all land cards from it onto the battlefield. If you do, discard your hand";
}
public ManabondEffect(final ManabondEffect effect) {
@ -80,24 +80,22 @@ class ManabondEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
player.revealCards("Manabond", player.getHand(), game);
Cards hand = player.getHand().copy();
for(UUID uuid : hand){
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
controller.revealCards(sourceObject.getIdName(), controller.getHand(), game);
Set<Card> toBattlefield = new LinkedHashSet<>();
for (UUID uuid : controller.getHand()) {
Card card = game.getCard(uuid);
if(card != null){
if(card.getCardType().contains(CardType.LAND)){
card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
}
else{
player.discard(card, source, game);
}
if (card != null && card.getCardType().contains(CardType.LAND)) {
toBattlefield.add(card);
}
}
}
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, false, true, null);
controller.discard(controller.getHand().size(), false, source, game);
return true;
}
return false;
}
@ -105,4 +103,4 @@ class ManabondEffect extends OneShotEffect {
public ManabondEffect copy() {
return new ManabondEffect(this);
}
}
}

View file

@ -31,9 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
@ -83,12 +81,12 @@ class CantBeEquippedSourceEffect extends ContinuousRuleModifyingEffectImpl {
}
public CantBeEquippedSourceEffect() {
super(Duration.WhileOnBattlefield, Outcome.Neutral);
staticText = "{this} can't be equipped";
super(Duration.WhileOnBattlefield, Outcome.Neutral);
staticText = "{this} can't be equipped";
}
@Override
public ContinuousEffect copy() {
public CantBeEquippedSourceEffect copy() {
return new CantBeEquippedSourceEffect(this);
}
@ -96,14 +94,14 @@ class CantBeEquippedSourceEffect extends ContinuousRuleModifyingEffectImpl {
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ATTACH;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getTargetId().equals(source.getSourceId())) {
Permanent permanent = game.getPermanent(event.getSourceId());
if(permanent != null && permanent.getSubtype().contains("Equipment")){
return true;
}
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && permanent.getSubtype().contains("Equipment")) {
return true;
}
}
return false;
}

View file

@ -54,14 +54,7 @@ import mage.players.Player;
* @author jeffwadsworth
*/
public class MycosynthGolem extends CardImpl {
private static final FilterSpell filter = new FilterSpell("Artifact creature spells you cast");
static {
filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public MycosynthGolem(UUID ownerId) {
super(ownerId, 137, "Mycosynth Golem", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{11}");
this.expansionSetCode = "5DN";
@ -75,8 +68,8 @@ public class MycosynthGolem extends CardImpl {
// Artifact creature spells you cast have affinity for artifacts.
this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD, new MycosynthGolemGainAbilitySpellsEffect(new AffinityForArtifactsAbility(), filter)));
Zone.BATTLEFIELD, new MycosynthGolemGainAbilitySpellsEffect()));
}
public MycosynthGolem(final MycosynthGolem card) {
@ -91,20 +84,21 @@ public class MycosynthGolem extends CardImpl {
class MycosynthGolemGainAbilitySpellsEffect extends ContinuousEffectImpl {
private final Ability ability;
private final FilterSpell filter;
private static final FilterSpell filter = new FilterSpell("Artifact creature spells you cast");
private static final Ability ability = new AffinityForArtifactsAbility();
public MycosynthGolemGainAbilitySpellsEffect(Ability ability, FilterSpell filter) {
static {
filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public MycosynthGolemGainAbilitySpellsEffect() {
super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
this.ability = ability;
this.filter = filter;
staticText = filter.getMessage() + " have " + ability.getRule();
staticText = "Artifact creature spells you cast have affinity for artifacts";
}
public MycosynthGolemGainAbilitySpellsEffect(final MycosynthGolemGainAbilitySpellsEffect effect) {
super(effect);
this.ability = effect.ability;
this.filter = effect.filter;
}
@Override
@ -114,17 +108,15 @@ class MycosynthGolemGainAbilitySpellsEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && permanent != null) {
if (controller != null && permanent != null) {
for (StackObject stackObject : game.getStack()) {
// only spells cast, so no copies of spells
if ((stackObject instanceof Spell) && !stackObject.isCopy() && stackObject.getControllerId().equals(source.getControllerId())) {
Spell spell = (Spell) stackObject;
if (filter.match(spell, game)) {
if (!spell.getAbilities().contains(ability)) {
game.getState().addOtherAbility(spell.getCard(), ability);
}
game.getState().addOtherAbility(spell.getCard(), ability);
}
}
}

View file

@ -28,10 +28,6 @@
package mage.sets.gatecrash;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
@ -39,6 +35,9 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -80,7 +79,7 @@ class ThespiansStageCopyEffect extends OneShotEffect {
public ThespiansStageCopyEffect() {
super(Outcome.Benefit);
this.staticText = "Thespian's Stage becomes a copy of target land and gains this ability";
this.staticText = "{this} becomes a copy of target land and gains this ability";
}
public ThespiansStageCopyEffect(final ThespiansStageCopyEffect effect) {
@ -97,7 +96,7 @@ class ThespiansStageCopyEffect extends OneShotEffect {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
Permanent copyFromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (sourcePermanent != null && copyFromPermanent != null) {
Permanent newPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent, source, new EmptyApplyToPermanent());
Permanent newPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent.getId(), source, new EmptyApplyToPermanent());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ThespiansStageCopyEffect(), new GenericManaCost(2));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetLandPermanent());

View file

@ -57,7 +57,7 @@ public class MizziumTransreliquat extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MizziumTransreliquatCopyEffect(), new ManaCostsImpl("{3}"));
ability.addTarget(new TargetArtifactPermanent());
this.addAbility(ability);
// {1}{U}{R}: Mizzium Transreliquat becomes a copy of target artifact and gains this ability.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MizziumTransreliquatCopyAndGainAbilityEffect(), new ManaCostsImpl("{1}{U}{R}"));
ability.addTarget(new TargetArtifactPermanent());
@ -74,12 +74,11 @@ public class MizziumTransreliquat extends CardImpl {
}
}
class MizziumTransreliquatCopyEffect extends OneShotEffect {
public MizziumTransreliquatCopyEffect() {
super(Outcome.Copy);
this.staticText = "Mizzium Transreliquat becomes a copy of target artifact until end of turn";
this.staticText = "{this} becomes a copy of target artifact until end of turn";
}
public MizziumTransreliquatCopyEffect(final MizziumTransreliquatCopyEffect effect) {
@ -96,17 +95,18 @@ class MizziumTransreliquatCopyEffect extends OneShotEffect {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
Permanent copyFromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (sourcePermanent != null && copyFromPermanent != null) {
game.copyPermanent(Duration.EndOfTurn, copyFromPermanent, sourcePermanent, source, new EmptyApplyToPermanent());
game.copyPermanent(Duration.EndOfTurn, copyFromPermanent, sourcePermanent.getId(), source, new EmptyApplyToPermanent());
return true;
}
return false;
}
}
class MizziumTransreliquatCopyAndGainAbilityEffect extends OneShotEffect {
public MizziumTransreliquatCopyAndGainAbilityEffect() {
super(Outcome.Benefit);
this.staticText = "Mizzium Transreliquat becomes a copy of target artifact and gains this ability";
this.staticText = "{this} becomes a copy of target artifact and gains this ability";
}
public MizziumTransreliquatCopyAndGainAbilityEffect(final MizziumTransreliquatCopyAndGainAbilityEffect effect) {
@ -123,7 +123,7 @@ class MizziumTransreliquatCopyAndGainAbilityEffect extends OneShotEffect {
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
Permanent copyFromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (sourcePermanent != null && copyFromPermanent != null) {
Permanent newPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent, source, new EmptyApplyToPermanent());
Permanent newPermanent = game.copyPermanent(copyFromPermanent, sourcePermanent.getId(), source, new EmptyApplyToPermanent());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MizziumTransreliquatCopyAndGainAbilityEffect(), new ManaCostsImpl("{1}{U}{R}"));
ability.addTarget(new TargetArtifactPermanent());
newPermanent.addAbility(ability, source.getSourceId(), game);
@ -131,4 +131,4 @@ class MizziumTransreliquatCopyAndGainAbilityEffect extends OneShotEffect {
}
return false;
}
}
}

View file

@ -34,7 +34,6 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect;
@ -50,24 +49,24 @@ import mage.counters.CounterType;
/**
*
* @author anonymous
* @author Luna Skyrise
*/
public class LandCap extends CardImpl {
public LandCap(UUID ownerId) {
super(ownerId, 319, "Land Cap", Rarity.RARE, new CardType[]{CardType.LAND}, "");
super(ownerId, 338, "Land Cap", Rarity.RARE, new CardType[]{CardType.LAND}, "");
this.expansionSetCode = "ICE";
// Land Cap doesn't untap during your untap step if it has a depletion counter on it.
Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(),
new SourceHasCounterCondition(CounterType.DEPLETION, 0));
Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(false, true),
new SourceHasCounterCondition(CounterType.DEPLETION, 1, Integer.MAX_VALUE));
effect.setText("{this} doesn't untap during your untap step if it has a depletion counter on it");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
this.addAbility(ability);
// At the beginning of your upkeep, remove a depletion counter from Land Cap.
Ability ability2 = new BeginningOfUpkeepTriggeredAbility(new RemoveCounterSourceEffect(CounterType.DEPLETION.createInstance()), TargetController.YOU, false);
this.addAbility(ability2);
// {tap}: Add {W} or {U} to your mana pool. Put a depletion counter on Land Cap.
// {T}: Add {W} or {U} to your mana pool. Put a depletion counter on Land Cap.
Ability ability3 = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.WhiteMana, new TapSourceCost());
ability3.addEffect(new AddCountersSourceEffect(CounterType.DEPLETION.createInstance()));
this.addAbility(ability3);

View file

@ -49,7 +49,7 @@ import mage.counters.CounterType;
/**
*
* @author anonymous
* @author Luna Skyrise
*/
public class LavaTubes extends CardImpl {
@ -58,8 +58,8 @@ public class LavaTubes extends CardImpl {
this.expansionSetCode = "ICE";
// Lava Tubes doesn't untap during your untap step if it has a depletion counter on it.
Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(),
new SourceHasCounterCondition(CounterType.DEPLETION, 0));
Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(false, true),
new SourceHasCounterCondition(CounterType.DEPLETION, 1, Integer.MAX_VALUE));
effect.setText("{this} doesn't untap during your untap step if it has a depletion counter on it");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
this.addAbility(ability);

View file

@ -34,7 +34,6 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.SourceHasCounterCondition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect;
@ -50,7 +49,7 @@ import mage.counters.CounterType;
/**
*
* @author anonymous
* @author Luna Skyrise
*/
public class RiverDelta extends CardImpl {
@ -59,8 +58,8 @@ public class RiverDelta extends CardImpl {
this.expansionSetCode = "ICE";
// River Delta doesn't untap during your untap step if it has a depletion counter on it.
Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(),
new SourceHasCounterCondition(CounterType.DEPLETION, 0));
Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(false, true),
new SourceHasCounterCondition(CounterType.DEPLETION, 1, Integer.MAX_VALUE));
effect.setText("{this} doesn't untap during your untap step if it has a depletion counter on it");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
this.addAbility(ability);

View file

@ -49,7 +49,7 @@ import mage.counters.CounterType;
/**
*
* @author anonymous
* @author Luna Skyrise
*/
public class TimberlineRidge extends CardImpl {
@ -58,8 +58,8 @@ public class TimberlineRidge extends CardImpl {
this.expansionSetCode = "ICE";
// Timberline Ridge doesn't untap during your untap step if it has a depletion counter on it.
Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(),
new SourceHasCounterCondition(CounterType.DEPLETION, 0));
Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(false, true),
new SourceHasCounterCondition(CounterType.DEPLETION, 1, Integer.MAX_VALUE));
effect.setText("{this} doesn't untap during your untap step if it has a depletion counter on it");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
this.addAbility(ability);

View file

@ -49,7 +49,7 @@ import mage.counters.CounterType;
/**
*
* @author anonymous
* @author Luna Skyrise
*/
public class Veldt extends CardImpl {
@ -58,8 +58,8 @@ public class Veldt extends CardImpl {
this.expansionSetCode = "ICE";
// Veldt doesn't untap during your untap step if it has a depletion counter on it.
Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(),
new SourceHasCounterCondition(CounterType.DEPLETION, 0));
Effect effect = new ConditionalContinuousRuleModifyingEffect(new DontUntapInControllersUntapStepSourceEffect(false, true),
new SourceHasCounterCondition(CounterType.DEPLETION, 1, Integer.MAX_VALUE));
effect.setText("{this} doesn't untap during your untap step if it has a depletion counter on it");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
this.addAbility(ability);

View file

@ -27,14 +27,9 @@
*/
package mage.sets.innistrad;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardTargetCost;
@ -47,6 +42,13 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -101,15 +103,21 @@ class GrimoireOfTheDeadEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
for (Player player: game.getPlayers().values()) {
for (Card card: player.getGraveyard().getCards(game)) {
if (card.getCardType().contains(CardType.CREATURE)) {
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
game.addEffect(new GrimoireOfTheDeadEffect2(card.getId()), source);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Set<Card> creatureCards = new LinkedHashSet<>();
for (Player player : game.getPlayers().values()) {
for (Card card : player.getGraveyard().getCards(game)) {
if (card.getCardType().contains(CardType.CREATURE)) {
creatureCards.add(card);
game.addEffect(new GrimoireOfTheDeadEffect2(card.getId()), source);
}
}
}
controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, true, null);
return true;
}
return true;
return false;
}
@Override
@ -121,10 +129,10 @@ class GrimoireOfTheDeadEffect extends OneShotEffect {
class GrimoireOfTheDeadEffect2 extends ContinuousEffectImpl {
private UUID targetId;
private final UUID targetId;
public GrimoireOfTheDeadEffect2(UUID targetId) {
super(Duration.EndOfGame, Outcome.Neutral);
super(Duration.Custom, Outcome.Neutral);
this.targetId = targetId;
staticText = "Becomes a black Zombie in addition to its other colors and types";
}
@ -170,4 +178,4 @@ class GrimoireOfTheDeadEffect2 extends ContinuousEffectImpl {
return layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4;
}
}
}

View file

@ -64,7 +64,7 @@ public class PolymorphousRush extends CardImpl {
// Strive - Polymorphous Rush costs {1}{U} more to cast for each target beyond the first.
this.addAbility(new StriveAbility("{1}{U}"));
// Choose a creature on the battlefield. Any number of target creatures you control each become a copy of that creature until end of turn.
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE, filter, false));
this.getSpellAbility().addEffect(new PolymorphousRushCopyEffect());
@ -82,21 +82,21 @@ public class PolymorphousRush extends CardImpl {
}
class PolymorphousRushCopyEffect extends OneShotEffect {
public PolymorphousRushCopyEffect() {
super(Outcome.Copy);
this.staticText = "Choose a creature on the battlefield. Any number of target creatures you control each become a copy of that creature until end of turn";
}
public PolymorphousRushCopyEffect(final PolymorphousRushCopyEffect effect) {
super(effect);
}
@Override
public PolymorphousRushCopyEffect copy() {
return new PolymorphousRushCopyEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
@ -107,10 +107,10 @@ class PolymorphousRushCopyEffect extends OneShotEffect {
if (target.canChoose(source.getId(), controller.getId(), game) && controller.chooseTarget(outcome, target, source, game)) {
Permanent copyFromCreature = game.getPermanent(target.getFirstTarget());
if (copyFromCreature != null) {
for (UUID copyToId: getTargetPointer().getTargets(game, source)) {
for (UUID copyToId : getTargetPointer().getTargets(game, source)) {
Permanent copyToCreature = game.getPermanent(copyToId);
if (copyToCreature != null) {
game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToCreature, source, new EmptyApplyToPermanent());
game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToId, source, new EmptyApplyToPermanent());
}
}
}
@ -119,4 +119,5 @@ class PolymorphousRushCopyEffect extends OneShotEffect {
}
return false;
}
}

View file

@ -110,7 +110,7 @@ class WorldgorgerDragonEntersEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null) {
UUID exileId = CardUtil.getObjectExileZoneId(game, sourceObject);
UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (exileId != null) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (!permanent.getId().equals(source.getSourceId())) { // Another
@ -145,7 +145,7 @@ class WorldgorgerDragonLeavesEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() -1;
int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() - 1;
ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter));
if (exile != null) {
exile = exile.copy();

View file

@ -114,15 +114,15 @@ class CopyArtifactEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (player != null && sourcePermanent != null) {
MageObject sourceObject = game.getObject(source.getSourceId());
if (player != null && sourceObject != null) {
Target target = new TargetPermanent(filter);
target.setNotTarget(true);
if (target.canChoose(source.getControllerId(), game)) {
player.choose(Outcome.Copy, target, source.getSourceId(), game);
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
if (copyFromPermanent != null) {
game.copyPermanent(copyFromPermanent, sourcePermanent, source, applier);
game.copyPermanent(copyFromPermanent, sourceObject.getId(), source, applier);
return true;
}
}

View file

@ -48,7 +48,6 @@ import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.util.functions.EmptyApplyToPermanent;
/**
* @author duncant
*/
@ -68,11 +67,11 @@ public class Shapesharer extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
this.addAbility(ChangelingAbility.getInstance());
// {2}{U}: Target Shapeshifter becomes a copy of target creature until your next turn.
Ability copyAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new ShapesharerEffect(),
new ManaCostsImpl("{2}{U}"));
new ShapesharerEffect(),
new ManaCostsImpl("{2}{U}"));
copyAbility.addTarget(new TargetPermanent(filterShapeshifter));
copyAbility.addTarget(new TargetCreaturePermanent());
this.addAbility(copyAbility);
@ -89,6 +88,7 @@ public class Shapesharer extends CardImpl {
}
class ShapesharerEffect extends OneShotEffect {
public ShapesharerEffect() {
super(Outcome.Copy);
this.staticText = "Target Shapeshifter becomes a copy of target creature until your next turn.";
@ -105,10 +105,12 @@ class ShapesharerEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability ability) {
Permanent copyTo = game.getPermanent(ability.getFirstTarget());
Permanent copyTo = game.getPermanent(getTargetPointer().getFirst(game, ability));
if (copyTo != null) {
Permanent copyFrom = game.getPermanentOrLKIBattlefield(ability.getTargets().get(1).getFirstTarget());
game.copyPermanent(Duration.EndOfTurn, copyFrom, copyTo, ability, new EmptyApplyToPermanent());
if (copyFrom != null) {
game.copyPermanent(Duration.EndOfTurn, copyFrom, copyTo.getId(), ability, new EmptyApplyToPermanent());
}
}
return true;
}

View file

@ -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,28 +20,29 @@
* 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.magic2010;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect;
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.counters.CounterType;
import mage.game.Game;
import mage.players.Player;
@ -98,14 +99,16 @@ class LilianaVessEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
for (UUID playerId: controller.getInRange()) {
for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
for (Card card: player.getGraveyard().getCards(game)) {
Set<Card> creatureCards = new LinkedHashSet<>();
for (Card card : player.getGraveyard().getCards(game)) {
if (card.getCardType().contains(CardType.CREATURE)) {
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
creatureCards.add(card);
}
}
controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, false, null);
}
}
return true;

View file

@ -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,32 +20,34 @@
* 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.magic2011;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.List;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
@ -82,34 +84,36 @@ class MassPolymorphEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
int count;
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game);
count = creatures.size();
for (Permanent creature: creatures) {
creature.moveToExile(null, null, source.getSourceId(), game);
}
Cards revealed = new CardsImpl();
Cards creatureCards = new CardsImpl();
Cards nonCreatureCards = new CardsImpl();
Player player = game.getPlayer(source.getControllerId());
while (creatureCards.size() < count && player.getLibrary().size() > 0) {
Card card = player.getLibrary().removeFromTop(game);
revealed.add(card);
if (card.getCardType().contains(CardType.CREATURE)) {
creatureCards.add(card);
} else {
nonCreatureCards.add(card);
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
int count;
// Cards creatures = new CardsImpl();
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game);
Set<Card> creaturesToExile = new HashSet<>();
creaturesToExile.addAll(creatures);
count = creatures.size();
controller.moveCards(creaturesToExile, null, Zone.HAND, source, game);
Cards revealed = new CardsImpl();
Set<Card> creatureCards = new LinkedHashSet<>();
Cards nonCreatureCards = new CardsImpl();
while (creatureCards.size() < count && controller.getLibrary().size() > 0) {
Card card = controller.getLibrary().removeFromTop(game);
revealed.add(card);
if (card.getCardType().contains(CardType.CREATURE)) {
creatureCards.add(card);
} else {
nonCreatureCards.add(card);
}
}
controller.revealCards(sourceObject.getIdName(), revealed, game);
controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, true, null);
controller.putCardsOnTopOfLibrary(nonCreatureCards, game, source, false);
controller.shuffleLibrary(game);
return true;
}
player.revealCards("Mass Polymorph", revealed, game);
for (Card creatureCard: creatureCards.getCards(game)) {
creatureCard.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
}
for (Card card: nonCreatureCards.getCards(game)) {
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.GRAVEYARD, true, true);
}
player.shuffleLibrary(game);
return true;
return false;
}
@Override
@ -117,4 +121,4 @@ class MassPolymorphEffect extends OneShotEffect {
return new MassPolymorphEffect(this);
}
}
}

View file

@ -25,12 +25,9 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2012;
import java.util.UUID;
import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
@ -38,6 +35,11 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -47,20 +49,23 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class Flight extends CardImpl {
public Flight (UUID ownerId) {
public Flight(UUID ownerId) {
super(ownerId, 53, "Flight", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}");
this.expansionSetCode = "M12";
this.subtype.add("Aura");
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature has flying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA)));
}
public Flight (final Flight card) {
public Flight(final Flight card) {
super(card);
}

View file

@ -97,15 +97,15 @@ class PhantasmalImageCopyEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (player != null && sourcePermanent != null) {
MageObject sourceObject = game.getObject(source.getSourceId());
if (player != null && sourceObject != null) {
Target target = new TargetPermanent(new FilterCreaturePermanent("creature (you copy from)"));
target.setNotTarget(true);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
player.choose(Outcome.Copy, target, source.getSourceId(), game);
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
if (copyFromPermanent != null) {
game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() {
game.copyPermanent(copyFromPermanent, sourceObject.getId(), source, new ApplyToPermanent() {
@Override
public Boolean apply(Game game, Permanent permanent) {
if (!permanent.getSubtype().contains("Illusion")) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.magic2014;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
@ -49,7 +51,6 @@ public class RiseOfTheDarkRealms extends CardImpl {
super(ownerId, 111, "Rise of the Dark Realms", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{7}{B}{B}");
this.expansionSetCode = "M14";
// Put all creature cards from all graveyards onto the battlefield under your control.
this.getSpellAbility().addEffect(new RiseOfTheDarkRealmsEffect());
}
@ -78,17 +79,23 @@ class RiseOfTheDarkRealmsEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
for (UUID playerId: controller.getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
for (Card card: player.getGraveyard().getCards(game)) {
if (card.getCardType().contains(CardType.CREATURE)) {
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
if (controller != null) {
Set<Card> creatureCards = new LinkedHashSet<>();
for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
for (Card card : player.getGraveyard().getCards(game)) {
if (card.getCardType().contains(CardType.CREATURE)) {
creatureCards.add(card);
}
}
}
}
controller.moveCards(creatureCards, Zone.BATTLEFIELD, source, game, false, false, true, null);
return true;
}
return true;
return false;
}
@Override

View file

@ -29,6 +29,7 @@ package mage.sets.magic2015;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -96,15 +97,15 @@ class MercurialPretenderCopyEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (player != null && sourcePermanent != null) {
MageObject sourceObject = game.getObject(source.getSourceId());
if (player != null && sourceObject != null) {
Target target = new TargetPermanent(new FilterControlledCreaturePermanent());
target.setNotTarget(true);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
player.choose(Outcome.Copy, target, source.getSourceId(), game);
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
if (copyFromPermanent != null) {
game.copyPermanent(copyFromPermanent, sourcePermanent, source,
game.copyPermanent(copyFromPermanent, sourceObject.getId(), source,
// {2}{U}{U}: Return this creature to its owner's hand.
new AbilityApplier(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{2}{U}{U}")))
);

View file

@ -27,8 +27,8 @@
*/
package mage.sets.magicorigins;
import java.util.ArrayList;
import java.util.List;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
@ -94,23 +94,22 @@ class AnimistsAwakeningEffect extends OneShotEffect {
Cards cards = new CardsImpl(Zone.LIBRARY);
int xValue = source.getManaCostsToPay().getX();
cards.addAll(controller.getLibrary().getTopCards(game, xValue));
List<Permanent> lands = new ArrayList<>();
if (cards.size() > 0) {
controller.revealCards(sourceObject.getIdName(), cards, game);
Set<Card> toBattlefield = new LinkedHashSet<>();
for (Card card : cards.getCards(new FilterLandCard(), source.getSourceId(), source.getControllerId(), game)) {
cards.remove(card);
controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), true);
Permanent land = game.getPermanent(card.getId());
if (land != null) {
lands.add(land);
}
toBattlefield.add(card);
}
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, true, false, true, null);
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
if (SpellMasteryCondition.getInstance().apply(game, source)) {
for (Permanent land : lands) {
land.untap(game);
for (Card card : toBattlefield) {
Permanent land = game.getPermanent(card.getId());
if (land != null) {
land.untap(game);
}
}
}
}

View file

@ -29,23 +29,14 @@ package mage.sets.magicorigins;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChangeATargetOfTargetSpellAbilityToSourceEffect;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.game.stack.StackAbility;
import mage.game.stack.StackObject;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetStackObject;
import mage.target.Targets;
/**
*
@ -63,9 +54,9 @@ public class MizziumMeddler extends CardImpl {
// Flash
this.addAbility(FlashAbility.getInstance());
// When Mizzium Meddler enters the battlefield, change a target of target spell or ability to Mizzium Meddler.
Ability ability = new EntersBattlefieldTriggeredAbility(new MizziumMeddlerEffect());
// When Mizzium Meddler enters the battlefield, you may change a target of target spell or ability to Mizzium Meddler.
Ability ability = new EntersBattlefieldTriggeredAbility(new ChangeATargetOfTargetSpellAbilityToSourceEffect(), true);
ability.addTarget(new TargetStackObject());
this.addAbility(ability);
}
@ -79,92 +70,3 @@ public class MizziumMeddler extends CardImpl {
return new MizziumMeddler(this);
}
}
class MizziumMeddlerEffect extends OneShotEffect {
public MizziumMeddlerEffect() {
super(Outcome.Neutral);
staticText = "Change a target of target spell or ability to {this}";
}
public MizziumMeddlerEffect(final MizziumMeddlerEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget());
MageObject sourceObject = game.getObject(source.getSourceId());
if (stackObject != null && sourceObject != null) {
Targets targets;
Ability sourceAbility;
MageObject oldTarget = null;
if (stackObject instanceof Spell) {
Spell spell = (Spell)stackObject;
sourceAbility = spell.getSpellAbility();
targets = spell.getSpellAbility().getTargets();
} else if (stackObject instanceof StackAbility) {
StackAbility stackAbility = (StackAbility)stackObject;
sourceAbility = stackAbility;
targets = stackAbility.getTargets();
} else {
return false;
}
boolean twoTimesTarget = false;
if (targets.size() == 1 && targets.get(0).getTargets().size() == 1) {
Target target = targets.get(0);
if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) {
oldTarget = game.getObject(targets.getFirstTarget());
target.clearChosen();
// The source is still the spell on the stack
target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game);
}
} else {
Player player = game.getPlayer(source.getControllerId());
for (Target target: targets) {
for (UUID targetId: target.getTargets()) {
MageObject object = game.getObject(targetId);
String name;
if (object == null) {
Player targetPlayer = game.getPlayer(targetId);
name = targetPlayer.getLogName();
} else {
name = object.getName();
}
if (!targetId.equals(source.getSourceId()) && target.getTargets().contains(source.getSourceId())) {
// you can't change this target to MizziumMeddler because MizziumMeddler is already another targetId of that target.
twoTimesTarget = true;
continue;
}
if (name != null && player.chooseUse(Outcome.Neutral, new StringBuilder("Change target from ").append(name).append(" to ").append(sourceObject.getName()).append("?").toString(), source, game)) {
if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) {
oldTarget = game.getObject(targets.getFirstTarget());
target.remove(targetId);
// The source is still the spell on the stack
target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game);
break;
}
}
}
}
}
if (oldTarget != null) {
game.informPlayers(sourceObject.getLogName() + ": Changed target of " +stackObject.getLogName() + " from " + oldTarget.getLogName() + " to " + sourceObject.getLogName());
} else {
if (twoTimesTarget) {
game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its not valid to target it twice for " + stackObject.getName());
} else {
game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its no valid target for " + stackObject.getName());
}
}
return true;
}
return false;
}
@Override
public MizziumMeddlerEffect copy() {
return new MizziumMeddlerEffect(this);
}
}

View file

@ -44,6 +44,7 @@ import mage.filter.common.FilterNonlandCard;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.PermanentToken;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.common.TargetCardInExile;
@ -100,7 +101,8 @@ class KnowledgePoolEffect1 extends OneShotEffect {
Player player = game.getPlayer(playerId);
if (player != null) {
player.moveCardsToExile(player.getLibrary().getTopCards(game, 3), source, game, true,
CardUtil.getObjectExileZoneId(game, sourceObject), sourceObject.getIdName() + " (" + sourceObject.getZoneChangeCounter(game) + ")");
CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()),
sourceObject.getIdName() + " (" + sourceObject.getZoneChangeCounter(game) + ")");
}
}
return true;
@ -168,7 +170,8 @@ class KnowledgePoolEffect2 extends OneShotEffect {
MageObject sourceObject = game.getObject(source.getSourceId());
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && spell != null && sourceObject != null) {
UUID exileZoneId = CardUtil.getObjectExileZoneId(game, sourceObject);
int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() - 1;
UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter);
if (controller.moveCardsToExile(spell, source, game, true, exileZoneId, sourceObject.getIdName())) {
Player player = game.getPlayer(spell.getControllerId());
if (player != null && player.chooseUse(Outcome.PlayForFree, "Cast another nonland card exiled with " + sourceObject.getLogName() + " without paying that card's mana cost?", source, game)) {

View file

@ -88,7 +88,7 @@ public class PhyrexianMetamorph extends CardImpl {
// You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
Effect effect = new CopyPermanentEffect(filter, phyrexianMetamorphApplier);
effect.setText("You may have {this} enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect));
Ability ability = new SimpleStaticAbility(Zone.ALL, new EntersBattlefieldEffect(effect));
this.addAbility(ability);
}

View file

@ -29,24 +29,15 @@ package mage.sets.newphyrexia;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChangeATargetOfTargetSpellAbilityToSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.game.stack.StackAbility;
import mage.game.stack.StackObject;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetStackObject;
import mage.target.Targets;
/**
*
@ -62,7 +53,7 @@ public class Spellskite extends CardImpl {
this.toughness = new MageInt(4);
// {UP}: Change a target of target spell or ability to Spellskite.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SpellskiteEffect(), new ManaCostsImpl("{UP}"));
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChangeATargetOfTargetSpellAbilityToSourceEffect(), new ManaCostsImpl("{UP}"));
ability.addTarget(new TargetStackObject());
this.addAbility(ability);
}
@ -76,110 +67,3 @@ public class Spellskite extends CardImpl {
return new Spellskite(this);
}
}
class SpellskiteEffect extends OneShotEffect {
public SpellskiteEffect() {
super(Outcome.Neutral);
staticText = "Change a target of target spell or ability to {this}";
}
public SpellskiteEffect(final SpellskiteEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget());
MageObject sourceObject = game.getObject(source.getSourceId());
if (stackObject != null && sourceObject != null) {
Targets targets = new Targets();
Ability sourceAbility;
String oldTargetName = null;
if (stackObject instanceof Spell) {
Spell spell = (Spell) stackObject;
sourceAbility = spell.getSpellAbility();
} else if (stackObject instanceof StackAbility) {
StackAbility stackAbility = (StackAbility) stackObject;
sourceAbility = stackAbility;
} else {
return false;
}
for (UUID modeId : sourceAbility.getModes().getSelectedModes()) {
sourceAbility.getModes().setActiveMode(modeId);
targets.addAll(sourceAbility.getTargets());
}
boolean twoTimesTarget = false;
if (targets.size() == 1 && targets.get(0).getTargets().size() == 1) {
Target target = targets.get(0);
if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) {
oldTargetName = getTargetName(targets.getFirstTarget(), game);
target.clearChosen();
// The source is still the spell on the stack
target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game);
}
} else {
Player controller = game.getPlayer(source.getControllerId());
boolean validTargets = false;
do {
for (Target target : targets) {
for (UUID targetId : target.getTargets()) {
String name = getTargetName(targets.getFirstTarget(), game);
if (!targetId.equals(source.getSourceId()) && target.getTargets().contains(source.getSourceId())) {
// you can't change this target to Spellskite because Spellskite is already another targetId of that target.
twoTimesTarget = true;
continue;
}
if (target.canTarget(stackObject.getControllerId(), source.getSourceId(), sourceAbility, game)) {
validTargets = true;
if (name != null
&& controller.chooseUse(Outcome.Neutral, "Change target from " + name + " to " + sourceObject.getLogName() + "?", source, game)) {
oldTargetName = getTargetName(targetId, game);
target.remove(targetId);
// The source is still the spell on the stack
target.addTarget(source.getSourceId(), stackObject.getStackAbility(), game);
break;
}
}
}
if (oldTargetName != null) {
break;
}
}
if (oldTargetName == null) {
game.informPlayer(controller, "You have to select at least one target to change to spellskite!");
}
} while (validTargets && oldTargetName == null);
}
if (oldTargetName != null) {
game.informPlayers(sourceObject.getLogName() + ": Changed target of " + stackObject.getLogName() + " from " + oldTargetName + " to " + sourceObject.getLogName());
} else {
if (twoTimesTarget) {
game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its not valid to target it twice for " + stackObject.getLogName());
} else {
game.informPlayers(sourceObject.getLogName() + ": Target not changed to " + sourceObject.getLogName() + " because its no valid target for " + stackObject.getLogName());
}
}
return true;
}
return false;
}
@Override
public SpellskiteEffect copy() {
return new SpellskiteEffect(this);
}
private String getTargetName(UUID objectId, Game game) {
MageObject object = game.getObject(objectId);
if (object != null) {
return object.getLogName();
}
Player player = game.getPlayer(objectId);
if (player != null) {
return player.getLogName();
}
return null;
}
}

View file

@ -92,7 +92,7 @@ class SkyshipWeatherlightEffect extends SearchEffect {
MageObject sourceObject = source.getSourceObject(game);
if (sourceObject != null && controller != null) {
if (controller.searchLibrary(target, game)) {
UUID exileZone = CardUtil.getObjectExileZoneId(game, sourceObject);
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (target.getTargets().size() > 0) {
for (UUID cardID : target.getTargets()) {
Card card = controller.getLibrary().getCard(cardID, game);

View file

@ -46,7 +46,6 @@ import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.functions.EmptyApplyToPermanent;
/**
*
* @author North
@ -142,7 +141,7 @@ class RenegadeDoppelgangerEffect extends OneShotEffect {
return false;
}
game.copyPermanent(Duration.EndOfTurn, targetCreature, permanent, source, new EmptyApplyToPermanent());
game.copyPermanent(Duration.EndOfTurn, targetCreature, permanent.getId(), source, new EmptyApplyToPermanent());
return false;
}
}

View file

@ -98,15 +98,15 @@ class SakashimaTheImpostorCopyEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
if (player != null && sourcePermanent != null) {
MageObject sourceObject = game.getObject(source.getSourceId());
if (player != null && sourceObject != null) {
Target target = new TargetPermanent(new FilterCreaturePermanent());
target.setNotTarget(true);
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
player.choose(Outcome.Copy, target, source.getSourceId(), game);
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
if (copyFromPermanent != null) {
game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() {
game.copyPermanent(copyFromPermanent, sourceObject.getId(), source, new ApplyToPermanent() {
@Override
public Boolean apply(Game game, Permanent permanent) {
if (!permanent.getSupertype().contains("Legendary")) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.scarsofmirrodin;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
@ -115,13 +117,15 @@ class GenesisWaveEffect extends OneShotEffect {
target1.setRequired(false);
controller.choose(Outcome.PutCardInPlay, cards, target1, game);
Set<Card> toBattlefield = new LinkedHashSet<>();
for (UUID cardId : target1.getTargets()) {
Card card = cards.get(cardId, game);
if (card != null) {
cards.remove(card);
controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
toBattlefield.add(card);
}
}
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game, false, false, false, null);
controller.moveCards(cards, Zone.LIBRARY, Zone.GRAVEYARD, source, game);
}
return true;

View file

@ -25,20 +25,19 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.shadowmoor;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.ObjectColor;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.continuous.BecomesColorTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.FearAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.target.common.TargetCreaturePermanent;
/**
@ -47,19 +46,25 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class AphoticWisps extends CardImpl {
public AphoticWisps (UUID ownerId) {
public AphoticWisps(UUID ownerId) {
super(ownerId, 55, "Aphotic Wisps", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}");
this.expansionSetCode = "SHM";
// Target creature becomes black and gains fear until end of turn. (It can't be blocked except by artifact creatures and/or black creatures.)
// Target creature becomes black and gains fear until end of turn. (It can't be blocked except by artifact creatures and/or black creatures.)
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FearAbility.getInstance(), Duration.EndOfTurn));
Effect effect = new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.EndOfTurn);
effect.setText("Target creature becomes black");
this.getSpellAbility().addEffect(effect);
effect = new GainAbilityTargetEffect(FearAbility.getInstance(), Duration.EndOfTurn);
effect.setText("and gains fear until end of turn");
this.getSpellAbility().addEffect(effect);
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
effect = new DrawCardSourceControllerEffect(1);
effect.setText("<br>Draw a card");
this.getSpellAbility().addEffect(effect);
}
public AphoticWisps (final AphoticWisps card) {
public AphoticWisps(final AphoticWisps card) {
super(card);
}
@ -69,4 +74,3 @@ public class AphoticWisps extends CardImpl {
}
}

View file

@ -99,7 +99,7 @@ class CemeteryPucaEffect extends OneShotEffect {
if (copyToCreature != null) {
Permanent copyFromCreature = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.BATTLEFIELD);
if (copyFromCreature != null) {
game.copyPermanent(Duration.WhileOnBattlefield, copyFromCreature, copyToCreature, source, new EmptyApplyToPermanent());
game.copyPermanent(Duration.WhileOnBattlefield, copyFromCreature, copyToCreature.getId(), source, new EmptyApplyToPermanent());
ContinuousEffect effect = new GainAbilityTargetEffect(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new CemeteryPucaEffect(), new ManaCostsImpl("{1}")), false, new FilterCreaturePermanent("a creature"), true), Duration.WhileOnBattlefield);
effect.setTargetPointer(new FixedTarget(copyToCreature.getId()));
game.addEffect(effect, source);

View file

@ -45,12 +45,12 @@ import mage.target.TargetPlayer;
/**
*
* @author jeffwadsworth
*
*/
public class DrownerInitiate extends CardImpl {
private static final FilterSpell filter = new FilterSpell("a blue spell");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
}
@ -65,10 +65,10 @@ public class DrownerInitiate extends CardImpl {
this.toughness = new MageInt(1);
// Whenever a player casts a blue spell, you may pay {1}. If you do, target player puts the top two cards of his or her library into his or her graveyard.
Ability ability = new SpellCastAllTriggeredAbility(new DoIfCostPaid(new PutLibraryIntoGraveTargetEffect(2), new ManaCostsImpl("{1}")), filter, true);
Ability ability = new SpellCastAllTriggeredAbility(new DoIfCostPaid(new PutLibraryIntoGraveTargetEffect(2), new ManaCostsImpl("{1}")), filter, false);
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
public DrownerInitiate(final DrownerInitiate card) {

View file

@ -53,7 +53,6 @@ public class FateTransfer extends CardImpl {
super(ownerId, 161, "Fate Transfer", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{U/B}");
this.expansionSetCode = "SHM";
// Move all counters from target creature onto another target creature.
this.getSpellAbility().addEffect(new FateTransferEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
@ -96,9 +95,8 @@ class FateTransferEffect extends OneShotEffect {
&& creatureToMoveCountersTo != null) {
Permanent copyCreature = creatureToMoveCountersFrom.copy();
for (Counter counter : copyCreature.getCounters().values()) {
Counter newCounterTest = new Counter(counter.getName(), counter.getCount());
creatureToMoveCountersFrom.removeCounters(newCounterTest, game);
creatureToMoveCountersTo.addCounters(newCounterTest, game);
creatureToMoveCountersFrom.removeCounters(counter, game);
creatureToMoveCountersTo.addCounters(counter, game);
}
return true;
}

View file

@ -72,7 +72,7 @@ public class LeechBonder extends CardImpl {
// Leech Bonder enters the battlefield with two -1/-1 counters on it.
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(2))));
// {U}, {untap}: Move a counter from target creature onto a second target creature.
// {U}, {untap}: Move a counter from target creature onto another target creature.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LeechBonderEffect(), new ManaCostsImpl("{U}"));
ability.addCost(new UntapSourceCost());
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature to remove counter from")));

View file

@ -30,22 +30,16 @@ package mage.sets.shadowmoor;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.StateTriggeredAbility;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.StackObject;
import mage.players.Player;
/**
*
@ -62,7 +56,7 @@ public class LureboundScarecrow extends CardImpl {
this.toughness = new MageInt(4);
// As Lurebound Scarecrow enters the battlefield, choose a color.
this.addAbility(new AsEntersBattlefieldAbility(new LureboundScarecrowChooseColorEffect()));
this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect()));
// When you control no permanents of the chosen color, sacrifice Lurebound Scarecrow.
this.addAbility(new LureboundScarecrowTriggeredAbility());
@ -78,40 +72,6 @@ public class LureboundScarecrow extends CardImpl {
}
}
class LureboundScarecrowChooseColorEffect extends OneShotEffect {
public LureboundScarecrowChooseColorEffect() {
super(Outcome.BoostCreature);
staticText = "choose a color";
}
public LureboundScarecrowChooseColorEffect(final LureboundScarecrowChooseColorEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
StackObject sourceStackObject = game.getStack().getStackObject(source.getSourceId());
Permanent permanent = game.getPermanent(source.getSourceId());
if (player != null && sourceStackObject != null && permanent != null) {
ChoiceColor colorChoice = new ChoiceColor();
if (player.choose(Outcome.BoostCreature, colorChoice, game)) {
game.informPlayers(sourceStackObject.getName() + ": " + player.getLogName() + " has chosen " + colorChoice.getChoice());
game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor());
permanent.addInfo("chosen color", new StringBuilder("<font color='blue'>Chosen color: ").append(colorChoice.getColor().getDescription()).append("</font>").toString(), game);
}
}
return false;
}
@Override
public LureboundScarecrowChooseColorEffect copy() {
return new LureboundScarecrowChooseColorEffect(this);
}
}
class LureboundScarecrowTriggeredAbility extends StateTriggeredAbility {
private static final String staticText = "When you control no permanents of the chosen color, sacrifice {this}.";

View file

@ -61,7 +61,6 @@ public class Mirrorweave extends CardImpl {
super(ownerId, 143, "Mirrorweave", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{W/U}{W/U}");
this.expansionSetCode = "SHM";
// Each other creature becomes a copy of target nonlegendary creature until end of turn.
this.getSpellAbility().addEffect(new MirrorWeaveEffect());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
@ -105,7 +104,7 @@ class MirrorWeaveEffect extends OneShotEffect {
filter.add(Predicates.not(new PermanentIdPredicate(copyFromCreature.getId())));
for (Permanent copyToCreature : game.getBattlefield().getAllActivePermanents(filter, game)) {
if (copyToCreature != null) {
game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToCreature, source, new EmptyApplyToPermanent());
game.copyPermanent(Duration.EndOfTurn, copyFromCreature, copyToCreature.getId(), source, new EmptyApplyToPermanent());
}
}
}

View file

@ -29,19 +29,16 @@ package mage.sets.shadowmoor;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.AttacksOrBlocksTriggeredAbility;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
*
@ -57,7 +54,10 @@ public class WickerWarcrawler extends CardImpl {
this.toughness = new MageInt(6);
// Whenever Wicker Warcrawler attacks or blocks, put a -1/-1 counter on it at end of combat.
this.addAbility(new AttacksOrBlocksTriggeredAbility(new WickerWarcrawlerEffect(), false));
Effect effect = new AddCountersSourceEffect(CounterType.M1M1.createInstance(), true);
effect.setText("put a -1/-1 counter on it at end of combat");
DelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(effect);
this.addAbility(new AttacksOrBlocksTriggeredAbility(new CreateDelayedTriggeredAbilityEffect(ability, false, false), false));
}
@ -70,35 +70,3 @@ public class WickerWarcrawler extends CardImpl {
return new WickerWarcrawler(this);
}
}
class WickerWarcrawlerEffect extends OneShotEffect {
WickerWarcrawlerEffect() {
super(Outcome.Detriment);
staticText = "put a -1/-1 counter on {this} at the end of combat";
}
WickerWarcrawlerEffect(final WickerWarcrawlerEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent wickerWarcrawler = game.getPermanent(source.getSourceId());
if (wickerWarcrawler != null) {
AtTheEndOfCombatDelayedTriggeredAbility delayedAbility = new AtTheEndOfCombatDelayedTriggeredAbility(new AddCountersTargetEffect(CounterType.M1M1.createInstance()));
delayedAbility.setSourceId(source.getSourceId());
delayedAbility.setControllerId(source.getControllerId());
delayedAbility.setSourceObject(source.getSourceObject(game), game);
delayedAbility.getEffects().get(0).setTargetPointer(new FixedTarget(source.getSourceId()));
game.addDelayedTriggeredAbility(delayedAbility);
return true;
}
return false;
}
@Override
public WickerWarcrawlerEffect copy() {
return new WickerWarcrawlerEffect(this);
}
}

View file

@ -114,7 +114,7 @@ class TidehollowScullerExileEffect extends OneShotEffect {
if (controller.choose(Outcome.Exile, opponent.getHand(), target, game)) {
Card card = opponent.getHand().get(target.getFirstTarget(), game);
if (card != null) {
controller.moveCardToExileWithInfo(card, CardUtil.getObjectExileZoneId(game, sourcePermanent), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.HAND, true);
controller.moveCardToExileWithInfo(card, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), sourcePermanent.getIdName(), source.getSourceId(), game, Zone.HAND, true);
}
}

View file

@ -28,9 +28,6 @@
package mage.sets.tempest;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -39,7 +36,9 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.common.TargetCreaturePermanent;
@ -56,9 +55,10 @@ public class RootwaterMatriarch extends CardImpl {
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// {TAP}: Gain control of target creature for as long as that creature is enchanted
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.OneUse), EnchantedTargetCondition.getInstance(), "Gain control of target creature for as long as that creature is enchanted");
// {T}: Gain control of target creature for as long as that creature is enchanted
ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainControlTargetEffect(Duration.Custom), EnchantedTargetCondition.getInstance(),
"Gain control of target creature for as long as that creature is enchanted");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);

View file

@ -73,7 +73,6 @@ public class AshiokNightmareWeaver extends CardImpl {
this.expansionSetCode = "THS";
this.subtype.add("Ashiok");
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
// +2: Exile the top three cards of target opponent's library.
@ -121,14 +120,9 @@ class AshiokNightmareWeaverExileEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (sourceObject != null && opponent != null && controller != null) {
UUID exileZone = CardUtil.getObjectExileZoneId(game, sourceObject);
UUID exileZone = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());
if (exileZone != null) {
for (int i = 0; i < 3; i++) {
Card card = opponent.getLibrary().getFromTop(game);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileZone, sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
}
}
controller.moveCardsToExile(opponent.getLibrary().getTopCards(game, 3), source, game, true, exileZone, sourceObject.getIdName());
return true;
}
}
@ -167,11 +161,10 @@ class AshiokNightmareWeaverPutIntoPlayEffect extends OneShotEffect {
}
}
FilterCard filter = new FilterCreatureCard(new StringBuilder("creature card with converted mana cost {").append(cmc).append("} exiled with Ashiok, Nightmare Weaver").toString());
FilterCard filter = new FilterCreatureCard("creature card with converted mana cost {" + cmc + "} exiled with " + sourceObject.getIdName());
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, cmc));
Target target = new TargetCardInExile(filter, CardUtil.getObjectExileZoneId(game, sourceObject));
Target target = new TargetCardInExile(filter, CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()));
if (target.canChoose(source.getSourceId(), controller.getId(), game)) {
if (controller.chooseTarget(Outcome.PutCreatureInPlay, target, source, game)) {
@ -182,7 +175,7 @@ class AshiokNightmareWeaverPutIntoPlayEffect extends OneShotEffect {
if (permanent != null) {
permanent.changeControllerId(source.getControllerId(), game);
}
ContinuousEffectImpl effect = new AshiokNightmareWeaverAddTypeEffect();
effect.setTargetPointer(new FixedTarget(card.getId()));
game.addEffect(effect, source);
@ -267,7 +260,7 @@ class AshiokNightmareWeaverExileAllEffect extends OneShotEffect {
if (exileId == null) {
return false;
}
for (UUID opponentId: game.getOpponents(source.getControllerId())) {
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
Player opponent = game.getPlayer(opponentId);
if (opponent != null) {
Cards cards = new CardsImpl();
@ -280,7 +273,7 @@ class AshiokNightmareWeaverExileAllEffect extends OneShotEffect {
}
cards.clear();
cards.addAll(opponent.getGraveyard());
for (UUID cardId :cards) {
for (UUID cardId : cards) {
Card card = game.getCard(cardId);
if (card != null) {
controller.moveCardToExileWithInfo(card, exileId, sourceObject.getIdName(), source.getSourceId(), game, Zone.GRAVEYARD, true);

View file

@ -108,7 +108,7 @@ class VesuvanDoppelgangerCopyEffect extends OneShotEffect {
controller.choose(Outcome.Copy, target, source.getSourceId(), game);
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
if (copyFromPermanent != null) {
game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() {
game.copyPermanent(copyFromPermanent, sourcePermanent.getId(), source, new ApplyToPermanent() {
@Override
public Boolean apply(Game game, Permanent permanent) {
permanent.getColor(game).setColor(sourcePermanent.getColor(game));

View file

@ -28,7 +28,9 @@
package mage.sets.urzassaga;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
@ -102,7 +104,7 @@ class ShowAndTellEffect extends OneShotEffect {
if (controller == null) {
return false;
}
List<Card> cardsToPutIntoPlay = new ArrayList<>();
Set<Card> cardsToPutIntoPlay = new LinkedHashSet<>();
TargetCardInHand target = new TargetCardInHand(filter);
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
@ -119,12 +121,6 @@ class ShowAndTellEffect extends OneShotEffect {
}
}
}
for (Card card : cardsToPutIntoPlay) {
Player player = game.getPlayer(card.getOwnerId());
if (player != null) {
player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
}
}
return true;
return controller.moveCards(cardsToPutIntoPlay, Zone.BATTLEFIELD, source, game, false, false, true, null);
}
}

View file

@ -32,7 +32,6 @@ import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
@ -53,8 +52,7 @@ public class FeralContest extends CardImpl {
super(ownerId, 100, "Feral Contest", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{G}");
this.expansionSetCode = "WWK";
// Put a +1/+1 counter on target creature you control.
// Put a +1/+1 counter on target creature you control.
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance()));
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
// Another target creature blocks it this turn if able.
@ -88,7 +86,7 @@ class FeralContestEffect extends RequirementEffect {
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
public boolean applies(Permanent permanent, Ability source, Game game) {
if (permanent.getId().equals(source.getTargets().get(1).getFirstTarget())) {
return permanent.canBlock(source.getFirstTarget(), game);
}
@ -116,4 +114,3 @@ class FeralContestEffect extends RequirementEffect {
}
}

View file

@ -33,8 +33,6 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.costs.OptionalAdditionalCost;
import mage.abilities.costs.OptionalAdditionalCostImpl;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
@ -56,7 +54,7 @@ import mage.target.common.TargetOpponent;
*/
public class BloodTribute extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Vampire you control");
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("an untapped Vampire you control");
static {
filter.add(Predicates.not(new TappedPredicate()));
@ -67,20 +65,18 @@ public class BloodTribute extends CardImpl {
super(ownerId, 81, "Blood Tribute", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}{B}");
this.expansionSetCode = "ZEN";
// Kicker - Tap an untapped Vampire you control.
OptionalAdditionalCost cost = new OptionalAdditionalCostImpl("Kicker-","",new TapTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true)));
this.addAbility(new KickerAbility(cost));
this.addAbility(new KickerAbility(new TapTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true))));
// Target opponent loses half his or her life, rounded up.
this.getSpellAbility().addTarget(new TargetOpponent());
this.getSpellAbility().addEffect(new BloodTributeLoseLifeEffect());
// If Blood Tribute was kicked, you gain life equal to the life lost this way.
Effect effect = new ConditionalOneShotEffect(
new BloodTributeGainLifeEffect(),
KickedCondition.getInstance(),
"If Blood Tribute was kicked, you gain life equal to the life lost this way");
"If {this} was kicked, you gain life equal to the life lost this way");
this.getSpellAbility().addEffect(effect);
}