Implemented Secure the Scene

This commit is contained in:
Evan Kranzler 2020-06-18 18:53:16 -04:00
parent 3a40b9dfb3
commit e1a396d145
2 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,68 @@
package mage.cards.s;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.SoldierToken;
import mage.game.permanent.token.Token;
import mage.target.common.TargetNonlandPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SecureTheScene extends CardImpl {
public SecureTheScene(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{W}");
// Exile target nonland permanent. Its controller creates a 1/1 white Soldier creature token.
this.getSpellAbility().addEffect(new ExileTargetEffect());
this.getSpellAbility().addEffect(new SecureTheSceneEffect());
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
}
private SecureTheScene(final SecureTheScene card) {
super(card);
}
@Override
public SecureTheScene copy() {
return new SecureTheScene(this);
}
}
class SecureTheSceneEffect extends OneShotEffect {
private static final Token token = new SoldierToken();
SecureTheSceneEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Its controller creates a 1/1 white Soldier creature token";
}
private SecureTheSceneEffect(final SecureTheSceneEffect effect) {
super(effect);
}
@Override
public SecureTheSceneEffect copy() {
return new SecureTheSceneEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
if (permanent == null) {
return false;
}
return token.putOntoBattlefield(1, game, source.getSourceId(), permanent.getControllerId());
}
}

View file

@ -220,6 +220,7 @@ public final class CoreSet2021 extends ExpansionSet {
cards.add(new SetCardInfo("Scorching Dragonfire", 158, Rarity.COMMON, mage.cards.s.ScorchingDragonfire.class));
cards.add(new SetCardInfo("Scoured Barrens", 250, Rarity.COMMON, mage.cards.s.ScouredBarrens.class));
cards.add(new SetCardInfo("Seasoned Hallowblade", 34, Rarity.UNCOMMON, mage.cards.s.SeasonedHallowblade.class));
cards.add(new SetCardInfo("Secure the Scene", 35, Rarity.COMMON, mage.cards.s.SecureTheScene.class));
cards.add(new SetCardInfo("See the Truth", 69, Rarity.RARE, mage.cards.s.SeeTheTruth.class));
cards.add(new SetCardInfo("Selfless Savior", 36, Rarity.UNCOMMON, mage.cards.s.SelflessSavior.class));
cards.add(new SetCardInfo("Setessan Training", 205, Rarity.COMMON, mage.cards.s.SetessanTraining.class));