* Mirror Entity - Fixed that the "gain all creature types" was applied in the wrong layer.

This commit is contained in:
LevelX2 2015-12-12 18:20:42 +01:00
parent 54788bc875
commit e2873be2f8
5 changed files with 33 additions and 30 deletions

View file

@ -41,7 +41,9 @@ import mage.abilities.keyword.ChangelingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
@ -51,7 +53,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
*/
public class MirrorEntity extends CardImpl {
static private FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Creatures you control");
static private FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Creatures you control");
public MirrorEntity(UUID ownerId) {
super(ownerId, 31, "Mirror Entity", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}");
@ -68,7 +70,7 @@ public class MirrorEntity extends CardImpl {
Effect effect = new SetPowerToughnessAllEffect(variableMana, variableMana, Duration.EndOfTurn, filter, true);
effect.setText("Until end of turn, creatures you control have base power and toughness X/X");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new VariableManaCost());
effect = new GainAbilityAllEffect(ChangelingAbility.getInstance(), Duration.EndOfTurn, filter);
effect = new GainAbilityAllEffect(ChangelingAbility.getInstance(), Duration.EndOfTurn, filter, false, Layer.TypeChangingEffects_4, SubLayer.NA);
effect.setText("and gain all creature types");
ability.addEffect(effect);
this.addAbility(ability);

View file

@ -25,19 +25,18 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.returntoravnica;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CantBeCounteredSourceEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.Filter;
import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
@ -55,16 +54,14 @@ public class AbruptDecay extends CardImpl {
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 4));
}
public AbruptDecay (UUID ownerId) {
public AbruptDecay(UUID ownerId) {
super(ownerId, 141, "Abrupt Decay", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{B}{G}");
this.expansionSetCode = "RTR";
// Abrupt Decay can't be countered by spells or abilities.
Effect effect = new CantBeCounteredSourceEffect();
Effect effect = new CantBeCounteredSourceEffect();
effect.setText("{this} can't be countered by spells or abilities");
Ability ability = new SimpleStaticAbility(Zone.STACK,effect);
Ability ability = new SimpleStaticAbility(Zone.STACK, effect);
ability.setRuleAtTheTop(true);
this.addAbility(ability);
@ -73,7 +70,7 @@ public class AbruptDecay extends CardImpl {
this.getSpellAbility().addTarget(new TargetNonlandPermanent(filter));
}
public AbruptDecay (final AbruptDecay card) {
public AbruptDecay(final AbruptDecay card) {
super(card);
}

View file

@ -28,21 +28,23 @@
package mage.sets.returntoravnica;
import java.util.UUID;
import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.OverloadAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetNonlandPermanent;
/**
*
* @author LevelX2
@ -59,7 +61,6 @@ public class CyclonicRift extends CardImpl {
super(ownerId, 35, "Cyclonic Rift", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{U}");
this.expansionSetCode = "RTR";
// Return target nonland permanent you don't control to its owner's hand.
this.getSpellAbility().addTarget(new TargetNonlandPermanent(filter));
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
@ -97,7 +98,7 @@ class CyclonicRiftEffect extends OneShotEffect {
if (!creature.getControllerId().equals(source.getControllerId())) {
creature.moveToZone(Zone.HAND, source.getSourceId(), game, true);
}
}
return true;
}
@ -106,4 +107,4 @@ class CyclonicRiftEffect extends OneShotEffect {
public CyclonicRiftEffect copy() {
return new CyclonicRiftEffect(this);
}
}
}

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,12 +20,11 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common.continuous;
import java.util.HashMap;
@ -70,7 +69,11 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
}
public GainAbilityAllEffect(Ability ability, Duration duration, FilterPermanent filter, boolean excludeSource) {
super(duration, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
this(ability, duration, filter, excludeSource, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA);
}
public GainAbilityAllEffect(Ability ability, Duration duration, FilterPermanent filter, boolean excludeSource, Layer layer, SubLayer subLayer) {
super(duration, layer, subLayer, Outcome.AddAbility);
this.ability = ability;
this.filter = filter;
this.excludeSource = excludeSource;
@ -89,7 +92,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
public void init(Ability source, Game game) {
super.init(source, game);
if (this.affectedObjectsSet) {
for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
affectedObjectList.add(new MageObjectReference(perm, game));
}
@ -117,7 +120,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
}
}
} else {
for (Permanent perm: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
perm.addAbility(ability, source.getSourceId(), game, false);
}
@ -125,7 +128,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
// still as long as the prev. permanent is known to the LKI (e.g. Mikaeus, the Unhallowed) so gained dies triggered ability will trigger
HashMap<UUID, MageObject> LKIBattlefield = game.getLKI().get(Zone.BATTLEFIELD);
if (LKIBattlefield != null) {
for (MageObject mageObject: LKIBattlefield.values()) {
for (MageObject mageObject : LKIBattlefield.values()) {
Permanent perm = (Permanent) mageObject;
if (!(excludeSource && perm.getId().equals(source.getSourceId()))) {
if (filter.match(perm, source.getSourceId(), source.getControllerId(), game)) {
@ -156,7 +159,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
sb.append(" gains ");
} else {
sb.append(" gain ");
}
}
}
if (quotes) {
sb.append("\"");

View file

@ -3230,7 +3230,7 @@ public abstract class PlayerImpl implements Player, Serializable {
card = game.getCard(card.getId());
}
if (!game.isSimulation()) {
game.informPlayers(this.getLogName() + " puts "
game.informPlayers(getLogName() + " puts "
+ (withName ? card.getLogName() : (card.isFaceDown(game) ? "a face down card" : "a card"))
+ " from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + " "
+ (card.getOwnerId().equals(this.getId()) ? "into his or her hand" : "into its owner's hand")