[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.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
@ -43,10 +44,10 @@ import mage.target.common.TargetCardInOpponentsGraveyard;
* @author Archer262 * @author Archer262
*/ */
public class DisposalMummy extends CardImpl { public class DisposalMummy extends CardImpl {
public DisposalMummy(UUID ownerId, CardSetInfo setInfo) { public DisposalMummy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.subtype.add("Zombie"); this.subtype.add("Zombie");
this.subtype.add("Jackal"); this.subtype.add("Jackal");
this.power = new MageInt(2); this.power = new MageInt(2);
@ -58,11 +59,11 @@ public class DisposalMummy extends CardImpl {
ability.addTarget(target); ability.addTarget(target);
this.addAbility(ability); this.addAbility(ability);
} }
public DisposalMummy(final DisposalMummy card) { public DisposalMummy(final DisposalMummy card) {
super(card); super(card);
} }
@Override @Override
public DisposalMummy copy() { public DisposalMummy copy() {
return new DisposalMummy(this); return new DisposalMummy(this);

View file

@ -41,7 +41,6 @@ import mage.filter.StaticFilters;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.Target; import mage.target.Target;
import mage.target.TargetPlayer;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetOpponent; import mage.target.common.TargetOpponent;
@ -58,9 +57,9 @@ public class Doomfall extends CardImpl {
this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(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().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. // Target opponent reveals his or her hand. You choose a nonland card from it. Exile that card.
Mode mode = new Mode(); Mode mode = new Mode();
@ -103,7 +102,7 @@ class DoomfallEffect extends OneShotEffect {
Target target = new TargetControlledCreaturePermanent(); Target target = new TargetControlledCreaturePermanent();
target.setNotTarget(true); target.setNotTarget(true);
if (targetPlayer.choose(outcome, target, source.getSourceId(), game)) { 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; return true;
} }

View file

@ -27,6 +27,7 @@
*/ */
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
@ -45,8 +46,6 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/** /**
* *
* @author Plopman * @author Plopman
@ -54,18 +53,20 @@ import java.util.UUID;
public class Duplicant extends CardImpl { public class Duplicant extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature");
static { static {
filter.add(Predicates.not(new TokenPredicate())); filter.add(Predicates.not(new TokenPredicate()));
} }
public Duplicant(UUID ownerId, CardSetInfo setInfo) { 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.subtype.add("Shapeshifter");
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(4); this.toughness = new MageInt(4);
// Imprint - When Duplicant enters the battlefield, you may exile target nontoken creature. // 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)); ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability); 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. // 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); return new Duplicant(this);
} }
} }
class ExileTargetEffect extends OneShotEffect {
class DuplicantExileTargetEffect extends OneShotEffect {
public ExileTargetEffect() { public DuplicantExileTargetEffect() {
super(Outcome.Exile); super(Outcome.Exile);
} }
public ExileTargetEffect(final ExileTargetEffect effect) { public DuplicantExileTargetEffect(final DuplicantExileTargetEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public ExileTargetEffect copy() { public DuplicantExileTargetEffect copy() {
return new ExileTargetEffect(this); return new DuplicantExileTargetEffect(this);
} }
@Override @Override
@ -102,13 +103,13 @@ class ExileTargetEffect extends OneShotEffect {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
Permanent sourcePermananent = game.getPermanent(source.getSourceId()); Permanent sourcePermananent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
if(sourcePermananent != null){ if (sourcePermananent != null) {
sourcePermananent.imprint(permanent.getId(), game); sourcePermananent.imprint(permanent.getId(), game);
sourcePermananent.addInfo("imprint", new StringBuilder("[Imprinted card - ").append(permanent.getName()).append(']').toString(), game); sourcePermananent.addInfo("imprint", new StringBuilder("[Imprinted card - ").append(permanent.getName()).append(']').toString(), game);
} }
return permanent.moveToExile(null, null, source.getSourceId(), game); return permanent.moveToExile(null, null, source.getSourceId(), game);
} }
return false; return false;
} }
@ -118,17 +119,16 @@ class ExileTargetEffect extends OneShotEffect {
} }
} }
class DuplicantContinuousEffect extends ContinuousEffectImpl { class DuplicantContinuousEffect extends ContinuousEffectImpl {
public DuplicantContinuousEffect() { public DuplicantContinuousEffect() {
super(Duration.WhileOnBattlefield, Outcome.BoostCreature); super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
staticText = "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"; staticText = "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";
} }
public DuplicantContinuousEffect(final DuplicantContinuousEffect effect) { public DuplicantContinuousEffect(final DuplicantContinuousEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public DuplicantContinuousEffect copy() { public DuplicantContinuousEffect copy() {
@ -139,10 +139,9 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
if(!permanent.getImprinted().isEmpty()){ if (!permanent.getImprinted().isEmpty()) {
Card card = game.getCard(permanent.getImprinted().get(0)); Card card = game.getCard(permanent.getImprinted().get(0));
if(card != null && card.isCreature()) if (card != null && card.isCreature()) {
{
switch (layer) { switch (layer) {
case TypeChangingEffects_4: case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) { if (sublayer == SubLayer.NA) {
@ -152,29 +151,28 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
break; break;
case PTChangingEffects_7: case PTChangingEffects_7:
if (sublayer == SubLayer.SetPT_7b) { if (sublayer == SubLayer.SetPT_7b) {
permanent.getPower().setValue(card.getPower().getValue()); permanent.getPower().setValue(card.getPower().getValue());
permanent.getToughness().setValue(card.getToughness().getValue()); permanent.getToughness().setValue(card.getToughness().getValue());
} }
} }
return true; return true;
} }
} }
} }
return false; return false;
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
return false; return false;
} }
@Override @Override
public boolean hasLayer(Layer layer) { public boolean hasLayer(Layer layer) {
return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4; return layer == Layer.PTChangingEffects_7 || layer == Layer.TypeChangingEffects_4;
} }
} }

View file

@ -43,6 +43,7 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; 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. // 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().addEffect(new HourOfGloryEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
} }
public HourOfGlory(final HourOfGlory card) { public HourOfGlory(final HourOfGlory card) {

View file

@ -36,7 +36,12 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.counters.CounterType; import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters; 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.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; 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); int permanents = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_NON_LAND, controllingPlayer.getId(), game);
if (permanents > 0 && controllingPlayer.chooseUse(outcome, "Sacrifices a nonland permanent?", 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)) { "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)) { if (controllingPlayer.choose(outcome, target, source.getSourceId(), game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget()); Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) { if (permanent != null) {