diff --git a/Mage.Sets/src/mage/cards/f/FiendishDuo.java b/Mage.Sets/src/mage/cards/f/FiendishDuo.java new file mode 100644 index 00000000000..41b7da9023c --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FiendishDuo.java @@ -0,0 +1,88 @@ +package mage.cards.f; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.FirstStrikeAbility; +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.players.Player; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class FiendishDuo extends CardImpl { + + public FiendishDuo(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + + this.subtype.add(SubType.DEVIL); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // If a source would deal damage to an opponent, it deals double that damage that player instead. + this.addAbility(new SimpleStaticAbility(new FiendishDuoEffect())); + } + + private FiendishDuo(final FiendishDuo card) { + super(card); + } + + @Override + public FiendishDuo copy() { + return new FiendishDuo(this); + } +} + +class FiendishDuoEffect extends ReplacementEffectImpl { + + FiendishDuoEffect() { + super(Duration.WhileOnBattlefield, Outcome.Damage); + staticText = "If a source would deal damage to an opponent, " + + "it deals double that damage to that player instead"; + } + + private FiendishDuoEffect(final FiendishDuoEffect effect) { + super(effect); + } + + @Override + public FiendishDuoEffect copy() { + return new FiendishDuoEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGE_PLAYER; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Player player = game.getPlayer(source.getControllerId()); + return player != null && player.hasOpponent(event.getTargetId(), game); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(CardUtil.addWithOverflowCheck(event.getAmount(), event.getAmount())); + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/GameNight2019.java b/Mage.Sets/src/mage/sets/GameNight2019.java index d38fb6b4d31..c9b0e4ef04b 100644 --- a/Mage.Sets/src/mage/sets/GameNight2019.java +++ b/Mage.Sets/src/mage/sets/GameNight2019.java @@ -20,6 +20,7 @@ public final class GameNight2019 extends ExpansionSet { this.hasBasicLands = false; // TODO: change when spoiled cards.add(new SetCardInfo("Earthshaker Giant", 5, Rarity.MYTHIC, mage.cards.e.EarthshakerGiant.class)); + cards.add(new SetCardInfo("Fiendish Duo", 4, Rarity.MYTHIC, mage.cards.f.FiendishDuo.class)); cards.add(new SetCardInfo("Highcliff Felidar", 1, Rarity.MYTHIC, mage.cards.h.HighcliffFelidar.class)); cards.add(new SetCardInfo("Sphinx of Enlightenment", 2, Rarity.MYTHIC, mage.cards.s.SphinxOfEnlightenment.class)); }