[SNC] Implemented Ballroom Brawlers

This commit is contained in:
Evan Kranzler 2022-04-11 20:50:00 -04:00
parent 95632891a4
commit 9ac54e6f4b
2 changed files with 97 additions and 0 deletions

View file

@ -0,0 +1,96 @@
package mage.cards.b;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.targetpointer.FixedTargets;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import static mage.filter.predicate.permanent.ControllerControlsIslandPredicate.filter;
/**
* @author TheElk801
*/
public final class BallroomBrawlers extends CardImpl {
public BallroomBrawlers(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.WARRIOR);
this.power = new MageInt(3);
this.toughness = new MageInt(5);
// Whenever Ballroom Brawlers attacks, Ballroom Brawlers and up to one other target creature you control each gain your choice of first strike or lifelink until end of turn.
Ability ability = new AttacksTriggeredAbility(new BallroomBrawlersEffect());
ability.addTarget(new TargetPermanent(0, 1, filter));
this.addAbility(ability);
}
private BallroomBrawlers(final BallroomBrawlers card) {
super(card);
}
@Override
public BallroomBrawlers copy() {
return new BallroomBrawlers(this);
}
}
class BallroomBrawlersEffect extends OneShotEffect {
BallroomBrawlersEffect() {
super(Outcome.Benefit);
staticText = "{this} and up to one other target creature you control " +
"both gain your choice of first strike or lifelink until end of turn";
}
private BallroomBrawlersEffect(final BallroomBrawlersEffect effect) {
super(effect);
}
@Override
public BallroomBrawlersEffect copy() {
return new BallroomBrawlersEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
List<Permanent> permanents = new ArrayList<>();
permanents.add(source.getSourcePermanentIfItStillExists(game));
permanents.add(game.getPermanent(getTargetPointer().getFirst(game, source)));
permanents.removeIf(Objects::isNull);
if (permanents.isEmpty()) {
return false;
}
Ability ability = player.chooseUse(
outcome, "Choose first strike or lifelink", null,
"First Strike", "Lifelink", source, game
) ? FirstStrikeAbility.getInstance() : LifelinkAbility.getInstance();
game.addEffect(new GainAbilityTargetEffect(ability, Duration.EndOfTurn)
.setTargetPointer(new FixedTargets(permanents, game)), source);
return true;
}
}

View file

@ -29,6 +29,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
cards.add(new SetCardInfo("A Little Chat", 47, Rarity.UNCOMMON, mage.cards.a.ALittleChat.class));
cards.add(new SetCardInfo("An Offer You Can't Refuse", 51, Rarity.UNCOMMON, mage.cards.a.AnOfferYouCantRefuse.class));
cards.add(new SetCardInfo("Arc Spitter", 233, Rarity.UNCOMMON, mage.cards.a.ArcSpitter.class));
cards.add(new SetCardInfo("Ballroom Brawlers", 3, Rarity.UNCOMMON, mage.cards.b.BallroomBrawlers.class));
cards.add(new SetCardInfo("Black Market Tycoon", 167, Rarity.RARE, mage.cards.b.BlackMarketTycoon.class));
cards.add(new SetCardInfo("Botanical Plaza", 247, Rarity.COMMON, mage.cards.b.BotanicalPlaza.class));
cards.add(new SetCardInfo("Brokers Ascendancy", 170, Rarity.RARE, mage.cards.b.BrokersAscendancy.class));