[MID] Implemented Vengeful Strangler / Strangling Grasp

This commit is contained in:
Evan Kranzler 2021-09-17 09:12:30 -04:00
parent 7c2db3c5fc
commit aed6a4ac3d
4 changed files with 223 additions and 1 deletions

View file

@ -59,7 +59,7 @@ class AccursedWitchReturnTransformedEffect extends OneShotEffect {
AccursedWitchReturnTransformedEffect() { AccursedWitchReturnTransformedEffect() {
super(Outcome.PutCardInPlay); super(Outcome.PutCardInPlay);
this.staticText = "Put {this} from your graveyard onto the battlefield transformed under your control attached to target opponent"; this.staticText = "return it to the battlefield transformed under your control attached to target opponent";
} }
private AccursedWitchReturnTransformedEffect(final AccursedWitchReturnTransformedEffect effect) { private AccursedWitchReturnTransformedEffect(final AccursedWitchReturnTransformedEffect effect) {

View file

@ -0,0 +1,115 @@
package mage.cards.s;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
import mage.filter.common.FilterNonlandPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class StranglingGrasp extends CardImpl {
private static final FilterPermanent filter
= new FilterCreatureOrPlaneswalkerPermanent("creature or planeswalker an opponent controls");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public StranglingGrasp(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "");
this.subtype.add(SubType.AURA);
this.color.setBlack(true);
this.transformable = true;
this.nightCard = true;
// Enchant creature or planeswalker an opponent controls
TargetPermanent auraTarget = new TargetPermanent(filter);
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// At the beginning of your upkeep, enchanted permanent's controller sacrifices a nonland permanent and loses 1 life.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new StranglingGraspEffect(), TargetController.YOU, false
));
}
private StranglingGrasp(final StranglingGrasp card) {
super(card);
}
@Override
public StranglingGrasp copy() {
return new StranglingGrasp(this);
}
}
class StranglingGraspEffect extends OneShotEffect {
private static final FilterPermanent filter = new FilterNonlandPermanent("nonland permanent you control");
static {
filter.add(TargetController.YOU.getControllerPredicate());
}
StranglingGraspEffect() {
super(Outcome.Benefit);
staticText = "enchanted permanent's controller sacrifices a nonland permanent and loses 1 life";
}
private StranglingGraspEffect(final StranglingGraspEffect effect) {
super(effect);
}
@Override
public StranglingGraspEffect copy() {
return new StranglingGraspEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent sourcePermanent = source.getSourcePermanentOrLKI(game);
if (sourcePermanent == null) {
return false;
}
Permanent attachedTo = game.getPermanentOrLKIBattlefield(sourcePermanent.getAttachedTo());
if (attachedTo == null) {
return false;
}
Player player = game.getPlayer(attachedTo.getControllerId());
if (player == null) {
return false;
}
TargetPermanent target = new TargetPermanent(filter);
target.setNotTarget(true);
if (target.canChoose(source.getSourceId(), player.getId(), game)) {
player.choose(outcome, target, source.getSourceId(), game);
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) {
permanent.sacrifice(source, game);
}
}
player.loseLife(1, game, source, false);
return true;
}
}

View file

@ -0,0 +1,105 @@
package mage.cards.v;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.CantBlockAbility;
import mage.abilities.common.DiesSourceTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.TransformAbility;
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.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class VengefulStrangler extends CardImpl {
private static final FilterPermanent filter
= new FilterCreatureOrPlaneswalkerPermanent("creature or planeswalker an opponent controls");
static {
filter.add(TargetController.OPPONENT.getControllerPredicate());
}
public VengefulStrangler(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(2);
this.toughness = new MageInt(1);
this.transformable = true;
this.secondSideCardClazz = mage.cards.s.StranglingGrasp.class;
// Vengeful Strangler can't block.
this.addAbility(new CantBlockAbility());
// When Vengeful Strangler dies, return it to the battlefield transformed under your control attached to target creature or planeswalker an opponent controls.
this.addAbility(new TransformAbility());
Ability ability = new DiesSourceTriggeredAbility(new VengefulStranglerEffect());
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}
private VengefulStrangler(final VengefulStrangler card) {
super(card);
}
@Override
public VengefulStrangler copy() {
return new VengefulStrangler(this);
}
}
class VengefulStranglerEffect extends OneShotEffect {
VengefulStranglerEffect() {
super(Outcome.PutCardInPlay);
this.staticText = "return it to the battlefield transformed under your control " +
"attached to target creature or planeswalker an opponent controls";
}
private VengefulStranglerEffect(final VengefulStranglerEffect effect) {
super(effect);
}
@Override
public VengefulStranglerEffect copy() {
return new VengefulStranglerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (controller == null || permanent == null
|| game.getState().getZone(source.getSourceId()) != Zone.GRAVEYARD) {
return false;
}
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
UUID secondFaceId = game.getCard(source.getSourceId()).getSecondCardFace().getId();
game.getState().setValue("attachTo:" + secondFaceId, permanent.getId());
Card card = game.getCard(source.getSourceId());
if (card == null) {
return false;
}
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
Permanent sourcePermanent = game.getPermanent(card.getId());
if (sourcePermanent == null) {
return false;
}
permanent.addAttachment(card.getId(), source, game);
return true;
}
}

