mirror of
https://github.com/correl/mage.git
synced 2024-12-28 11:14:13 +00:00
[NEO] Implemented Invoke Despair
This commit is contained in:
parent
ec1a555312
commit
0586014afa
2 changed files with 103 additions and 0 deletions
102
Mage.Sets/src/mage/cards/i/InvokeDespair.java
Normal file
102
Mage.Sets/src/mage/cards/i/InvokeDespair.java
Normal file
|
@ -0,0 +1,102 @@
|
|||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledEnchantmentPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class InvokeDespair extends CardImpl {
|
||||
|
||||
public InvokeDespair(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}{B}{B}");
|
||||
|
||||
// Target opponent sacrifices a creature. If they can't, they lose 2 life and you draw a card. Then repeat this process for an enchantment and a planeswalker.
|
||||
this.getSpellAbility().addEffect(new InvokeDespairEffect());
|
||||
this.getSpellAbility().addTarget(new TargetOpponent());
|
||||
}
|
||||
|
||||
private InvokeDespair(final InvokeDespair card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InvokeDespair copy() {
|
||||
return new InvokeDespair(this);
|
||||
}
|
||||
}
|
||||
|
||||
class InvokeDespairEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterControlledEnchantmentPermanent enchantmentFilter = new FilterControlledEnchantmentPermanent();
|
||||
|
||||
public InvokeDespairEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
this.staticText = "Target opponent sacrifices a creature. If they can't, they lose 2 life and you draw a card. Then repeat this process for an enchantment and a planeswalker";
|
||||
}
|
||||
|
||||
private InvokeDespairEffect(final InvokeDespairEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InvokeDespairEffect copy() {
|
||||
return new InvokeDespairEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player opponent = game.getPlayer(source.getFirstTarget());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (opponent == null || controller == null) {
|
||||
return false;
|
||||
}
|
||||
Target target = new TargetControlledCreaturePermanent();
|
||||
target.setNotTarget(true);
|
||||
opponent.choose(outcome, target, source.getSourceId(), game);
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source, game);
|
||||
} else {
|
||||
opponent.loseLife(2, game, source, false);
|
||||
controller.drawCards(1, source, game);
|
||||
}
|
||||
target = new TargetControlledPermanent(enchantmentFilter);
|
||||
target.setNotTarget(true);
|
||||
opponent.choose(outcome, target, source.getSourceId(), game);
|
||||
permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source, game);
|
||||
} else {
|
||||
opponent.loseLife(2, game, source, false);
|
||||
controller.drawCards(1, source, game);
|
||||
}
|
||||
target = new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_PLANESWALKER);
|
||||
target.setNotTarget(true);
|
||||
opponent.choose(outcome, target, source.getSourceId(), game);
|
||||
permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.sacrifice(source, game);
|
||||
} else {
|
||||
opponent.loseLife(2, game, source, false);
|
||||
controller.drawCards(1, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -126,6 +126,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Inkrise Infiltrator", 100, Rarity.COMMON, mage.cards.i.InkriseInfiltrator.class));
|
||||
cards.add(new SetCardInfo("Inventive Iteration", 57, Rarity.RARE, mage.cards.i.InventiveIteration.class));
|
||||
cards.add(new SetCardInfo("Invigorating Hot Spring", 223, Rarity.UNCOMMON, mage.cards.i.InvigoratingHotSpring.class));
|
||||
cards.add(new SetCardInfo("Invoke Despair", 101, Rarity.RARE, mage.cards.i.InvokeDespair.class));
|
||||
cards.add(new SetCardInfo("Invoke the Ancients", 193, Rarity.RARE, mage.cards.i.InvokeTheAncients.class));
|
||||
cards.add(new SetCardInfo("Invoke the Winds", 58, Rarity.RARE, mage.cards.i.InvokeTheWinds.class));
|
||||
cards.add(new SetCardInfo("Ironhoof Boar", 148, Rarity.COMMON, mage.cards.i.IronhoofBoar.class));
|
||||
|
|
Loading…
Reference in a new issue