[OTJ] Implement Neutralize the Guards

This commit is contained in:
Susucre 2024-03-29 22:25:09 +01:00
parent 94a714b1b7
commit 4be9427bbd
2 changed files with 69 additions and 0 deletions

View file

@ -0,0 +1,68 @@
package mage.cards.n;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AddContinuousEffectToGame;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.keyword.SurveilEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.target.common.TargetOpponent;
import java.util.UUID;
/**
* @author Susucr
*/
public final class NeutralizeTheGuards extends CardImpl {
public NeutralizeTheGuards(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}");
// Creatures target opponent controls get -1/-1 until end of turn. Surveil 2.
this.getSpellAbility().addEffect(new NeutralizeTheGuardsEffect());
this.getSpellAbility().addTarget(new TargetOpponent());
this.getSpellAbility().addEffect(new SurveilEffect(2));
}
private NeutralizeTheGuards(final NeutralizeTheGuards card) {
super(card);
}
@Override
public NeutralizeTheGuards copy() {
return new NeutralizeTheGuards(this);
}
}
class NeutralizeTheGuardsEffect extends OneShotEffect {
NeutralizeTheGuardsEffect() {
super(Outcome.Benefit);
staticText = "gain control of all creatures target opponent controls";
}
private NeutralizeTheGuardsEffect(final NeutralizeTheGuardsEffect effect) {
super(effect);
}
@Override
public NeutralizeTheGuardsEffect copy() {
return new NeutralizeTheGuardsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new ControllerIdPredicate(source.getFirstTarget()));
return new AddContinuousEffectToGame(
new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter, false)
).apply(game, source);
}
}

View file

@ -92,6 +92,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet {
cards.add(new SetCardInfo("Mine Raider", 135, Rarity.COMMON, mage.cards.m.MineRaider.class));
cards.add(new SetCardInfo("Miriam, Herd Whisperer", 221, Rarity.UNCOMMON, mage.cards.m.MiriamHerdWhisperer.class));
cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Neutralize the Guards", 95, Rarity.UNCOMMON, mage.cards.n.NeutralizeTheGuards.class));
cards.add(new SetCardInfo("Nimble Brigand", 58, Rarity.UNCOMMON, mage.cards.n.NimbleBrigand.class));
cards.add(new SetCardInfo("Oko, the Ringleader", 223, Rarity.MYTHIC, mage.cards.o.OkoTheRingleader.class));
cards.add(new SetCardInfo("Omenport Vigilante", 21, Rarity.UNCOMMON, mage.cards.o.OmenportVigilante.class));