[J22] small change to Disciple of Perdition

This commit is contained in:
theelk801 2023-04-28 18:06:55 -04:00
parent 5a63702cb6
commit be832e27b2

View file

@ -1,54 +1,50 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
import mage.abilities.common.DiesSourceTriggeredAbility; import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.constants.SubType;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect; import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
import mage.abilities.effects.common.LoseLifeSourceControllerEffect; import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/** /**
*
* @author @stwalsh4118 * @author @stwalsh4118
*/ */
public final class DiscipleOfPerdition extends CardImpl { public final class DiscipleOfPerdition extends CardImpl {
public DiscipleOfPerdition(UUID ownerId, CardSetInfo setInfo) { public DiscipleOfPerdition(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WARLOCK); this.subtype.add(SubType.WARLOCK);
this.power = new MageInt(1); this.power = new MageInt(1);
this.toughness = new MageInt(3); this.toughness = new MageInt(3);
// When Disciple of Perdition dies, choose one. If you have exactly 13 life, you may choose both. // When Disciple of Perdition dies, choose one. If you have exactly 13 life, you may choose both.
Ability ability = new DiesSourceTriggeredAbility(null, false); // * You draw a card and you lose 1 life.
Ability ability = new DiesSourceTriggeredAbility(new DrawCardSourceControllerEffect(1), false);
ability.getModes().setChooseText("Choose one. If you have exactly 13 life, you may choose both."); ability.getModes().setChooseText("Choose one. If you have exactly 13 life, you may choose both.");
ability.getModes().setMoreCondition(DiscipleOfPerditionCondition.instance); ability.getModes().setMoreCondition(DiscipleOfPerditionCondition.instance);
// * You draw a card and you lose 1 life.
ability.addEffect(new DrawCardSourceControllerEffect(1));
ability.addEffect(new LoseLifeSourceControllerEffect(1)); ability.addEffect(new LoseLifeSourceControllerEffect(1));
// * Exile target opponent's graveyard. That player loses 1 life. // * Exile target opponent's graveyard. That player loses 1 life.
Mode mode = new Mode(new ExileGraveyardAllTargetPlayerEffect().setText("Exile target opponent's graveyard")); ability.addMode(new Mode(new ExileGraveyardAllTargetPlayerEffect()
mode.addTarget(new TargetOpponent()); .setText("Exile target opponent's graveyard"))
ability.addMode(mode); .addEffect(new LoseLifeTargetEffect(1).setText("that player loses 1 life"))
.addTarget(new TargetOpponent()));
this.addAbility(ability); this.addAbility(ability);
} }
private DiscipleOfPerdition(final DiscipleOfPerdition card) { private DiscipleOfPerdition(final DiscipleOfPerdition card) {
@ -63,14 +59,10 @@ public final class DiscipleOfPerdition extends CardImpl {
enum DiscipleOfPerditionCondition implements Condition { enum DiscipleOfPerditionCondition implements Condition {
instance; instance;
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(source.getControllerId());
if(player.getLife() == 13) { return player != null && player.getLife() == 13;
return true;
}
return false;
} }
} }