Improved target messages fot multi-mode cards

This commit is contained in:
Oleg Agafonov 2019-01-21 13:56:49 +04:00
parent ff5839860e
commit 6f4d04121d
11 changed files with 61 additions and 73 deletions

View file

@ -1,6 +1,5 @@
package mage.cards.a;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
@ -11,8 +10,9 @@ import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class ArtfulTakedown extends CardImpl {
@ -33,14 +33,14 @@ public final class ArtfulTakedown extends CardImpl {
this.getSpellAbility().addEffect(
new TapTargetEffect().setText("target creature")
);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter1));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter1).withChooseHint("tap"));
// Target creature gets -2/-4 until end of turn.
Mode mode = new Mode(
new BoostTargetEffect(-2, -4, Duration.EndOfTurn)
.setText("target creature gets -2/-4 until end of turn")
);
mode.addTarget(new TargetCreaturePermanent(filter2));
mode.addTarget(new TargetCreaturePermanent(filter2).withChooseHint("gets -2/-4 until end of turn"));
this.getSpellAbility().addMode(mode);
}

View file

@ -1,7 +1,5 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
@ -20,8 +18,9 @@ import mage.filter.predicate.other.PlayerPredicate;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author emerald000
*/
public final class BlessedAlliance extends CardImpl {
@ -35,7 +34,7 @@ public final class BlessedAlliance extends CardImpl {
}
public BlessedAlliance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}");
// Escalate {2}
this.addAbility(new EscalateAbility(new GenericManaCost(2)));
@ -48,20 +47,20 @@ public final class BlessedAlliance extends CardImpl {
Effect effect = new GainLifeTargetEffect(4);
effect.setText("Target player gains 4 life");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetPlayer(1, 1, false, filterGainLife));
this.getSpellAbility().addTarget(new TargetPlayer(1, 1, false, filterGainLife).withChooseHint("player gains 4 life"));
// Untap up to two target creatures.
Mode mode = new Mode();
effect = new UntapTargetEffect();
effect.setText("Untap up to two target creatures");
mode.addEffect(effect);
mode.addTarget(new TargetCreaturePermanent(0, 2, filterCreature, false));
mode.addTarget(new TargetCreaturePermanent(0, 2, filterCreature, false).withChooseHint("untap"));
this.getSpellAbility().addMode(mode);
// Target opponent sacrifices an attacking creature.
mode = new Mode();
mode.addEffect(new SacrificeEffect(new FilterAttackingCreature(), 1, "Target opponent"));
mode.addTarget(new TargetPlayer(1, 1, false, filterSacrifice));
mode.addTarget(new TargetPlayer(1, 1, false, filterSacrifice).withChooseHint("sacrifices an attacking creature"));
this.getSpellAbility().addMode(mode);
}

View file

@ -1,7 +1,5 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
@ -16,8 +14,9 @@ import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class BorrowedHostility extends CardImpl {
@ -26,7 +25,7 @@ public final class BorrowedHostility extends CardImpl {
private static final FilterCreaturePermanent filterFirstStrike = new FilterCreaturePermanent("creature to gain first strike");
public BorrowedHostility(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");
// Escalate {3}
this.addAbility(new EscalateAbility(new ManaCostsImpl<>("{3}")));
@ -38,15 +37,15 @@ public final class BorrowedHostility extends CardImpl {
// Target creature gets +3/+0 until end of turn.;
Effect effect = new BoostTargetEffect(3, 0, Duration.EndOfTurn);
effect.setText("Target creature gets +3/+0 until end of turn");
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterBoost));
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterBoost).withChooseHint("gets +3/+0 until end of turn"));
// Target creature gains first strike until end of turn.
Mode mode = new Mode();
effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn);
effect.setText("Target creature gains first strike until end of turn");
mode.addEffect(effect);
mode.addTarget(new TargetCreaturePermanent(filterFirstStrike));
mode.addTarget(new TargetCreaturePermanent(filterFirstStrike).withChooseHint("gains first strike until end of turn"));
this.getSpellAbility().addMode(mode);
}

