mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
[KHM] Implemented Skull Raid
This commit is contained in:
parent
ec8c7523d2
commit
f4972c42ab
2 changed files with 77 additions and 0 deletions
76
Mage.Sets/src/mage/cards/s/SkullRaid.java
Normal file
76
Mage.Sets/src/mage/cards/s/SkullRaid.java
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue