* Murkfiend Liege , Prophet of Kruphix, Quest for Renewal - Changed the untap effects from a triggered ability to a continious rule changing effect not going to stack.

This commit is contained in:
LevelX2 2014-02-25 17:50:15 +01:00
parent 634b4d5e6d
commit 2520644e2c
4 changed files with 118 additions and 24 deletions

View file

@ -30,16 +30,13 @@ package mage.sets.commander2013;
import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.BeginningOfUntapTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.UntapAllControllerEffect;
import mage.abilities.effects.common.continious.BoostControlledEffect;
import mage.abilities.effects.common.continious.UntapAllDuringEachOtherPlayersUntapStepEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
@ -53,7 +50,7 @@ public class MurkfiendLiege extends CardImpl<MurkfiendLiege> {
private static final FilterCreaturePermanent filterGreen = new FilterCreaturePermanent("green creatures");
private static final FilterCreaturePermanent filterBlue = new FilterCreaturePermanent("blue creatures");
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent();
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("green and/or blue creatures you control");
static {
filterGreen.add(new ColorPredicate(ObjectColor.GREEN));
filterBlue.add(new ColorPredicate(ObjectColor.BLUE));
@ -77,8 +74,7 @@ public class MurkfiendLiege extends CardImpl<MurkfiendLiege> {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1,1, Duration.WhileOnBattlefield, filterBlue, true)));
// Untap all green and/or blue creatures you control during each other player's untap step.
Effect effect = new UntapAllControllerEffect(filter, "Untap all green and/or blue creatures you control");
this.addAbility(new BeginningOfUntapTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.NOT_YOU, false));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UntapAllDuringEachOtherPlayersUntapStepEffect(filter)));
}

View file

@ -29,16 +29,13 @@ package mage.sets.theros;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.BeginningOfUntapTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.UntapAllControllerEffect;
import mage.abilities.effects.common.continious.CastAsThoughItHadFlashEffect;
import mage.abilities.effects.common.continious.UntapAllDuringEachOtherPlayersUntapStepEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreatureCard;
@ -51,7 +48,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*/
public class ProphetOfKruphix extends CardImpl<ProphetOfKruphix> {
private static final FilterPermanent filter = new FilterPermanent();
private static final FilterPermanent filter = new FilterPermanent("creatures and lands you control");
static {
filter.add(Predicates.or(
new CardTypePredicate(CardType.CREATURE),
@ -70,8 +67,7 @@ public class ProphetOfKruphix extends CardImpl<ProphetOfKruphix> {
this.toughness = new MageInt(3);
// Untap all creatures and lands you control during each other player's untap step.
Effect effect = new UntapAllControllerEffect(filter, "Untap all creatures and lands you control");
this.addAbility(new BeginningOfUntapTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.NOT_YOU, false));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UntapAllDuringEachOtherPlayersUntapStepEffect(filter)));
// You may cast creature cards as though they had flash.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CastAsThoughItHadFlashEffect(Duration.WhileOnBattlefield, new FilterCreatureCard("creature cards"))));

View file

@ -28,17 +28,15 @@
package mage.sets.worldwake;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.common.BecomesTappedCreatureControlledTriggeredAbility;
import mage.abilities.common.BeginningOfUntapTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.HasCounterCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.UntapAllControllerEffect;
import mage.abilities.decorator.ConditionalContinousEffect;
import mage.abilities.effects.common.continious.UntapAllDuringEachOtherPlayersUntapStepEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.constants.TargetController;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
@ -61,9 +59,10 @@ public class QuestForRenewal extends CardImpl<QuestForRenewal> {
this.addAbility(new BecomesTappedCreatureControlledTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true));
// As long as there are four or more quest counters on Quest for Renewal, untap all creatures you control during each other player's untap step.
ConditionalOneShotEffect effect = new ConditionalOneShotEffect(new UntapAllControllerEffect(filter, ""), new HasCounterCondition(CounterType.QUEST, 4), "as long as there are four or more quest counters on <this>, untap all creatures you control");
this.addAbility(new BeginningOfUntapTriggeredAbility(Zone.BATTLEFIELD, effect, TargetController.NOT_YOU, false));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
new UntapAllDuringEachOtherPlayersUntapStepEffect(filter),
new HasCounterCondition(CounterType.QUEST, 4),
"As long as there are four or more quest counters on {this}, untap all creatures you control during each other player's untap step.", false)));
}
public QuestForRenewal(final QuestForRenewal card) {

View file

@ -0,0 +1,103 @@
/*
* 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.continious;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.RestrictionEffect;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.SubLayer;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class UntapAllDuringEachOtherPlayersUntapStepEffect extends ContinuousEffectImpl<UntapAllDuringEachOtherPlayersUntapStepEffect> {
private final FilterPermanent filter;
public UntapAllDuringEachOtherPlayersUntapStepEffect(FilterPermanent filter) {
super(Duration.WhileOnBattlefield, Outcome.Untap);
this.filter = filter;
staticText = new StringBuilder("Untap all ").append(filter.getMessage()).append(" during each other player's untap step").toString();
}
public UntapAllDuringEachOtherPlayersUntapStepEffect(final UntapAllDuringEachOtherPlayersUntapStepEffect effect) {
super(effect);
this.filter = effect.filter;
}
@Override
public UntapAllDuringEachOtherPlayersUntapStepEffect copy() {
return new UntapAllDuringEachOtherPlayersUntapStepEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Boolean applied = (Boolean) game.getState().getValue(source.getSourceId() + "applied");
if (applied == null) {
applied = Boolean.FALSE;
}
if (!applied && layer.equals(Layer.RulesEffects)) {
if (!game.getActivePlayerId().equals(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) {
game.getState().setValue(source.getSourceId() + "applied", true);
for (Permanent artifact: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
boolean untap = true;
for (RestrictionEffect effect: game.getContinuousEffects().getApplicableRestrictionEffects(artifact, game).keySet()) {
untap &= effect.canBeUntapped(artifact, game);
}
if (untap) {
artifact.untap(game);
}
}
}
} else if (applied && layer.equals(Layer.RulesEffects)) {
if (game.getStep().getType() == PhaseStep.END_TURN) {
game.getState().setValue(source.getSourceId() + "applied", false);
}
}
return true;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.RulesEffects;
}
}