mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
[DMU] Implemented Sol'Kanar the Tainted
This commit is contained in:
parent
78f8d9a14b
commit
9806d6e092
2 changed files with 113 additions and 0 deletions
112
Mage.Sets/src/mage/cards/s/SolKanarTheTainted.java
Normal file
112
Mage.Sets/src/mage/cards/s/SolKanarTheTainted.java
Normal file
|
@ -0,0 +1,112 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SolKanarTheTainted extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterCreatureOrPlaneswalkerPermanent("other target creature or planeswalker");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public SolKanarTheTainted(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{B}{R}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
this.subtype.add(SubType.DEMON);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// At the beginning of your end step, choose one that hasn't been chosen --
|
||||
// * Draw a card.
|
||||
Ability ability = new BeginningOfEndStepTriggeredAbility(
|
||||
new DrawCardSourceControllerEffect(1), TargetController.YOU, false
|
||||
);
|
||||
ability.getModes().setEachModeOnlyOnce(true);
|
||||
|
||||
// * Each opponent loses 2 life and you gain 2 life.
|
||||
ability.addMode(new Mode(new LoseLifeOpponentsEffect(2))
|
||||
.addEffect(new GainLifeEffect(2).concatBy("and")));
|
||||
|
||||
// * Sol'Kanar the Tainted deals 3 damage to up to one other target creature or planeswalker.
|
||||
ability.addMode(new Mode(new DamageTargetEffect(3))
|
||||
.addTarget(new TargetPermanent(0, 1, filter)));
|
||||
|
||||
// * Exile Sol'Kanar, then return it to the battlefield under an opponent's control.
|
||||
ability.addMode(new Mode(new SolKanarTheTaintedEffect()));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private SolKanarTheTainted(final SolKanarTheTainted card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SolKanarTheTainted copy() {
|
||||
return new SolKanarTheTainted(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SolKanarTheTaintedEffect extends OneShotEffect {
|
||||
|
||||
SolKanarTheTaintedEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "exile {this}, then return it to the battlefield under an opponent's control";
|
||||
}
|
||||
|
||||
private SolKanarTheTaintedEffect(final SolKanarTheTaintedEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SolKanarTheTaintedEffect copy() {
|
||||
return new SolKanarTheTaintedEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (permanent == null || player == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = permanent.getMainCard();
|
||||
player.moveCards(permanent, Zone.EXILED, source, game);
|
||||
if (card instanceof PermanentToken) {
|
||||
return true;
|
||||
}
|
||||
TargetOpponent target = new TargetOpponent(true);
|
||||
player.choose(outcome, target, source, game);
|
||||
Player opponent = game.getPlayer(target.getFirstTarget());
|
||||
return opponent == null || opponent.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
|
@ -223,6 +223,7 @@ public final class DominariaUnited extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Smash to Dust", 144, Rarity.COMMON, mage.cards.s.SmashToDust.class));
|
||||
cards.add(new SetCardInfo("Snarespinner", 179, Rarity.COMMON, mage.cards.s.Snarespinner.class));
|
||||
cards.add(new SetCardInfo("Soaring Drake", 66, Rarity.COMMON, mage.cards.s.SoaringDrake.class));
|
||||
cards.add(new SetCardInfo("Sol'Kanar the Tainted", 219, Rarity.MYTHIC, mage.cards.s.SolKanarTheTainted.class));
|
||||
cards.add(new SetCardInfo("Soul of Windgrace", 220, Rarity.MYTHIC, mage.cards.s.SoulOfWindgrace.class));
|
||||
cards.add(new SetCardInfo("Sphinx of Clear Skies", 67, Rarity.MYTHIC, mage.cards.s.SphinxOfClearSkies.class));
|
||||
cards.add(new SetCardInfo("Splatter Goblin", 109, Rarity.COMMON, mage.cards.s.SplatterGoblin.class));
|
||||
|
|
Loading…
Reference in a new issue