diff --git a/Mage.Sets/src/mage/cards/s/StarfieldVocalist.java b/Mage.Sets/src/mage/cards/s/StarfieldVocalist.java new file mode 100644 index 00000000000..274a8fd3644 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/StarfieldVocalist.java @@ -0,0 +1,92 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.WarpAbility; +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.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.events.NumberOfTriggersEvent; + +import java.util.Optional; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class StarfieldVocalist extends CardImpl { + + public StarfieldVocalist(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.BARD); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // If a permanent entering the battlefield causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time. + this.addAbility(new SimpleStaticAbility(new StarfieldVocalistEffect())); + + // Warp {1}{U} + this.addAbility(new WarpAbility(this, "{1}{U}")); + } + + private StarfieldVocalist(final StarfieldVocalist card) { + super(card); + } + + @Override + public StarfieldVocalist copy() { + return new StarfieldVocalist(this); + } +} + +class StarfieldVocalistEffect extends ReplacementEffectImpl { + + StarfieldVocalistEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "if a permanent entering the battlefield causes a triggered ability of " + + "a permanent you control to trigger, that ability triggers an additional time"; + } + + private StarfieldVocalistEffect(final StarfieldVocalistEffect effect) { + super(effect); + } + + @Override + public StarfieldVocalistEffect copy() { + return new StarfieldVocalistEffect(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) { + return source.isControlledBy(event.getPlayerId()) + && Optional + .ofNullable(event) + .filter(NumberOfTriggersEvent.class::isInstance) + .map(NumberOfTriggersEvent.class::cast) + .map(NumberOfTriggersEvent::getSourceEvent) + .filter(EntersTheBattlefieldEvent.class::isInstance) + .isPresent() + && game.getPermanent(event.getSourceId()) != null; + } + + @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/EdgeOfEternities.java b/Mage.Sets/src/mage/sets/EdgeOfEternities.java index c44067fdda2..0624352f817 100644 --- a/Mage.Sets/src/mage/sets/EdgeOfEternities.java +++ b/Mage.Sets/src/mage/sets/EdgeOfEternities.java @@ -108,6 +108,10 @@ public final class EdgeOfEternities extends ExpansionSet { cards.add(new SetCardInfo("Sothera, the Supervoid", 382, Rarity.MYTHIC, mage.cards.s.SotheraTheSupervoid.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Sothera, the Supervoid", 386, Rarity.MYTHIC, mage.cards.s.SotheraTheSupervoid.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Starbreach Whale", 77, Rarity.COMMON, mage.cards.s.StarbreachWhale.class)); + cards.add(new SetCardInfo("Starfield Vocalist", 328, Rarity.RARE, mage.cards.s.StarfieldVocalist.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Starfield Vocalist", 359, Rarity.MYTHIC, mage.cards.s.StarfieldVocalist.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Starfield Vocalist", 385, Rarity.RARE, mage.cards.s.StarfieldVocalist.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Starfield Vocalist", 78, Rarity.RARE, mage.cards.s.StarfieldVocalist.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Starfighter Pilot", 38, Rarity.COMMON, mage.cards.s.StarfighterPilot.class)); cards.add(new SetCardInfo("Stomping Ground", 258, Rarity.RARE, mage.cards.s.StompingGround.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Stomping Ground", 283, Rarity.RARE, mage.cards.s.StompingGround.class, NON_FULL_USE_VARIOUS));