mirror of
https://github.com/correl/mage.git
synced 2025-04-10 17:00:08 -09:00
* Wall of Deceit - Fixed not working "Turn face down" ability.
This commit is contained in:
parent
c824d012d1
commit
9919a3403d
1 changed files with 37 additions and 9 deletions
|
@ -29,18 +29,20 @@ package mage.cards.w;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect;
|
|
||||||
import mage.abilities.keyword.DefenderAbility;
|
import mage.abilities.keyword.DefenderAbility;
|
||||||
import mage.abilities.keyword.MorphAbility;
|
import mage.abilities.keyword.MorphAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -49,19 +51,17 @@ import mage.constants.Zone;
|
||||||
public class WallOfDeceit extends CardImpl {
|
public class WallOfDeceit extends CardImpl {
|
||||||
|
|
||||||
public WallOfDeceit(UUID ownerId, CardSetInfo setInfo) {
|
public WallOfDeceit(UUID ownerId, CardSetInfo setInfo) {
|
||||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}");
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
||||||
this.subtype.add(SubType.WALL);
|
this.subtype.add(SubType.WALL);
|
||||||
this.power = new MageInt(0);
|
this.power = new MageInt(0);
|
||||||
this.toughness = new MageInt(5);
|
this.toughness = new MageInt(5);
|
||||||
|
|
||||||
// Defender
|
// Defender
|
||||||
this.addAbility(DefenderAbility.getInstance());
|
this.addAbility(DefenderAbility.getInstance());
|
||||||
|
|
||||||
// {3}: Turn Wall of Deceit face down.
|
// {3}: Turn Wall of Deceit face down.
|
||||||
Effect effect = new BecomesFaceDownCreatureEffect(Duration.Custom, BecomesFaceDownCreatureEffect.FaceDownType.MANIFESTED);
|
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new WallOfDeceitEffect(), new ManaCostsImpl("{3}")));
|
||||||
effect.setText("Turn Wall of Deceit face down. <i>(It becomes a 2/2 creature.)</i>");
|
|
||||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{3}")));
|
|
||||||
|
|
||||||
// Morph {U}
|
// Morph {U}
|
||||||
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{U}")));
|
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{U}")));
|
||||||
}
|
}
|
||||||
|
@ -75,3 +75,31 @@ public class WallOfDeceit extends CardImpl {
|
||||||
return new WallOfDeceit(this);
|
return new WallOfDeceit(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class WallOfDeceitEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
public WallOfDeceitEffect() {
|
||||||
|
super(Outcome.Detriment);
|
||||||
|
this.staticText = "Turn {this} face down";
|
||||||
|
}
|
||||||
|
|
||||||
|
public WallOfDeceitEffect(final WallOfDeceitEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WallOfDeceitEffect copy() {
|
||||||
|
return new WallOfDeceitEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||||
|
if (sourcePermanent != null
|
||||||
|
&& source.getSourceObjectZoneChangeCounter() == sourcePermanent.getZoneChangeCounter(game) // in case source was blinked after ability was set to stack
|
||||||
|
&& !sourcePermanent.isFaceDown(game)) {
|
||||||
|
sourcePermanent.setFaceDown(true, game);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue