Implemented Blow Your House Down

This commit is contained in:
Evan Kranzler 2019-09-09 16:57:28 -04:00
parent 6ad29ab2d6
commit b6fe812061
2 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,70 @@
package mage.cards.b;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.combat.CantBlockTargetEffect;
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.target.Target;
import mage.target.common.TargetCreaturePermanent;
import java.util.Collection;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class BlowYourHouseDown extends CardImpl {
public BlowYourHouseDown(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}");
// Up to three target creatures can't block this turn. Destroy any of them that are Walls.
this.getSpellAbility().addEffect(new CantBlockTargetEffect(Duration.EndOfTurn));
this.getSpellAbility().addEffect(new BlowYourHouseDownEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 3));
}
private BlowYourHouseDown(final BlowYourHouseDown card) {
super(card);
}
@Override
public BlowYourHouseDown copy() {
return new BlowYourHouseDown(this);
}
}
class BlowYourHouseDownEffect extends OneShotEffect {
BlowYourHouseDownEffect() {
super(Outcome.Benefit);
staticText = "Destroy any of them that are Walls";
}
private BlowYourHouseDownEffect(final BlowYourHouseDownEffect effect) {
super(effect);
}
@Override
public BlowYourHouseDownEffect copy() {
return new BlowYourHouseDownEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
source.getTargets()
.stream()
.map(Target::getTargets)
.flatMap(Collection::stream)
.map(game::getPermanent)
.filter(permanent -> permanent != null && permanent.hasSubtype(SubType.WALL, game))
.forEach(permanent -> permanent.destroy(source.getSourceId(), game, false));
return true;
}
}

View file

@ -37,6 +37,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Banish into Fable", 325, Rarity.RARE, mage.cards.b.BanishIntoFable.class));
cards.add(new SetCardInfo("Beanstalk Giant", 149, Rarity.UNCOMMON, mage.cards.b.BeanstalkGiant.class));
cards.add(new SetCardInfo("Belle of the Brawl", 78, Rarity.UNCOMMON, mage.cards.b.BelleOfTheBrawl.class));
cards.add(new SetCardInfo("Blow Your House Down", 114, Rarity.COMMON, mage.cards.b.BlowYourHouseDown.class));
cards.add(new SetCardInfo("Chittering Witch", 319, Rarity.RARE, mage.cards.c.ChitteringWitch.class));
cards.add(new SetCardInfo("Chulane, Teller of Tales", 326, Rarity.MYTHIC, mage.cards.c.ChulaneTellerOfTales.class));
cards.add(new SetCardInfo("Command Tower", 333, Rarity.COMMON, mage.cards.c.CommandTower.class));