mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
[HOU] Some fixes.
This commit is contained in:
parent
3e61465d8e
commit
c1c224c7ff
5 changed files with 42 additions and 34 deletions
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,9 +53,11 @@ 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");
|
||||||
|
@ -65,7 +66,7 @@ public class Duplicant extends CardImpl {
|
||||||
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
|
||||||
|
@ -118,7 +119,6 @@ class ExileTargetEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class DuplicantContinuousEffect extends ContinuousEffectImpl {
|
class DuplicantContinuousEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
public DuplicantContinuousEffect() {
|
public DuplicantContinuousEffect() {
|
||||||
|
@ -141,8 +141,7 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
|
||||||
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) {
|
||||||
|
@ -159,7 +158,6 @@ class DuplicantContinuousEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue