[HOU] Some fixes.

This commit is contained in:
LevelX2 2017-07-08 15:53:50 +02:00
parent 3e61465d8e
commit c1c224c7ff
5 changed files with 42 additions and 34 deletions

View file

@ -31,6 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;

View file

@ -41,7 +41,6 @@ import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetPlayer;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetOpponent;
@ -58,9 +57,9 @@ public class Doomfall extends CardImpl {
this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(1);
// Target player exiles a creature he or she controls.
// Target opponent exiles a creature he or she controls.
this.getSpellAbility().addEffect(new DoomfallEffect());
this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addTarget(new TargetOpponent());
// Target opponent reveals his or her hand. You choose a nonland card from it. Exile that card.
Mode mode = new Mode();
@ -103,7 +102,7 @@ class DoomfallEffect extends OneShotEffect {
Target target = new TargetControlledCreaturePermanent();
target.setNotTarget(true);
if (targetPlayer.choose(outcome, target, source.getSourceId(), game)) {
targetPlayer.moveCards(game.getCard(target.getFirstTarget()), Zone.EXILED, source, game);
targetPlayer.moveCards(game.getPermanent(target.getFirstTarget()), Zone.EXILED, source, game);
}
return true;
}

View file

@ -27,6 +27,7 @@
*/
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
@ -45,8 +46,6 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Plopman
@ -54,18 +53,20 @@ import java.util.UUID;
public class Duplicant extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature");
static {
filter.add(Predicates.not(new TokenPredicate()));
}
public Duplicant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{6}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{6}");
this.subtype.add("Shapeshifter");
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// Imprint - When Duplicant enters the battlefield, you may exile target nontoken creature.
Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetEffect(), true, "<i>Imprint - </i>");
Ability ability = new EntersBattlefieldTriggeredAbility(new DuplicantExileTargetEffect(), true, "<i>Imprint - </i>");
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
// As long as the exiled card is a creature card, Duplicant has that card's power, toughness, and creature types. It's still a Shapeshifter.
@ -81,20 +82,20 @@ public class Duplicant extends CardImpl {
return new Duplicant(this);
}
}
class ExileTargetEffect extends OneShotEffect {
class DuplicantExileTargetEffect extends OneShotEffect {
public ExileTargetEffect() {
public DuplicantExileTargetEffect() {
super(Outcome.Exile);
}
public ExileTargetEffect(final ExileTargetEffect effect) {
public DuplicantExileTargetEffect(final DuplicantExileTargetEffect effect) {
super(effect);
}
@Override
public ExileTargetEffect copy() {
return new ExileTargetEffect(this);
public DuplicantExileTargetEffect copy() {
return new DuplicantExileTargetEffect(this);
}
@Override
@ -102,7 +103,7 @@ class ExileTargetEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
Permanent sourcePermananent = game.getPermanent(source.getSourceId());
if (permanent != null) {
if(sourcePermananent != null){
if (sourcePermananent != null) {
sourcePermananent.imprint(permanent.getId(), game);
sourcePermananent.addInfo("imprint", new StringBuilder("[Imprinted card - ").append(permanent.getName()).append(']').toString(), game);
}
@ -118,7 +119,6 @@ class ExileTargetEffect extends OneShotEffect {
}
}
class DuplicantContinuousEffect extends ContinuousEffectImpl {
public DuplicantContinuousEffect() {
@ -139,10 +139,9 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
if(!permanent.getImprinted().isEmpty()){
if (!permanent.getImprinted().isEmpty()) {
Card card = game.getCard(permanent.getImprinted().get(0));
if(card != null && card.isCreature())
{
if (card != null && card.isCreature()) {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
@ -159,7 +158,6 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
}
return true;
}
}

View file

@ -43,6 +43,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
*
@ -55,6 +56,7 @@ public class HourOfGlory extends CardImpl {
// Exile target creature. If that creature was a God, its controller reveals his or her hand and exiles all cards with the same name as that creature.
this.getSpellAbility().addEffect(new HourOfGloryEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
public HourOfGlory(final HourOfGlory card) {

View file

@ -36,7 +36,12 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.PermanentIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -94,7 +99,10 @@ class TormentOfVenomEffect extends OneShotEffect {
int permanents = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_NON_LAND, controllingPlayer.getId(), game);
if (permanents > 0 && controllingPlayer.chooseUse(outcome, "Sacrifices a nonland permanent?",
"Otherwise you have to discard a card or lose 3 life.", "Sacrifice", "Discard or life loss", source, game)) {
Target target = new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_NON_LAND);
FilterPermanent filter = new FilterControlledPermanent("another nonland permanent");
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
filter.add(Predicates.not(new PermanentIdPredicate(targetCreature.getId())));
Target target = new TargetPermanent(filter);
if (controllingPlayer.choose(outcome, target, source.getSourceId(), game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) {