[ODY] Fixed 29 Odyssey cards.

This commit is contained in:
LevelX2 2013-10-19 12:17:33 +02:00
parent d4f8e6bc1e
commit b4d43649b4
29 changed files with 210 additions and 213 deletions

View file

@ -110,8 +110,6 @@ class BridgeFromBelowAbility extends TriggeredAbilityImpl<BridgeFromBelowAbility
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event; ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) { if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) { if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {

View file

@ -29,6 +29,7 @@
package mage.sets.magic2010; package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Rarity; import mage.constants.Rarity;
@ -49,8 +50,13 @@ public class Overrun extends CardImpl<Overrun> {
this.expansionSetCode = "M10"; this.expansionSetCode = "M10";
this.color.setGreen(true); this.color.setGreen(true);
this.getSpellAbility().addEffect(new BoostControlledEffect(3, 3, Duration.EndOfTurn)); // Creatures you control get +3/+3 and gain trample until end of turn.
this.getSpellAbility().addEffect(new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent())); Effect effect = new BoostControlledEffect(3, 3, Duration.EndOfTurn);
effect.setText("Creatures you control get +3/+3");
this.getSpellAbility().addEffect(effect);
effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent());
effect.setText("and gain trample until end of turn");
this.getSpellAbility().addEffect(effect);
} }
public Overrun(final Overrun card) { public Overrun(final Overrun card) {

View file

@ -42,7 +42,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
*/ */
public class BelovedChaplain extends CardImpl<BelovedChaplain> { public class BelovedChaplain extends CardImpl<BelovedChaplain> {
public static final FilterCard filter = new FilterCard("Creature"); public static final FilterCard filter = new FilterCard("creature");
static { static {
filter.add(new CardTypePredicate(CardType.CREATURE)); filter.add(new CardTypePredicate(CardType.CREATURE));

View file

@ -70,7 +70,7 @@ class BlazingSalvoEffect extends OneShotEffect<BlazingSalvoEffect> {
public BlazingSalvoEffect() { public BlazingSalvoEffect() {
super(Outcome.Damage); super(Outcome.Damage);
this.staticText = "Blazing Salvo deals 3 damage to target creature unless that creature's controller has Blazing Salvo deal 5 damage to him or her."; this.staticText = "Blazing Salvo deals 3 damage to target creature unless that creature's controller has Blazing Salvo deal 5 damage to him or her";
} }
public BlazingSalvoEffect(final BlazingSalvoEffect effect){ public BlazingSalvoEffect(final BlazingSalvoEffect effect){

View file

@ -90,7 +90,7 @@ public class CabalInquisitor extends CardImpl<CabalInquisitor> {
class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl<ActivateAsSorceryConditionalActivatedAbility> { class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl<ActivateAsSorceryConditionalActivatedAbility> {
private Condition condition; private Condition condition;
private String ruleText = "Threshold - {1}{B}, {tap}, Exile two cards from your graveyard: Target player discards a card. Activate this ability only any time you could cast a sorcery, and only if seven or more cards are in your graveyard."; private String ruleText = "<i>Threshold<i/> - {1}{B}, {t}, Exile two cards from your graveyard: Target player discards a card. Activate this ability only any time you could cast a sorcery, and only if seven or more cards are in your graveyard.";
private static final Effects emptyEffects = new Effects(); private static final Effects emptyEffects = new Effects();
@ -131,6 +131,6 @@ class ActivateAsSorceryConditionalActivatedAbility extends ActivatedAbilityImpl<
@Override @Override
public String getRule() { public String getRule() {
return super.getRule() + " Activate this ability only any time you could cast a sorcery."; return ruleText;
} }
} }

View file

@ -65,7 +65,7 @@ public class CabalPatriarch extends CardImpl<CabalPatriarch> {
// {2}{B}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. // {2}{B}, Sacrifice a creature: Target creature gets -2/-2 until end of turn.
Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{2}{B}")); Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{2}{B}"));
TargetControlledPermanent target = new TargetControlledPermanent(new FilterControlledCreaturePermanent("")); TargetControlledPermanent target = new TargetControlledPermanent(new FilterControlledCreaturePermanent("a creature"));
target.setRequired(true); target.setRequired(true);
ability1.addCost(new SacrificeTargetCost(target)); ability1.addCost(new SacrificeTargetCost(target));
ability1.addTarget(new TargetCreaturePermanent(true)); ability1.addTarget(new TargetCreaturePermanent(true));

View file

@ -70,7 +70,8 @@ public class CausticTar extends CardImpl<CausticTar> {
// Enchanted land has "{tap}: Target player loses 3 life." // Enchanted land has "{tap}: Target player loses 3 life."
Ability tarAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(3), new TapSourceCost()); Ability tarAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(3), new TapSourceCost());
tarAbility.addTarget(new TargetPlayer(true)); tarAbility.addTarget(new TargetPlayer(true));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(tarAbility, AttachmentType.AURA, Duration.WhileOnBattlefield))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(tarAbility, AttachmentType.AURA,
Duration.WhileOnBattlefield,"Enchanted land has \"{t}: Target player loses 3 life.\"")));
} }

View file

@ -83,7 +83,7 @@ class CeaseFireEffect extends ReplacementEffectImpl<CeaseFireEffect> {
public CeaseFireEffect() { public CeaseFireEffect() {
super(Duration.EndOfTurn, Outcome.Detriment); super(Duration.EndOfTurn, Outcome.Detriment);
staticText = "Target player can't cast creature spells."; staticText = "Target player can't cast creature spells";
} }
public CeaseFireEffect(final CeaseFireEffect effect) { public CeaseFireEffect(final CeaseFireEffect effect) {

View file

@ -54,7 +54,8 @@ public class Confessor extends CardImpl<Confessor> {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Whenever a player discards a card, you may gain 1 life. // Whenever a player discards a card, you may gain 1 life.
this.addAbility(new SimpleTriggeredAbility(Zone.BATTLEFIELD, EventType.DISCARDED_CARD, new GainLifeEffect(1), "Whenever a player discards a card, ", true, true)); this.addAbility(new SimpleTriggeredAbility(
Zone.BATTLEFIELD, EventType.DISCARDED_CARD, new GainLifeEffect(1), "Whenever a player discards a card, you may", false, true));
} }
public Confessor(final Confessor card) { public Confessor(final Confessor card) {

View file

@ -36,6 +36,7 @@ import mage.abilities.condition.common.CardsInControllerGraveCondition;
import mage.abilities.costs.Cost; import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.decorator.ConditionalContinousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect; import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
@ -46,11 +47,14 @@ import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.other.OwnerPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent; import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
@ -61,6 +65,12 @@ import mage.target.targetpointer.FixedTarget;
*/ */
public class DecayingSoil extends CardImpl<DecayingSoil> { public class DecayingSoil extends CardImpl<DecayingSoil> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature");
static{
filter.add(new OwnerPredicate(TargetController.YOU));
filter.add(Predicates.not(new TokenPredicate()));
}
public DecayingSoil(UUID ownerId) { public DecayingSoil(UUID ownerId) {
super(ownerId, 127, "Decaying Soil", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}"); super(ownerId, 127, "Decaying Soil", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}");
this.expansionSetCode = "ODY"; this.expansionSetCode = "ODY";
@ -76,9 +86,9 @@ public class DecayingSoil extends CardImpl<DecayingSoil> {
// Threshold - As long as seven or more cards are in your graveyard, Decaying Soil has "Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand." // Threshold - As long as seven or more cards are in your graveyard, Decaying Soil has "Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand."
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new ConditionalContinousEffect(new GainAbilitySourceEffect(new DecayingSoilTriggeredAbility()), new ConditionalContinousEffect(new GainAbilitySourceEffect(new DecayingSoilTriggeredAbility(new DecayingSoilEffect(), filter)),
new CardsInControllerGraveCondition(7), new CardsInControllerGraveCondition(7),
"<br/><br/><i>Threshold</i> - As long as seven or more cards are in your graveyard, {this} has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand."))); "<i>Threshold</i> - As long as seven or more cards are in your graveyard, {this} has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand")));
} }
public DecayingSoil(final DecayingSoil card) { public DecayingSoil(final DecayingSoil card) {
@ -93,13 +103,16 @@ public class DecayingSoil extends CardImpl<DecayingSoil> {
class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl<DecayingSoilTriggeredAbility> { class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl<DecayingSoilTriggeredAbility> {
DecayingSoilTriggeredAbility() { protected FilterCreaturePermanent filter;
super(Zone.BATTLEFIELD, new DecayingSoilEffect(), true);
public DecayingSoilTriggeredAbility(Effect effect, FilterCreaturePermanent filter) {
super(Zone.BATTLEFIELD, effect, false);
this.filter = filter;
} }
DecayingSoilTriggeredAbility(DecayingSoilTriggeredAbility ability) { public DecayingSoilTriggeredAbility(DecayingSoilTriggeredAbility ability) {
super(ability); super(ability);
this.filter = ability.filter;
} }
@Override @Override
@ -107,58 +120,50 @@ class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl<DecayingSoilTrig
return new DecayingSoilTriggeredAbility(this); return new DecayingSoilTriggeredAbility(this);
} }
@Override
public boolean checkInterveningIfClause(Game game) {
return true;
}
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
// make sure card is on battlefield
UUID sourceId = getSourceId();
if (game.getPermanent(sourceId) == null) {
// or it is being removed
if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) {
return false;
}
}
ZoneChangeEvent zEvent = (ZoneChangeEvent) event; ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
Permanent permanent = zEvent.getTarget(); if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && if (permanent != null && filter.match(permanent, this.getSourceId(), this.getControllerId(), game)) {
permanent.getControllerId().equals(this.controllerId) && getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
zEvent.getToZone() == Zone.GRAVEYARD && return true;
zEvent.getFromZone() == Zone.BATTLEFIELD && }
!(permanent instanceof PermanentToken) &&
permanent.getCardType().contains(CardType.CREATURE)) {
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
return true;
} }
} }
return false; return false;
} }
@Override
public boolean checkInterveningIfClause(Game game) {
Player controller = game.getPlayer(this.getControllerId());
if(controller != null && controller.getGraveyard().contains(this.getSourceId())) {
return true;
}
return false;
}
@Override @Override
public String getRule() { public String getRule() {
return "<br/><br/><i>Threshold</i> - As long as seven or more cards are in your graveyard, {this} has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand."; return new StringBuilder("Whenever a ").append(filter.getMessage()).append(" is put into your graveyard from the battlefield, ").append(super.getRule()).toString();
} }
} }
class DecayingSoilEffect extends OneShotEffect<DecayingSoilEffect> { class DecayingSoilEffect extends OneShotEffect<DecayingSoilEffect> {
private final Cost cost = new GenericManaCost(2); private final Cost cost = new GenericManaCost(1);
public DecayingSoilEffect() { public DecayingSoilEffect() {
super(Outcome.Benefit); super(Outcome.Benefit);
staticText = "you may pay {1}. If you do, return that card to your hand";
} }
public DecayingSoilEffect(DecayingSoilEffect effect) { public DecayingSoilEffect(final DecayingSoilEffect effect) {
super(effect); super(effect);
} }
@ -169,7 +174,7 @@ class DecayingSoilEffect extends OneShotEffect<DecayingSoilEffect> {
if (player.chooseUse(Outcome.Benefit, " - Pay " + cost.getText() + "?", game)) { if (player.chooseUse(Outcome.Benefit, " - Pay " + cost.getText() + "?", game)) {
cost.clearPaid(); cost.clearPaid();
if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) {
UUID target = targetPointer.getFirst(game, source); UUID target = this.getTargetPointer().getFirst(game, source);
if (target != null) { if (target != null) {
Card card = game.getCard(target); Card card = game.getCard(target);
// check if it's still in graveyard // check if it's still in graveyard
@ -181,7 +186,6 @@ class DecayingSoilEffect extends OneShotEffect<DecayingSoilEffect> {
} }
} }
} }
return false; return false;
} }