View file

@ -289,6 +289,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
cards.add(new SetCardInfo("Storm the Festival", 200, Rarity.RARE, mage.cards.s.StormTheFestival.class)); cards.add(new SetCardInfo("Storm the Festival", 200, Rarity.RARE, mage.cards.s.StormTheFestival.class));
cards.add(new SetCardInfo("Storm-Charged Slasher", 157, Rarity.RARE, mage.cards.s.StormChargedSlasher.class)); cards.add(new SetCardInfo("Storm-Charged Slasher", 157, Rarity.RARE, mage.cards.s.StormChargedSlasher.class));
cards.add(new SetCardInfo("Stormrider Spirit", 79, Rarity.COMMON, mage.cards.s.StormriderSpirit.class)); cards.add(new SetCardInfo("Stormrider Spirit", 79, Rarity.COMMON, mage.cards.s.StormriderSpirit.class));
cards.add(new SetCardInfo("Strangling Grasp", 126, Rarity.UNCOMMON, mage.cards.s.StranglingGrasp.class));
cards.add(new SetCardInfo("Stromkirk Bloodthief", 123, Rarity.UNCOMMON, mage.cards.s.StromkirkBloodthief.class)); cards.add(new SetCardInfo("Stromkirk Bloodthief", 123, Rarity.UNCOMMON, mage.cards.s.StromkirkBloodthief.class));
cards.add(new SetCardInfo("Stuffed Bear", 259, Rarity.COMMON, mage.cards.s.StuffedBear.class)); cards.add(new SetCardInfo("Stuffed Bear", 259, Rarity.COMMON, mage.cards.s.StuffedBear.class));
cards.add(new SetCardInfo("Sungold Barrage", 36, Rarity.COMMON, mage.cards.s.SungoldBarrage.class)); cards.add(new SetCardInfo("Sungold Barrage", 36, Rarity.COMMON, mage.cards.s.SungoldBarrage.class));
@ -319,6 +320,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
cards.add(new SetCardInfo("Vampire Interloper", 125, Rarity.COMMON, mage.cards.v.VampireInterloper.class)); cards.add(new SetCardInfo("Vampire Interloper", 125, Rarity.COMMON, mage.cards.v.VampireInterloper.class));
cards.add(new SetCardInfo("Vampire Socialite", 249, Rarity.UNCOMMON, mage.cards.v.VampireSocialite.class)); cards.add(new SetCardInfo("Vampire Socialite", 249, Rarity.UNCOMMON, mage.cards.v.VampireSocialite.class));
cards.add(new SetCardInfo("Vanquish the Horde", 41, Rarity.RARE, mage.cards.v.VanquishTheHorde.class)); cards.add(new SetCardInfo("Vanquish the Horde", 41, Rarity.RARE, mage.cards.v.VanquishTheHorde.class));
cards.add(new SetCardInfo("Vengeful Strangler", 126, Rarity.UNCOMMON, mage.cards.v.VengefulStrangler.class));
cards.add(new SetCardInfo("Village Reavers", 165, Rarity.UNCOMMON, mage.cards.v.VillageReavers.class)); cards.add(new SetCardInfo("Village Reavers", 165, Rarity.UNCOMMON, mage.cards.v.VillageReavers.class));
cards.add(new SetCardInfo("Village Watch", 165, Rarity.UNCOMMON, mage.cards.v.VillageWatch.class)); cards.add(new SetCardInfo("Village Watch", 165, Rarity.UNCOMMON, mage.cards.v.VillageWatch.class));
cards.add(new SetCardInfo("Vivisection", 83, Rarity.UNCOMMON, mage.cards.v.Vivisection.class)); cards.add(new SetCardInfo("Vivisection", 83, Rarity.UNCOMMON, mage.cards.v.Vivisection.class));