View file

@ -1,7 +1,5 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
@ -14,8 +12,9 @@ import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class BorrowedMalevolence extends CardImpl {
@ -24,7 +23,7 @@ public final class BorrowedMalevolence extends CardImpl {
private static final FilterCreaturePermanent filterCreatureMinus = new FilterCreaturePermanent("creature to get -1/-1");
public BorrowedMalevolence(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{B}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}");
// Escalate {2}
this.addAbility(new EscalateAbility(new GenericManaCost(2)));
@ -37,14 +36,14 @@ public final class BorrowedMalevolence extends CardImpl {
Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);
effect.setText("Target creature gets +1/+1 until end of turn");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterCreaturePlus));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterCreaturePlus).withChooseHint("gets +1/+1 until end of turn"));
// Target creature gets -1/-1 until end of turn.
Mode mode = new Mode();
effect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn);
effect.setText("Target creature gets -1/-1 until end of turn");
mode.addEffect(effect);
mode.addTarget(new TargetCreaturePermanent(filterCreatureMinus));
mode.addTarget(new TargetCreaturePermanent(filterCreatureMinus).withChooseHint("gets -1/-1 until end of turn"));
this.getSpellAbility().addMode(mode);
}

View file

@ -1,7 +1,5 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
@ -18,8 +16,9 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author North
*/
public final class BranchingBolt extends CardImpl {
@ -33,19 +32,18 @@ public final class BranchingBolt extends CardImpl {
}
public BranchingBolt(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{R}{G}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}{G}");
// Choose one or both -
this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(2);
// Branching Bolt deals 3 damage to target creature with flying;
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterFlying));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterFlying).withChooseHint("deals 3 damage, without flying"));
// or Branching Bolt deals 3 damage to target creature without flying.
Mode mode = new Mode();
mode.addEffect(new DamageTargetEffect(3));
mode.addTarget(new TargetCreaturePermanent(filterNotFlying));
mode.addTarget(new TargetCreaturePermanent(filterNotFlying).withChooseHint("deals 3 damage, without flying"));
this.getSpellAbility().addMode(mode);
}

View file