View file

@ -33,7 +33,8 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.CardsInControllerGraveCondition; import mage.abilities.condition.common.CardsInControllerGraveCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.continious.BoostControlledEffect; import mage.abilities.effects.common.AddContinuousEffectToGame;
import mage.abilities.effects.common.continious.BoostAllEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
@ -41,7 +42,6 @@ import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ColorPredicate;
import mage.abilities.effects.common.AddContinuousEffectToGame;
/** /**
* *
@ -49,8 +49,7 @@ import mage.abilities.effects.common.AddContinuousEffectToGame;
*/ */
public class DivineSacrament extends CardImpl<DivineSacrament> { public class DivineSacrament extends CardImpl<DivineSacrament> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("White creatures");
static { static {
filter.add(new ColorPredicate(ObjectColor.WHITE)); filter.add(new ColorPredicate(ObjectColor.WHITE));
} }
@ -62,13 +61,13 @@ public class DivineSacrament extends CardImpl<DivineSacrament> {
this.color.setWhite(true); this.color.setWhite(true);
// White creatures get +1/+1. // White creatures get +1/+1.
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, false)); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false));
this.addAbility(ability);
// Threshold - White creatures get an additional +1/+1 as long as seven or more cards are in your graveyard. // Threshold - White creatures get an additional +1/+1 as long as seven or more cards are in your graveyard.
ability.addEffect( ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalOneShotEffect(
new ConditionalOneShotEffect( new AddContinuousEffectToGame(new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)),
new AddContinuousEffectToGame(new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, false)),
new CardsInControllerGraveCondition(7), new CardsInControllerGraveCondition(7),
"<br/><br/><i>Threshold</i> - If seven or more cards are in your graveyard, white creatures get an additional +1/+1." "<i>Threshold</i> - If seven or more cards are in your graveyard, white creatures get an additional +1/+1."
)); ));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -59,8 +59,10 @@ public class DwarvenStrikeForce extends CardImpl<DwarvenStrikeForce> {
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// Discard a card at random: Dwarven Strike Force gains first strike and haste until end of turn. // Discard a card at random: Dwarven Strike Force gains first strike and haste until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new DiscardCardCost(true)); Effect effect = new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn);
Effect effect = new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(),Duration.EndOfTurn); effect.setText("{this} gains first strike");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new DiscardCardCost(true));
effect = new GainAbilitySourceEffect(HasteAbility.getInstance(),Duration.EndOfTurn);
effect.setText("and haste until end of turn"); effect.setText("and haste until end of turn");
ability.addEffect(effect); ability.addEffect(effect);
this.addAbility(ability); this.addAbility(ability);

