diff --git a/Mage.Sets/src/mage/cards/s/SynchronizedSpellcraft.java b/Mage.Sets/src/mage/cards/s/SynchronizedSpellcraft.java new file mode 100644 index 0000000000..429a8abd52 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SynchronizedSpellcraft.java @@ -0,0 +1,77 @@ +package mage.cards.s; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.common.PartyCount; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.hint.common.PartyCountHint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SynchronizedSpellcraft extends CardImpl { + + public SynchronizedSpellcraft(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}"); + + // Synchronized Spellcraft deals 4 damage to target creature and X damage to that creature's controller, where X is the number of creatures in your party. + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + this.getSpellAbility().addEffect(new SynchronizedSpellcraftEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addHint(PartyCountHint.instance); + } + + private SynchronizedSpellcraft(final SynchronizedSpellcraft card) { + super(card); + } + + @Override + public SynchronizedSpellcraft copy() { + return new SynchronizedSpellcraft(this); + } +} + +class SynchronizedSpellcraftEffect extends OneShotEffect { + + SynchronizedSpellcraftEffect() { + super(Outcome.Benefit); + staticText = "and X damage to that creature's controller, where X is the number of creatures in your party. " + + "(Your party consists of up to one each of Cleric, Rogue, Warrior, and Wizard.)"; + } + + private SynchronizedSpellcraftEffect(final SynchronizedSpellcraftEffect effect) { + super(effect); + } + + @Override + public SynchronizedSpellcraftEffect copy() { + return new SynchronizedSpellcraftEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int partyCount = PartyCount.instance.calculate(game, source, this); + if (partyCount < 1) { + return false; + } + Permanent permanent = game.getPermanentOrLKIBattlefield(source.getFirstTarget()); + if (permanent == null) { + return false; + } + Player player = game.getPlayer(permanent.getControllerId()); + if (player == null) { + return false; + } + return player.damage(partyCount, source.getSourceId(), game) > 0; + } +} diff --git a/Mage.Sets/src/mage/sets/ZendikarRising.java b/Mage.Sets/src/mage/sets/ZendikarRising.java index 8e98fca9bc..7a9934c741 100644 --- a/Mage.Sets/src/mage/sets/ZendikarRising.java +++ b/Mage.Sets/src/mage/sets/ZendikarRising.java @@ -293,6 +293,7 @@ public final class ZendikarRising extends ExpansionSet { cards.add(new SetCardInfo("Sure-Footed Infiltrator", 83, Rarity.UNCOMMON, mage.cards.s.SureFootedInfiltrator.class)); cards.add(new SetCardInfo("Swamp", 272, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Swarm Shambler", 207, Rarity.RARE, mage.cards.s.SwarmShambler.class)); + cards.add(new SetCardInfo("Synchronized Spellcraft", 168, Rarity.COMMON, mage.cards.s.SynchronizedSpellcraft.class)); cards.add(new SetCardInfo("Tajuru Blightblade", 208, Rarity.COMMON, mage.cards.t.TajuruBlightblade.class)); cards.add(new SetCardInfo("Tajuru Snarecaster", 210, Rarity.COMMON, mage.cards.t.TajuruSnarecaster.class)); cards.add(new SetCardInfo("Tangled Florahedron", 211, Rarity.UNCOMMON, mage.cards.t.TangledFlorahedron.class));