diff --git a/Mage.Sets/src/mage/cards/h/HarmonicProdigy.java b/Mage.Sets/src/mage/cards/h/HarmonicProdigy.java new file mode 100644 index 0000000000..4dd99d3a18 --- /dev/null +++ b/Mage.Sets/src/mage/cards/h/HarmonicProdigy.java @@ -0,0 +1,91 @@ +package mage.cards.h; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.ProwessAbility; +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.game.events.GameEvent; +import mage.game.events.NumberOfTriggersEvent; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class HarmonicProdigy extends CardImpl { + + public HarmonicProdigy(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(3); + + // Prowess + this.addAbility(new ProwessAbility()); + + // If an ability of a Shaman or another Wizard you control triggers, that ability triggers an additional time. + this.addAbility(new SimpleStaticAbility(new HarmonicProdigyEffect())); + } + + private HarmonicProdigy(final HarmonicProdigy card) { + super(card); + } + + @Override + public HarmonicProdigy copy() { + return new HarmonicProdigy(this); + } +} + +class HarmonicProdigyEffect extends ReplacementEffectImpl { + + HarmonicProdigyEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "if an ability of a Shaman or another Wizard you control triggers, " + + "that ability triggers an additional time"; + } + + HarmonicProdigyEffect(final HarmonicProdigyEffect effect) { + super(effect); + } + + @Override + public HarmonicProdigyEffect copy() { + return new HarmonicProdigyEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.NUMBER_OF_TRIGGERS; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (!(event instanceof NumberOfTriggersEvent)) { + return false; + } + Permanent permanent = game.getPermanent(((NumberOfTriggersEvent) event).getSourceId()); + return permanent != null + && permanent.isControlledBy(source.getControllerId()) + && (permanent.hasSubtype(SubType.SHAMAN, game) + || (permanent.hasSubtype(SubType.WIZARD, game) + && !permanent.getId().equals(source.getSourceId()))); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(event.getAmount() + 1); + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/ModernHorizons2.java b/Mage.Sets/src/mage/sets/ModernHorizons2.java index cf8f3cf7bb..0df0c2b435 100644 --- a/Mage.Sets/src/mage/sets/ModernHorizons2.java +++ b/Mage.Sets/src/mage/sets/ModernHorizons2.java @@ -87,6 +87,7 @@ public final class ModernHorizons2 extends ExpansionSet { cards.add(new SetCardInfo("Gorilla Shaman", 280, Rarity.UNCOMMON, mage.cards.g.GorillaShaman.class)); cards.add(new SetCardInfo("Greed", 274, Rarity.UNCOMMON, mage.cards.g.Greed.class)); cards.add(new SetCardInfo("Grief", 87, Rarity.MYTHIC, mage.cards.g.Grief.class)); + cards.add(new SetCardInfo("Harmonic Prodigy", 132, Rarity.RARE, mage.cards.h.HarmonicProdigy.class)); cards.add(new SetCardInfo("Herd Baloth", 165, Rarity.UNCOMMON, mage.cards.h.HerdBaloth.class)); cards.add(new SetCardInfo("Ignoble Hierarch", 166, Rarity.RARE, mage.cards.i.IgnobleHierarch.class)); cards.add(new SetCardInfo("Imperial Recruiter", 281, Rarity.MYTHIC, mage.cards.i.ImperialRecruiter.class));