View file

@ -80,7 +80,7 @@ class EngulfingFlamesEffect extends ReplacementEffectImpl<EngulfingFlamesEffect>
public EngulfingFlamesEffect() { public EngulfingFlamesEffect() {
super(Duration.EndOfTurn, Outcome.Detriment); super(Duration.EndOfTurn, Outcome.Detriment);
staticText = "A creature dealt damage this way can't be regenerated this turn"; staticText = "It can't be regenerated this turn";
} }
public EngulfingFlamesEffect(final EngulfingFlamesEffect effect) { public EngulfingFlamesEffect(final EngulfingFlamesEffect effect) {

View file

@ -72,8 +72,7 @@ public class FilthyCur extends CardImpl<FilthyCur> {
class DealtDamageLoseLifeTriggeredAbility extends TriggeredAbilityImpl<DealtDamageLoseLifeTriggeredAbility> { class DealtDamageLoseLifeTriggeredAbility extends TriggeredAbilityImpl<DealtDamageLoseLifeTriggeredAbility> {
public DealtDamageLoseLifeTriggeredAbility(Zone zone, Effect effect, boolean optional) {
public DealtDamageLoseLifeTriggeredAbility(Zone zone, Effect effect, boolean optional) {
super(zone, effect, optional); super(zone, effect, optional);
} }
@ -92,7 +91,6 @@ class DealtDamageLoseLifeTriggeredAbility extends TriggeredAbilityImpl<DealtDama
if (event.getTargetId().equals(this.sourceId)) { if (event.getTargetId().equals(this.sourceId)) {
this.getEffects().clear(); this.getEffects().clear();
this.addEffect(new LoseLifeControllerEffect(event.getAmount())); this.addEffect(new LoseLifeControllerEffect(event.getAmount()));
this.getControllerId();
return true; return true;
} }
} }
@ -101,6 +99,6 @@ class DealtDamageLoseLifeTriggeredAbility extends TriggeredAbilityImpl<DealtDama
@Override @Override
public String getRule() { public String getRule() {
return "Whenever {this} is dealt damage, you lose that much life"; return "Whenever {this} is dealt damage, you lose that much life.";
} }
} }

View file

@ -30,13 +30,11 @@ package mage.sets.odyssey;
import java.util.UUID; import java.util.UUID;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ColorPredicate;
@ -52,12 +50,10 @@ import mage.target.targetpointer.FirstTargetPointer;
*/ */
public class GhastlyDemise extends CardImpl<GhastlyDemise> { public class GhastlyDemise extends CardImpl<GhastlyDemise> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature if its tougness is less than the number of cards in your graveyard"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature if its tougness is less than the number of cards in your graveyard");
static {
static{
filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
} }
public GhastlyDemise(UUID ownerId) { public GhastlyDemise(UUID ownerId) {
super(ownerId, 139, "Ghastly Demise", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); super(ownerId, 139, "Ghastly Demise", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}");
@ -65,6 +61,7 @@ public class GhastlyDemise extends CardImpl<GhastlyDemise> {
this.color.setBlack(true); this.color.setBlack(true);
// Destroy target nonblack creature if its toughness is less than or equal to the number of cards in your graveyard.
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new GhastlyDemiseEffect(false)); this.getSpellAbility().addEffect(new GhastlyDemiseEffect(false));
} }
@ -81,16 +78,11 @@ public class GhastlyDemise extends CardImpl<GhastlyDemise> {
class GhastlyDemiseEffect extends OneShotEffect<GhastlyDemiseEffect> { class GhastlyDemiseEffect extends OneShotEffect<GhastlyDemiseEffect> {
protected boolean noRegen; protected boolean noRegen;
public GhastlyDemiseEffect(String ruleText) {
this(false);
ruleText = "Destroy target nonblack creature if its toughness is less than or equal to the number of cards in your graveyard.";
staticText = ruleText;
}
public GhastlyDemiseEffect(boolean noRegen) { public GhastlyDemiseEffect(boolean noRegen) {
super(Outcome.DestroyPermanent); super(Outcome.DestroyPermanent);
staticText = "Destroy target nonblack creature if its toughness is less than or equal to the number of cards in your graveyard";
this.noRegen = noRegen; this.noRegen = noRegen;
} }
@ -111,30 +103,21 @@ protected boolean noRegen;
for (Target target : source.getTargets()) { for (Target target : source.getTargets()) {
for (UUID permanentId : target.getTargets()) { for (UUID permanentId : target.getTargets()) {
Permanent permanent = game.getPermanent(permanentId); Permanent permanent = game.getPermanent(permanentId);
if (permanent != null && permanent.getToughness().getValue() <= game.getPlayer(source.getControllerId()).getGraveyard().count(new FilterCard(), game)) { if (permanent != null && permanent.getToughness().getValue() <= game.getPlayer(source.getControllerId()).getGraveyard().size()) {
permanent.destroy(source.getId(), game, noRegen); permanent.destroy(source.getSourceId(), game, noRegen);
affectedTargets++; affectedTargets++;
} }
} }
} }
} } else if (targetPointer.getTargets(game, source).size() > 0) {
else if (targetPointer.getTargets(game, source).size() > 0) {
for (UUID permanentId : targetPointer.getTargets(game, source)) { for (UUID permanentId : targetPointer.getTargets(game, source)) {
Permanent permanent = game.getPermanent(permanentId); Permanent permanent = game.getPermanent(permanentId);
if (permanent != null && permanent.getToughness().getValue() <= game.getPlayer(source.getControllerId()).getGraveyard().count(new FilterCard(), game)) { if (permanent != null && permanent.getToughness().getValue() <= game.getPlayer(source.getControllerId()).getGraveyard().size()) {
permanent.destroy(source.getId(), game, noRegen); permanent.destroy(source.getSourceId(), game, noRegen);
affectedTargets++; affectedTargets++;
} }
} }
} }
return affectedTargets > 0; return affectedTargets > 0;
} }
@Override
public String getText(Mode mode) {
return staticText;
}
} }

