mirror of
https://github.com/correl/mage.git
synced 2024-11-25 11:09:53 +00:00
fixed a bunch of discard issues (#6532)
This commit is contained in:
parent
713a7ab35d
commit
c24851b4a9
13 changed files with 89 additions and 116 deletions
|
@ -8,7 +8,7 @@ import mage.abilities.keyword.KickerAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
|
||||
|
@ -24,7 +24,7 @@ public final class BogDown extends CardImpl {
|
|||
|
||||
// Kicker-Sacrifice two lands.
|
||||
this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2,
|
||||
new FilterControlledLandPermanent("two lands"), true))));
|
||||
StaticFilters.FILTER_CONTROLLED_LAND_SHORT_TEXT, true))));
|
||||
|
||||
// Target player discards two cards. If Bog Down was kicked, that player discards three cards instead.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DiscardTargetEffect(3),
|
||||
|
|
|
@ -43,7 +43,7 @@ public final class CabalTherapist extends CardImpl {
|
|||
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
|
||||
new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME),
|
||||
false, "choose a nonland card name, then target player " +
|
||||
"reveals their hand and discards all cards with that name."
|
||||
"reveals their hand and discards all cards with that name"
|
||||
);
|
||||
ability.addEffect(new CabalTherapistDiscardEffect());
|
||||
ability.addTarget(new TargetPlayer());
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
@ -15,17 +13,19 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public final class GreelMindRaker extends CardImpl {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("two cards");
|
||||
|
||||
public GreelMindRaker(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||
|
||||
|
@ -36,14 +36,16 @@ public final class GreelMindRaker extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// {X}{B}, {tap}, Discard two cards: Target player discards X cards at random.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DiscardTargetEffect(ManacostVariableValue.instance, true), new ManaCostsImpl("{X}{B}"));
|
||||
Ability ability = new SimpleActivatedAbility(new DiscardTargetEffect(
|
||||
ManacostVariableValue.instance, true
|
||||
), new ManaCostsImpl("{X}{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard())));
|
||||
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, filter)));
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public GreelMindRaker(final GreelMindRaker card) {
|
||||
private GreelMindRaker(final GreelMindRaker card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ class InsidiousDreamsAdditionalCost extends VariableCostImpl {
|
|||
|
||||
InsidiousDreamsAdditionalCost() {
|
||||
super("cards to discard");
|
||||
this.text = "as an additional cost to cast this spell, discard X cards";
|
||||
this.text = "discard X cards";
|
||||
}
|
||||
|
||||
InsidiousDreamsAdditionalCost(final InsidiousDreamsAdditionalCost cost) {
|
||||
|
|
|
@ -1,30 +1,34 @@
|
|||
package mage.cards.k;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.costs.common.DiscardHandCost;
|
||||
import mage.abilities.costs.common.SacrificeAllCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.LoseLifeTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public final class KaerveksSpite extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent("permanents you control");
|
||||
|
||||
public KaerveksSpite(UUID ownerId, CardSetInfo cardSetInfo) {
|
||||
super(ownerId, cardSetInfo, new CardType[]{CardType.INSTANT}, "{B}{B}{B}");
|
||||
|
||||
// As an additional cost to cast Kaervek's Spite, sacrifice all permanents you control and discard your hand.
|
||||
this.getSpellAbility().addCost(new SacrificeAllCost(new FilterControlledPermanent("permanents you control")));
|
||||
this.getSpellAbility().addCost(new SacrificeAllCost(filter));
|
||||
this.getSpellAbility().addCost(new DiscardHandCost());
|
||||
|
||||
// Target player loses 5 life.
|
||||
Effect effect = new LoseLifeTargetEffect(5);
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
// Target player loses 5 life.=
|
||||
this.getSpellAbility().addEffect(new LoseLifeTargetEffect(5));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
||||
public KaerveksSpite(final KaerveksSpite other) {
|
||||
private KaerveksSpite(final KaerveksSpite other) {
|
||||
super(other);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
|
||||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.BeginningOfDrawTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.CountersSourceCount;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DiscardCardControllerTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect;
|
||||
|
@ -20,42 +17,48 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class MidnightOil extends CardImpl {
|
||||
|
||||
public MidnightOil(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}");
|
||||
|
||||
// Midnight Oil enters the battlefield with seven hour counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(new Counter(CounterType.HOUR.createInstance(7))),
|
||||
"with seven hour counters on it"));
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(
|
||||
CounterType.HOUR.createInstance(7)
|
||||
), "with seven hour counters on it"
|
||||
));
|
||||
|
||||
// At the beginning of your draw step, draw an additional card and remove two hour counters from Midnight Oil.
|
||||
Ability ability = new BeginningOfDrawTriggeredAbility(new DrawCardSourceControllerEffect(1), TargetController.YOU, false);
|
||||
Effect effect = new RemoveCounterSourceEffect(CounterType.HOUR.createInstance(2));
|
||||
effect.setText("and remove two hour counters from {this}");
|
||||
ability.addEffect(effect);
|
||||
Ability ability = new BeginningOfDrawTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(1),
|
||||
TargetController.YOU, false
|
||||
);
|
||||
ability.addEffect(new RemoveCounterSourceEffect(
|
||||
CounterType.HOUR.createInstance(2)
|
||||
).concatBy("and"));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Your maximum hand size is equal to the number of hour counters on Midnight Oil.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MaximumHandSizeControllerEffect(new CountersSourceCount(CounterType.HOUR), Duration.WhileOnBattlefield, HandSizeModification.SET, TargetController.YOU)));
|
||||
this.addAbility(new SimpleStaticAbility(new MaximumHandSizeControllerEffect(
|
||||
new CountersSourceCount(CounterType.HOUR), Duration.WhileOnBattlefield,
|
||||
HandSizeModification.SET, TargetController.YOU
|
||||
).setText("your maximum hand size is equal to the number of hour counters on {this}")));
|
||||
|
||||
// Whenever you discard a card, you lose 1 life.
|
||||
this.addAbility(new MidnightOilTriggeredAbility(new LoseLifeSourceControllerEffect(1)));
|
||||
|
||||
this.addAbility(new DiscardCardControllerTriggeredAbility(
|
||||
new LoseLifeSourceControllerEffect(1), false
|
||||
));
|
||||
}
|
||||
|
||||
public MidnightOil(final MidnightOil card) {
|
||||
private MidnightOil(final MidnightOil card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
@ -64,35 +67,3 @@ public final class MidnightOil extends CardImpl {
|
|||
return new MidnightOil(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MidnightOilTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
MidnightOilTriggeredAbility(Effect effect) {
|
||||
super(Zone.BATTLEFIELD, effect, false);
|
||||
}
|
||||
|
||||
MidnightOilTriggeredAbility(final MidnightOilTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MidnightOilTriggeredAbility copy() {
|
||||
return new MidnightOilTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.DISCARDED_CARD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return isControlledBy(event.getPlayerId());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you discard a card, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ class NogginWhackEffect extends OneShotEffect {
|
|||
if (!revealedCards.isEmpty()) {
|
||||
targetPlayer.revealCards(source, revealedCards, game);
|
||||
controller.chooseTarget(Outcome.Exile, revealedCards, targetInHand, source, game);
|
||||
targetPlayer.discard(new CardsImpl(target.getTargets()), source, game);
|
||||
targetPlayer.discard(new CardsImpl(targetInHand.getTargets()), source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,24 +1,23 @@
|
|||
|
||||
package mage.cards.p;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.choices.ChoiceColor;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class Persecute extends CardImpl {
|
||||
|
@ -29,7 +28,6 @@ public final class Persecute extends CardImpl {
|
|||
// Choose a color. Target player reveals their hand and discards all cards of that color.
|
||||
this.getSpellAbility().addEffect(new PersecuteEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
|
||||
}
|
||||
|
||||
public Persecute(final Persecute card) {
|
||||
|
@ -44,12 +42,12 @@ public final class Persecute extends CardImpl {
|
|||
|
||||
class PersecuteEffect extends OneShotEffect {
|
||||
|
||||
public PersecuteEffect() {
|
||||
PersecuteEffect() {
|
||||
super(Outcome.Discard);
|
||||
this.staticText = "Choose a color. Target player reveals their hand and discards all cards of that color";
|
||||
}
|
||||
|
||||
public PersecuteEffect(final PersecuteEffect effect) {
|
||||
private PersecuteEffect(final PersecuteEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
@ -64,17 +62,16 @@ class PersecuteEffect extends OneShotEffect {
|
|||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
if (controller != null && sourceObject != null && targetPlayer != null && controller.choose(outcome, choice, game)) {
|
||||
Cards hand = targetPlayer.getHand();
|
||||
targetPlayer.revealCards(sourceObject.getIdName(), hand, game);
|
||||
Set<Card> cards = hand.getCards(game);
|
||||
for (Card card : cards) {
|
||||
if (card != null && card.getColor(game).shares(choice.getColor())) {
|
||||
targetPlayer.discard(card, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
if (controller == null
|
||||
|| sourceObject == null
|
||||
|| targetPlayer == null
|
||||
|| !controller.choose(outcome, choice, game)) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
FilterCard filterCard = new FilterCard();
|
||||
filterCard.add(new ColorPredicate(choice.getColor()));
|
||||
targetPlayer.revealCards(source, targetPlayer.getHand(), game);
|
||||
targetPlayer.discard(new CardsImpl(targetPlayer.getHand().getCards(filterCard, game)), source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public final class Probe extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
|
||||
new DiscardTargetEffect(2),
|
||||
KickedCondition.instance,
|
||||
"<br><br>if this spell was kicked, target player discards two cards"));
|
||||
"<br><br>If this spell was kicked, target player discards two cards"));
|
||||
this.getSpellAbility().setTargetAdjuster(ProbeAdjuster.instance);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public final class PsychicVortex extends CardImpl {
|
|||
class PsychicVortexCost extends CostImpl {
|
||||
|
||||
PsychicVortexCost() {
|
||||
this.text = "Draw a card.";
|
||||
this.text = "Draw a card";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -47,7 +47,7 @@ class SickeningDreamsAdditionalCost extends VariableCostImpl {
|
|||
|
||||
SickeningDreamsAdditionalCost() {
|
||||
super("cards to discard");
|
||||
this.text = "as an additional cost to cast this spell, discard X cards";
|
||||
this.text = "discard X cards";
|
||||
}
|
||||
|
||||
SickeningDreamsAdditionalCost(final SickeningDreamsAdditionalCost cost) {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
|
@ -11,22 +9,23 @@ import mage.abilities.keyword.TrampleAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class ThoughtGorger extends CardImpl {
|
||||
|
||||
public ThoughtGorger(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{B}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
|
||||
this.subtype.add(SubType.HORROR);
|
||||
|
||||
this.power = new MageInt(2);
|
||||
|
@ -35,15 +34,13 @@ public final class ThoughtGorger extends CardImpl {
|
|||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// When Thought Gorger enters the battlefield, put a +1/+1 counter on it for each card in your hand. If you do, discard your hand.
|
||||
Ability ability1 = new EntersBattlefieldTriggeredAbility(new ThoughtGorgerEffectEnters());
|
||||
this.addAbility(ability1);
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new ThoughtGorgerEffectEnters()));
|
||||
|
||||
// When Thought Gorger leaves the battlefield, draw a card for each +1/+1 counter on it.
|
||||
Ability ability2 = new LeavesBattlefieldTriggeredAbility(new ThoughtGorgerEffectLeaves(), false);
|
||||
this.addAbility(ability2);
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new ThoughtGorgerEffectLeaves(), false));
|
||||
}
|
||||
|
||||
public ThoughtGorger(final ThoughtGorger card) {
|
||||
private ThoughtGorger(final ThoughtGorger card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
@ -56,12 +53,12 @@ public final class ThoughtGorger extends CardImpl {
|
|||
|
||||
class ThoughtGorgerEffectEnters extends OneShotEffect {
|
||||
|
||||
public ThoughtGorgerEffectEnters() {
|
||||
ThoughtGorgerEffectEnters() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "put a +1/+1 counter on it for each card in your hand. If you do, discard your hand.";
|
||||
}
|
||||
|
||||
public ThoughtGorgerEffectEnters(final ThoughtGorgerEffectEnters effect) {
|
||||
private ThoughtGorgerEffectEnters(final ThoughtGorgerEffectEnters effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
@ -74,24 +71,27 @@ class ThoughtGorgerEffectEnters extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent thoughtGorger = game.getPermanent(source.getSourceId());
|
||||
if (player != null && !player.getHand().isEmpty() && thoughtGorger != null ) {
|
||||
int cardsInHand = player.getHand().size();
|
||||
thoughtGorger.addCounters(CounterType.P1P1.createInstance(cardsInHand), source, game);
|
||||
player.discard(cardsInHand, false, source, game);
|
||||
return true;
|
||||
if (player == null
|
||||
|| player.getHand().isEmpty()
|
||||
|| thoughtGorger == null
|
||||
|| !thoughtGorger.addCounters(
|
||||
CounterType.P1P1.createInstance(player.getHand().size()), source, game
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
player.discard(player.getHand(), source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class ThoughtGorgerEffectLeaves extends OneShotEffect {
|
||||
|
||||
public ThoughtGorgerEffectLeaves() {
|
||||
ThoughtGorgerEffectLeaves() {
|
||||
super(Outcome.Neutral);
|
||||
this.staticText = "draw a card for each +1/+1 counter on it.";
|
||||
}
|
||||
|
||||
public ThoughtGorgerEffectLeaves(final ThoughtGorgerEffectLeaves effect) {
|
||||
private ThoughtGorgerEffectLeaves(final ThoughtGorgerEffectLeaves effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ public class DrawCardSourceControllerEffect extends OneShotEffect {
|
|||
super(effect);
|
||||
this.amount = effect.amount.copy();
|
||||
this.whoDrawCard = effect.whoDrawCard;
|
||||
setText();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue