[NCC] Implement The Beamtown Bullies (#9378)

This commit is contained in:
arketec 2022-08-17 18:01:49 -07:00 committed by GitHub
parent 6cfefeea95
commit 56d5ad3dbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 164 additions and 0 deletions

View file

@ -0,0 +1,132 @@
package mage.cards.t;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.combat.GoadTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetOpponentWhoseTurnItIs;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author Arketec
*/
public final class TheBeamtownBullies extends CardImpl {
private static final FilterCard filter = new FilterCard("nonlegendary creature card");
static {
filter.add(Predicates.not(SuperType.LEGENDARY.getPredicate()));
filter.add(CardType.CREATURE.getPredicate());
}
public TheBeamtownBullies(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.OGRE);
this.subtype.add(SubType.DEVIL);
this.subtype.add(SubType.WARRIOR);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Vigilance, Haste
this.addAbility(VigilanceAbility.getInstance());
this.addAbility(HasteAbility.getInstance());
// Target opponent whose turn it is puts target nonlegendary creature card from your graveyard onto the battlefield under their control. It gains haste. Goad it. At the beginning of the next end step, exile it.
Ability ability = new SimpleActivatedAbility(new TheBeamtownBulliesEffect(), new TapSourceCost());
// Choose a non-legendary creature to put on the battlefield under their control
ability.addTarget(new TargetCardInYourGraveyard(filter));
this.addAbility(ability);
}
private TheBeamtownBullies(final TheBeamtownBullies card) {
super(card);
}
@Override
public TheBeamtownBullies copy() {
return new TheBeamtownBullies(this);
}
}
class TheBeamtownBulliesEffect extends OneShotEffect {
public TheBeamtownBulliesEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "Target opponent whose turn it is puts target nonlegendary creature card from your graveyard onto the battlefield under their control. It gains haste. Goad it. At the beginning of the next end step, exile it.";
}
private TheBeamtownBulliesEffect(final TheBeamtownBulliesEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
// Ability is targeted
TargetPlayer targetOpponent = new TargetOpponentWhoseTurnItIs(game);
Player controller = game.getPlayer(source.getControllerId());
controller.chooseTarget(Outcome.Neutral, targetOpponent, source, game);
Player opponent = game.getPlayer(targetOpponent.getFirstTarget());
// check to ensure it is the chosen opponent's turn
if (opponent != null && opponent.getId().equals(game.getActivePlayerId()))
{
// Put the chosen card onto the battlefield under opponents control
Card card = game.getCard(source.getTargets().getFirstTarget());
if (card == null || !opponent.moveCards(card, Zone.BATTLEFIELD, source, game)) {
return false;
}
// Add continuous effects
Permanent permanent = game.getPermanent(card.getId());
if (permanent == null) {
return false;
}
// Apply Haste
ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
hasteEffect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(hasteEffect, source);
// Goad the creature
GoadTargetEffect goadEffect = new GoadTargetEffect();
goadEffect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(goadEffect, source);
// Exile it at end of turn
Effect exileEffect = new ExileTargetEffect("At the beginning of the next end step, exile it");
exileEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
return false;
}
@Override
public Effect copy() {
return new TheBeamtownBulliesEffect(this);
}
}

View file

@ -301,6 +301,7 @@ public final class NewCapennaCommander extends ExpansionSet {
cards.add(new SetCardInfo("Temur Sabertooth", 315, Rarity.UNCOMMON, mage.cards.t.TemurSabertooth.class));
cards.add(new SetCardInfo("Terminate", 353, Rarity.UNCOMMON, mage.cards.t.Terminate.class));
cards.add(new SetCardInfo("Tezzeret's Gambit", 235, Rarity.RARE, mage.cards.t.TezzeretsGambit.class));
cards.add(new SetCardInfo("The Beamtown Bullies", 6, Rarity.MYTHIC, mage.cards.t.TheBeamtownBullies.class));
cards.add(new SetCardInfo("Thief of Sanity", 354, Rarity.RARE, mage.cards.t.ThiefOfSanity.class));
cards.add(new SetCardInfo("Thragtusk", 316, Rarity.RARE, mage.cards.t.Thragtusk.class));
cards.add(new SetCardInfo("Thriving Bluff", 438, Rarity.COMMON, mage.cards.t.ThrivingBluff.class));

View file

@ -0,0 +1,31 @@
package mage.target.common;
import mage.filter.FilterOpponent;
import mage.filter.predicate.other.PlayerIdPredicate;
import mage.game.Game;
import mage.target.TargetPlayer;
/**
* @author Arketec
*/
public class TargetOpponentWhoseTurnItIs extends TargetPlayer {
public TargetOpponentWhoseTurnItIs(Game game) {
this(game,false);
}
public TargetOpponentWhoseTurnItIs(Game game, boolean notTarget) {
super(1, 1, notTarget, new FilterOpponent());
super.filter.add(new PlayerIdPredicate(game.getActivePlayerId()));
}
private TargetOpponentWhoseTurnItIs(final TargetOpponentWhoseTurnItIs target) {
super(target);
}
@Override
public TargetOpponentWhoseTurnItIs copy() {
return new TargetOpponentWhoseTurnItIs(this);
}
}