View file

@ -61,7 +61,7 @@ public class InfectedVermin extends CardImpl<InfectedVermin> {
new DamageEverythingEffect(3), new DamageEverythingEffect(3),
new ManaCostsImpl("{3}{B}"), new ManaCostsImpl("{3}{B}"),
new CardsInControllerGraveCondition(7), new CardsInControllerGraveCondition(7),
"<br/><br/><i>Threshold</i> - {3}{B}: Infected Vermin deals 3 damage to each creature and each player. Activate this ability only if seven or more cards are in your graveyard.")); "<i>Threshold</i> - {3}{B}: Infected Vermin deals 3 damage to each creature and each player. Activate this ability only if seven or more cards are in your graveyard."));
} }
public InfectedVermin(final InfectedVermin card) { public InfectedVermin(final InfectedVermin card) {

View file

@ -72,7 +72,7 @@ public class KamahlsDesire extends CardImpl<KamahlsDesire> {
// Threshold - Enchanted creature gets +3/+0 as long as seven or more cards are in your graveyard. // Threshold - Enchanted creature gets +3/+0 as long as seven or more cards are in your graveyard.
ability.addEffect(new ConditionalContinousEffect(new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield), ability.addEffect(new ConditionalContinousEffect(new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield),
new CardsInControllerGraveCondition(7), new CardsInControllerGraveCondition(7),
"<br/><br/><i>Threshold</i> - Enchanted creature gets +3/+0 as long as seven or more cards are in your graveyard.")); "<i>Threshold</i> - Enchanted creature gets +3/+0 as long as seven or more cards are in your graveyard"));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -38,8 +38,8 @@ import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent; import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AbilityPredicate; import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.CardTypePredicate;
@ -51,8 +51,8 @@ import mage.target.common.TargetControlledPermanent;
*/ */
public class MagmaVein extends CardImpl<MagmaVein> { public class MagmaVein extends CardImpl<MagmaVein> {
private static final FilterPermanent filter1 = new FilterPermanent("creature without flying"); private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("creature without flying");
private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("land"); private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("a land");
static { static {
filter1.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); filter1.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));

View file

@ -48,15 +48,13 @@ import mage.target.TargetSpell;
*/ */
public class MoltenInfluence extends CardImpl<MoltenInfluence> { public class MoltenInfluence extends CardImpl<MoltenInfluence> {
private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); private static final FilterSpell filter = new FilterSpell("instant or sorcery spell");
static { static {
Predicates.or( Predicates.or(
new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)); new CardTypePredicate(CardType.SORCERY));
} }
public MoltenInfluence(UUID ownerId) { public MoltenInfluence(UUID ownerId) {
super(ownerId, 207, "Molten Influence", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{R}"); super(ownerId, 207, "Molten Influence", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{R}");
this.expansionSetCode = "ODY"; this.expansionSetCode = "ODY";
@ -79,15 +77,14 @@ public class MoltenInfluence extends CardImpl<MoltenInfluence> {
} }
} }
class MoltenInfluenceEffect extends OneShotEffect<MoltenInfluenceEffect> { class MoltenInfluenceEffect extends OneShotEffect<MoltenInfluenceEffect> {
public MoltenInfluenceEffect() { public MoltenInfluenceEffect() {
super(Outcome.Detriment); super(Outcome.Detriment);
this.staticText = "Counter target instant or sorcery spell unless its controller has Molten Influence deal 4 damage to him or her."; this.staticText = "Counter target instant or sorcery spell unless its controller has Molten Influence deal 4 damage to him or her";
} }
public MoltenInfluenceEffect(final MoltenInfluenceEffect effect){ public MoltenInfluenceEffect(final MoltenInfluenceEffect effect) {
super(effect); super(effect);
} }
@ -96,19 +93,18 @@ class MoltenInfluenceEffect extends OneShotEffect<MoltenInfluenceEffect> {
return new MoltenInfluenceEffect(this); return new MoltenInfluenceEffect(this);
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Spell spell = game.getStack().getSpell(source.getFirstTarget()); Spell spell = game.getStack().getSpell(source.getFirstTarget());
if (spell!=null) { if (spell != null) {
Player player = game.getPlayer(spell.getOwnerId()); Player player = game.getPlayer(spell.getControllerId());
String message = "Have Molten Influence do 4 damage to you?"; String message = "Have Molten Influence do 4 damage to you?";
if (player.chooseUse(Outcome.Damage, message, game)){ if (player.chooseUse(Outcome.Damage, message, game)) {
player.damage(4, source.getSourceId(), game, false, true); player.damage(4, source.getSourceId(), game, false, true);
} else { } else {
spell.counter(source.getId(), game); spell.counter(source.getSourceId(), game);
}
}
return false;
} }
}
return false;
}
} }

