[SNC] Implemented Backstreet Bruiser

This commit is contained in:
Daniel Bomar 2022-04-15 15:47:32 -05:00
parent a6e9b947b5
commit bfff3043c0
No known key found for this signature in database
GPG key ID: C86C8658F4023918
2 changed files with 72 additions and 0 deletions

View file

@ -0,0 +1,71 @@
package mage.cards.b;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.Condition;
import mage.abilities.decorator.ConditionalAsThoughEffect;
import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.counters.Counter;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author weirddan455
*/
public final class BackstreetBruiser extends CardImpl {
public BackstreetBruiser(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.CEPHALID);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Defender
this.addAbility(DefenderAbility.getInstance());
// As long as there are two or more counters among creatures you control, Backstreet Bruiser can attack as though it didn't have defender.
this.addAbility(new SimpleStaticAbility(new ConditionalAsThoughEffect(
new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield),
BackstreetBruiserCondition.instance
).setText("As long as there are two or more counters among creatures you control, {this} can attack as though it didn't have defender")));
}
private BackstreetBruiser(final BackstreetBruiser card) {
super(card);
}
@Override
public BackstreetBruiser copy() {
return new BackstreetBruiser(this);
}
}
enum BackstreetBruiserCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
int totalCounters = 0;
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURE, source.getControllerId(), source, game)) {
for (Counter counter : permanent.getCounters(game).values()) {
totalCounters += counter.getCount();
if (totalCounters >= 2) {
return true;
}
}
}
return false;
}
}

View file

@ -35,6 +35,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet {
cards.add(new SetCardInfo("Arc Spitter", 233, Rarity.UNCOMMON, mage.cards.a.ArcSpitter.class));
cards.add(new SetCardInfo("Attended Socialite", 133, Rarity.COMMON, mage.cards.a.AttendedSocialite.class));
cards.add(new SetCardInfo("Aven Heartstabber", 166, Rarity.RARE, mage.cards.a.AvenHeartstabber.class));
cards.add(new SetCardInfo("Backstreet Bruiser", 35, Rarity.COMMON, mage.cards.b.BackstreetBruiser.class));
cards.add(new SetCardInfo("Backup Agent", 2, Rarity.COMMON, mage.cards.b.BackupAgent.class));
cards.add(new SetCardInfo("Ballroom Brawlers", 3, Rarity.UNCOMMON, mage.cards.b.BallroomBrawlers.class));
cards.add(new SetCardInfo("Big Score", 102, Rarity.COMMON, mage.cards.b.BigScore.class));