diff --git a/Mage.Sets/src/mage/cards/b/BondOfRevival.java b/Mage.Sets/src/mage/cards/b/BondOfRevival.java new file mode 100644 index 00000000000..e10a10f214c --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BondOfRevival.java @@ -0,0 +1,81 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BondOfRevival extends CardImpl { + + public BondOfRevival(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}"); + + // Return target creature card from your graveyard to the battlefield. It gains haste until your next turn. + this.getSpellAbility().addEffect(new BondOfRevivalEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard( + StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD + )); + } + + private BondOfRevival(final BondOfRevival card) { + super(card); + } + + @Override + public BondOfRevival copy() { + return new BondOfRevival(this); + } +} + +class BondOfRevivalEffect extends OneShotEffect { + + BondOfRevivalEffect() { + super(Outcome.Benefit); + staticText = "Return target creature card from your graveyard to the battlefield. " + + "It gains haste until your next turn."; + } + + private BondOfRevivalEffect(final BondOfRevivalEffect effect) { + super(effect); + } + + @Override + public BondOfRevivalEffect copy() { + return new BondOfRevivalEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Card card = game.getCard(source.getFirstTarget()); + if (player == null || card == null) { + return false; + } + ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.UntilYourNextTurn); + effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1)); + if (player.moveCards(card, Zone.BATTLEFIELD, source, game)) { + game.addEffect(effect, source); + } + return true; + } +} + + diff --git a/Mage.Sets/src/mage/sets/WarOfTheSpark.java b/Mage.Sets/src/mage/sets/WarOfTheSpark.java index 8606a755daa..f245358ef70 100644 --- a/Mage.Sets/src/mage/sets/WarOfTheSpark.java +++ b/Mage.Sets/src/mage/sets/WarOfTheSpark.java @@ -41,6 +41,7 @@ public final class WarOfTheSpark extends ExpansionSet { cards.add(new SetCardInfo("Bolt Bend", 115, Rarity.UNCOMMON, mage.cards.b.BoltBend.class)); cards.add(new SetCardInfo("Bond of Flourishing", 155, Rarity.UNCOMMON, mage.cards.b.BondOfFlourishing.class)); cards.add(new SetCardInfo("Bond of Insight", 43, Rarity.UNCOMMON, mage.cards.b.BondOfInsight.class)); + cards.add(new SetCardInfo("Bond of Revival", 80, Rarity.UNCOMMON, mage.cards.b.BondOfRevival.class)); cards.add(new SetCardInfo("Bulwark Giant", 7, Rarity.COMMON, mage.cards.b.BulwarkGiant.class)); cards.add(new SetCardInfo("Burning Prophet", 117, Rarity.COMMON, mage.cards.b.BurningProphet.class)); cards.add(new SetCardInfo("Chainwhip Cyclops", 118, Rarity.COMMON, mage.cards.c.ChainwhipCyclops.class));