diff --git a/Mage.Sets/src/mage/cards/b/BlizzardBrawl.java b/Mage.Sets/src/mage/cards/b/BlizzardBrawl.java new file mode 100644 index 00000000000..bebfb506129 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BlizzardBrawl.java @@ -0,0 +1,96 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SuperType; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterControlledPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BlizzardBrawl extends CardImpl { + + public BlizzardBrawl(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); + + this.addSuperType(SuperType.SNOW); + + // Choose target creature you control and target creature you don't control. The creature you control gets +1/+0 and gains indestructible until end of turn if you control three or more snow permanents. Then those creatures fight each other. + this.getSpellAbility().addEffect(new BlizzardBrawlEffect()); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL)); + } + + private BlizzardBrawl(final BlizzardBrawl card) { + super(card); + } + + @Override + public BlizzardBrawl copy() { + return new BlizzardBrawl(this); + } +} + +class BlizzardBrawlEffect extends OneShotEffect { + + private static final FilterPermanent filter = new FilterControlledPermanent(); + + static { + filter.add(SuperType.SNOW.getPredicate()); + } + + BlizzardBrawlEffect() { + super(Outcome.Benefit); + staticText = "Choose target creature you control and target creature you don't control. " + + "The creature you control gets +1/+0 and gains indestructible until end of turn " + + "if you control three or more snow permanents. Then those creatures fight each other."; + } + + private BlizzardBrawlEffect(final BlizzardBrawlEffect effect) { + super(effect); + } + + @Override + public BlizzardBrawlEffect copy() { + return new BlizzardBrawlEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature1 = game.getPermanent(source.getTargets().get(0).getFirstTarget()); + Permanent creature2 = game.getPermanent(source.getTargets().get(1).getFirstTarget()); + if (creature1 == null) { + return false; + } + if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) >= 3) { + game.addEffect(new BoostTargetEffect( + 1, 0, Duration.EndOfTurn + ).setTargetPointer(new FixedTarget(creature1.getId(), game)), source); + game.addEffect(new GainAbilityTargetEffect( + IndestructibleAbility.getInstance(), Duration.EndOfTurn + ).setTargetPointer(new FixedTarget(creature1.getId(), game)), source); + } + if (creature2 == null) { + return true; + } + game.getState().processAction(game); + return creature1.fight(creature2, source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index 61b75d162e6..98d34902222 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -62,6 +62,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Behold the Multiverse", 46, Rarity.COMMON, mage.cards.b.BeholdTheMultiverse.class)); cards.add(new SetCardInfo("Binding the Old Gods", 206, Rarity.UNCOMMON, mage.cards.b.BindingTheOldGods.class)); cards.add(new SetCardInfo("Blightstep Pathway", 252, Rarity.RARE, mage.cards.b.BlightstepPathway.class)); + cards.add(new SetCardInfo("Blizzard Brawl", 162, Rarity.UNCOMMON, mage.cards.b.BlizzardBrawl.class)); cards.add(new SetCardInfo("Bloodline Pretender", 235, Rarity.UNCOMMON, mage.cards.b.BloodlinePretender.class)); cards.add(new SetCardInfo("Bretagard Stronghold", 253, Rarity.UNCOMMON, mage.cards.b.BretagardStronghold.class)); cards.add(new SetCardInfo("Broken Wings", 164, Rarity.COMMON, mage.cards.b.BrokenWings.class));