[ZNR] Implemented Synchronized Spellcraft

This commit is contained in:
Evan Kranzler 2020-09-08 16:16:36 -04:00
parent 7632c86fc0
commit ce90d066a0
2 changed files with 78 additions and 0 deletions

View file

@ -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. " +
"<i>(Your party consists of up to one each of Cleric, Rogue, Warrior, and Wizard.)</i>";
}
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;
}
}

View file

@ -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));