@ -1,7 +1,5 @@
package mage.cards.b;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
@ -18,13 +16,15 @@ import mage.target.common.TargetCreatureOrPlaneswalker;
import mage.target.common.TargetSpellOrPermanent;
import mage.watchers.common.DamagedByWatcher;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class BrutalExpulsion extends CardImpl {
private static final FilterSpellOrPermanent filter = new FilterSpellOrPermanent("spell or creature");
static {
filter.setPermanentFilter(new FilterCreaturePermanent());
}
@ -39,15 +39,15 @@ public final class BrutalExpulsion extends CardImpl {
this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(2);
// - Return target spell or creature to its owner's hand;
this.getSpellAbility().addTarget(new TargetSpellOrPermanent(1, 1, filter, false));
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
this.getSpellAbility().addTarget(new TargetSpellOrPermanent(1, 1, filter, false).withChooseHint("return to its owner's hand"));
// or Brutal Expulsion deals 2 damage to target creature or planeswalker. If that permanent would be put into a graveyard this turn, exile it instead.
Mode mode = new Mode();
mode.addTarget(new TargetCreatureOrPlaneswalker());
mode.addEffect(new DamageTargetEffect(2));
Effect effect = new DealtDamageToCreatureBySourceDies(this, Duration.EndOfTurn);
effect.setText("If that permanent would be put into a graveyard this turn, exile it instead");
mode.addEffect(effect);
mode.addTarget(new TargetCreatureOrPlaneswalker().withChooseHint("deals 2 damage and exile instead"));
this.getSpellAbility().addMode(mode);
this.getSpellAbility().addWatcher(new DamagedByWatcher(true));
}

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.DamageTargetEffect;
@ -15,18 +13,19 @@ import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetPlayerOrPlaneswalker;
import java.util.UUID;
/**
*
* @author jeffwadsworth
*/
public final class ClanDefiance extends CardImpl {
static final private FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying");
static final private FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature without flying");
static final private FilterCreaturePermanent filterFlying = new FilterCreaturePermanent("creature with flying");
static final private FilterCreaturePermanent filterWithoutFlying = new FilterCreaturePermanent("creature without flying");
static {
filter.add(new AbilityPredicate(FlyingAbility.class));
filter2.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
filterFlying.add(new AbilityPredicate(FlyingAbility.class));
filterWithoutFlying.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
}
public ClanDefiance(UUID ownerId, CardSetInfo setInfo) {
@ -37,16 +36,16 @@ public final class ClanDefiance extends CardImpl {
this.getSpellAbility().getModes().setMaxModes(3);
// Clan Defiance deals X damage to target creature with flying;
this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.instance));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterFlying).withChooseHint("deals X damage, with flying"));
// Clan Defiance deals X damage to target creature without flying;
Mode mode1 = new Mode();
mode1.addEffect(new DamageTargetEffect(ManacostVariableValue.instance));
mode1.addTarget(new TargetCreaturePermanent(filter2));
mode1.addTarget(new TargetCreaturePermanent(filterWithoutFlying).withChooseHint("deals X damage, without flying"));
this.getSpellAbility().addMode(mode1);
// and/or Clan Defiance deals X damage to target player.
Mode mode2 = new Mode();
mode2.addEffect(new DamageTargetEffect(ManacostVariableValue.instance));
mode2.addTarget(new TargetPlayerOrPlaneswalker());
mode2.addTarget(new TargetPlayerOrPlaneswalker().withChooseHint("deals X damage"));
this.getSpellAbility().addMode(mode2);
}

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.DiscardCardCost;
@ -25,8 +23,9 @@ import mage.filter.predicate.other.PlayerPredicate;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class CollectiveBrutality extends CardImpl {
@ -44,7 +43,7 @@ public final class CollectiveBrutality extends CardImpl {
}
public CollectiveBrutality(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
// Escalate - Discard a card.
Cost cost = new DiscardCardCost();
@ -59,14 +58,14 @@ public final class CollectiveBrutality extends CardImpl {
Effect effect = new DiscardCardYouChooseTargetEffect(filter, TargetController.ANY);
effect.setText("Target opponent reveals their hand. You choose an instant or sorcery card from it. That player discards that card");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetPlayer(1, 1, false, filterDiscard));
this.getSpellAbility().addTarget(new TargetPlayer(1, 1, false, filterDiscard).withChooseHint("reveals hand, you choose to discard"));
// Target creature gets -2/-2 until end of turn.;
Mode mode = new Mode();
effect = new BoostTargetEffect(-2, -2, Duration.EndOfTurn);
effect.setText("Target creature gets -2/-2 until end of turn");
mode.addEffect(effect);
mode.addTarget(new TargetCreaturePermanent(filterCreatureMinus));
mode.addTarget(new TargetCreaturePermanent(filterCreatureMinus).withChooseHint("gets -2/-2 until end of turn"));
this.getSpellAbility().addMode(mode);
// Target opponent loses 2 life and you gain 2 life.
@ -74,10 +73,9 @@ public final class CollectiveBrutality extends CardImpl {
effect = new LoseLifeTargetEffect(2);
effect.setText("Target opponent loses 2 life");
mode.addEffect(effect);
mode.addTarget(new TargetPlayer(1, 1, false, filterLoseLife));
mode.addTarget(new TargetPlayer(1, 1, false, filterLoseLife).withChooseHint("loses 2 life"));
effect = new GainLifeEffect(2);
effect.setText("and you gain 2 life");
mode.addEffect(effect);
mode.addEffect(effect.concatBy("and"));
this.getSpellAbility().addMode(mode);
}

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.costs.mana.GenericManaCost;
@ -22,8 +20,9 @@ import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetOpponentOrPlaneswalker;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class CollectiveDefiance extends CardImpl {
@ -43,14 +42,14 @@ public final class CollectiveDefiance extends CardImpl {
// Target player discards all cards in their hand, then draws that many cards.;
this.getSpellAbility().addEffect(new CollectiveDefianceEffect());
this.getSpellAbility().addTarget(new TargetPlayer(1, 1, false, filterDiscard));
this.getSpellAbility().addTarget(new TargetPlayer(1, 1, false, filterDiscard).withChooseHint("discards all cards and draws"));
// Collective Defiance deals 4 damage to target creature.;
Mode mode = new Mode();
Effect effect = new DamageTargetEffect(4);
effect.setText("{this} deals 4 damage to target creature");
mode.addEffect(effect);
mode.addTarget(new TargetCreaturePermanent(filterCreature));
mode.addTarget(new TargetCreaturePermanent(filterCreature).withChooseHint("deals 4 damage to"));
this.getSpellAbility().addMode(mode);
// Collective Defiance deals 3 damage to target opponent or planeswalker.
@ -58,7 +57,7 @@ public final class CollectiveDefiance extends CardImpl {
effect = new DamageTargetEffect(3);
effect.setText("{this} deals 3 damage to target opponent or planeswalker");
mode.addEffect(effect);
mode.addTarget(new TargetOpponentOrPlaneswalker());
mode.addTarget(new TargetOpponentOrPlaneswalker().withChooseHint("deals 3 damage to"));
this.getSpellAbility().addMode(mode);
}

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.costs.Cost;
@ -32,8 +30,9 @@ import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetEnchantmentPermanent;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class CollectiveEffort extends CardImpl {
@ -62,14 +61,14 @@ public final class CollectiveEffort extends CardImpl {
// Destroy target creature with power 4 or greater.;
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterDestroyCreature));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterDestroyCreature).withChooseHint("destroy"));
// Destroy target enchantment.;
Mode mode = new Mode();
Effect effect = new DestroyTargetEffect();
effect.setText("Destroy target enchantment");
mode.addEffect(effect);
mode.addTarget(new TargetEnchantmentPermanent(filterDestroyEnchantment));
mode.addTarget(new TargetEnchantmentPermanent(filterDestroyEnchantment).withChooseHint("destroy"));
this.getSpellAbility().addMode(mode);
// Put a +1/+1 counter on each creature target player controls.
@ -77,7 +76,7 @@ public final class CollectiveEffort extends CardImpl {
effect = new CollectiveEffortEffect();
effect.setText("Put a +1/+1 counter on each creature target player controls");
mode.addEffect(effect);
mode.addTarget(new TargetPlayer(1, 1, false, filterPlayer));
mode.addTarget(new TargetPlayer(1, 1, false, filterPlayer).withChooseHint("put +1/+1 counter on each creature"));
this.getSpellAbility().addMode(mode);
}

View file

@ -1,7 +1,5 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
@ -10,28 +8,28 @@ import mage.constants.CardType;
import mage.target.common.TargetArtifactPermanent;
import mage.target.common.TargetEnchantmentPermanent;
import java.util.UUID;
/**
*
* @author Ryan-Saklad
*/
public final class CrushContraband extends CardImpl {
public CrushContraband(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{W}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}");
// Choose one or both - Destroy target artifact; or Destroy target land.
this.getSpellAbility().getModes().setMinModes(1);
this.getSpellAbility().getModes().setMaxModes(2);
this.getSpellAbility().addTarget(new TargetArtifactPermanent());
this.getSpellAbility().addEffect(new ExileTargetEffect());
this.getSpellAbility().addTarget(new TargetArtifactPermanent().withChooseHint("destroy"));
Mode mode1 = new Mode();
mode1.addTarget(new TargetEnchantmentPermanent());
mode1.addEffect(new ExileTargetEffect());
mode1.addTarget(new TargetEnchantmentPermanent().withChooseHint("destroy"));
this.getSpellAbility().addMode(mode1);
}
public CrushContraband(final CrushContraband card) {