diff --git a/Mage.Sets/src/mage/cards/s/SkullRaid.java b/Mage.Sets/src/mage/cards/s/SkullRaid.java new file mode 100644 index 0000000000..51f5fd6507 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SkullRaid.java @@ -0,0 +1,76 @@ +package mage.cards.s; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.ForetellAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetOpponent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SkullRaid extends CardImpl { + + public SkullRaid(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}"); + + // Target opponent discards two cards. If fewer than two cards were discarded this way, you draw cards equal to the difference. + this.getSpellAbility().addEffect(new SkullRaidEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + + // Foretell {1}{B} + this.addAbility(new ForetellAbility(this, "{1}{B}")); + } + + private SkullRaid(final SkullRaid card) { + super(card); + } + + @Override + public SkullRaid copy() { + return new SkullRaid(this); + } +} + +class SkullRaidEffect extends OneShotEffect { + + SkullRaidEffect() { + super(Outcome.Benefit); + staticText = "target opponent discards two cards. " + + "If fewer than two cards were discarded this way, " + + "you draw cards equal to the difference"; + } + + private SkullRaidEffect(final SkullRaidEffect effect) { + super(effect); + } + + @Override + public SkullRaidEffect copy() { + return new SkullRaidEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player opponent = game.getPlayer(source.getFirstTarget()); + if (opponent == null) { + return false; + } + int discarded = opponent.discard(2, false, false, source, game).size(); + if (discarded >= 2) { + return true; + } + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + player.drawCards(2 - discarded, source, game); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index 8ef9a6333d..dd09d9b908 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -242,6 +242,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Skemfar Avenger", 109, Rarity.RARE, mage.cards.s.SkemfarAvenger.class)); cards.add(new SetCardInfo("Skemfar Elderhall", 268, Rarity.UNCOMMON, mage.cards.s.SkemfarElderhall.class)); cards.add(new SetCardInfo("Skemfar Shadowsage", 110, Rarity.UNCOMMON, mage.cards.s.SkemfarShadowsage.class)); + cards.add(new SetCardInfo("Skull Raid", 111, Rarity.COMMON, mage.cards.s.SkullRaid.class)); cards.add(new SetCardInfo("Smashing Success", 151, Rarity.COMMON, mage.cards.s.SmashingSuccess.class)); cards.add(new SetCardInfo("Snakeskin Veil", 194, Rarity.COMMON, mage.cards.s.SnakeskinVeil.class)); cards.add(new SetCardInfo("Snow-Covered Forest", 284, Rarity.LAND, mage.cards.s.SnowCoveredForest.class));