mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
[SNC] Implemented Extract the Truth
This commit is contained in:
parent
b4af1c3473
commit
8eccb669f9
3 changed files with 69 additions and 3 deletions
50
Mage.Sets/src/mage/cards/e/ExtractTheTruth.java
Normal file
50
Mage.Sets/src/mage/cards/e/ExtractTheTruth.java
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
package mage.cards.e;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import mage.abilities.Mode;
|
||||||
|
import mage.abilities.effects.common.SacrificeEffect;
|
||||||
|
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.filter.FilterCard;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
|
import mage.filter.predicate.Predicates;
|
||||||
|
import mage.target.common.TargetOpponent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author weirddan455
|
||||||
|
*/
|
||||||
|
public final class ExtractTheTruth extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterCard filter = new FilterCard("creature, enchantment, or planeswalker card");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.ENCHANTMENT.getPredicate(), CardType.PLANESWALKER.getPredicate()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExtractTheTruth(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}");
|
||||||
|
|
||||||
|
// Choose one—
|
||||||
|
// • Target opponent reveals their hand. You may choose a creature, enchantment, or planeswalker card from it. That player discards that card.
|
||||||
|
DiscardCardYouChooseTargetEffect effect = new DiscardCardYouChooseTargetEffect(filter);
|
||||||
|
effect.setOptional(true);
|
||||||
|
this.getSpellAbility().addEffect(effect);
|
||||||
|
this.getSpellAbility().addTarget(new TargetOpponent());
|
||||||
|
|
||||||
|
// • Target opponent sacrifices an enchantment.
|
||||||
|
this.getSpellAbility().addMode(new Mode(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_ENCHANTMENT, 1, "Target opponent")).addTarget(new TargetOpponent()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private ExtractTheTruth(final ExtractTheTruth card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ExtractTheTruth copy() {
|
||||||
|
return new ExtractTheTruth(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -91,6 +91,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Evolving Door", 144, Rarity.RARE, mage.cards.e.EvolvingDoor.class));
|
cards.add(new SetCardInfo("Evolving Door", 144, Rarity.RARE, mage.cards.e.EvolvingDoor.class));
|
||||||
cards.add(new SetCardInfo("Exhibition Magician", 106, Rarity.COMMON, mage.cards.e.ExhibitionMagician.class));
|
cards.add(new SetCardInfo("Exhibition Magician", 106, Rarity.COMMON, mage.cards.e.ExhibitionMagician.class));
|
||||||
cards.add(new SetCardInfo("Exotic Pets", 185, Rarity.UNCOMMON, mage.cards.e.ExoticPets.class));
|
cards.add(new SetCardInfo("Exotic Pets", 185, Rarity.UNCOMMON, mage.cards.e.ExoticPets.class));
|
||||||
|
cards.add(new SetCardInfo("Extract the Truth", 78, Rarity.COMMON, mage.cards.e.ExtractTheTruth.class));
|
||||||
cards.add(new SetCardInfo("Faerie Vandal", 44, Rarity.UNCOMMON, mage.cards.f.FaerieVandal.class));
|
cards.add(new SetCardInfo("Faerie Vandal", 44, Rarity.UNCOMMON, mage.cards.f.FaerieVandal.class));
|
||||||
cards.add(new SetCardInfo("Fatal Grudge", 187, Rarity.UNCOMMON, mage.cards.f.FatalGrudge.class));
|
cards.add(new SetCardInfo("Fatal Grudge", 187, Rarity.UNCOMMON, mage.cards.f.FatalGrudge.class));
|
||||||
cards.add(new SetCardInfo("Fight Rigging", 145, Rarity.RARE, mage.cards.f.FightRigging.class));
|
cards.add(new SetCardInfo("Fight Rigging", 145, Rarity.RARE, mage.cards.f.FightRigging.class));
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect {
|
||||||
private DynamicValue numberCardsToReveal;
|
private DynamicValue numberCardsToReveal;
|
||||||
private final DynamicValue numberCardsToDiscard;
|
private final DynamicValue numberCardsToDiscard;
|
||||||
private boolean revealAllCards;
|
private boolean revealAllCards;
|
||||||
|
private boolean optional = false;
|
||||||
|
|
||||||
public DiscardCardYouChooseTargetEffect() {
|
public DiscardCardYouChooseTargetEffect() {
|
||||||
this(StaticFilters.FILTER_CARD_A);
|
this(StaticFilters.FILTER_CARD_A);
|
||||||
|
|
@ -99,6 +100,12 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect {
|
||||||
this.numberCardsToDiscard = effect.numberCardsToDiscard;
|
this.numberCardsToDiscard = effect.numberCardsToDiscard;
|
||||||
this.numberCardsToReveal = effect.numberCardsToReveal;
|
this.numberCardsToReveal = effect.numberCardsToReveal;
|
||||||
this.revealAllCards = effect.revealAllCards;
|
this.revealAllCards = effect.revealAllCards;
|
||||||
|
this.optional = effect.optional;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOptional(boolean optional) {
|
||||||
|
this.optional = optional;
|
||||||
|
staticText = this.setText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -147,7 +154,7 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect {
|
||||||
if (numberToDiscard <= 0) {
|
if (numberToDiscard <= 0) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
TargetCard target = new TargetCard(numberToDiscard, Zone.HAND, filter);
|
TargetCard target = new TargetCard(optional ? 0 : numberToDiscard, numberToDiscard, Zone.HAND, filter);
|
||||||
if (!controller.choose(Outcome.Benefit, revealedCards, target, game)) {
|
if (!controller.choose(Outcome.Benefit, revealedCards, target, game)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
@ -175,7 +182,11 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
sb.append(" reveals ");
|
sb.append(" reveals ");
|
||||||
if (revealAllCards) {
|
if (revealAllCards) {
|
||||||
sb.append("their hand. You choose ");
|
sb.append("their hand. You ");
|
||||||
|
if (optional) {
|
||||||
|
sb.append("may ");
|
||||||
|
}
|
||||||
|
sb.append("choose ");
|
||||||
if (discardMultipleCards) {
|
if (discardMultipleCards) {
|
||||||
sb.append(numberCardsToDiscard).append(' ').append(filter.getMessage());
|
sb.append(numberCardsToDiscard).append(' ').append(filter.getMessage());
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -194,7 +205,11 @@ public class DiscardCardYouChooseTargetEffect extends OneShotEffect {
|
||||||
sb.append("a number of cards from their hand equal to ");
|
sb.append("a number of cards from their hand equal to ");
|
||||||
sb.append(numberCardsToReveal.getMessage());
|
sb.append(numberCardsToReveal.getMessage());
|
||||||
}
|
}
|
||||||
sb.append(". You choose ");
|
sb.append(". You ");
|
||||||
|
if (optional) {
|
||||||
|
sb.append("may ");
|
||||||
|
}
|
||||||
|
sb.append("choose ");
|
||||||
if (numberCardsToDiscard instanceof StaticValue) {
|
if (numberCardsToDiscard instanceof StaticValue) {
|
||||||
sb.append(CardUtil.numberToText(((StaticValue) numberCardsToDiscard).getValue()));
|
sb.append(CardUtil.numberToText(((StaticValue) numberCardsToDiscard).getValue()));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue