Implemented Ob Nixilis, the Hate-Twisted

This commit is contained in:
Evan Kranzler 2019-03-31 19:29:01 -04:00
parent 53a5c6a617
commit a493f26b4f
3 changed files with 87 additions and 1 deletions

View file

@ -0,0 +1,85 @@
package mage.cards.o;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.DrawCardOpponentTriggeredAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ObNixilisTheHateTwisted extends CardImpl {
public ObNixilisTheHateTwisted(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{3}{B}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.NIXILIS);
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// Whenever an opponent draws a card, Ob Nixilis, the Hate-Twisted deals 1 damage to that player.
this.addAbility(new DrawCardOpponentTriggeredAbility(new DamageTargetEffect(
1, "that player"
), false, true));
// -2: Destroy target creature. Its controller draws two cards.
Ability ability = new LoyaltyAbility(new ObNixilisTheHateTwistedEffect(), -2);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
}
private ObNixilisTheHateTwisted(final ObNixilisTheHateTwisted card) {
super(card);
}
@Override
public ObNixilisTheHateTwisted copy() {
return new ObNixilisTheHateTwisted(this);
}
}
class ObNixilisTheHateTwistedEffect extends OneShotEffect {
ObNixilisTheHateTwistedEffect() {
super(Outcome.Benefit);
staticText = "Destroy target creature. Its controller draws two cards";
}
private ObNixilisTheHateTwistedEffect(final ObNixilisTheHateTwistedEffect effect) {
super(effect);
}
@Override
public ObNixilisTheHateTwistedEffect copy() {
return new ObNixilisTheHateTwistedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
permanent.destroy(source.getSourceId(), game, false);
Player player = game.getPlayer(permanent.getControllerId());
if (player == null) {
return false;
}
player.drawCards(2, game);
return true;
}
}

View file

@ -18,7 +18,7 @@ public final class UnderworldDreams extends CardImpl {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}{B}{B}");
// Whenever an opponent draws a card, Underworld Dreams deals 1 damage to him or her.
this.addAbility(new DrawCardOpponentTriggeredAbility(new DamageTargetEffect(1, true, "him or her"), false, true));
this.addAbility(new DrawCardOpponentTriggeredAbility(new DamageTargetEffect(1, true, "that player"), false, true));
}
public UnderworldDreams(final UnderworldDreams card) {

View file

@ -46,6 +46,7 @@ public final class WarOfTheSpark extends ExpansionSet {
cards.add(new SetCardInfo("Mountain", 261, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("No Escape", 63, Rarity.COMMON, mage.cards.n.NoEscape.class));
cards.add(new SetCardInfo("Ob Nixilis's Cruelty", 101, Rarity.COMMON, mage.cards.o.ObNixilissCruelty.class));
cards.add(new SetCardInfo("Ob Nixilis, the Hate-Twisted", 100, Rarity.UNCOMMON, mage.cards.o.ObNixilisTheHateTwisted.class));
cards.add(new SetCardInfo("Paradise Druid", 171, Rarity.UNCOMMON, mage.cards.p.ParadiseDruid.class));
cards.add(new SetCardInfo("Plains", 250, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Plains", 251, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));