View file

@ -70,11 +70,11 @@ public class Mudhole extends CardImpl<Mudhole> {
class MudholeEffect extends OneShotEffect<MudholeEffect> { class MudholeEffect extends OneShotEffect<MudholeEffect> {
private static final FilterCard filter = new FilterLandCard(); private static final FilterCard filter = new FilterLandCard();
public MudholeEffect() { public MudholeEffect() {
super(Outcome.Exile); super(Outcome.Exile);
staticText = "Target player exiles all land cards from his or her graveyard."; staticText = "Target player exiles all land cards from his or her graveyard";
} }
public MudholeEffect(final MudholeEffect effect) { public MudholeEffect(final MudholeEffect effect) {
@ -83,9 +83,9 @@ class MudholeEffect extends OneShotEffect<MudholeEffect> {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
if (targetPlayer != null) { if (targetPlayer != null) {
for (Card card: targetPlayer.getGraveyard().getCards(filter, game)) { for (Card card : targetPlayer.getGraveyard().getCards(filter, game)) {
card.moveToExile(null, "", source.getSourceId(), game); card.moveToExile(null, "", source.getSourceId(), game);
} }
return true; return true;
@ -97,5 +97,4 @@ class MudholeEffect extends OneShotEffect<MudholeEffect> {
public MudholeEffect copy() { public MudholeEffect copy() {
return new MudholeEffect(this); return new MudholeEffect(this);
} }
} }

View file

@ -32,11 +32,14 @@ import mage.MageInt;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility; import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.CardsInControllerGraveCondition; import mage.abilities.condition.common.CardsInControllerGraveCondition;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.decorator.ConditionalActivatedAbility; import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.decorator.ConditionalContinousEffect;
import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
import mage.abilities.effects.common.continious.SetCardColorSourceEffect; import mage.abilities.effects.common.continious.SetCardColorSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
@ -57,10 +60,9 @@ import mage.target.common.TargetCreaturePermanent;
public class RepentantVampire extends CardImpl<RepentantVampire> { public class RepentantVampire extends CardImpl<RepentantVampire> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("black creature"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("black creature");
static {
static { filter.add(new ColorPredicate(ObjectColor.BLACK));
filter.add(new ColorPredicate(ObjectColor.BLACK)); }
}
public RepentantVampire(UUID ownerId) { public RepentantVampire(UUID ownerId) {
super(ownerId, 157, "Repentant Vampire", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); super(ownerId, 157, "Repentant Vampire", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
@ -74,16 +76,21 @@ public class RepentantVampire extends CardImpl<RepentantVampire> {
// Flying // Flying
this.addAbility(FlyingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance());
// Whenever a creature dealt damage by Repentant Vampire this turn dies, put a +1/+1 counter on Repentant Vampire. // Whenever a creature dealt damage by Repentant Vampire this turn dies, put a +1/+1 counter on Repentant Vampire.
this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false)); this.addAbility(new DiesAndDealtDamageThisTurnTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
// Threshold - As long as seven or more cards are in your graveyard, Repentant Vampire is white and has "{tap}: Destroy target black creature." // Threshold - As long as seven or more cards are in your graveyard, Repentant Vampire is white and has "{tap}: Destroy target black creature."
Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
new DestroyTargetEffect(), new SetCardColorSourceEffect(ObjectColor.WHITE, Duration.WhileOnBattlefield),
new TapSourceCost(), new CardsInControllerGraveCondition(7),
new CardsInControllerGraveCondition(7), "<i>Threshold</i> - As long as seven or more cards are in your graveyard, {this} is white",
"<br/><br/><i>Threshold</i> - As long as seven or more cards are in your graveyard, Repentant Vampire is white and has \"{t}: Destroy target black creature."); false));
ability.addTarget(new TargetCreaturePermanent(filter)); Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost());
ability.addEffect(new ConditionalContinousEffect(new SetCardColorSourceEffect(ObjectColor.WHITE, Duration.EndOfGame), new CardsInControllerGraveCondition(7), "")); gainedAbility.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability); ability.addEffect(new ConditionalContinousEffect(
new GainAbilitySourceEffect(gainedAbility, Duration.WhileOnBattlefield),
new CardsInControllerGraveCondition(7),
"and has \"{t}: Destroy target black creature.\"",
false));
this.addAbility(ability);
} }
public RepentantVampire(final RepentantVampire card) { public RepentantVampire(final RepentantVampire card) {

View file

@ -37,8 +37,10 @@ import mage.cards.CardImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetControlledPermanent;
/** /**
* *
@ -57,7 +59,9 @@ public class SadisticHypnotist extends CardImpl<SadisticHypnotist> {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Sacrifice a creature: Target player discards two cards. Activate this ability only any time you could cast a sorcery. // Sacrifice a creature: Target player discards two cards. Activate this ability only any time you could cast a sorcery.
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(2), new SacrificeTargetCost(new TargetControlledCreaturePermanent(true))); TargetControlledPermanent target = new TargetControlledCreaturePermanent(1,1, new FilterControlledCreaturePermanent("a creature"), true);
target.setRequired(true);
Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(2), new SacrificeTargetCost(target));
ability.addTarget(new TargetPlayer(true)); ability.addTarget(new TargetPlayer(true));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -28,14 +28,13 @@
package mage.sets.odyssey; package mage.sets.odyssey;
import java.util.UUID; import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -69,10 +68,8 @@ public class Standstill extends CardImpl<Standstill> {
} }
} }
class SpellCastTriggeredAbility extends TriggeredAbilityImpl<SpellCastTriggeredAbility> { class SpellCastTriggeredAbility extends TriggeredAbilityImpl<SpellCastTriggeredAbility> {
public SpellCastTriggeredAbility() { public SpellCastTriggeredAbility() {
super(Zone.BATTLEFIELD, new StandstillEffect(), false); super(Zone.BATTLEFIELD, new StandstillEffect(), false);
} }
@ -92,7 +89,7 @@ class SpellCastTriggeredAbility extends TriggeredAbilityImpl<SpellCastTriggeredA
@Override @Override
public String getRule() { public String getRule() {
return "When a player casts a spell, sacrifice Standstill. If you do, each of that player's opponents draws three cards"; return "When a player casts a spell, sacrifice Standstill. If you do, each of that player's opponents draws three cards.";
} }
@Override @Override
@ -101,12 +98,11 @@ class SpellCastTriggeredAbility extends TriggeredAbilityImpl<SpellCastTriggeredA
} }
} }
class StandstillEffect extends OneShotEffect<StandstillEffect> { class StandstillEffect extends OneShotEffect<StandstillEffect> {
public StandstillEffect() { public StandstillEffect() {
super(Outcome.Sacrifice); super(Outcome.Sacrifice);
staticText = "sacrifice {this}"; staticText = "sacrifice {this}. If you do, each of that player's opponents draws three cards";
} }
public StandstillEffect(final StandstillEffect effect) { public StandstillEffect(final StandstillEffect effect) {
@ -122,18 +118,16 @@ class StandstillEffect extends OneShotEffect<StandstillEffect> {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId()); Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) { if (permanent != null) {
if(permanent.sacrifice(source.getSourceId(), game)){ if (permanent.sacrifice(source.getSourceId(), game)) {
for(UUID uuid : game.getOpponents(this.getTargetPointer().getFirst(game, source))){ for (UUID uuid : game.getOpponents(this.getTargetPointer().getFirst(game, source))) {
Player player = game.getPlayer(uuid); Player player = game.getPlayer(uuid);
if(player != null){ if (player != null) {
player.drawCards(3, game); player.drawCards(3, game);
} }
} }
return true; return true;
} }
return false;
} }
return false; return false;
} }
} }

View file

@ -71,7 +71,7 @@ class TaintedPactEffect extends OneShotEffect<TaintedPactEffect>{
public TaintedPactEffect() { public TaintedPactEffect() {
super(Outcome.DrawCard); super(Outcome.DrawCard);
this.staticText = "Exile the top card of your library. You may put that card into your hand unless it has the same name as another card exiled this way. Repeat this process until you put a card into your hand or you exile two cards with the same name, whichever comes first."; this.staticText = "Exile the top card of your library. You may put that card into your hand unless it has the same name as another card exiled this way. Repeat this process until you put a card into your hand or you exile two cards with the same name, whichever comes first";
} }
public TaintedPactEffect(final TaintedPactEffect effect) { public TaintedPactEffect(final TaintedPactEffect effect) {

View file

@ -72,15 +72,15 @@ public class Tombfire extends CardImpl<Tombfire> {
class TombfireEffect extends OneShotEffect<TombfireEffect> { class TombfireEffect extends OneShotEffect<TombfireEffect> {
private static final FilterCard filter = new FilterCard("flashback"); private static final FilterCard filter = new FilterCard("cards with flashback");
static{ static {
filter.add(new AbilityPredicate(FlashbackAbility.class)); filter.add(new AbilityPredicate(FlashbackAbility.class));
} }
public TombfireEffect() { public TombfireEffect() {
super(Outcome.Exile); super(Outcome.Exile);
staticText = "Target player exiles all cards with flashback from his or her graveyard."; staticText = "Target player exiles all cards with flashback from his or her graveyard";
} }
public TombfireEffect(final TombfireEffect effect) { public TombfireEffect(final TombfireEffect effect) {
@ -91,19 +91,17 @@ private static final FilterCard filter = new FilterCard("flashback");
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
if (targetPlayer != null) { if (targetPlayer != null) {
for (Card card: targetPlayer.getGraveyard().getCards(filter, game)) { for (Card card : targetPlayer.getGraveyard().getCards(filter, game)) {
card.moveToExile(null, "", source.getSourceId(), game); card.moveToExile(null, "", source.getSourceId(), game);
} }
return true; return true;
} else {
return false;
} }
return false;
} }
@Override @Override
public TombfireEffect copy() { public TombfireEffect copy() {
return new TombfireEffect(this); return new TombfireEffect(this);
} }
} }

View file

@ -27,25 +27,29 @@
*/ */
package mage.sets.odyssey; package mage.sets.odyssey;
import mage.constants.*; import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.DiscardTargetCost; import mage.abilities.costs.common.DiscardTargetCost;
import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.abilities.effects.common.continious.SetCardColorTargetEffect; import mage.abilities.effects.common.continious.SetCardColorTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.choices.ChoiceColor; import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
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.TargetCardInHand; import mage.target.common.TargetCardInHand;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/** /**
* @author magenoxx_at_gmail.com * @author magenoxx_at_gmail.com
*/ */
@ -61,7 +65,9 @@ public class WildMongrel extends CardImpl<WildMongrel> {
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Discard a card: Wild Mongrel gets +1/+1 and becomes the color of your choice until end of turn. // Discard a card: Wild Mongrel gets +1/+1 and becomes the color of your choice until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new DiscardTargetCost(new TargetCardInHand())); Effect effect = new BoostSourceEffect(1, 1, Duration.EndOfTurn);
effect.setText("{this} gets +1/+1");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new DiscardTargetCost(new TargetCardInHand()));
ability.addEffect(new ChangeColorEffect()); ability.addEffect(new ChangeColorEffect());
this.addAbility(ability); this.addAbility(ability);
} }
@ -80,7 +86,7 @@ class ChangeColorEffect extends OneShotEffect<ChangeColorEffect> {
public ChangeColorEffect() { public ChangeColorEffect() {
super(Outcome.Neutral); super(Outcome.Neutral);
staticText = "becomes the color of your choice until end of turn"; staticText = "and becomes the color of your choice until end of turn";
} }
public ChangeColorEffect(final ChangeColorEffect effect) { public ChangeColorEffect(final ChangeColorEffect effect) {

View file

@ -55,7 +55,6 @@ import mage.target.common.TargetCreaturePermanent;
public class ZombieAssassin extends CardImpl<ZombieAssassin> { public class ZombieAssassin extends CardImpl<ZombieAssassin> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature");
static { static {
filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
} }
@ -76,7 +75,8 @@ public class ZombieAssassin extends CardImpl<ZombieAssassin> {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(true), new TapSourceCost()); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(true), new TapSourceCost());
Target target = new TargetCreaturePermanent(filter); Target target = new TargetCreaturePermanent(filter);
target.setRequired(true); target.setRequired(true);
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(2,2,new FilterCard("two cards from your graveyard")))); ability.addTarget(target);
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(2,2,new FilterCard("cards from your graveyard"))));
ability.addCost(new ExileSourceCost()); ability.addCost(new ExileSourceCost());
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -38,6 +38,7 @@ import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
/** /**
@ -72,7 +73,7 @@ public class EssenceSliver extends CardImpl<EssenceSliver> {
class DealsDamageTriggeredAbility extends TriggeredAbilityImpl<DealsDamageTriggeredAbility> { class DealsDamageTriggeredAbility extends TriggeredAbilityImpl<DealsDamageTriggeredAbility> {
private boolean setTargetPointer; private boolean setTargetPointer;
public DealsDamageTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) { public DealsDamageTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) {
super(Zone.BATTLEFIELD, effect, optional); super(Zone.BATTLEFIELD, effect, optional);
@ -80,37 +81,37 @@ class DealsDamageTriggeredAbility extends TriggeredAbilityImpl<DealsDamageTrigge
} }
public DealsDamageTriggeredAbility(final DealsDamageTriggeredAbility ability) { public DealsDamageTriggeredAbility(final DealsDamageTriggeredAbility ability) {
super(ability); super(ability);
this.setTargetPointer = ability.setTargetPointer; this.setTargetPointer = ability.setTargetPointer;
} }
@Override @Override
public DealsDamageTriggeredAbility copy() { public DealsDamageTriggeredAbility copy() {
return new DealsDamageTriggeredAbility(this); return new DealsDamageTriggeredAbility(this);
} }
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE || if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE
event.getType() == GameEvent.EventType.DAMAGED_PLAYER || || event.getType() == GameEvent.EventType.DAMAGED_PLAYER
event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER) { || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER) {
if (game.getPermanent(event.getSourceId()).hasSubtype("Sliver")) { Permanent creature = game.getPermanent(event.getSourceId());
if (setTargetPointer) { if (creature != null && creature.hasSubtype("Sliver")) {
for (Effect effect : this.getEffects()) { if (setTargetPointer) {
effect.setTargetPointer(new FixedTarget(game.getControllerId(event.getSourceId()))); for (Effect effect : this.getEffects()) {
effect.setValue("damage", event.getAmount()); effect.setTargetPointer(new FixedTarget(game.getControllerId(event.getSourceId())));
} effect.setValue("damage", event.getAmount());
}
return true;
} }
}
return true;
} }
return false;
}
return false;
} }
@Override @Override
public String getRule() { public String getRule() {
return "Whenever a Sliver deals damage, its controller" + super.getRule(); return "Whenever a Sliver deals damage, its controller" + super.getRule();
} }
} }

View file

@ -47,7 +47,7 @@ public class FilterCreatureOrPlayer extends FilterImpl<Object> implements Filter
protected FilterPlayer playerFilter; protected FilterPlayer playerFilter;
public FilterCreatureOrPlayer() { public FilterCreatureOrPlayer() {
this("player or creature"); this("creature or player");
} }
public FilterCreatureOrPlayer(String name) { public FilterCreatureOrPlayer(String name) {