[NEC] Implemented Access Denied

This commit is contained in:
Evan Kranzler 2022-02-08 08:46:54 -05:00
parent 4f2671f475
commit 8d8e2017e6
3 changed files with 67 additions and 2 deletions

View file

@ -0,0 +1,65 @@
package mage.cards.a;
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.game.Game;
import mage.game.permanent.token.ThopterColorlessToken;
import mage.game.stack.StackObject;
import mage.target.TargetSpell;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AccessDenied extends CardImpl {
public AccessDenied(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}");
// Counter target spell. Create X 1/1 colorless Thopter artifact creature tokens with flying, where X is that spell's mana value.
this.getSpellAbility().addEffect(new AccessDeniedEffect());
this.getSpellAbility().addTarget(new TargetSpell());
}
private AccessDenied(final AccessDenied card) {
super(card);
}
@Override
public AccessDenied copy() {
return new AccessDenied(this);
}
}
class AccessDeniedEffect extends OneShotEffect {
AccessDeniedEffect() {
super(Outcome.Benefit);
staticText = "counter target spell. Create X 1/1 colorless Thopter " +
"artifact creature tokens with flying, where X is that spell's mana value";
}
private AccessDeniedEffect(final AccessDeniedEffect effect) {
super(effect);
}
@Override
public AccessDeniedEffect copy() {
return new AccessDeniedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
StackObject stackObject = game.getStack().getStackObject(targetPointer.getFirst(game, source));
if (stackObject != null) {
game.getStack().counter(source.getFirstTarget(), source, game);
return new ThopterColorlessToken().putOntoBattlefield(stackObject.getManaValue(), game, source);
}
return false;
}
}

View file

@ -2,7 +2,6 @@ package mage.cards.s;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -58,7 +57,7 @@ class SpellSwindleEffect extends OneShotEffect {
StackObject stackObject = game.getStack().getStackObject(targetPointer.getFirst(game, source));
if (stackObject != null) {
game.getStack().counter(source.getFirstTarget(), source, game);
return new CreateTokenEffect(new TreasureToken(), stackObject.getManaValue()).apply(game, source);
return new TreasureToken().putOntoBattlefield(stackObject.getManaValue(), game, source);
}
return false;
}

View file

@ -19,6 +19,7 @@ public final class NeonDynastyCommander extends ExpansionSet {
super("Neon Dynasty Commander", "NEC", ExpansionSet.buildDate(2022, 2, 18), SetType.SUPPLEMENTAL);
this.hasBasicLands = false;
cards.add(new SetCardInfo("Access Denied", 11, Rarity.RARE, mage.cards.a.AccessDenied.class));
cards.add(new SetCardInfo("Aerial Surveyor", 5, Rarity.RARE, mage.cards.a.AerialSurveyor.class));
cards.add(new SetCardInfo("Chishiro, the Shattered Blade", 1, Rarity.MYTHIC, mage.cards.c.ChishiroTheShatteredBlade.class));
cards.add(new SetCardInfo("Kotori, Pilot Prodigy", 2, Rarity.MYTHIC, mage.cards.k.KotoriPilotProdigy.class));